1

I am migrating an old application that use the SqlMemberShipProvider and have a lot of authorization rules. 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>

And am migrating to the new IdentityProvider, does the Identity Provider recognize the old rules from web.config ?

amd
  • 20,637
  • 6
  • 49
  • 67
  • I have been having trouble with this, as `IsInRole` doesn't work, since the roles are of type `http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, and not just "role". Would love to see a working example of this if you ever found one. – codeMonkey Apr 11 '22 at 23:29

1 Answers1

0

I haven't tried it with Identity yet but I have reason to believe that your mentioned web.config settings should work with Identity as well. Because Identity framework uses ClaimsPrincipal object which implements the old Iprincipal interface and it is IPrincipal which has the implementation of IsInRole method. I believe that this method is used to get the required functionality.

Muhammad Adeel Zahid
  • 17,474
  • 14
  • 90
  • 155