I\'m trying to learn Spring security currently. I used BCryptPasswordEncoder
to encode user password before persisting into a database
Code:
Maybe you can implement this simple code to evade Spring Encoder
public class PasswordEnconderTest implements PasswordEncoder {
@Override
public String encode(CharSequence charSequence) {
return charSequence.toString();
}
@Override
public boolean matches(CharSequence charSequence, String s) {
return charSequence.toString().equals(s);
}
}
and add in your WebSecurityConfig:
@Bean
public PasswordEncoder passwordEncoder(){
return new PasswordEnconderTest();
}
it's not recommended but you can implement