Authentication settings in IIS 7.5 and ASP.Net, what is difference? -
i start learn web programming using iis 7.5 in windows 2008 r2, , asp.net 4.
i notice both iis , asp.net can define authentication rules. in iis, there form authentication setting can redirect user specified page authentication, below:
and then, in asp web.config file, find similar settings:
<authentication mode="forms"> <forms loginurl="~/account/login.aspx" timeout="2880" /> </authentication>
when finish both settings, assume page request redirect login.aspx page. didn't. confused. how 2 sets of configs work together? , why page request not redirected?
thanks
update
finally working , think understand now. website structure below:
it modifying autherization rules. deny unauthorized users root:
<authorization> <deny users="?" /> </authorization>
css files should allowed users, have styles\web.config:
<authorization> <allow users="*" /> </authorization>
and allow unauthorized users access register.aspx, have account\web.config:
<location path="register.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> <system.web> <authorization> <deny users="?"/> </authorization> </system.web>
there's component need configure: authorization. if don't, unauthorized users have access pages , not redirected login page. example:
<authorization> <deny users="?" /> </authorization>
this specifies unauthenticated users denied access pages in application. authorization
element part of system.web
configuration section.
Comments
Post a Comment