In Spring Security 5.4 we introduced the WebSecurityCustomizer to allow customizing WebSecurity without needing the WebSecurityConfigurerAdapter.
Any customizations to WebSecurity should be done by exposing a WebSecurityCustomizer bean.
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring().antMatchers("/ignore1", "/ignore2");
}
See #22739 (comment) for more details around removing the use of WebSecurityConfigurerAdapter.