We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm hitting a weird problem trying to call the isExpired function on a Jwt.
Setup: Single-page web app is sending access token to a server. Server is verifying the token.
Packages: "@okta/jwt-verifier": "^2.1.0", "@okta/oidc-middleware": "^4.1.0",
Server code:
import OktaJwtVerifier from '@okta/jwt-verifier'; const oktaJwtVerifier:OktaJwtVerifier = new OktaJwtVerifier(oktaConfig); ... const jwt = await oktaJwtVerifier.verifyAccessToken(token, audience) console.log(`JWT: ${JSON.stringify(jwt)}`) console.log(`IsExpired: ${jwt.isExpired()}`)
Output:
JWT: {"header":{"typ":"JWT","alg":"RS256","kid":"[...]"},"claims":{"ver":1,"jti":"[...]","iss":"[internal uri]","aud":"api://default","iat":1623249209,"exp":1623252809,"cid":"0oa1j3h0l6b5DdVTm1d8","uid":"00u1g2d7eprtOZQrC1d8","scp":["email","profile","openid"],"sub":"me","mail":"[email protected]"}} ERROR: TypeError: Cannot read property 'exp' of undefined {}
Expected: instead of an error, should see "isExpired: false"
Side question: What happens when I try to verify an expired token? Will verifyAccessToken throw? Do I even need to check the expiration?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm hitting a weird problem trying to call the isExpired function on a Jwt.
Setup: Single-page web app is sending access token to a server. Server is verifying the token.
Packages:
"@okta/jwt-verifier": "^2.1.0",
"@okta/oidc-middleware": "^4.1.0",
Server code:
Output:
Expected: instead of an error, should see "isExpired: false"
Side question: What happens when I try to verify an expired token? Will verifyAccessToken throw? Do I even need to check the expiration?
The text was updated successfully, but these errors were encountered: