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

"nbf" claim timestamp check failed #113

Closed
4 tasks done
tiansen-tw opened this issue Sep 20, 2023 · 1 comment · Fixed by #115
Closed
4 tasks done

"nbf" claim timestamp check failed #113

tiansen-tw opened this issue Sep 20, 2023 · 1 comment · Fixed by #115
Labels
bug Something isn't working

Comments

@tiansen-tw
Copy link

tiansen-tw commented Sep 20, 2023

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

The verify will failed due the "nbf" claim check. In this code.

There is a options object as third optional args. If no set this args then jose will set tolerance to 0. It will leads to the JWT verify failed.

Your code validate the iat & exp with clockTolerance, so the clockTolerance should pass to jose as well.

Reproduction

  1. Generate JWT token with nbf claim. The value can be current timestamp + 300
  2. Set auth({clockTolerance: 600, issuer:'your issuer', audience: 'your audience'})
  3. Call your api

Additional context

No response

express-oauth2-jwt-bearer version

audience

Node.js version

18.17.1

@tiansen-tw tiansen-tw added the bug Something isn't working label Sep 20, 2023
@adamjmcgrath
Copy link
Contributor

Thanks for raising this @tiansen-tw - will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants