asp.net - IIS7 Authorization rules with custom role provider not working -
can please tell me why iis subdirectory authorization rules not working?
i suspect it's using custom membership , role provider.
users, anonymous , users logged in 401.2 unauthorized
error files in /users
subdirectory.
i'm trying restrict access static files , asp.net pages in subdirectory. used authorization rules button in iis7 manager.
in /users
has created web.config
file section:
<system.webserver> <security> <authorization> <remove users="*" roles="" verbs="" /> <add accesstype="deny" users="?" /> <add accesstype="allow" roles="auth_users" /> </authorization> </security> </system.webserver>
in web.config
of site root these custom role , membership settings. membership , role providers working fine - user added role, it's authorization rules aren't working.
<rolemanager enabled="true" defaultprovider="myroleprovider"> <providers> <remove name="aspnetsqlroleprovider" /> <add name="myroleprovider" type="system.web.security.sqlroleprovider" applicationname="myusersapp" /> </providers> </rolemanager> <membership defaultprovider="mymembershipprovider"> <providers> <remove name="aspnetsqlmembershipprovider" /> <add name="mymembershipprovider" type="system.web.security.sqlmembershipprovider" applicationname="myusersapp" /> </providers> </membership>
still playing this, looks promising.. i'm thinking there's more elegant solution out there.
<location path="users"> <system.web> <authorization> <allow roles="auth_users" /> <deny users="*" /> </authorization> </system.web> <system.webserver> <handlers> <add name="html" path="*.html" verb="get, head, post, debug" type="system.web.staticfilehandler" /> <add name="js" path="*.js" verb="get, head, post, debug" type="system.web.staticfilehandler" /> <!--more static file types...--> </handlers> </system.webserver> </location>
Comments
Post a Comment