Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC Client fails to verify JWT token. Internal Server Error #6345

Open
DaanSelen opened this issue Aug 28, 2024 · 5 comments
Open

OIDC Client fails to verify JWT token. Internal Server Error #6345

DaanSelen opened this issue Aug 28, 2024 · 5 comments
Labels

Comments

@DaanSelen
Copy link

Describe the bug
The bug is failing to be able to connect using OIDC general connect setup. We've setup a config with the required fields and it does call our second device for authentication, however when returning to meshcentral, the JWT is put into a JSON.parse() function which errors out.

To Reproduce
Steps to reproduce the behavior:
Try to login usin Entrust OpenID Connect.

Expected behavior
Log into my account succesfully.

Screenshots
If applicable, add screenshots to help explain your problem.
image

I converted the Byte array to a string and printed it: below. But normally the bytecode is passed directly to JSON.parse() function.

eyJ4NXQiOiI4ajJuMmMzcmpvM0pzanY3ZkJNckVsbUNlSFkiLCJraWQiOiI3MjE1MTQ5MCIsInR5cCI6IkpXVCIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJkc2VsZW5Ac3lzdGVtZWMubmwiLCJhdWQiOiJkYTQ5NTEzYi04YjBlLTRlZmEtYWE0Yi0zMzY3YWQ2ZGM2ZmMiLCJuYW1lIjoiRGFhbiBTZWxlbiIsImlzcyI6Imh0dHBzOi8vc2lzbmwuZGUudHJ1c3RlZGF1dGguY29tL2FwaS9vaWRjIiwiZ2l2ZW5fbmFtZSI6IkRhYW4iLCJmYW1pb... rest of jwt
Aug 28 13:41:02 thoth node[441762]: ERR: SyntaxError: Unexpected token e in JSON at position 0
Aug 28 13:41:02 thoth node[441762]:     at JSON.parse (<anonymous>)
Aug 28 13:41:02 thoth node[441762]:     at Client.userinfo (/opt/meshcentral/app/node_modules/openid-client/lib/client.js:1292:16)
Aug 28 13:41:02 thoth node[441762]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Aug 28 13:41:02 thoth node[441762]:     at async /opt/meshcentral/app/node_modules/openid-client/lib/passport_strategy.js:182:24

Server Software (please complete the following information):

  • OS: Debian
  • Virtualization: ESXi

Client Device (please complete the following information):

  • Device: Laptop
  • OS: WIndows
  • Network: Meshcentral over WAN
  • Browser: Brave

Additional context
Add any other context about the problem here.

Your config.json file relevant info:

"authStrategies": {
          "oidc": {
              "issuer": {
                  "issuer": "https://domain.com/api/oidc",
                  "authorization_endpoint": "https://domain.com/api/oidc/authorize",
                  "token_endpoint": "https://domain.com/api/oidc/token",
                  "endsession_endpoint": "https://domain.com/api/oidc/endsession",
                  "jwks_uri": "https://domain.com/api/oidc/jwks"
              },
              "client": {
                  "client_id": "<clientid>",
                  "client_secret": "<cliensecret>",
                  "redirect_uri": "https://remote.domain.com/auth-oidc-callback",
                  "_post_logout_redirect_uri": "https://remote.domain.com/login",
                  "_token_endpoint_auth_method": "client_secret_basic",
                  "_response_types": "authorization_code"
              },
              "custom": {
                  "scope": [ "openid", "profile", "read.EmailAlias" ],
                  "preset": null
              },
              "logouturl": "https://remote.domain.com/logout",
              "newAccounts": false
          }
      }
@DaanSelen DaanSelen added the bug label Aug 28, 2024
@si458
Copy link
Collaborator

si458 commented Aug 28, 2024

you didnt specify what verison of meshcentral you are running
or what nodejs version you are using

@DaanSelen
Copy link
Author

you didnt specify what verison of meshcentral you are running or what nodejs version you are using

Excuse me, of course!

image
With Node version: v18.19.0

@si458
Copy link
Collaborator

si458 commented Aug 30, 2024

what is ur oidc provider as im not having issue here?
also have you tried removing the "custom" value incase its that?

@DaanSelen
Copy link
Author

what is ur oidc provider as im not having issue here?
also have you tried removing the "custom" value incase its that?

We use Entrust OIDC

@si458
Copy link
Collaborator

si458 commented Sep 13, 2024

is this still an issue?
is it possible for you to email myself and let me test with your environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants