모든 저작권은 Baeldung에 있습니다. All copyrights are in Baeldung.
스프링 시큐리티가 버전업이 되면서 websecurityconfigureradapter가 deprecated되었다. 그에 따라 등록 방법도 달라졌다.
다음은 customprovider 등록 방법이다.
@EnableWebSecurity
public class SecurityConfig {
@Autowired
private CustomAuthenticationProvider customProvider;
@Bean
public AuthenticationManager authenticationManager (HttpSecurity http) throws Exception {
AuthenticationManagerBuilder authenticationManagerBuilder =
http.getSharedObject(AuthenticationManagerBuilder.class);
authenticationManagerBuilder.authenticationProvider(customProvider);
return authenticationManagerBuilder.build();
}
출처 : Baeldung security