public interface ForgottenLoginManager
To reset a user's password, clients of ForgottenLoginManager
would do the following:
Modifier and Type | Method and Description |
---|---|
boolean |
isValidResetToken(long directoryId,
String username,
String token)
Returns true if the password reset token for the user with the specified username and directory ID are
valid and not expired.
|
void |
resetUserCredential(long directoryId,
String username,
PasswordCredential credential,
String token)
Resets the user credentials and invalidates the token.
|
void |
sendResetLink(Application application,
String username)
Sends a reset link to the first user with the matching username from all the active directories assigned
to the application.
|
void |
sendResetLink(long directoryId,
String username)
Sends a reset link to the user with specified username and directory ID.
|
boolean |
sendUsernames(Application application,
String email)
Sends the usernames associated with the given email address.
|
void sendResetLink(Application application, String username) throws UserNotFoundException, InvalidEmailAddressException, ApplicationPermissionException
application
- user is searched in application's assigned directoriesusername
- username of the user to send the password reset linkUserNotFoundException
- if no user with the supplied username existsInvalidEmailAddressException
- if the user does not have a valid email address to send the password reset email toApplicationPermissionException
- if the application does not have permission to modify the userboolean sendUsernames(Application application, String email) throws InvalidEmailAddressException
Sends the usernames associated with the given email address. No email will be sent if there are no usernames
associated with a given email
.
The method returns a boolean, which should only ever be passed to authenticated applications to avoid leaking information.
application
- search application's assigned directories for usernames associated with the email
email
- email address of the usertrue
if any users with that address were found.InvalidEmailAddressException
- if the email
is not validvoid sendResetLink(long directoryId, String username) throws DirectoryNotFoundException, UserNotFoundException, InvalidEmailAddressException, OperationFailedException
Similar to sendResetLink(Application, String)
except applying to a directory-specific
user.
directoryId
- directory ID of the user to modifyusername
- username of the user to send the password reset linkDirectoryNotFoundException
- if the directory specified by directoryId could not be foundUserNotFoundException
- if the user specified by username could not be foundInvalidEmailAddressException
- if the user does not have a valid email address to send the password reset email toOperationFailedException
boolean isValidResetToken(long directoryId, String username, String token)
sendResetLink(com.atlassian.crowd.model.application.Application, java.lang.String)
.directoryId
- directory ID of the user to validateusername
- username of the user to verify the tokentoken
- password reset tokenvoid resetUserCredential(long directoryId, String username, PasswordCredential credential, String token) throws DirectoryNotFoundException, UserNotFoundException, InvalidResetPasswordTokenException, OperationFailedException, InvalidCredentialException, DirectoryPermissionException
directoryId
- directory ID of the userusername
- user name of the user to perform a credential resetcredential
- new credentialstoken
- password reset tokenDirectoryNotFoundException
- if the directory could not be found.UserNotFoundException
- if the user could not be found in the given directory.InvalidResetPasswordTokenException
- if the reset token is not valid.OperationFailedException
- if there was an error performing the operation or instantiating the backend directory.InvalidCredentialException
- if the user's credential does not meet the validation requirements for an associated directory.DirectoryPermissionException
- if the directory is not allowed to perform the operationCopyright © 2013 Atlassian. All Rights Reserved.