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
ConstructorDescriptionPasswordUpdateServiceImpl
(org.slf4j.Logger log, Context context, Authenticator authenticator, PrincipalService principalService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
setValidators
(List<PasswordValidator> validators) void
updatePassword
(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:PasswordUpdateService
Updates and verifies the new password for given credentials- Specified by:
updatePassword
in 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:PasswordUpdateService
Validate a password against the password policy- Specified by:
validatePassword
in interfacePasswordUpdateService
- Parameters:
username
- the name of the usernewPassword
- the new password- Returns:
- the validation result
-
getPasswordRules
- Specified by:
getPasswordRules
in interfacePasswordUpdateService
- Returns:
- the current password policy
-
setValidators
-