ControllerBase.Unauthorized Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Unauthorized(Object) |
Creates an UnauthorizedObjectResult that produces a Status401Unauthorized response. |
Unauthorized() |
Creates an UnauthorizedResult that produces a Status401Unauthorized response. |
- Source:
- ControllerBase.cs
- Source:
- ControllerBase.cs
Creates an UnauthorizedObjectResult that produces a Status401Unauthorized response.
public:
virtual Microsoft::AspNetCore::Mvc::UnauthorizedObjectResult ^ Unauthorized(System::Object ^ value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.UnauthorizedObjectResult Unauthorized (object value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.UnauthorizedObjectResult Unauthorized (object? value);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Unauthorized : obj -> Microsoft.AspNetCore.Mvc.UnauthorizedObjectResult
override this.Unauthorized : obj -> Microsoft.AspNetCore.Mvc.UnauthorizedObjectResult
Public Overridable Function Unauthorized (value As Object) As UnauthorizedObjectResult
Parameters
- value
- Object
Returns
The created UnauthorizedObjectResult for the response.
- Attributes
Applies to
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
ASP.NET Core | 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
- Source:
- ControllerBase.cs
- Source:
- ControllerBase.cs
- Source:
- ControllerBase.cs
Creates an UnauthorizedResult that produces a Status401Unauthorized response.
public:
virtual Microsoft::AspNetCore::Mvc::UnauthorizedResult ^ Unauthorized();
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.UnauthorizedResult Unauthorized ();
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Unauthorized : unit -> Microsoft.AspNetCore.Mvc.UnauthorizedResult
override this.Unauthorized : unit -> Microsoft.AspNetCore.Mvc.UnauthorizedResult
Public Overridable Function Unauthorized () As UnauthorizedResult
Returns
The created UnauthorizedResult for the response.
- Attributes
Applies to
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
ASP.NET Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |