-
-
Notifications
You must be signed in to change notification settings - Fork 716
Closed
Labels
Description
In
Line 129 in c5ee34e
raise InvalidIssuedAtError('Issued At claim (iat) cannot be in' |
if iat > (now + leeway):
raise InvalidIssuedAtError('Issued At claim (iat) cannot be in'
' the future.')
I just debugged an issue in prod where jwt.decode()
failed because of this. Mostly because the other party's jwt lib added 'iat' a few seconds or minutes ahead of our clock time ('clock skew' as mentioned in JWT specs).
I can't find any place in the specs that says that a JWT should be invalid if 'iat' is in the future. It seems like it's just there to be informative. I can use 'nbf' if I want to specify a "time before which the token MUST NOT be accepted for processing"
I consulted
So either
- I'm wrong and there is a JWT spec that says this is important to check. I want to know this, because if it's out there, I shouldn't just catch these errors from PyJWT and
pass
. Regardless of whether @jpadilla wants to remove thatraise
in his lib. - PyJWT is checking that unnecessarily, and we should remove it to be more compliant
tlrobinson