-
Notifications
You must be signed in to change notification settings - Fork 9
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
Error getting while verifing the okta token from Node.js #16
Comments
What issuer do you specify on creation of
Your error looks like issuer mismatch on Angular and Node.js |
We are facing the same issue as above, Is there any resolve on this . |
@saumyadip1782 |
Hear is the error |
Hi, @jayendrajatav and @saumyadip1782 did you fix this problem ? |
Similar issue: okta/okta-oidc-js#797 |
Any updates about that? I'm using OKTA_ISSUER=${OKTA_DOMAIN}/oauth2/default and OKTA_AUDIENCE=api://default and getting the same error. |
@ArthurWosniaki Could you please set environment variable |
Sorry, let me be more clear: .env:
server:
The accessToken.claims.iss is the same from OKTA_ISSUER and aud is same from OKTA_AUDIENCE. Where do I add this DEBUG? Edit: BTW this is a GraphQL server, i'm sending the accessToken in the args through the playground for testing, idk if this matters... Edit 2: turns out it was a SELF_SIGNED_CERT_IN_CHAIN error when requesting the jwks endpoint... i set NODE_TLS_REJECT_UNAUTHORIZED=0 and it bypassed the problem... |
I'm running into the same issue, and I'm half a step away from writing my own validation because I can't get this one working, and it buries all the real error messages. |
It's the SSL cert. I was testing local, so i needed to disable the TLS. When i deployed the project to my https dev environment it worked fine without need to disable TLS. |
I wanted to add an Information to this topic that I just found out:
And I tested this, the Which is kind of confusing because everywhere else it says "if you are trying to protect an API/resource server with OAuth tokens, you should be using Access Tokens instead for auth". So I guess in case of |
I keep getting this error intermittently with a production application. It's concerning that there seems to be no definitive resolution available. |
I was able to get this to work with both access token and id token from the ones generated from an Okta SPA app. Example curl request below. You will need to update
I did notice id token returns the groups from the groups claim, which is useful in my case, and access token does not |
Describe the bug?
Using Okta JWT Verifier package in node.js with nest framework, we are getting error ("Error while resolving signing key for kid "cjCtmAl4jaByzZs5p****************zf6ZAU" ).
we are using
const jwt = await oktaJwtVerifier.verifyAccessToken(token,ENV_VALUES.OKTA_CLIENTID);
to get the email and claims.What is expected to happen?
Expected OKTA claims and email after token verification.
What is the actual behavior?
Frontend (Angular):
We receive a token from the Okta using the following configuration syntax.
const okta_prod_config = { issuer: '[xxxxxxx.okta.com/](http://xxxxxxx.okta.com/)', clientId: '**********', redirectUri: window.location.origin + '/login/callback', scopes: ['openid', 'profile', 'email'], testing: { disableHttpsCheck: false } };
After the successful Okta authentication, we pass this token to our server through the API header I.e., Authorization: Token
Backend (NodeJs)
After receiving the token from the API header, we are verifying the token using jwt okta verifier by passing the clientid and the issuer.
const jwt = await oktaJwtVerifier.verifyAccessToken(token,ENV_VALUES.OKTA_CLIENTID);
We are tried pasting the token received from okta in jwt.io and verified the information with that of the information passed in the okta verifier. The information matches. but the code goes to the catch block and throws an error mentioned below in the screenshot
Reproduction Steps?
It happens everytime.
SDK Versions
jwt-verifier package Version: 2.0.0
OKTA SDK (Angular):
"@okta/okta-angular": "^4.1.1",
"@okta/okta-auth-js": "^5.11.0",
Execution Environment
node -v
): 13.9.1Additional Information?
No response
The text was updated successfully, but these errors were encountered: