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

Add a 60-second leeway to the JWT validation logic #689

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

liudonggalaxy
Copy link

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Other, please describe:

When an identity provider (IDP) is implemented using the Authlib library, a machine client connecting to the IDP via the client credentials flow—using the client secret JWT or other JWT-based methods—may occasionally encounter an Invalid client error. This issue arises because the local time on the client's machine can sometimes be one or two seconds ahead of the IDP's time. As a result, the iat claim in the client-signed JWT appears to be in the future, causing the IDP to reject it. To resolve this, a 60-second leeway can be added to the JWT validation logic.

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

  • You consent that the copyright of your pull request source code belongs to Authlib's author.

@liudonggalaxy liudonggalaxy marked this pull request as ready for review November 29, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant