AuthenticationHttpContextExtensions.ForbidAsync 方法

定义

重载

ForbidAsync(HttpContext, String)

禁止使用指定方案对当前请求执行。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。

ForbidAsync(HttpContext, String, AuthenticationProperties)

禁止使用指定方案对当前请求执行。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。

ForbidAsync(HttpContext)

使用默认的禁止方案禁止当前请求。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。 可以使用 配置 DefaultForbidScheme默认的禁止方案。

ForbidAsync(HttpContext, AuthenticationProperties)

使用默认的禁止方案禁止当前请求。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。 可以使用 配置 DefaultForbidScheme默认的禁止方案。

ForbidAsync(HttpContext, String)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

禁止使用指定方案对当前请求执行。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ ForbidAsync(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ scheme);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context, string scheme);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context, string? scheme);
static member ForbidAsync : Microsoft.AspNetCore.Http.HttpContext * string -> System.Threading.Tasks.Task
<Extension()>
Public Function ForbidAsync (context As HttpContext, scheme As String) As Task

参数

context
HttpContext

上下文 HttpContext

scheme
String

身份验证方案的名称。

返回

任务。

适用于

ForbidAsync(HttpContext, String, AuthenticationProperties)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

禁止使用指定方案对当前请求执行。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ ForbidAsync(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ scheme, Microsoft::AspNetCore::Authentication::AuthenticationProperties ^ properties);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context, string scheme, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context, string? scheme, Microsoft.AspNetCore.Authentication.AuthenticationProperties? properties);
static member ForbidAsync : Microsoft.AspNetCore.Http.HttpContext * string * Microsoft.AspNetCore.Authentication.AuthenticationProperties -> System.Threading.Tasks.Task
<Extension()>
Public Function ForbidAsync (context As HttpContext, scheme As String, properties As AuthenticationProperties) As Task

参数

context
HttpContext

上下文 HttpContext

scheme
String

身份验证方案的名称。

返回

任务。

适用于

ForbidAsync(HttpContext)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

使用默认的禁止方案禁止当前请求。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。 可以使用 配置 DefaultForbidScheme默认的禁止方案。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ ForbidAsync(Microsoft::AspNetCore::Http::HttpContext ^ context);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context);
static member ForbidAsync : Microsoft.AspNetCore.Http.HttpContext -> System.Threading.Tasks.Task
<Extension()>
Public Function ForbidAsync (context As HttpContext) As Task

参数

context
HttpContext

上下文 HttpContext

返回

任务。

适用于

ForbidAsync(HttpContext, AuthenticationProperties)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

使用默认的禁止方案禁止当前请求。 当经过身份验证的用户尝试访问不允许他们访问的资源时,将使用禁止。 可以使用 配置 DefaultForbidScheme默认的禁止方案。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ ForbidAsync(Microsoft::AspNetCore::Http::HttpContext ^ context, Microsoft::AspNetCore::Authentication::AuthenticationProperties ^ properties);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties);
public static System.Threading.Tasks.Task ForbidAsync (this Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Authentication.AuthenticationProperties? properties);
static member ForbidAsync : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Authentication.AuthenticationProperties -> System.Threading.Tasks.Task
<Extension()>
Public Function ForbidAsync (context As HttpContext, properties As AuthenticationProperties) As Task

参数

context
HttpContext

上下文 HttpContext

返回

任务。

适用于