-
Notifications
You must be signed in to change notification settings - Fork 1
How to use authenticationManager Bean in 5.7.1
Kim Jeong Ho edited this page Jun 23, 2022
·
1 revision
참고 : https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter
Is there any example how can I expose the AuthenticationManager bean? Previously I could do this by extending WebSecurityConfigurerAdapter and then creating the following method in my security config:
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
The following solution solved the issue for me.
@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
return authenticationConfiguration.getAuthenticationManager();
}