共用方式為


ClaimsChallengeHandler.OnChallengeAsync Method

Definition

Executed in the event a 401 response with a WWW-Authenticate authentication challenge header is received after the initial request.

protected virtual System.Threading.Tasks.Task<bool> OnChallengeAsync (System.Net.Http.HttpRequestMessage requestMessage, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken);
abstract member OnChallengeAsync : System.Net.Http.HttpRequestMessage * System.Net.Http.HttpResponseMessage * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.OnChallengeAsync : System.Net.Http.HttpRequestMessage * System.Net.Http.HttpResponseMessage * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Protected Overridable Function OnChallengeAsync (requestMessage As HttpRequestMessage, responseMessage As HttpResponseMessage, cancellationToken As CancellationToken) As Task(Of Boolean)

Parameters

requestMessage
HttpRequestMessage

The HttpMessage to be authenticated.

responseMessage
HttpResponseMessage
cancellationToken
CancellationToken

Cancelation token

Returns

A boolean indicated whether the request should be retried

Remarks

This implementation handles common authentication challenges such as claims challenges. Service client libraries may derive from this and extend to handle service specific authentication challenges.

Applies to