-
Notifications
You must be signed in to change notification settings - Fork 125
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
InsufficientAuthenticationException being handled as HTTP 500 instead of 401 #582
Comments
Previous similar issue: #498 I'm out of ideas here, tbh. Can you reproduce it in a test so we can improve our test suite? |
I will try reproduce it in test as soon as possible. |
I figured out the problem. Its occurs when I have two @ControllerAdvice, one implementing ProblemHandling and the other one implementing SecurityAdviceTrait. If I disable the one implementing ProblemHandling then code works as expected. If I use just one @ControllerAdvice implements the two interfaces also seems to work. I'm not sure if this is a bug or just a missconfiguration. Here's a sample: https://github.com/icaromagnago/sample-spring-problem-issue |
Just use the higher |
I'm using Springboot 2..3.4.RELEASE and problem-spring-web 0.25.0.
When trying to make a request to the API with no token a InsufficientAuthenticationException is thrown, in this case the HTTP status code should be 401, but problem library is handling it as status code 500.
Configurations
Spring security
Controller Advice
In version 0.23.0 works as expected.
The text was updated successfully, but these errors were encountered: