Class PasswordUpdateServiceImpl
java.lang.Object
ch.tocco.nice2.web.core.impl.auth.password.PasswordUpdateServiceImpl
- All Implemented Interfaces:
PasswordUpdateService
Updates the password of a principal and checks the validity of the new password
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordUpdateServiceImpl(org.slf4j.Logger log, Context context, Authenticator authenticator, PrincipalService principalService) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetValidators(List<PasswordValidator> validators) voidupdatePassword(String username, @Nullable String oldPassword, String newPassword) Updates and verifies the new password for given credentialsvalidatePassword(String username, String newPassword) Validate a password against the password policy
-
Constructor Details
-
PasswordUpdateServiceImpl
public PasswordUpdateServiceImpl(org.slf4j.Logger log, Context context, Authenticator authenticator, PrincipalService principalService)
-
-
Method Details
-
updatePassword
public void updatePassword(String username, @Nullable @Nullable String oldPassword, String newPassword) throws UpdatePasswordException Description copied from interface:PasswordUpdateServiceUpdates and verifies the new password for given credentials- Specified by:
updatePasswordin interfacePasswordUpdateService- Parameters:
username- user for which the new password should be setoldPassword- the current password (user input) - may be null for usermanagersnewPassword- new password (user input)- Throws:
UpdatePasswordException- when the supplied password(s) are not valid
-
validatePassword
Description copied from interface:PasswordUpdateServiceValidate a password against the password policy- Specified by:
validatePasswordin interfacePasswordUpdateService- Parameters:
username- the name of the usernewPassword- the new password- Returns:
- the validation result
-
getPasswordRules
- Specified by:
getPasswordRulesin interfacePasswordUpdateService- Returns:
- the current password policy
-
setValidators
-