【发布时间】:2020-06-27 15:41:58
【问题描述】:
在 Asp.net Core 3 中 我的数据库中有两个 admin 和 user 值(用于角色),我想用来授权。我不想使用身份。 请帮帮我
【问题讨论】:
-
你想如何验证..基于表单的身份验证?
标签: asp.net asp.net-core authorization roles asp.net-authorization
在 Asp.net Core 3 中 我的数据库中有两个 admin 和 user 值(用于角色),我想用来授权。我不想使用身份。 请帮帮我
【问题讨论】:
标签: asp.net asp.net-core authorization roles asp.net-authorization
如果您不想使用默认的Identity,Microsoft 提供了许多自定义方法。您可以阅读 this article 以使用没有身份的 Cookie 身份验证或 Custom Policy-based。
【讨论】:
Use cookie authentication without ASP.NET Core Identity。如何使用 IsInRole 方法检查角色?