Currently, in DelegatingPasswordEncoder class
@Override
public String encode(CharSequence rawPassword) {
return this.idPrefix + this.idForEncode + this.idSuffix + this.passwordEncoderForEncode.encode(rawPassword);
}
Enhancement: Add an overload method
@Override
public String encode(CharSequence rawPassword, String idForEncode) {
return this.idPrefix + idForEncode + this.idSuffix + this.idToPasswordEncoder.get(idForEncode ).encode(rawPassword);
}
With this enhancement, we can now easily choose a different encoder when encoding a plain password.
This allows us to create the DelegatingPasswordEncoder using the simple api call PasswordEncoderFactories.createDelegatingPasswordEncoder() and yet able to use the created encoder to switch between different encoding algorithms whenever encoding is performed
Currently, in DelegatingPasswordEncoder class
Enhancement: Add an overload method
With this enhancement, we can now easily choose a different encoder when encoding a plain password.
This allows us to create the DelegatingPasswordEncoder using the simple api call
PasswordEncoderFactories.createDelegatingPasswordEncoder()and yet able to use the created encoder to switch between different encoding algorithms whenever encoding is performed