AccessTokenInterceptor

class AccessTokenInterceptor @Inject constructor(credentialProvider: CredentialProvider) : <ERROR CLASS> ERROR CLASS: Symbol not found for Interceptor

Interceptor used to add Bearer Token authentication headers to requests.

This interceptor adds the access token to the request headers for endpoints that require Bearer Token Authentication.

OAuth2 (consent) resource endpoints — those whose path contains the Constants.EndpointPaths.OAUTH2 segment but not the Constants.EndpointPaths.TOKEN segment, e.g. /{productType}/oauth2/{apiVersion}/userinfo — are authenticated with the OAuth2 consent token from CredentialProvider.getOauthAccessToken. All other endpoints, including the OAuth2 token endpoint (/{productType}/oauth2/token/) which mints that consent token, use the regular API-user Bearer token from CredentialProvider.getAccessToken.

The token is fetched from CredentialProvider on every request so that the SDK never holds credential state internally.

Parameters

credentialProvider

Supplies the access token at request time.

Constructors

Link copied to clipboard
@Inject
constructor(credentialProvider: CredentialProvider)

Functions

Link copied to clipboard
open override fun intercept(chain: ERROR CLASS: Symbol not found for Interceptor.Chain): ERROR CLASS: Symbol not found for Response

Intercepts the request and adds the Bearer Token header.