loginWithPassword
client.loginWithPassword( email, phoneNumber, customIdentifier, password, success, failure, // Optional arguments scope )
About this command
Authenticate the user with the specified identifier (email, phone number, or custom identifier) and password.
A user may identify himself with either his email address or his phone number if the SMS feature is enabled.
Examples
client.loginWithPassword(
email = "john.doe@gmail.com",
password = "UCrcF4RH",
scope = listOf("openid", "profile", "email"),
success = { authToken -> ... }, // Get the profile's authentication token
failure = { error -> ... } // Handle a ReachFive error
)
client.loginWithPassword(
phoneNumber = "+33682234940",
password = "UCrcF4RH",
scope = listOf("openid", "profile", "phone"),
success = { authToken -> ... }, // Get the profile's authentication token
failure = { error -> ... } // Handle a ReachFive error
)
client.loginWithPassword(
customIdentifier = "coolCat55",
password = "UCrcF4RH",
scope = listOf("openid", "profile", "email"),
success = { authToken -> ... }, // Get the profile's authentication token
failure = { error -> ... } // Handle a ReachFive error
)
Parameters
The email address of the profile. |
|
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. |
|
A string that allows users to authenticate with something other than an |
|
The password of the profile |
|
List of space-delimited, case-sensitive strings representing the requested scope. Default scopes are the allowed scopes set up in the client’s configuration. |
|
Callback called once the login has succeeded. You’ll get an |
|
Callback called once the request has failed. You’ll get a |
Response
Type: Unit
AuthToken
The authentication token.
idToken |
The ID token JSON Web Token (JWT) that contains the profile’s information. |
||||||||||||||||||||||||||||||||||
accessToken |
The authorization credential JSON Web Token (JWT) used to access the ReachFive API. |
||||||||||||||||||||||||||||||||||
refreshToken |
The refresh token JSON Web Token (JWT) used to obtain new access tokens once they expire. |
||||||||||||||||||||||||||||||||||
The step up token used to continue the step up flow and validate the user for authentication purposes. This only applies for MFA flows. |
|||||||||||||||||||||||||||||||||||
tokenType |
The type of token. Always equal to |
||||||||||||||||||||||||||||||||||
expiresIn |
The lifetime in seconds of the access token. If |
||||||||||||||||||||||||||||||||||
user OpenIDUser |
The user’s information contained in the ID token.
|
ReachFiveError
message |
The message of the error. |
||||||||||||||
getErrorCode() |
The error code’s enumeration value. |
||||||||||||||
code |
The HTTP status code or SDK error code. |
||||||||||||||
exception |
The stack trace of the error. |
||||||||||||||
data |
Additional data about the error.
|