/** * As in the above method the user account lock claim, primary challenges * claim will be separately handled. Identity claims will be removed from * the claim set before adding claims to the user store. */ @Override public boolean doPreSetUserClaimValues(String userName, Map<String, String> claims, String profileName, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } if (log.isDebugEnabled()) { log.debug("doPreSetUserClaimValues executed in the IdentityStoreEventListener for user: " + userName); } boolean accountLocked = Boolean.parseBoolean(claims.get(UserIdentityDataStore.ACCOUNT_LOCK)); if (accountLocked) { IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants .ErrorCode.USER_IS_LOCKED); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); } return storeInIdentityDataStore(userName, userStoreManager, PRE_SET_USER_CLAIM_VALUES, claims); }
IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants .ErrorCode.USER_IS_LOCKED); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants .ErrorCode.USER_DOES_NOT_EXIST); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); throw new AccountLockException(UserCoreConstants.ErrorCode.USER_IS_LOCKED, message);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityUtil.threadLocalProperties.get().put(IdentityCoreConstants.USER_ACCOUNT_STATE, IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);
new IdentityErrorMsgContext(UserCoreConstants.ErrorCode.INVALID_CREDENTIAL, currentFailedAttempts, maximumFailedAttempts); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); if (log.isDebugEnabled()) { String msg = String.format("Login attempt failed. Bypassing account locking for user %s", userName); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityUtil.threadLocalProperties.get().put(IdentityCoreConstants.USER_ACCOUNT_STATE, UserCoreConstants.ErrorCode.USER_IS_LOCKED); IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants.ErrorCode.INVALID_CREDENTIAL, currentFailedAttempts, maximumFailedAttempts); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);
IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); throw new IdentityEventException(errorMsg);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); } else {
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); } else {
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants .ErrorCode.USER_DOES_NOT_EXIST); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); return; IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_NOT_CONFIRMED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); throw new IdentityEventException(IdentityCoreConstants.USER_ACCOUNT_NOT_CONFIRMED_ERROR_CODE, "User : " + userName + " not confirmed yet.");
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants .ErrorCode.USER_IS_LOCKED); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); } else if (isAccountDisabled) { IdentityUtil.clearIdentityErrorMsg(); IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); } else {
if (accountDisabled) { IdentityUtil.clearIdentityErrorMsg(); IdentityUtil.setIdentityErrorMsg(new IdentityErrorMsgContext(IdentityCoreConstants .USER_ACCOUNT_DISABLED_ERROR_CODE)); if (accountLocked) { IdentityUtil.clearIdentityErrorMsg(); IdentityUtil.setIdentityErrorMsg(new IdentityErrorMsgContext(UserCoreConstants.ErrorCode .USER_IS_LOCKED));
IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); String errorMsg = "User account is disabled for user : " + userName; log.warn(errorMsg); userIdentityDTO.getFailAttempts(), config.getAuthPolicyMaxLoginAttempts()); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); String errorMsg = "User account is locked for user : " + userName + ". cannot login until the account is unlocked ";
IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); String errorMsg = "User account is disabled for user : " + userName; log.warn(errorMsg); .setFailedLoginAttempts(config.getAuthPolicyMaxLoginAttempts()); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); String errorMsg = "User account is locked for user : " + userName + ". cannot login until the account is unlocked ";
IdentityMgtConstants.LockedReason.MAX_ATTEMTS_EXCEEDED.toString(), userIdentityDTO.getFailAttempts(), config.getAuthPolicyMaxLoginAttempts()); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityUtil.threadLocalProperties.get().put(IdentityCoreConstants.USER_ACCOUNT_STATE, UserCoreConstants.ErrorCode.USER_IS_LOCKED); IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants.ErrorCode.INVALID_CREDENTIAL, userIdentityDTO.getFailAttempts(), config.getAuthPolicyMaxLoginAttempts()); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);
IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants.ErrorCode.USER_IS_LOCKED, userIdentityDTO.getFailAttempts(), config.getAuthPolicyMaxLoginAttempts()); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext(UserCoreConstants.ErrorCode.INVALID_CREDENTIAL, userIdentityDTO.getFailAttempts(), config.getAuthPolicyMaxLoginAttempts()); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext);