@Role
@Unstable
public interface ResetPasswordManager
Modifier and Type | Method and Description |
---|---|
ResetPasswordRequestResponse |
checkVerificationCode(UserReference userReference,
String verificationCode)
Check if the given verification code is correct for the user reference.
|
ResetPasswordRequestResponse |
requestResetPassword(UserReference userReference)
Perform a reset password request and return the information to send to the user.
|
void |
resetPassword(UserReference userReference,
String newPassword)
Reset the password of the given user with the given new password.
|
void |
sendResetPasswordEmailRequest(ResetPasswordRequestResponse requestResponse)
Send
ResetPasswordRequestResponse information by email to the user. |
ResetPasswordRequestResponse requestResetPassword(UserReference userReference) throws ResetPasswordException
userReference
- the reference of the user for which to reset the password.ResetPasswordException
- if any problem occurs.void sendResetPasswordEmailRequest(ResetPasswordRequestResponse requestResponse) throws ResetPasswordException
ResetPasswordRequestResponse
information by email to the user.requestResponse
- the reset password information to send to the user to confirm her identity.ResetPasswordException
- in case of problem for sending the email.ResetPasswordRequestResponse checkVerificationCode(UserReference userReference, String verificationCode) throws ResetPasswordException
ResetPasswordException
if the verification code is not correct.
The verification code must be reset at each check, even if the validation is not correct, to ensure that an
attacker cannot bruteforce it.userReference
- the reference for which to check the verification code.verificationCode
- the code to check.ResetPasswordException
- if the verification code is wrong or cannot be validated.void resetPassword(UserReference userReference, String newPassword) throws ResetPasswordException
userReference
- the reference of the user for which to reset the password.newPassword
- the new password to set.ResetPasswordException
- in case of problem when modifying the password.Copyright © 2004–2021 XWiki. All rights reserved.