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.
Loading...
Related Quiz
- When defining a one-to-many relationship in Entity Framework Core, which Fluent API method is commonly used to represent the "many" side?
- While testing the registration page, you notice that users can register with very weak passwords. How can you enforce stricter password policies in ASP.NET Core?
- How did project.json handle transitive dependencies differently than the NuGet approach in previous ASP.NET versions?
- Which method in Entity Framework Core is primarily used for tracking changes made to an entity?
- If you wish to apply a unique constraint on a column using the Fluent API in Entity Framework Core, which method should you use inside OnModelCreating?