Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChainedTokenCredential

Package version

Enables multiple {@link TokenCredential} implementations to be tried in order until one of the getToken methods returns an {@link AccessToken}.

Hierarchy

Implements

  • TokenCredential

Index

Constructors

Methods

Constructors

constructor

Methods

getToken

  • getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>
  • Returns the first {@link AccessToken} returned by one of the chained {@link TokenCredential} implementations. Throws an AggregateAuthenticationError when one or more credentials throws an AuthenticationError and no credentials have returned an {@link AccessToken}.

    Parameters

    • scopes: string | string[]

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

    • Optional options: GetTokenOptions

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

    Returns Promise<AccessToken | null>

Generated using TypeDoc