BearerTokenAuthProvider class

Provider that handles Bearer Token authentication

Constructors

BearerTokenAuthProvider(() => Promise<string>)

Methods

AddAuthenticationInfo(AxiosRequestConfig<any>)

Adds authentication info to http requests

Constructor Details

BearerTokenAuthProvider(() => Promise<string>)

new BearerTokenAuthProvider(getToken: () => Promise<string>)

Parameters

getToken

() => Promise<string>

Function that returns the content of bearer token used in http request

Method Details

AddAuthenticationInfo(AxiosRequestConfig<any>)

Adds authentication info to http requests

function AddAuthenticationInfo(config: AxiosRequestConfig<any>): Promise<AxiosRequestConfig<any>>

Parameters

config

AxiosRequestConfig<any>

Contains all the request information and can be updated to include extra authentication info. Refer https://axios-http.com/docs/req_config for detailed document.

Returns

Promise<AxiosRequestConfig<any>>

Updated axios request config.