Skip logging errors when account is locked or disabled
@@ -722,11 +722,17 @@ public class DefaultStepHandler implements StepHandler {
if (errorContext != null) {
Throwable rootCause = ExceptionUtils.getRootCause(e);
if (!IdentityCoreConstants.ADMIN_FORCED_USER_PASSWORD_RESET_VIA_OTP_ERROR_CODE.
- equals(errorContext.getErrorCode()) && !(rootCause instanceof UserStoreClientException)) {
+ equals(errorContext.getErrorCode()) && !(rootCause instanceof UserStoreClientException) &&
+ !IdentityCoreConstants.USER_ACCOUNT_LOCKED_ERROR_CODE.equals(errorContext.getErrorCode()) &&
+ !IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE.equals(errorContext.getErrorCode())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Authentication failed exception!", e);
}
LOG.error("Authentication failed exception! " + e.getMessage());
+ } else {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Authentication failed exception!", e);
+ }
}
} else {
if (LOG.isDebugEnabled()) {
