IAuthenticationService.ForbidAsync Method

Definition

Forbids the specified authentication scheme. Forbid is used when an authenticated user attempts to access a resource they are not permitted to access.

C#
public System.Threading.Tasks.Task ForbidAsync (Microsoft.AspNetCore.Http.HttpContext context, string scheme, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties);
C#
public System.Threading.Tasks.Task ForbidAsync (Microsoft.AspNetCore.Http.HttpContext context, string? scheme, Microsoft.AspNetCore.Authentication.AuthenticationProperties? properties);

Parameters

context
HttpContext

The HttpContext.

scheme
String

The name of the authentication scheme.

Returns

A task.

Applies to

Produkt Versioner
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0