If you want to respond with HTTP status 403 and allow the authentication logic of ASP.NET Core to process the response using forbidden processing logic (it can be configured in your class Startupand can cause redirection to another page), use:
return Forbid();
( Unauthorized())
HTTP 403 API , ASP.NET Core , :
return StatusCode(403);