When using the [Authorize] attribute with policies, the specified policy name must be previously registered in the _________.
- Startup.cs
- Program.cs
- appsettings.json
- ConfigureServices method
When using the [Authorize] attribute with policies, the specified policy name must be previously registered in the ConfigureServices method within the Startup.cs file. This is where you define and configure your authorization policies, associating them with specific requirements and roles.
Loading...
Related Quiz
- Your application needs to restrict access based on the originating country of the request. How would you leverage middleware to achieve this requirement?
- When designing attribute routes, which approach helps in preventing route conflicts?
- What is the primary role of Entity Framework Core in ASP.NET Core applications?
- In ASP.NET Core Identity, which class is primarily responsible for user management, including creating users?
- In ASP.NET Core, custom middlewares can be created using a delegate with the signature _______.