Skip to content

ProvidedAccessTokenStrategy

This strategy is used when you already have an access token and want to use it. The authentication strategy will automatically renew the token when it expires. Designed to allow a browser-based-app to post the access token to the server and use it from there.

Param

Spotify application client id.

Param

The access token returned from a client side Authorization Code with PKCE flow.

Implements

Constructors

new ProvidedAccessTokenStrategy()

new ProvidedAccessTokenStrategy(clientId, accessToken, refreshTokenAction?): ProvidedAccessTokenStrategy

Parameters

clientId: string

accessToken: AccessToken

refreshTokenAction?

Returns

ProvidedAccessTokenStrategy

Source

auth/ProvidedAccessTokenStrategy.ts:19

Methods

getAccessToken()

getAccessToken(): Promise<null | AccessToken>

Returns

Promise<null | AccessToken>

Implementation of

IAuthStrategy.getAccessToken

Source

auth/ProvidedAccessTokenStrategy.ts:58


getOrCreateAccessToken()

getOrCreateAccessToken(): Promise<AccessToken>

Returns

Promise<AccessToken>

Implementation of

IAuthStrategy.getOrCreateAccessToken

Source

auth/ProvidedAccessTokenStrategy.ts:46


removeAccessToken()

removeAccessToken(): void

Returns

void

Implementation of

IAuthStrategy.removeAccessToken

Source

auth/ProvidedAccessTokenStrategy.ts:62


setConfiguration()

setConfiguration(_): void

Parameters

_: SdkConfiguration

Returns

void

Implementation of

IAuthStrategy.setConfiguration

Source

auth/ProvidedAccessTokenStrategy.ts:44