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

failure function

Callback called once the request has failed. You’ll get a ReachFiveError as an argument.

tokens AuthToken

optional The authorization token.

This revokes any access and refresh tokens associated with the specified authorization token.

ssoCustomTab Activity

optional A custom tab calling /identity/v1/logout endpoint opened to kill the browser’s SSO session.

success function

Callback called once the request has succeeded.

Response

Type: Unit

ReachFiveError

message string

The message of the error.

getErrorCode() ErrorCode

The error code’s enumeration value.

code string

The HTTP status code or SDK error code.

exception string

The stack trace of the error.

data ReachFiveApiError

Additional data about the error.

error string

The main error message.

errorId string

The identifier of the error.

errorUserMsg string

The user-friendly error message.

This property is translated according to the user’s browser settings. Currently supported languages:
Currently supported languages
  • ar - العربية Arabic

  • de - Deutsch German

  • en - English

  • es - Español Spanish

  • fr - Français French

  • hu - Magyar Hungarian

  • it - Italiano Italian

  • jp - 日本 Japanese

  • ko - 한국인 Korean

  • nl - Nederlands Dutch

  • pt - Portuguese

  • ru - Ру́сский Russian

  • sk - Slovenský Slovak

  • zh-CN - People’s Republic of China Simplified Chinese

  • zh-Hans - Simplified Chinese

  • zh-Hant - Traditional Chinese

  • zh-HK - Hong Kong Traditional Chinese

  • zh-MO - Macao Traditional Chinese

  • zh-SG - Singapore Simplified Chinese

  • zh-TW - Taiwan Traditional Chinese

errorMessageKey string

The technical error code.

errorDescription string

The technical error message.

errorDetails ReachFiveApiErrorDetails

  • field - The field concerned by the error.

  • message - The message error returned for the field.