Cannot override SecurityFilterChain in Spring Boot context reliably #33103
Labels
for: external-project
For an external project and not something we can fix
status: invalid
An issue that we don't feel is valid
I have created a small project, which simply defines
SecurityFilterChain
according to documentation:however it does not override the bean created by
OAuth2SecurityFilterChainConfiguration
which is picked up by the framework.To reproduce the issue launch the application with
and then call the only controller:
One can see that because I have disabled the authentication for that very path, HTTP call should complete successfully.
When I was playing around I discovered the following:
to equivalent (in that very case)
it starts working correctly as only one
SecurityFilterChain
instance is created. It brings me to idea that on some reasonDefaultWebSecurityCondition
does not sense theSecurityFilterChain
created by scanner launched from XML (?)@Primary
annotation does not help.@Order(Ordered.HIGHEST_PRECEDENCE)
fixes the issue in that particular small project, but not always in real-life (bigger) projects. I was not able to detect factors that influence that.does not work, likely due to issue #5427.
P.S. This issue is a follow-up of my comment in issue #10822.
The text was updated successfully, but these errors were encountered: