Azure.Core.Pipeline.BearerTokenAuthenticationPolicy
Event that is triggered when the transport needs to be updated.
Creates a new instance of BearerTokenAuthenticationPolicy using provided token credential and scope to authenticate for.
public BearerTokenAuthenticationPolicy(TokenCredential credential, string scope, HttpPipelineTransportOptions transportOptions)
Creates a new instance of BearerTokenAuthenticationPolicy using provided token credential and scope to authenticate for.
Creates a new instance of BearerTokenAuthenticationPolicy using provided token credential and scopes to authenticate for.
public BearerTokenAuthenticationPolicy(TokenCredential credential, IEnumerable<string> scopes, HttpPipelineTransportOptions transportOptions)
Creates a new instance of BearerTokenAuthenticationPolicy using provided token credential and scopes to authenticate for.
Sets the Authorization header on the Request by calling GetToken, or from cache, if possible.
protected ValueTask AuthenticateAndAuthorizeRequestAsync(HttpMessage message, TokenRequestContext context)
Sets the Authorization header on the Request by calling GetToken, or from cache, if possible.
Executes before ProcessAsync or
Process is called.
Implementers of this method are expected to call AuthenticateAndAuthorizeRequest or AuthenticateAndAuthorizeRequestAsync
if authorization is required for requests not related to handling a challenge response.
Executes before ProcessAsync or
Process is called.
Implementers of this method are expected to call AuthenticateAndAuthorizeRequest or AuthenticateAndAuthorizeRequestAsync
if authorization is required for requests not related to handling a challenge response.
Executed in the event a 401 response with a WWW-Authenticate authentication challenge header is received after the initial request.
The default implementation will attempt to handle Continuous Access Evaluation (CAE) claims challenges.
Executed in the event a 401 response with a WWW-Authenticate authentication challenge header is received after the initial request.
The default implementation will attempt to handle Continuous Access Evaluation (CAE) claims challenges.
Triggers the TransportOptionsChanged event to update the transport with new options.
This can be used to trigger transport updates when token refreshes happen in the background and new tokens have different requirements for the transport, such as a different client certificate.