-
Notifications
You must be signed in to change notification settings - Fork 41.1k
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
2.7.0: SecurityFilterChain antMatcher trigger all the filters on not matching route #31511
Comments
When Spring Boot detects a servlet filter it automatically registers it with the regular filter chain so each filter will be always executed in this case. As mentioned here in the documentation. If you don't want this to happen, because you want to add them in the security chain, you need to add an explicit See also:
For the Spring Boot Team, this keeps popping up quite regularly on StackOverflow as well. Would it make sense to have a marker annotation (something like |
Thanks, @mdeinum.
Yes, I think so. #16500 is tracking some sort of enhancement in this area. |
@mdeinum thx, |
|
@sysmat I don't see the connection between your latest comment and the rest of this issue. An upgrade to Spring Boot 3.0.3 brings with it an upgrade to Spring Security 6.0. Please check the relevant section of Spring Boot's migration guide and the Spring Security documentation to which it links. If this doesn't help, please open a new issue with a complete yet minimal sample that reproduces the problem. |
@wilkinsona thx for link to migration, but there is nothing of sort braking changes about EnableWebSecurity, SecurityFilterChain, antMatcher, HttpSecurity, OncePerRequestFilter |
|
|
|
@sysmat As I said above, this belongs in a separate issue and needs to be accompanied by a minimal sample that reproduces the problem. From what's you've shown this far, that issue should be a Spring Security issue. |
Env
error
Expected behavior
Filter is triggered only for URL segment whish is defined
Demo
demo.zip
The text was updated successfully, but these errors were encountered: