Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does authorization in web.config check sub-groups as well?

If I put something like this in my ASP.NET web application's web.config:

   <authorization>
       <allow roles="MyUsers" />
       <deny users="*" />
   </authorization>

and then have an ActiveDirectory group SpecialGroup that is inside MyUsers, will a member of SpecialGroup be allowed to access my application?

like image 202
Stewart Johnson Avatar asked Sep 06 '25 15:09

Stewart Johnson


1 Answers

Yes, it will. When you log on, a security token is constructed containing details of all¹ of the groups you're a member of, and that includes all nested groups. That token is what's used to determine access. This is why you have to log off and on when you're added to a group.

But just to be sure, I tested it on on of my sites and it worked as described.

¹ actually, it's possible to be in so many groups that they won't all fit in the token (which has a limited size) in which case, your token contains the first 'n' groups (which depends on the order returned by the domain controller, so you can see some odd behaviour).

like image 163
serialhobbyist Avatar answered Sep 11 '25 14:09

serialhobbyist