ChainedTokenCredential Class

Definition

Provides a TokenCredential implementation which chains multiple TokenCredential implementations to be tried in order until one of the getToken methods returns a non-default AccessToken.

public class ChainedTokenCredential : Azure.Core.TokenCredential
type ChainedTokenCredential = class
    inherit TokenCredential
Public Class ChainedTokenCredential
Inherits TokenCredential
Inheritance
ChainedTokenCredential

Constructors

ChainedTokenCredential(TokenCredential[])

Creates an instance with the specified TokenCredential sources.

Methods

GetToken(TokenRequestContext, CancellationToken)

Sequentially calls GetToken(TokenRequestContext, CancellationToken) on all the specified sources, returning the first successfully obtained AccessToken. 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.

GetTokenAsync(TokenRequestContext, CancellationToken)

Sequentially calls GetToken(TokenRequestContext, CancellationToken) on all the specified sources, returning the first successfully obtained AccessToken. 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.

Applies to