BearerTokenAuthenticationPolicy Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A policy that sends an AccessToken provided by a TokenCredential as an Authentication header.
public class BearerTokenAuthenticationPolicy : Azure.Core.Pipeline.HttpPipelinePolicy
type BearerTokenAuthenticationPolicy = class
inherit HttpPipelinePolicy
Public Class BearerTokenAuthenticationPolicy
Inherits HttpPipelinePolicy
- Inheritance
Constructors
BearerTokenAuthenticationPolicy(TokenCredential, IEnumerable<String>) |
Creates a new instance of BearerTokenAuthenticationPolicy using provided token credential and scopes to authenticate for. |
BearerTokenAuthenticationPolicy(TokenCredential, String) |
Creates a new instance of BearerTokenAuthenticationPolicy using provided token credential and scope to authenticate for. |
Methods
AuthenticateAndAuthorizeRequest(HttpMessage, TokenRequestContext) |
Sets the Authorization header on the Request by calling GetToken, or from cache, if possible. |
AuthenticateAndAuthorizeRequestAsync(HttpMessage, TokenRequestContext) |
Sets the Authorization header on the Request by calling GetToken, or from cache, if possible. |
AuthorizeRequest(HttpMessage) |
Executes before ProcessAsync(HttpMessage, ReadOnlyMemory<HttpPipelinePolicy>) or Process(HttpMessage, ReadOnlyMemory<HttpPipelinePolicy>) is called. Implementers of this method are expected to call AuthenticateAndAuthorizeRequest(HttpMessage, TokenRequestContext) or AuthenticateAndAuthorizeRequestAsync(HttpMessage, TokenRequestContext) if authorization is required for requests not related to handling a challenge response. |
AuthorizeRequestAsync(HttpMessage) |
Executes before ProcessAsync(HttpMessage, ReadOnlyMemory<HttpPipelinePolicy>) or Process(HttpMessage, ReadOnlyMemory<HttpPipelinePolicy>) is called. Implementers of this method are expected to call AuthenticateAndAuthorizeRequest(HttpMessage, TokenRequestContext) or AuthenticateAndAuthorizeRequestAsync(HttpMessage, TokenRequestContext) if authorization is required for requests not related to handling a challenge response. |
AuthorizeRequestOnChallenge(HttpMessage) |
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. |
AuthorizeRequestOnChallengeAsync(HttpMessage) |
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. |
Process(HttpMessage, ReadOnlyMemory<HttpPipelinePolicy>) |
Applies the policy to the |
ProcessAsync(HttpMessage, ReadOnlyMemory<HttpPipelinePolicy>) |
Applies the policy to the |
Applies to
Azure SDK for .NET