我正在将我的Spring Security配置从WebSecurityConfigurerAdapter(已弃用)映射到使用Bean的配置.
我的配置类现在看起来像
@EnableWebSecurity
public class Config {
@Bean
protected SecurityFilterChain configure(HttpSecurity http) throws Exception {
return http.build();
}
}
我知道这个配置没有进行任何行为设置,但是它不应该返回一个类似于默认SecurityFilterChain的SecurityFilterChain Bean(就像没有指定任何配置一样)吗?当我启动我的应用程序时,没有控制器是安全的.