ASP.NET web.config authorization settings ignored

asp.netauthorizationiisSecurity

I have an asp.net (dynamic data) website set up as an application in a subdirectory of another site. This site requires different security settings from the top level site. Something like:

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

These settings are ignored in the sub site. However, they work on the top level site, but even when set on the top level site, they are not inherited by the sub-site, and it's freely accessible. What could cause these settings to be ignored? I've tried adding:

<location path="." inheritInChildApplications="false">  

to the top level web.config and then setting the above authorization rule in the sub site, even tried just denying all users. When visiting the site it looks like: http://mysite/mybrokensite

I am using windows authentication.

Best Answer

I think the key thing is this

website set up as an application in a subdirectory of another site

If it's a separate application within IIS it should have it's own web.config file and the security settings can be set from there. So you'll have one web.config for the main site and one for the subsite. really they are two applications.

If it's just a subfolder under your website then this doesn't apply. It depends how you've set it up under IIS. If it's a seperate app then the icon will be a world/cabbage type icon. If it's a sub-folder they the icon will be ... well a folder.