我可以使用Identity的授权规则(web.config)

时间:2015-11-30 13:51:25

标签: asp.net asp.net-membership asp.net-identity sqlmembershipprovider

我正在迁移使用SqlMemberShipProvider并具有大量授权规则的旧应用程序。 e.g。

<location path="test/Technical.html">
    <system.web>
      <authorization>
        <allow roles="Technical" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="test/Admin.html">
    <system.web>
      <authorization>
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

我正在迁移到新的IdentityProvider,身份提供商是否识别web.config中的旧规则?

1 个答案:

答案 0 :(得分:0)

我还没有尝试使用Identity,但我有理由相信您提到的web.config设置也适用于Identity。因为Identity框架使用实现旧ClaimsPrincipal接口的Iprincipal对象,并且IPrincipal具有IsInRole方法的实现。我相信这种方法用于获得所需的功能。

相关问题