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

Handle clock skew with leeway option #18

Closed
qburnsFB opened this issue Oct 9, 2019 · 3 comments
Closed

Handle clock skew with leeway option #18

qburnsFB opened this issue Oct 9, 2019 · 3 comments

Comments

@qburnsFB
Copy link

qburnsFB commented Oct 9, 2019

Description

Getting this error when running from my local server:

id_token issued in the future, now 1570650460, iat 1570650461

Running on a pushed production server works as expected.

According to the Auth0 ref, we can set a leeway integer to deal with small amount of clock skew. However, this library doesn't seem to support it as an option.

I saw a commit merged earlier today that solved a similar issue with the audience option. I tried following in their footsteps by adding settings.leeway to the handlers/login.js. I see it correctly added to the url when logging in, yet I still receive the error.

Reproduction

Possibly hard to reproduce unless you manually change the time to be incorrect.

Environment

Please provide the following:

  • Version of this library used: 0.3
  • Version of the platform or framework used, if applicable: Next 9.0.5
  • Other relevant versions (language, server software, OS, browser): Windows 10
  • Other modules/plugins/libraries that might be involved: Running a custom HTTPS server for local development, but was working perfectly fine locally as of Friday afternoon.
@qburnsFB
Copy link
Author

qburnsFB commented Oct 9, 2019

Update: Upon reading the openid-client docs, I discovered I can do the following:

in /handlers/login.js:

   // Create the authorization url.
    const client = yield clientProvider();
    client[custom.clock_tolerance] = 5; <-- add a clock tolerance here

Would it be beneficial to respect the leeway setting as expected and set it like so?

@sandrinodimattia
Copy link
Member

Fixed in v0.4.0. Let me know if we can close this issue.

@qburnsFB
Copy link
Author

Awesome! It seems to be working in my project. Thanks for the quick response and fix!

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

No branches or pull requests

2 participants