updatePassword
client.updatePassword(udpatePasswordRequest, successWithNoContent, failure)
About this command
Update the profile’s password. The parameters required in addition to the new password are either:
-
A fresh access token (less than 5 minutes old).
-
An access token and the old password.
-
The profile’s email address/phone number and the verification code sent by email/SMS through a request password reset flow.
|
Examples
import com.reach5.identity.sdk.core.models.AuthToken
import com.reach5.identity.sdk.core.models.requests.UpdatePasswordRequest.*
val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login
client.updatePassword(
updatePasswordRequest = UpdatePasswordRequest.AccessTokenParams(profileAuthToken, "gVc7piBn", "ZPf7LFtc"),
successWithNoContent = { _ -> ... }, // Do something
failure = { error -> ... } // Return a ReachFive error
)
import com.reach5.identity.sdk.core.models.AuthToken
import com.reach5.identity.sdk.core.models.requests.UpdatePasswordRequest.*
val freshProfileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login (less than 5 min)
client.updatePassword(
updatePasswordRequest = UpdatePasswordRequest.FreshAccessTokenParams(freshProfileAuthToken, "ZPf7LFtc"),
successWithNoContent = { _ -> ... }, // Do something
failure = { error -> ... } // Return a ReachFive error
)
import com.reach5.identity.sdk.core.models.requests.UpdatePasswordRequest.*
client.updatePassword(
updatePasswordRequest = UpdatePasswordRequest.EmailParams("john.doe@example.com", "234", "ZPf7LFtc"),
successWithNoContent = { _ -> ... }, // Do something
failure = { error -> ... } // Return a ReachFive error
)
import com.reach5.identity.sdk.core.models.requests.UpdatePasswordRequest.*
client.updatePassword(
updatePasswordRequest = UpdatePasswordRequest.SmsParams("+33682234940", "234", "ZPf7LFtc"),
successWithNoContent = { _ -> ... }, // Do something
failure = { error -> ... } // Return a ReachFive error
)
Parameters
The parameters required to update the profile’s password. The
|
|
Callback called once the request has succeeded. No argument is expected. |
|
Callback called once the request has failed. You’ll get a |
FreshAccessTokenParams
Authorization token of the profile retrieved from login (less than 5 minutes old).
|
|||||||||||||
password |
The new password of the profile. Password must meet the minimum requirements defined by the zxcvbn used. It must also be different from the old one. |
AccessTokenParams
Authorization token of the profile retrieved from login.
|
|||||||||||||
The old password of the profile. |
|||||||||||||
password |
The new password of the profile. Password must meet the minimum requirements defined by the zxcvbn used. It must also be different from the old one. |
EmailParams
The email address of the profile. |
|
The verification code sent by email or SMS. |
|
password |
The new password of the profile. Password must meet the minimum requirements defined by the zxcvbn used. It must also be different from the old one. |
SmsParams
The phone number of the profile. Both the international format and the national conventions of the account’s country are accepted if configured in account settings. |
|
The verification code sent by email or SMS. |
|
password |
The new password of the profile. Password must meet the minimum requirements defined by the zxcvbn used. It must also be different from the old one. |
Response
Type: Unit
ReachFiveError
message |
The message of the error. |
||||||||||||||
code |
The HTTP status code. |
||||||||||||||
exception |
The stack trace of the error. |
||||||||||||||
data |
Additional data about the error.
|