spring-security
spring-security copied to clipboard
Fail when several filter chains have the same securityMatcher
Related https://github.com/spring-projects/spring-security/issues/15220
@Bean
@Order(0)
SecurityFilterChain app(HttpSecurity http) throws Exception {
http
.securityMatcher("/app/**")
.authorizeHttpRequests(...)
.formLogin(...)
return http.build();
}
@Bean
@Order(1)
SecurityFilterChain api(HttpSecurity http) throws Exception {
http
.securityMatcher("/app/**")
.authorizeHttpRequests(...)
.httpBasic(...)
return http.build();
}
Is it correct to allow filter chains with the same matcher to be created? As far as I understand, this is the same case.