Interface UserPasswordService<P extends PasswordToken,U extends User>
- All Superinterfaces:
org.springframework.security.core.userdetails.UserDetailsPasswordService
- All Known Implementing Classes:
DefaultUserPasswordService
public interface UserPasswordService<P extends PasswordToken,U extends User>
extends org.springframework.security.core.userdetails.UserDetailsPasswordService
- Author:
- Chad Harchar (charchar)
-
Method Summary
Modifier and TypeMethodDescriptionbooleanchangePassword(ChangePasswordForm changePasswordForm, org.springframework.validation.BindingResult errors) From the providedChangePasswordForm, attempt to change the user's password.booleancreateResetPasswordToken(String clientId, String username) Creates a reset password token for the specified user, if they exist.booleancreateTokenForUser(String clientId, String username) Deprecated.booleanresetPassword(ResetPasswordForm resetPasswordForm, org.springframework.validation.BindingResult errors) From the providedResetPasswordForm, attempt to reset the user's password.updatePasswordForUser(U user, String password, String clientId) Send a password change notification email and update the user's password.Methods inherited from interface org.springframework.security.core.userdetails.UserDetailsPasswordService
updatePassword
-
Method Details
-
resetPassword
boolean resetPassword(ResetPasswordForm resetPasswordForm, org.springframework.validation.BindingResult errors) From the providedResetPasswordForm, attempt to reset the user's password. If a failure occurs, errors will be populated onBindingResultand `false` is returned. Otherwise, return `true`.- Parameters:
resetPasswordForm- The form to use to reset the user's password.errors- The object to hold any errors that might occur.- Returns:
- Whether the provided
ResetPasswordFormpassed validation in order for the password to be reset.
-
changePassword
boolean changePassword(ChangePasswordForm changePasswordForm, org.springframework.validation.BindingResult errors) From the providedChangePasswordForm, attempt to change the user's password. If a failure occurs, errors will be populated onBindingResultand `false` is returned. Otherwise, return `true`.- Parameters:
changePasswordForm- The form to use to change the user's password.errors- The object to hold any errors that might occur.- Returns:
- Whether the provided
ChangePasswordFormpassed validation in order for the password to be changed.
-
createResetPasswordToken
Creates a reset password token for the specified user, if they exist.- Parameters:
clientId- TheAuthorizedClient.getId()to verify againstusername- The username of the user for which to validate and create a token.- Returns:
- true if token successfully created, else false.
- Throws:
AccountLockedException- if user is locked and unable to reset their password
-
createTokenForUser
@Deprecated boolean createTokenForUser(String clientId, String username) throws AccountLockedException Deprecated.Creates a token for the specified user, if they exist.- Parameters:
clientId- TheAuthorizedClient.getId()to verify againstusername- The username of the user for which to validate and create a token.- Returns:
- true if token successfully created, else false.
- Throws:
AccountLockedException- if user is locked and unable to reset their password
-
updatePasswordForUser
Send a password change notification email and update the user's password.- Parameters:
user- The user who's password to update.password- The new password for the user.clientId- The clientId from the request.- Returns:
- The updated user.
-
createResetPasswordToken(java.lang.String, java.lang.String)instead.