We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
iat
Describe the bug
According to https://www.rfc-editor.org/rfc/rfc7519.html#section-4.1.6 the iat field should be a numeric field. Creating a token with iat:true passes validation. This looks to be because _validate_numeric_time returns True for bool inputs.
iat:true
_validate_numeric_time
To Reproduce
A minimal example to reproduce the behavior:
authlib.jose.rfc7519.JWTClaims({"iat": True}, {}).validate() authlib.jose.rfc7519.JWTClaims({"iat": False}, {}).validate()
Expected behavior
Both of those validate calls should fail similarly to:
>>> authlib.jose.rfc7519.JWTClaims({"iat": "not-a-number"}, {}).validate() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.11/site-packages/authlib/jose/rfc7519/claims.py", line 103, in validate self.validate_iat(now, leeway) File "/usr/lib/python3.11/site-packages/authlib/jose/rfc7519/claims.py", line 207, in validate_iat raise InvalidClaimError('iat') authlib.jose.errors.InvalidClaimError: invalid_claim: Invalid claim "iat"
Environment:
The text was updated successfully, but these errors were encountered:
lepture
No branches or pull requests
Describe the bug
According to https://www.rfc-editor.org/rfc/rfc7519.html#section-4.1.6 the
iat
field should be a numeric field. Creating a token withiat:true
passes validation. This looks to be because_validate_numeric_time
returns True for bool inputs.To Reproduce
A minimal example to reproduce the behavior:
Expected behavior
Both of those validate calls should fail similarly to:
Environment:
The text was updated successfully, but these errors were encountered: