Skip to content

Instantly share code, notes, and snippets.

@carchrae
Last active December 15, 2015 06:29
Show Gist options
  • Save carchrae/5216610 to your computer and use it in GitHub Desktop.
Save carchrae/5216610 to your computer and use it in GitHub Desktop.
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
public class CustomMd5PasswordEncoder extends Md5PasswordEncoder {
@Override
protected String mergePasswordAndSalt(String password, Object salt,
boolean strict) {
if (password == null) {
password = "";
}
if (salt == null) {
return password;
}
return salt.toString() + password;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment