-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Handling updated_at claim as a String in JsonWebToken throws error when expected as a number #43924
Comments
/cc @pedroigor (bearer-token), @sberyozkin (bearer-token,jwt,security) |
Hi @waldimiro Unfortunately the current So when you type Does it answer the question ? |
Hi @sberyozkin thank you for your time! unfortunately, the problem is a little more insidious... as you can see, in the code snippet, I don't call jsonWebToken.getClaim(“updated_at”) but Code snippet
Exception
|
@waldimiro Hi, I see it now at the smallrye-jwt level, it does expect this value be in the long format, I'm not sure now why this claim was even listed there, but I'll look at avoiding this log message |
Fixed by #44537 |
Description:
I encountered an issue when working with JWTs (JSON Web Tokens) in Quarkus. Specifically, when I try to read the updated_at claim from the JsonWebToken, I receive an error if the value is a string instead of a number. This issue commonly arises when using Auth0 as the identity provider because Auth0 provides the updated_at field as an ISO 8601 string (e.g., "2024-10-16T08:30:00.000Z") rather than as a Unix timestamp (number).
Steps to Reproduce:
Example Code:
Error:
The value of the 'updated_at' claim is not the expected type (2024-10-17T05:34:02.796Z - Cannot cast java.lang.String to java.lang.Number)
Can you help me? Thanks!!!
Environment:
Quarkus version: 3.14.4
Java version: jdk-21.0.3.9-hotspot
The text was updated successfully, but these errors were encountered: