AsyncBearerTokenCredentialPolicy Class
Adds a bearer token Authorization header to requests.
- Inheritance
-
azure.core.pipeline.policies._base_async.AsyncHTTPPolicyAsyncBearerTokenCredentialPolicy
Constructor
AsyncBearerTokenCredentialPolicy(credential: AsyncTokenCredential, *scopes: str, **kwargs: Any)
Parameters
Methods
| authorize_request |
Acquire a token from the credential and authorize the request with it. Keyword arguments are passed to the credential's get_token method. The token will be cached and used to authorize future requests. |
| on_challenge |
Authorize request according to an authentication challenge This method is called when the resource provider responds 401 with a WWW-Authenticate header. |
| on_exception |
Executed when an exception is raised while executing the next policy. This method is executed inside the exception handler. |
| on_request |
Adds a bearer token Authorization header to request and sends request to next policy. |
| on_response |
Executed after the request comes back from the next policy. |
| send |
Authorize request with a bearer token and send it to the next policy |
authorize_request
Acquire a token from the credential and authorize the request with it.
Keyword arguments are passed to the credential's get_token method. The token will be cached and used to authorize future requests.
async authorize_request(request: PipelineRequest, *scopes: str, **kwargs: Any) -> None
Parameters
on_challenge
Authorize request according to an authentication challenge
This method is called when the resource provider responds 401 with a WWW-Authenticate header.
async on_challenge(request: PipelineRequest, response: PipelineResponse) -> bool
Parameters
Returns
a bool indicating whether the policy should send the request
on_exception
Executed when an exception is raised while executing the next policy.
This method is executed inside the exception handler.
on_exception(request: PipelineRequest) -> None
Parameters
on_request
Adds a bearer token Authorization header to request and sends request to next policy.
async on_request(request: PipelineRequest) -> None
Parameters
Exceptions
on_response
Executed after the request comes back from the next policy.
on_response(request: PipelineRequest, response: PipelineResponse) -> Union[None, Awaitable[None]]
Parameters
send
Authorize request with a bearer token and send it to the next policy
async send(request: PipelineRequest) -> PipelineResponse
Parameters
Feedback
Submit and view feedback for