How to remove the role-related tables from ASP.NET Identity Core 2.0

前端 未结 2 1420
鱼传尺愫
鱼传尺愫 2021-01-20 20:42

With the advice read-elsewhere that Roles are a subset of Claims, I am looking at a clean way to ask the EF Core implementation in ASP.NET Identity not to create role-relate

2条回答
  •  旧时难觅i
    2021-01-20 21:19

    You can't, and it's very likely Identity would cease to function if you did. Like it or not, Identity utilizes roles. You can choose not to take advantage of this functionality, but it's there nevertheless.

    That said, in some sense, every authentication artifact is a "claim". However, claims are abstract concepts, whereas something like a role has a concrete implementation. If you need authorization filters, roles are what you should use. You could use claims, but then you just have to reimplement the concept of a role, anyways. Don't reinvent the wheel.

提交回复
热议问题