What is the primary purpose of the [Authorize] attribute in ASP.NET Core?

  • Authentication
  • Authorization
  • Caching
  • Logging
The [Authorize] attribute in ASP.NET Core is primarily used for Authorization, not Authentication. It restricts access to a particular action method or controller to only authenticated users who meet specific authorization requirements. This helps in controlling who can access different parts of your application based on roles or policies.
Add your answer
Loading...

Leave a comment

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