TypedResults.Challenge(AuthenticationProperties, IList<String>) 方法

定义

创建一个 ChallengeHttpResult 在执行时调用 的 ChallengeAsync(HttpContext, String, AuthenticationProperties)

此方法的行为取决于 IAuthenticationService 正在使用的 。 Status401UnauthorizedStatus403Forbidden 是可能的状态结果之一。

public static Microsoft.AspNetCore.Http.HttpResults.ChallengeHttpResult Challenge (Microsoft.AspNetCore.Authentication.AuthenticationProperties? properties = default, System.Collections.Generic.IList<string>? authenticationSchemes = default);
static member Challenge : Microsoft.AspNetCore.Authentication.AuthenticationProperties * System.Collections.Generic.IList<string> -> Microsoft.AspNetCore.Http.HttpResults.ChallengeHttpResult
Public Shared Function Challenge (Optional properties As AuthenticationProperties = Nothing, Optional authenticationSchemes As IList(Of String) = Nothing) As ChallengeHttpResult

参数

properties
AuthenticationProperties

AuthenticationProperties 用于执行身份验证质询。

authenticationSchemes
IList<String>

要质询的身份验证方案。

返回

为响应创建的 ChallengeHttpResult

适用于