-
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
Quarkus JWT producing 401 errors using @RolesAllowed #14450
Comments
/cc @sberyozkin |
@mklueh Hi, can you please add the trace configuration as suggested at: (also add thanks |
this is not related to the issue but you can also optimize
by default it is set to +5 mins so if it suits for the test then you can drop this call - and there should be a new method |
@sberyozkin thank you for the fast response. As soon as I create this class the auth is working as expected, which is not what I have expected.
So obviously the DefaultJWTCallerPrincipalFactory does not work in my case. I´ve debugged into the class JwtConsumer.java and there I´ve seen that the issuer was mismatching. I did the same in my actual application (where the issuers were correct) and found the reason why I´ve created this reproducer in the first place: I´ve passed an integer as the subject which is syntactically correct but leads to an exception I did not see in the logs
Passing the number as a string did work for me
Thank you for helping :) |
Hi @mklueh thanks, that original code should work as well, I'll fix it and will close this issue once Quarkus gets updated to smallrye-jwt 2.4.3 |
yeah, it is better to do |
Opened smallrye/smallrye-jwt#391 |
Thank you :) |
@mklueh Sorry, missed you last comment, thanks :-). I'm going to update to smallrye-jwt 2.4.3 shortly. FYI, after some thoughts I've decided to throw IAE in case of the well-known claims like thanks |
Describe the bug
I´m running into an issue with Quarkus JWT and I cannot get past the 401 error as none of my requests is getting authorized.
To create my ssh key pair I´m using the following code from the documentation https://quarkus.io/guides/security-jwt#generating-a-jwt :
And I´m creating my token with
While providing the necessary properties in application.properties
I´ve created a small producer where you just need to run the tests.
https://github.com/mklueh/quarkus-jwt-401-reproducer
Am I missing something or do I issue invalid tokens for whatever reason?
Thanks for any help
The text was updated successfully, but these errors were encountered: