你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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