Skip to content

Commit

Permalink
Better error message for expired credentials (MID-3746)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Dec 1, 2017
1 parent c28d59c commit beaaf14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Expand Up @@ -3091,6 +3091,8 @@ web.security.provider.locked=User is locked, please wait.
web.security.provider.password.bad=User doesn't have defined password.
web.security.provider.password.encoding=Couldn't authenticate user, reason: couldn't encode password.
web.security.provider.unavailable=Currently we are unable to process your request. Kindly try again later.
web.security.provider.credential.bad=Bad credentials
web.security.provider.credential.expired=Credentials have expired
web.security.ldap.access.denied=Access denied. You don't have permission to access, please contact Identity Manager's administrators.
web.security.ldap.denied=Permission denied.
web.security.ldap.disabled=User is disabled.
Expand Down
Expand Up @@ -3083,6 +3083,8 @@ web.security.provider.locked=User is locked, please wait.
web.security.provider.password.bad=User doesn't have defined password.
web.security.provider.password.encoding=Couldn't authenticate user, reason: couldn't encode password.
web.security.provider.unavailable=Currently we are unable to process your request. Kindly try again later.
web.security.provider.credential.bad=Bad credentials
web.security.provider.credential.expired=Credentials have expired
web.security.ldap.access.denied=Access denied. You don't have permission to access, please contact Identity Manager's administrators.
web.security.ldap.denied=Permission denied.
web.security.ldap.disabled=User is disabled.
Expand Down
Expand Up @@ -303,7 +303,7 @@ private <P extends CredentialPolicyType> void checkPasswordValidityAndAge(Connec
XMLGregorianCalendar passwordValidUntil = XmlTypeConverter.addDuration(changeTimestamp, maxAge);
if (clock.isPast(passwordValidUntil)) {
recordAuthenticationFailure(principal, connEnv, "password expired");
throw new CredentialsExpiredException(messages.getMessage("web.security.provider.password.bad"));
throw new CredentialsExpiredException(messages.getMessage("web.security.provider.credential.expired"));
}
}
}
Expand All @@ -325,7 +325,7 @@ private void checkPasswordValidityAndAge(ConnectionEnvironment connEnv, @NotNull
XMLGregorianCalendar passwordValidUntil = XmlTypeConverter.addDuration(changeTimestamp, maxAge);
if (clock.isPast(passwordValidUntil)) {
recordAuthenticationFailure(principal, connEnv, "password expired");
throw new CredentialsExpiredException(messages.getMessage("web.security.provider.password.bad"));
throw new CredentialsExpiredException(messages.getMessage("web.security.provider.credential.expired"));
}
}
}
Expand Down

0 comments on commit beaaf14

Please sign in to comment.