Springboot 3 버전에서는 WebSecurityConfigurerAdaper를 사용할 수 없게 됐다.
SecurityConfig 에서
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userService).passwordEncoder(passwordEncoder());
}
이렇게 쓰던 방식으로는 사용할 수 없게 되었다.
해결 방법은
@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
return authenticationConfiguration.getAuthenticationManager();
}
이렇게 빈을 등록하면 사용할 수 있다.
반응형