What Is Policy Based Authorization
Even When You Use Claim-Based or Role-Based Authorization, You Are Actually Using Policy-Based Authorization. a Policy Defines a Collection of Requirements...
Even when you use claim-based or role-based authorization, you are actually using Policy-based Authorization. A Policy defines a collection of requirements, that the user must satisfy in order to access a resource. The user must satisfy all the requirements.
An authorization policy consists of one or more requirements. Itβs registered as part of the authorization service configuration, in the Startup.ConfigureServices method: C# Copy.
The Authorize attribute enables you to restrict access to resources based on roles. It is a declarative attribute that can be applied to a controller or an action method. If you specify this attribute without any arguments, it only checks if the user is authenticated.