logout
client.logout( success, (1) failure, (2) tokens, ssoCustomTab )
1 | Required. |
2 | Required. |
About this command
Kills the SSO session corresponding to the app’s cookie jar.
If you pass a token
parameter, all tokens are revoked including access and refresh tokens.
If you pass the ssoCustomTab parameter
, a custom tab calling /identity/v1/logout
endpoint is opened to kill the browser’s SSO session.
Custom tabs and browser session
When using the logout
method for opening a custom tab and logging out in the browser, we have isReachFiveLogoutRequestCode
boolean to ensure the code is from ReachFive.
Finally, onLogoutResult assists in dealing with the custom tab opened by the logout
method when it redirects to the app.
Examples
client.logout(
success = { _ ->
// Handle successful logout, e.g., navigate to login screen
},
failure = { error ->
// Handle ReachFive error, e.g., show error message
},
tokens = authToken, // Revokes access/refresh tokens if provided
ssoCustomTab = activityInstance // Opens Custom Tab to clear browser's SSO session if provided
)
Parameters
Callback called once the request has failed. You’ll get a |
|
optional The authorization token. This revokes any access and refresh tokens associated with the specified authorization token. |
|
optional A custom tab calling |
|
Callback called once the request has succeeded. |
Response
Type: Unit
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.
|