Skip to content

Conversation

@LumanSuen
Copy link

See gh-47255

Added org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer as an optional include to enable the loading of the following configurations.

@Configuration
public class WebSecurityCustomizersConfiguration implements WebSecurityCustomizer {
    public void customize(WebSecurity web){
        web.ignoring().requestMatchers("/favicon.ico");
    }
}

However, please note that loading of @Bean definitions is still not supported.

@Configuration
public class WebSecurityCustomizersConfiguration implements WebSecurityCustomizer {
   @Bean
    public WebSecurityCustomizer faviconSecurityCustomizer() {
        return (web) -> web.ignoring().requestMatchers("/favicon.ico");
    }
}

Because @Configuration classes are not loaded by @WebMvcTest, I also can’t directly add Configuration.class to the includes, as that would make the change too extensive.

Therefore, I added org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer in the same way as org.springframework.security.web.SecurityFilterChain.

See spring-projectsgh-47255

Signed-off-by: LumanSuen <luman.suen@outlook.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants