Results.Forbid(AuthenticationProperties, IList<String>) Method

Definition

Creates a IResult that on execution invokes ForbidAsync(HttpContext, String, AuthenticationProperties).

By default, executing this result returns a Status403Forbidden. Some authentication schemes, such as cookies, will convert Status403Forbidden to a redirect to show a login page.

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

Parameters

properties
AuthenticationProperties

AuthenticationProperties used to perform the authentication challenge.

authenticationSchemes
IList<String>

The authentication schemes to challenge.

Returns

The created IResult for the response.

Remarks

Some authentication schemes, such as cookies, will convert Status403Forbidden to a redirect to show a login page.

Applies to