| | |
| | | // Check to see if the user has a password. If not, then fail. |
| | | // FIXME -- We need to have a way to enable/disable debugging. |
| | | pwPolicyState = new PasswordPolicyState(userEntry, false, false); |
| | | AttributeType pwType = pwPolicyState.getPasswordAttribute(); |
| | | AttributeType pwType |
| | | = pwPolicyState.getPolicy().getPasswordAttribute(); |
| | | |
| | | List<Attribute> pwAttr = userEntry.getAttribute(pwType); |
| | | if ((pwAttr == null) || (pwAttr.isEmpty())) |
| | |
| | | pwPolicyErrorType = PasswordPolicyErrorType.PASSWORD_EXPIRED; |
| | | } |
| | | |
| | | int maxGraceLogins = pwPolicyState.getMaxAllowedGraceLogins(); |
| | | int maxGraceLogins |
| | | = pwPolicyState.getPolicy().getGraceLoginCount(); |
| | | if ((maxGraceLogins > 0) && pwPolicyState.mayUseGraceLogin()) |
| | | { |
| | | List<Long> graceLoginTimes = pwPolicyState.getGraceLoginTimes(); |
| | |
| | | setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | setAuthFailureReason(msgID, message); |
| | | |
| | | int maxAllowedFailures = pwPolicyState.getMaxAllowedFailures(); |
| | | int maxAllowedFailures |
| | | = pwPolicyState.getPolicy().getLockoutFailureCount(); |
| | | if (maxAllowedFailures > 0) |
| | | { |
| | | pwPolicyState.updateAuthFailureTimes(); |
| | |
| | | |
| | | AccountStatusNotificationType notificationType; |
| | | |
| | | int lockoutDuration = pwPolicyState.getLockoutDuration(); |
| | | int lockoutDuration |
| | | = pwPolicyState.getPolicy().getLockoutDuration(); |
| | | if (lockoutDuration > 0) |
| | | { |
| | | notificationType = AccountStatusNotificationType. |
| | |
| | | pwPolicyErrorType = PasswordPolicyErrorType.PASSWORD_EXPIRED; |
| | | } |
| | | |
| | | int maxGraceLogins = pwPolicyState.getMaxAllowedGraceLogins(); |
| | | int maxGraceLogins |
| | | = pwPolicyState.getPolicy().getGraceLoginCount(); |
| | | if ((maxGraceLogins > 0) && pwPolicyState.mayUseGraceLogin()) |
| | | { |
| | | List<Long> graceLoginTimes = |
| | |
| | | if (saslHandler.isPasswordBased(saslMechanism)) |
| | | { |
| | | |
| | | int maxAllowedFailures = pwPolicyState.getMaxAllowedFailures(); |
| | | int maxAllowedFailures |
| | | = pwPolicyState.getPolicy().getLockoutFailureCount(); |
| | | if (maxAllowedFailures > 0) |
| | | { |
| | | pwPolicyState.updateAuthFailureTimes(); |
| | |
| | | int msgID; |
| | | String message; |
| | | |
| | | int lockoutDuration = pwPolicyState.getLockoutDuration(); |
| | | int lockoutDuration |
| | | = pwPolicyState.getPolicy().getLockoutDuration(); |
| | | if (lockoutDuration > 0) |
| | | { |
| | | notificationType = AccountStatusNotificationType. |