If a user is not authorized to access a specific action, what default HTTP status code does ASP.NET Core return?

  • 200 OK
  • 403 Forbidden
  • 401 Unauthorized
  • 404 Not Found
When a user is not authorized to access a specific action, ASP.NET Core returns a default HTTP status code of 401 Unauthorized. This status code indicates that the request lacks proper authentication credentials or the provided credentials are invalid for the requested resource. It's a fundamental part of the authentication and authorization process in web applications.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *