Search in sources :

Example 1 with PasswordValidator

use of com.emc.storageos.security.password.PasswordValidator in project coprhd-controller by CoprHD.

the class AuthenticationResource method validateLocalUserExpiration.

/**
 * validate if local user's password expired
 *
 * @param credentials
 */
private void validateLocalUserExpiration(UsernamePasswordCredentials credentials) {
    // skip validation, if user is not a local one.
    if (!_passwordUtils.isLocalUser(credentials.getUserName())) {
        return;
    }
    PasswordValidator validator = ValidatorFactory.buildExpireValidator(_passwordUtils.getConfigProperties());
    Password password = new Password(credentials.getUserName(), credentials.getPassword(), null);
    password.setPasswordHistory(_passwordUtils.getPasswordHistory(credentials.getUserName()));
    validator.validate(password);
}
Also used : PasswordValidator(com.emc.storageos.security.password.PasswordValidator) Password(com.emc.storageos.security.password.Password)

Aggregations

Password (com.emc.storageos.security.password.Password)1 PasswordValidator (com.emc.storageos.security.password.PasswordValidator)1