Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a numerical claim such as
updated_at
is presented as String by a provider like Auth0 (see quarkusio/quarkus#43924),smallrye-jwt
issues a warning, which is fair enough, since this and other standard claims are expected to be numbers, see the OIDC spec, and MP JWT spec itself expects such claims be numbers (long), for example, Claims.updated_at.What is a bit of a problem is that in quarkusio/quarkus#43924 it happens during the implicit overridden toString() call and getting this warning is confusing given that probably noone is ever trying to check the
updated_at
claim...So in this PR I simply made it log a more informative message at debug level...
The problem in general now is that if someone does want to get such claim as String, while it is specified to be of type
long
, thenJsonWebToken
API can't help directly... Now, there is a methodObject getClaim(String)
and I was thinking, I just get that String returned instead of long, but I'm nearly sure it will get me into a lot of trouble :-)So if some OIDC providers ignore the specification advice and issue claims which are supposed to be numbers as strings, then smallrye-jwt users can still get the raw token with
getClaim(Claims.raw_token)
and extracting such claim using JsonObject.