I just needed to encrypt the password programatically when I was storing it. Essentially:
new BCryptPasswordEncoder().encode(user.getPassword())
Pregunta
I have the following:
@Override
protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsManager()).passwordEncoder(passwordEncoder());
}
@Bean
public MongoUserDetailsService userDetailsManager() {
return new MongoUserDetailsService();
}
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
in my WebSecurityConfigurerAdapter and it seems to be working OK for checking the password on login.
Am I missing anything else to be able to store the password encrypted as well?
Solución
I just needed to encrypt the password programatically when I was storing it. Essentially:
new BCryptPasswordEncoder().encode(user.getPassword())