public interface EmailChangeManager
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String username,
long directoryId)
Aborts a pending e-mail validation for a given user in crowd app.
|
void |
changeEmail(String token,
String username)
Changes e-mail for a user in crowd app.
|
String |
getPendingNewEmailByToken(String token)
Returns new e-mail address for a e-mail change token.
|
String |
getPendingNewEmailByUser(String username,
long directoryId)
Returns new e-mail address for a user in crowd app for whom there's a pending e-mail verification.
|
boolean |
hasUserEmailChangePending(String username,
long directoryId)
Returns true if there is a pending e-mail verification for a user in crowd app, false otherwise.
|
boolean |
isAvailableForDirectory(long dirId)
Returns true if e-mail change by end-user feature is available for a given directory.
|
boolean |
isTokenValid(String token)
Returns true if a given token is a valid e-mail change verification token.
|
void |
resendEmail(String username,
long directoryId)
Resends an e-mail with a new token for a user in crowd app that has a pending e-mail verification.
|
void |
sendEmailAuthorization(String username,
String password,
long directoryId,
String newEmail)
Starts e-mail change flow for a user in crowd app, by sending two e-mails.
|
void sendEmailAuthorization(String username, String password, long directoryId, String newEmail) throws com.atlassian.crowd.exception.InvalidAuthenticationException, com.atlassian.crowd.exception.InvalidEmailAddressException, MailSendException, com.atlassian.crowd.exception.OperationNotPermittedException, com.atlassian.crowd.exception.ApplicationNotFoundException, SameEmailAddressException
newEmail. The first one contains info for an ongoing e-mail change.
The second one contains a link with a token which is required to change an e-mail. In order to do change an
e-mail, changeEmail(java.lang.String, java.lang.String) needs to be called with the aforementioned token passed as
an argument.username - username of the user for whom we're changing an e-mailpassword - password of the user for whom we're changing an e-maildirectoryId - directory ID of the user for whom we're changing an e-mailnewEmail - e-mail to which we'll replace an old email of the usercom.atlassian.crowd.exception.InvalidAuthenticationException - if authentication fails for given username and passwordcom.atlassian.crowd.exception.InvalidEmailAddressException - if passed newEmail is not a valid e-mail addressSameEmailAddressException - if passed newEmail is the same as the one currently used by a userMailSendException - if Crowd failed to send e-mail with a tokencom.atlassian.crowd.exception.OperationNotPermittedException - if feature is not availablecom.atlassian.crowd.exception.ApplicationNotFoundException - if 'crowd' app has not been foundvoid changeEmail(String token, String username) throws InvalidChangeEmailTokenException, com.atlassian.crowd.exception.InvalidAuthenticationException, com.atlassian.crowd.exception.UserNotFoundException, com.atlassian.crowd.exception.OperationFailedException, com.atlassian.crowd.exception.ApplicationNotFoundException, com.atlassian.crowd.exception.OperationNotPermittedException
This method SHALL only be called after calling sendEmailAuthorization(java.lang.String, java.lang.String, long, java.lang.String).
token - token sent in email by sendEmailAuthorization(java.lang.String, java.lang.String, long, java.lang.String)username - username of the user for whom we're changing an e-mailInvalidChangeEmailTokenException - if provide token is not validcom.atlassian.crowd.exception.InvalidAuthenticationException - if user identified by username is not the one who generated a tokencom.atlassian.crowd.exception.UserNotFoundException - if user does not existcom.atlassian.crowd.exception.OperationFailedException - if Crowd failed to update e-mailcom.atlassian.crowd.exception.ApplicationNotFoundException - if 'crowd' app has not been foundcom.atlassian.crowd.exception.OperationNotPermittedException - if feature is not availableboolean hasUserEmailChangePending(String username, long directoryId)
username - username of the userdirectoryId - directory ID of the userString getPendingNewEmailByUser(String username, long directoryId)
username - username of the userdirectoryId - directory ID of the userIllegalStateException - if user does not have a pending e-mail validationString getPendingNewEmailByToken(String token)
token - e-mail change tokenIllegalStateException - if user does not have a pending e-mail validationvoid resendEmail(String username, long directoryId) throws com.atlassian.crowd.exception.InvalidEmailAddressException, MailSendException, com.atlassian.crowd.exception.UserNotFoundException, com.atlassian.crowd.exception.ApplicationNotFoundException
username - of the userdirectoryId - directory ID of the userIllegalStateException - if user does not have a pending e-mail validationcom.atlassian.crowd.exception.InvalidEmailAddressException - if pending e-mail address is not a valid e-mail addressMailSendException - if Crowd failed to re-send e-mail with a tokencom.atlassian.crowd.exception.UserNotFoundException - if user does not existcom.atlassian.crowd.exception.ApplicationNotFoundException - if 'crowd' app has not been foundvoid abort(String username, long directoryId)
username - username of the userdirectoryId - directory ID of the userIllegalStateException - if user does not have a pending e-mail validationboolean isTokenValid(String token)
token - e-mail change tokenboolean isAvailableForDirectory(long dirId)
Feature might be disabled for a given directory because: - Crowd's e-mail server is NOT configured - Directory does not have permissions to change user e-mail
dirId - ID of the directoryCopyright © 2023 Atlassian. All rights reserved.