DefaultAzureCredential class

Provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

Extends

Constructors

DefaultAzureCredential(DefaultAzureCredentialClientIdOptions)

Creates an instance of the DefaultAzureCredential class with DefaultAzureCredentialClientIdOptions

This credential provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

The following credential types will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

DefaultAzureCredential(DefaultAzureCredentialOptions)

Creates an instance of the DefaultAzureCredential class with DefaultAzureCredentialOptions

This credential provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

The following credential types will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

DefaultAzureCredential(DefaultAzureCredentialResourceIdOptions)

Creates an instance of the DefaultAzureCredential class with DefaultAzureCredentialResourceIdOptions

This credential provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

The following credential types will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

Inherited Methods

getToken(string | string[], GetTokenOptions)

Returns the first access token returned by one of the chained TokenCredential implementations. Throws an AggregateAuthenticationError when one or more credentials throws an AuthenticationError and no credentials have returned an access token.

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.

Constructor Details

DefaultAzureCredential(DefaultAzureCredentialClientIdOptions)

Creates an instance of the DefaultAzureCredential class with DefaultAzureCredentialClientIdOptions

This credential provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

The following credential types will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

new DefaultAzureCredential(options?: DefaultAzureCredentialClientIdOptions)

Parameters

DefaultAzureCredential(DefaultAzureCredentialOptions)

Creates an instance of the DefaultAzureCredential class with DefaultAzureCredentialOptions

This credential provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

The following credential types will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

new DefaultAzureCredential(options?: DefaultAzureCredentialOptions)

Parameters

DefaultAzureCredential(DefaultAzureCredentialResourceIdOptions)

Creates an instance of the DefaultAzureCredential class with DefaultAzureCredentialResourceIdOptions

This credential provides a default ChainedTokenCredential configuration that should work for most applications that use the Azure SDK.

The following credential types will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

new DefaultAzureCredential(options?: DefaultAzureCredentialResourceIdOptions)

Parameters

Inherited Method Details

getToken(string | string[], GetTokenOptions)

Returns the first access token returned by one of the chained TokenCredential implementations. Throws an AggregateAuthenticationError when one or more credentials throws an AuthenticationError and no credentials have returned an access token.

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<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<AccessToken>

Inherited From ChainedTokenCredential.getToken