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

feat: Improve handling of clock skew #858

Merged
merged 5 commits into from Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/auth/_helpers.py
Expand Up @@ -20,7 +20,7 @@
import urllib


CLOCK_SKEW_SECS = 10 # 10 seconds
CLOCK_SKEW_SECS = 60 # 60 seconds
CLOCK_SKEW = datetime.timedelta(seconds=CLOCK_SKEW_SECS)


Expand Down
2 changes: 1 addition & 1 deletion google/auth/jwt.py
Expand Up @@ -190,7 +190,7 @@ def _verify_iat_and_exp(payload):
# for clock skew.
earliest = iat - _helpers.CLOCK_SKEW_SECS
if now < earliest:
raise ValueError("Token used too early, {} < {}".format(now, iat))
raise ValueError("Token used too early, {} < {}. Check that your computer's clock is set correctly.".format(now, iat))

# Make sure the token wasn't issued in the past.
exp = payload["exp"]
Expand Down