You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fixed now causes iat to exceed now + leeway in JWTClaimsRegistry.validate_iat() #68
"""The "iat" (issued at) claim identifies the time at which the JWT was
issued. This claim can be used to determine the age of the JWT. Its
value MUST be a number containing a NumericDate value. Use of this
claim is OPTIONAL.
"""
ifnot_validate_numeric_time(value):
raiseInvalidClaimError("iat")
ifvalue> (self.now+self.leeway):
raiseInvalidTokenError()
self.check_value("iat", value)
When calling claims_requests.validate(decoded_token.claims), the now timestamp used for validation isn’t updated dynamically resulting in iat > now + leeway.
changed the title [-]Fixed `now` causes `iat` to exceed `now + leeway` in `ClaimsRegistry.validate()`[/-][+]Fixed `now` causes `iat` to exceed `now + leeway` in `JWTClaimsRegistry.validate_iat()`[/+]on Jul 29, 2025
Activity
[-]Fixed `now` causes `iat` to exceed `now + leeway` in `ClaimsRegistry.validate()`[/-][+]Fixed `now` causes `iat` to exceed `now + leeway` in `JWTClaimsRegistry.validate_iat()`[/+]lepture commentedon Jul 30, 2025
This is caused by the way you use the claims registry. You need to initialize a claims request every time you want to do the claim validation.
lepture commentedon Jul 30, 2025
However, I can update the implementation so that the validator can be reused.
fix: generate now timestamp
lepture commentedon Aug 25, 2025
Please check the code in main branch.
kimminw00 commentedon Aug 25, 2025
I've reviewed the code in the main branch! LGTM