public class PasswordManager
extends java.lang.Object
implements android.arch.lifecycle.LifecycleObserver
PasswordManager class collects all of the APIs related to password management and
validation. Password management includes processes such as changing the password, resetting the
password, requesting an OTP for password reset, and getting the password policy for the user
account. Password validation involves verifying that a password satisfies the requirements set
forth by the password policy. All of these methods will be executed on a background thread and
return the result on the main thread. To receive the result, you are expected to pass a
corresponding SingleCallback or CompleteCallback.| Constructor and Description |
|---|
PasswordManager(android.support.v7.app.AppCompatActivity appCompatActivity)
Constructor for a
PasswordManager object with the lifecycle set. |
PasswordManager(android.support.v4.app.Fragment fragment)
Constructor for a
PasswordManager object with the lifecycle set. |
PasswordManager(android.arch.lifecycle.Lifecycle lifecycle)
Constructor for a
PasswordManager object with the lifecycle set. |
| Modifier and Type | Method and Description |
|---|---|
void |
changePassword(ChangePasswordParam changePasswordParam,
CompleteCallback callback)
Returns a
CompleteCallback after changing the password for a user account. |
void |
forgotPassword(java.lang.String email,
RecipientType recipientType,
CompleteCallback callback)
Returns a
CompleteCallback after requesting a one-time password (OTP) to reset a
password for a user account. |
void |
getPasswordPolicy(SingleCallback<PasswordPolicyEntity> callback)
Returns a system level
PasswordPolicyEntity object, which contains properties related
to password requirements. |
void |
resetPassword(ResetPasswordParam resetPasswordParam,
CompleteCallback callback)
Returns a
CompleteCallback after resetting the password for a user account. |
void |
validatePassword(java.util.List<java.lang.Character> password,
SingleCallback<java.lang.Boolean> callback)
Returns a boolean that represents whether or not the user password satisfies the password
policy.
|
public PasswordManager(android.arch.lifecycle.Lifecycle lifecycle)
PasswordManager object with the lifecycle set.lifecycle - See Lifecyclepublic PasswordManager(android.support.v7.app.AppCompatActivity appCompatActivity)
PasswordManager object with the lifecycle set.appCompatActivity - See AppCompatActivitypublic PasswordManager(android.support.v4.app.Fragment fragment)
PasswordManager object with the lifecycle set.fragment - See Fragmentpublic void changePassword(ChangePasswordParam changePasswordParam, CompleteCallback callback)
CompleteCallback after changing the password for a user account.changePasswordParam - the parameters for changing password. See
ChangePasswordParamcallback - the callback to receive the result of changing the password for a user
accountpublic void forgotPassword(java.lang.String email,
RecipientType recipientType,
CompleteCallback callback)
CompleteCallback after requesting a one-time password (OTP) to reset a
password for a user account. The OTP can be sent to either the email address or mobile phone
number that is associated with the email address provided in the parameter.
To utilize the OTP to reset the password, see resetPassword(ResetPasswordParam, CompleteCallback).
email - the email address for a user accountrecipientType - the type of recipient for the OTP. See RecipientTypecallback - the callback to receive the result of requesting an OTP to reset a
password for a user accountpublic void getPasswordPolicy(SingleCallback<PasswordPolicyEntity> callback)
PasswordPolicyEntity object, which contains properties related
to password requirements.callback - the callback to receive the PasswordPolicyEntity objectpublic void resetPassword(ResetPasswordParam resetPasswordParam, CompleteCallback callback)
CompleteCallback after resetting the password for a user account.resetPasswordParam - the parameters for the password reset. See
ResetPasswordParamcallback - the callback to receive the result of resetting the password for a
user accountpublic void validatePassword(java.util.List<java.lang.Character> password,
SingleCallback<java.lang.Boolean> callback)
password - the user account password to be validatedcallback - the callback to receive the result of password validation.true if the user account password validation was successful;
false otherwise