| | |
| | | userEntry = identityMapper.getEntryForID(authzIDStr.substring(2)); |
| | | if (userEntry == null) |
| | | { |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_MAP_USER.get(authzIDStr)); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_MAP_USER.get(authzIDStr)); |
| | | } |
| | | |
| | | operation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_MAP_USER.get(authzIDStr)); |
| | | return; |
| | | } |
| | | else |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(de.getResultCode()); |
| | | |
| | | operation.appendErrorMessage(ERR_EXTOP_PASSMOD_ERROR_MAPPING_USER |
| | | .get(authzIDStr,de.getMessageObject())); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_ERROR_MAPPING_USER.get( |
| | | authzIDStr, |
| | | de.getMessageObject())); |
| | | } |
| | | |
| | | //Encountered an exception while resolving identity. |
| | | operation.setResultCode(de.getResultCode()); |
| | | operation.appendErrorMessage(ERR_EXTOP_PASSMOD_ERROR_MAPPING_USER |
| | | .get(authzIDStr,de.getMessageObject())); |
| | | return; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | // IGNORE. |
| | | } |
| | | |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | // IGNORE. |
| | | } |
| | | } |
| | |
| | | |
| | | Message message = ERR_EXTOP_PASSMOD_ACCOUNT_DISABLED.get(); |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.appendErrorMessage(message); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | operation.appendAdditionalLogMessage(message); |
| | | } |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.appendErrorMessage(message); |
| | | |
| | | return; |
| | | } |
| | |
| | | |
| | | Message message = ERR_EXTOP_PASSMOD_ACCOUNT_LOCKED.get(); |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.appendErrorMessage(message); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | operation.appendAdditionalLogMessage(message); |
| | | } |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.appendErrorMessage(message); |
| | | |
| | | return; |
| | | return; |
| | | } |
| | | |
| | | |
| | |
| | | if (pwPolicyState.getPolicy().requireSecureAuthentication() && |
| | | (! operation.getClientConnection().isSecure())) |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | operation.setResultCode(ResultCode.CONFIDENTIALITY_REQUIRED); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_AUTH_REQUIRED.get()); |
| | |
| | | pwPolicyErrorType)); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED.get()); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED.get()); |
| | | return; |
| | | } |
| | | |
| | |
| | | if (pwPolicyState.getPolicy().requireSecurePasswordChanges() && |
| | | (! operation.getClientConnection().isSecure())) |
| | | { |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | operation.setResultCode(ResultCode.CONFIDENTIALITY_REQUIRED); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED.get()); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED.get()); |
| | | return; |
| | | } |
| | | |
| | |
| | | pwPolicyErrorType)); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage(ERR_EXTOP_PASSMOD_IN_MIN_AGE.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_IN_MIN_AGE.get()); |
| | | } |
| | | operation.appendErrorMessage(ERR_EXTOP_PASSMOD_IN_MIN_AGE.get()); |
| | | |
| | | return; |
| | | } |
| | |
| | | pwPolicyErrorType)); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED.get()); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED.get()); |
| | | return; |
| | | } |
| | | |
| | |
| | | newPassword = pwPolicyState.generatePassword(); |
| | | if (newPassword == null) |
| | | { |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_NO_PW_GENERATOR.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_NO_PW_GENERATOR.get()); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_NO_PW_GENERATOR.get()); |
| | | return; |
| | | } |
| | | else |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(de.getResultCode()); |
| | | operation.setResultCode(de.getResultCode()); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_GENERATE_PW.get( |
| | | de.getMessageObject())); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_GENERATE_PW.get( |
| | | de.getMessageObject())); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_GENERATE_PW.get( |
| | | de.getMessageObject())); |
| | | return; |
| | | } |
| | | } |
| | |
| | | isPreEncoded = true; |
| | | if (! pwPolicyState.getPolicy().allowPreEncodedPasswords()) |
| | | { |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED.get()); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED.get()); |
| | | return; |
| | | } |
| | | } |
| | |
| | | pwPolicyErrorType)); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_UNACCEPTABLE_PW.get( |
| | | String.valueOf(invalidReason))); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_UNACCEPTABLE_PW.get( |
| | | String.valueOf(invalidReason))); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_UNACCEPTABLE_PW.get( |
| | | String.valueOf(invalidReason))); |
| | | return; |
| | | } |
| | | } |
| | |
| | | if (selfChange || (! pwPolicyState.getPolicy(). |
| | | skipValidationForAdministrators())) |
| | | { |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PW_IN_HISTORY.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_PW_IN_HISTORY.get()); |
| | | } |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PW_IN_HISTORY.get()); |
| | | return; |
| | | } |
| | | } |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | | operation.setResultCode(de.getResultCode()); |
| | | operation.setResultCode(de.getResultCode()); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD.get( |
| | | de.getMessageObject())); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD.get( |
| | | de.getMessageObject())); |
| | | } |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD.get( |
| | | de.getMessageObject())); |
| | | return; |
| | | } |
| | | } |