TwurpleAuthenticationGetting dataExamplesFAQMigration

AppTokenAuthProvider

An auth provider that gets tokens using client credentials.

Overview

Constructor

new AppTokenAuthProvider(clientId, clientSecret, impliedScopes)

Creates a new auth provider to receive an application token with using the client ID and secret.

ParameterTypeRequiredDefaultDescription
clientIdstringnone

The client ID of your application.

clientSecretstringnone

The client secret of your application.

impliedScopesstring[]<complex>

The scopes that are implied for your application, for example an extension that is allowed to access subscriptions.

Properties

clientId

Type: string

The client ID.

currentScopes

Type: string[]

The scopes that are currently available using the access token.

Methods

getAccessTokenForUser()

async

Throws, because this auth provider does not support user authentication.

Return type: never

getAnyAccessToken()

async

Fetches an app access token.

Return type: AccessToken

getAppAccessToken(forceNew)

async

Fetches an app access token.

ParameterTypeRequiredDefaultDescription
forceNewbooleanfalse

Whether to always get a new token, even if the old one is still deemed valid internally.

Return type: AccessToken

getCurrentScopesForUser()

Throws, because this auth provider does not support user authentication.

Return type: never