Delen via


ControllerBase.Forbid Method

Definition

Overloads

Forbid(AuthenticationProperties, String[])

Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes and properties.

Forbid()

Creates a ForbidResult (Status403Forbidden by default).

Forbid(AuthenticationProperties)

Creates a ForbidResult (Status403Forbidden by default) with the specified properties.

Forbid(AuthenticationProperties)

Creates a ForbidResult with the specified properties.

Forbid(String[])

Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes.

Forbid(AuthenticationProperties, String[])

Creates a ForbidResult with the specified specified authentication schemes and properties.

Forbid(AuthenticationProperties, String[])

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes and properties.

public:
 virtual Microsoft::AspNetCore::Mvc::ForbidResult ^ Forbid(Microsoft::AspNetCore::Authentication::AuthenticationProperties ^ properties, ... cli::array <System::String ^> ^ authenticationSchemes);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ForbidResult Forbid (Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, params string[] authenticationSchemes);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Forbid : Microsoft.AspNetCore.Authentication.AuthenticationProperties * string[] -> Microsoft.AspNetCore.Mvc.ForbidResult
override this.Forbid : Microsoft.AspNetCore.Authentication.AuthenticationProperties * string[] -> Microsoft.AspNetCore.Mvc.ForbidResult
Public Overridable Function Forbid (properties As AuthenticationProperties, ParamArray authenticationSchemes As String()) As ForbidResult

Parameters

properties
AuthenticationProperties

AuthenticationProperties used to perform the authentication challenge.

authenticationSchemes
String[]

The authentication schemes to challenge.

Returns

The created ForbidResult for the response.

Attributes

Remarks

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

Applies to

Forbid()

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a ForbidResult (Status403Forbidden by default).

public:
 virtual Microsoft::AspNetCore::Mvc::ForbidResult ^ Forbid();
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ForbidResult Forbid ();
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Forbid : unit -> Microsoft.AspNetCore.Mvc.ForbidResult
override this.Forbid : unit -> Microsoft.AspNetCore.Mvc.ForbidResult
Public Overridable Function Forbid () As ForbidResult

Returns

The created ForbidResult for the response.

Attributes

Remarks

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

Applies to

Forbid(AuthenticationProperties)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a ForbidResult (Status403Forbidden by default) with the specified properties.

public:
 virtual Microsoft::AspNetCore::Mvc::ForbidResult ^ Forbid(Microsoft::AspNetCore::Authentication::AuthenticationProperties ^ properties);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ForbidResult Forbid (Microsoft.AspNetCore.Authentication.AuthenticationProperties properties);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Forbid : Microsoft.AspNetCore.Authentication.AuthenticationProperties -> Microsoft.AspNetCore.Mvc.ForbidResult
override this.Forbid : Microsoft.AspNetCore.Authentication.AuthenticationProperties -> Microsoft.AspNetCore.Mvc.ForbidResult
Public Overridable Function Forbid (properties As AuthenticationProperties) As ForbidResult

Parameters

properties
AuthenticationProperties

AuthenticationProperties used to perform the authentication challenge.

Returns

The created ForbidResult for the response.

Attributes

Remarks

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

Applies to

Forbid(AuthenticationProperties)

Creates a ForbidResult with the specified properties.

public:
 virtual Microsoft::AspNetCore::Mvc::ForbidResult ^ Forbid(Microsoft::AspNetCore::Http::Authentication::AuthenticationProperties ^ properties);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ForbidResult Forbid (Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties properties);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Forbid : Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties -> Microsoft.AspNetCore.Mvc.ForbidResult
override this.Forbid : Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties -> Microsoft.AspNetCore.Mvc.ForbidResult
Public Overridable Function Forbid (properties As AuthenticationProperties) As ForbidResult

Parameters

properties
AuthenticationProperties

AuthenticationProperties used to perform the authentication challenge.

Returns

The created ForbidResult for the response.

Attributes

Applies to

Forbid(String[])

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes.

public:
 virtual Microsoft::AspNetCore::Mvc::ForbidResult ^ Forbid(... cli::array <System::String ^> ^ authenticationSchemes);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ForbidResult Forbid (params string[] authenticationSchemes);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Forbid : string[] -> Microsoft.AspNetCore.Mvc.ForbidResult
override this.Forbid : string[] -> Microsoft.AspNetCore.Mvc.ForbidResult
Public Overridable Function Forbid (ParamArray authenticationSchemes As String()) As ForbidResult

Parameters

authenticationSchemes
String[]

The authentication schemes to challenge.

Returns

The created ForbidResult for the response.

Attributes

Remarks

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

Applies to

Forbid(AuthenticationProperties, String[])

Creates a ForbidResult with the specified specified authentication schemes and properties.

public:
 virtual Microsoft::AspNetCore::Mvc::ForbidResult ^ Forbid(Microsoft::AspNetCore::Http::Authentication::AuthenticationProperties ^ properties, ... cli::array <System::String ^> ^ authenticationSchemes);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ForbidResult Forbid (Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties properties, params string[] authenticationSchemes);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Forbid : Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties * string[] -> Microsoft.AspNetCore.Mvc.ForbidResult
override this.Forbid : Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties * string[] -> Microsoft.AspNetCore.Mvc.ForbidResult
Public Overridable Function Forbid (properties As AuthenticationProperties, ParamArray authenticationSchemes As String()) As ForbidResult

Parameters

properties
AuthenticationProperties

AuthenticationProperties used to perform the authentication challenge.

authenticationSchemes
String[]

The authentication schemes to challenge.

Returns

The created ForbidResult for the response.

Attributes

Applies to