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);
}
Aggregations