spring-security icon indicating copy to clipboard operation
spring-security copied to clipboard

Fail when several filter chains have the same securityMatcher

Open franticticktick opened this issue 1 year ago • 0 comments

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.

franticticktick avatar Oct 24 '24 13:10 franticticktick