ARMChallengeAuthenticationPolicy Class

Adds a bearer token Authorization header to requests.

This policy internally handles Continuous Access Evaluation (CAE) challenges. When it can't complete a challenge, it will return the 401 (unauthorized) response from ARM.

Inheritance
azure.core.pipeline.policies._authentication.BearerTokenCredentialPolicy
ARMChallengeAuthenticationPolicy

Constructor

ARMChallengeAuthenticationPolicy(credential: TokenCredential, *scopes: str, **kwargs: Any)

Parameters

credential
TokenCredential
Required

credential for authorizing requests

scopes
str
Required

required authentication scopes

Methods

on_challenge

Authorize request according to an ARM authentication challenge

on_challenge

Authorize request according to an ARM authentication challenge

on_challenge(request: PipelineRequest, response: PipelineResponse) -> bool

Parameters

request
PipelineRequest
Required

the request which elicited an authentication challenge

response
PipelineResponse
Required

ARM's response

Returns

a bool indicating whether the policy should send the request