-
Notifications
You must be signed in to change notification settings - Fork 119
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
use UTC instead of computer timezone to check exp, nbf and other time-related claims #297
Comments
Yeah, we should definitely always use UTC. |
Actually, I'm currently in EDT, so UTC-04. Running the code below:
Gives us:
The Running the below code instead:
Gives us:
Here we can see that This happens because the It's worth noting that in my example, I incorrectly labeled my current local time from See:
Gives us:
|
In
jwt.py
, among others checks which focus on time-related claims,jwcrypto
uses a "timezoned" time (time.time()
) in order to process the checks :this approach causes issues when using
jwcrypto
with a server having a timezone that is different of a client.I think we should use
datetime.utcnow()
by default instead, what do you think about it ?I can make a PR if needed.
The text was updated successfully, but these errors were encountered: