Package version:

Class DefaultAzureCredential

Provides a default ChainedTokenCredential configuration that works for most applications that use Azure SDK client libraries. For more information, see DefaultAzureCredential overview.

The following credential types will be tried, in order:

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

Hierarchy (view full)

Constructors

Methods

Constructors

Methods

  • 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.

    Parameters

    • scopes: 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>