Tag: dotnet-core


  • Multiple authorization handlers for the same requirement in ASP.NET Core

    We saw how we could set up policy-based authorization in our previous article. In this article, weโ€™ll focus on Weโ€™ll use the same scenario as we used for our policy-based authorization: two lounges, one for premium users and one for standard users. Letโ€™s say we want to allow the trial/limited user to experience the standard…

  • Policy-Based Authorization in ASP.NET Core

    What is a policy-based authorization? Unlike role-based authorization, which solely depends on the roles assigned to the users. A policy-based authorization uses requirements that will provide access to a resource when succeeded. A requirement is a collection of data used to evaluate the current user. Why do we need policy-based authorization? With policy-based authorization, we have…

  • Role-based Authorization in ASP.NET Core

    What is role-based authorization? As the name says, role-based authorization authorizes a user based on the role defined to the user. Creating roles and users in ASP.NET Core with Identity For this article, Iโ€™ve created a new ASP.NET Core app in .NET 6 with Individual Accounts as the Authentication type, which will create the roles,…