RefreshTokenContract

abstract class RefreshTokenContract

A utility class to allow implementing apps to automatically provide a new auth token when the SDK encounters a 401 error. Any time a network request receives a 401 Unauthorized response from the server, the SDK will automatically call onNewTokenRequest. Your implementation of onNewTokenRequest should fetch a new auth token, then call setNewAuthToken with the new token. The SDK will then automatically retry the failed network call with the new token. Calling setNewAuthToken with empty string will sign out of the SDK.

Constructors

RefreshTokenContract
Link copied to clipboard
fun RefreshTokenContract()

Functions

onNewTokenRequest
Link copied to clipboard
abstract fun onNewTokenRequest()
Your implementation of this function should retrieve a new auth token, then call setNewAuthToken with the new token.
setNewAuthToken
Link copied to clipboard
fun setNewAuthToken(token: String)