sfmcsdk / com.salesforce.marketingcloud.sfmcsdk.components.http / Authenticator

Authenticator

abstract class Authenticator

Extend this class to instruct NetworkManager how to get an AuthToken to authenticate your calls made through NetworkManager.

Constructors

<init>

Extend this class to instruct NetworkManager how to get an AuthToken to authenticate your calls made through NetworkManager.

Authenticator()

Functions

deleteCachedToken

Provide a method to delete the locally cached token. This method will be called when the previously used token has been determined to be invalid via a HTTP 401 response.

abstract fun deleteCachedToken(): Unit

getCachedTokenHeader

Provide the locally cached AuthToken as a key-value pair to be used in the header of your calls made through NetworkManager.

abstract fun getCachedTokenHeader(): Pair<String, String>?

refreshAuthTokenHeader

Provide a "fresh" AuthToken fetched from the authentication route as a key-value pair to be used in the header of your calls made through NetworkManager.

abstract fun refreshAuthTokenHeader(): Pair<String, String>?