Home > Software design >  how to tell services.AddAuthorization where is my custom user and role table is
how to tell services.AddAuthorization where is my custom user and role table is

Time:09-17

I just build my user and role policy table and a table for connecting these to gather but how to tell services.AddAuthorization to looking for which policy in which table.

I had read the document of Microsoft Role-based authorization but they don't use custom user and role table I even don't know how to ask my question I confused

I mean how did it know were looking for Administrator in this picture enter image description here

CodePudding user response:

I just build my user and role policy table and a table for connecting these to gather but how to tell services.AddAuthorization to looking for which policy in which table.

By default, in the official Microsoft document (about Role-based or Policy-based authorization), it uses the enter image description here

Besides, here are some relate articles, you can refer them:

Policy-based authorization in ASP.NET Core

Policy-Based And Role-Based Authorization In ASP.NET Core 3.0 Using Custom Handler

Cookie Authentication In ASP.NET Core(if you don't use Asp.net core Identity, you can refer this article and configure the policy).

  • Related