public interface PasswordService extends Service
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
activate(@NotNull PasswordTypeVO passwordType)
Activates a password whose mode is
PasswordMode.GENERATED creating a new password for the current user. |
void |
allowActivation(@NotNull PasswordActionDTO params)
Allows the given user to activate the given generated and pending password
|
void |
change(@NotNull ChangePasswordDTO dto)
Manually changes a password
|
void |
changeForgottenPassword(@NotNull ChangeForgottenPasswordDTO dto)
Changes a manual password leaving as
PasswordStatus.ACTIVE, or if generated, send a new one
(leaving as PasswordStatus.ACTIVE or PasswordStatus.RESET whether the user has the change
permission or not) |
void |
disable(@NotNull PasswordActionDTO params)
Disables a password.
|
void |
enable(@NotNull PasswordActionDTO params)
Enables a disabled password.
|
void |
forgotPasswordRequest(@NotNull ForgotPasswordRequestDTO params)
Initiates the forgot password operation,
allowing the user to set another password based on an e-mail token and security question verification.
|
java.lang.String |
generateNew(@NotNull ChangeGeneratedPasswordDTO params)
Allows to change a generated password by generating a new one
|
ChangeForgottenPasswordData |
getChangeForgottenPasswordData(@NotNull java.lang.String validationKey)
Returns data for a forgot password change request
|
ChangePasswordData |
getChangePasswordData(boolean changeSecondaryPassword)
Returns data for change the main/secondary access password (manual or generated)
|
UserPasswordsData |
getData(@NotNull UserLocatorVO locator)
Returns data for user passwords
|
PasswordData |
getPasswordData(@NotNull UserLocatorVO locator,
@NotNull PasswordTypeVO type)
Returns data for a given password of the given user.
|
SetSecurityQuestionData |
getSetSecurityQuestionData()
Returns data used to set the security question
|
java.util.List<java.lang.String> |
requestNewOTP(@NotNull SendMedium medium,
java.lang.String channel)
Generates a new OTP (removing any previous password, if any) and sends it by the specified medium using the
confirmation mode configured the given channel for the logged user.
|
java.util.List<java.lang.String> |
requestNewOTPForSecondaryPassword(SendMedium medium)
Same as
#requestNewOTP(SendMedium) but using the secondary password type configured in the current
channel for the logged user. |
void |
reset(@NotNull PasswordActionDTO params)
Resets the given generated password and allow it to be activated again
|
void |
resetAndSend(@NotNull ResetAndSendPasswordDTO params)
Generates a new value of a manual password and send it to the user (for example, via e-mail).
|
void |
resetSecurityQuestion(@NotNull UserLocatorVO locator)
Resets the security question, forcing the user to set a new one in the next login
|
void |
setSecurityQuestion(@NotNull SetSecurityQuestionDTO params)
Sets the security question's answer for the logged user
|
void |
unblock(@NotNull PasswordActionDTO params)
Unblocks the given user password
|
java.lang.String activate(@NotNull
@NotNull PasswordTypeVO passwordType)
throws FrameworkException
PasswordMode.GENERATED creating a new password for the current user.IllegalActionException - When the given password type is not generated, or is not in any of the following
statuses:
FrameworkExceptionvoid allowActivation(@NotNull
@NotNull PasswordActionDTO params)
throws FrameworkException
IllegalActionException - When the given password is not generated / doesn't apply to the given userFrameworkExceptionvoid change(@NotNull
@NotNull ChangePasswordDTO dto)
throws FrameworkException,
PasswordException
PasswordException - The current password is invalidValidationException - When the given new password is invalid according to the constraintsIllegalActionException - When the current password cannot be changed (for example, it is generated)FrameworkExceptionvoid changeForgottenPassword(@NotNull
@NotNull ChangeForgottenPasswordDTO dto)
throws FrameworkException,
InvalidSecurityAnswerException
PasswordStatus.ACTIVE, or if generated, send a new one
(leaving as PasswordStatus.ACTIVE or PasswordStatus.RESET whether the user has the change
permission or not)void disable(@NotNull
@NotNull PasswordActionDTO params)
throws FrameworkException
IllegalActionException - When the current password cannot be disabled (for example, is already disabled)FrameworkExceptionvoid enable(@NotNull
@NotNull PasswordActionDTO params)
throws FrameworkException
IllegalActionException - When the current password cannot be enabled (not in the disabled state)FrameworkExceptionvoid forgotPasswordRequest(@NotNull
@NotNull ForgotPasswordRequestDTO params)
throws FrameworkException,
RemoteAddressBlockedException
java.lang.String generateNew(@NotNull
@NotNull ChangeGeneratedPasswordDTO params)
throws FrameworkException
FrameworkExceptionChangeForgottenPasswordData getChangeForgottenPasswordData(@NotNull @NotNull java.lang.String validationKey) throws FrameworkException
FrameworkExceptionChangePasswordData getChangePasswordData(boolean changeSecondaryPassword) throws FrameworkException
FrameworkExceptionUserPasswordsData getData(@NotNull @NotNull UserLocatorVO locator) throws FrameworkException
FrameworkExceptionPasswordData getPasswordData(@NotNull @NotNull UserLocatorVO locator, @NotNull @NotNull PasswordTypeVO type) throws FrameworkException
FrameworkExceptionSetSecurityQuestionData getSetSecurityQuestionData() throws FrameworkException
FrameworkExceptionjava.util.List<java.lang.String> requestNewOTP(@NotNull
@NotNull SendMedium medium,
java.lang.String channel)
throws FrameworkException,
SmsSendingException
medium - the medium used to send the OTP.channel - the channel used to get the confirmation mode configuration (password type / device)SmsSendingException - only if medium is SendMedium.SMS and the OTP could not be sent to any
enabled for sms phone.FrameworkExceptionjava.util.List<java.lang.String> requestNewOTPForSecondaryPassword(SendMedium medium) throws FrameworkException, SmsSendingException
#requestNewOTP(SendMedium) but using the secondary password type configured in the current
channel for the logged user.void reset(@NotNull
@NotNull PasswordActionDTO params)
throws FrameworkException
FrameworkExceptionvoid resetAndSend(@NotNull
@NotNull ResetAndSendPasswordDTO params)
throws FrameworkException
PasswordStatus.RESET, forcing the user to change it.FrameworkExceptionvoid resetSecurityQuestion(@NotNull
@NotNull UserLocatorVO locator)
throws FrameworkException
FrameworkExceptionvoid setSecurityQuestion(@NotNull
@NotNull SetSecurityQuestionDTO params)
throws FrameworkException
FrameworkExceptionvoid unblock(@NotNull
@NotNull PasswordActionDTO params)
throws FrameworkException
IllegalActionException - When the given password is not blocked / doesn't apply to the given userFrameworkException