Delen via


TokenCredential interface

Represents a credential capable of providing an authentication token.

Methods

getToken(string | string[], GetTokenOptions)

Gets the token provided by this credential.

This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.

Method Details

getToken(string | string[], GetTokenOptions)

Gets the token provided by this credential.

This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.

function getToken(scopes: string | string[], options?: GetTokenOptions): Promise<null | AccessToken>

Parameters

scopes

string | string[]

The list of scopes for which the token will have access.

options
GetTokenOptions

The options used to configure any requests this TokenCredential implementation might make.

Returns

Promise<null | AccessToken>