ChainedTokenCredential Class

A sequence of credentials that is itself a credential.

Its get_token method calls get_token on each credential in the sequence, in order, returning the first valid token received.

Inheritance
builtins.object
ChainedTokenCredential

Constructor

ChainedTokenCredential(*credentials: TokenCredential)

Parameters

credentials
TokenCredential
Required

credential instances to form the chain

Methods

close

Close the transport session of each credential in the chain.

get_token

Request a token from each chained credential, in order, returning the first token received.

This method is called automatically by Azure SDK clients.

close

Close the transport session of each credential in the chain.

close() -> None

get_token

Request a token from each chained credential, in order, returning the first token received.

This method is called automatically by Azure SDK clients.

get_token(*scopes: str, **kwargs: Any) -> AccessToken

Parameters

scopes
str
Required

desired scopes for the access token. This method requires at least one scope.

Exceptions

no credential in the chain provided a token