Skip to content

Commit

Permalink
support not case-sensitive for salt password (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 committed Oct 23, 2022
1 parent 9891f4b commit a29322b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public Subject authenticated(Subject var) throws SurenessAuthenticationException
if (var.getCredential() != null && account.getPassword() != null) {
String password = String.valueOf(var.getCredential());
if (account.getSalt() != null && !"".equals(account.getSalt())) {
// Not case-sensitive for salt password
password = Md5Util.md5( password + account.getSalt());
if (password != null && password.equalsIgnoreCase(account.getPassword())) {
password = account.getPassword();
}
}
if (password == null || !password.equals(account.getPassword())) {
if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit a29322b

Please sign in to comment.