I fixed by add one line of code "authenticationManagerBuilder.parentAuthenticationManager(null);" to authenticationManager method in SecurityConfig class. This is modified code: @Bean public AuthenticationManager authenticationManager(HttpSecurity http) throws Exception { AuthenticationManagerBuilder authenticationManagerBuilder = http.getSharedObject(AuthenticationManagerBuilder.class); authenticationManagerBuilder.parentAuthenticationManager(null); authenticationManagerBuilder.userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder()); return authenticationManagerBuilder.build(); }
I fixed it by add this one line of code "authenticationManagerBuilder.parentAuthenticationManager(null);" to authenticationManager method in SecurityConfig class.
Excellent and very clear tutorial. It was very easy for me to understand. Thank you sir
Thank you for your insightful and up-to-date video, it cleared up the confusion caused by outdated tutorials and deprecated methods.
Thank you
Hey, thanks you for the up to date info, i have some problems with login and database authentication, can u make a video expaining it?
What if i want to persist the password and username (basically all the User data) in the database and retrieve from it?
There seems to be a problem with authentication when an account exists but the wrong password is entered. Does anyone have a solution?
I fixed by add one line of code "authenticationManagerBuilder.parentAuthenticationManager(null);" to authenticationManager method in SecurityConfig class. This is modified code: @Bean
public AuthenticationManager authenticationManager(HttpSecurity http) throws Exception {
AuthenticationManagerBuilder authenticationManagerBuilder = http.getSharedObject(AuthenticationManagerBuilder.class);
authenticationManagerBuilder.parentAuthenticationManager(null);
authenticationManagerBuilder.userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder());
return authenticationManagerBuilder.build();
}
When you have a username but the password is incorrect it goes into an infinite loop of database queries, does anyone know how to fix it?
I fixed it by add this one line of code "authenticationManagerBuilder.parentAuthenticationManager(null);" to authenticationManager method in SecurityConfig class.
I got a same problem, and looking for solution too