Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChainedTokenCredential

Package version

Enables multiple TokenCredential implementations to be tried in order until one of the getToken methods returns an access token.

Hierarchy

Implements

  • TokenCredential

Index

Constructors

Methods

Constructors

constructor

  • Creates an instance of ChainedTokenCredential using the given credentials.

    Parameters

    • Rest ...sources: TokenCredential[]

      TokenCredential implementations to be tried in order.

      Example usage:

      const firstCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);
      const secondCredential = new ClientSecretCredential(tenantId, anotherClientId, anotherSecret);
      const credentialChain = new ChainedTokenCredential(firstCredential, secondCredential);

    Returns ChainedTokenCredential

Methods

getToken

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

Generated using TypeDoc