Link to home
Start Free TrialLog in
Avatar of ExtremeFitness
ExtremeFitness

asked on

ASP.NET Form Authorization add and unsecured page

ASP.NET  I am using Form Authorization and would like to know how I can add and unsecured pages to my site?
Avatar of mmarinov
mmarinov

You can set all pages that you want to be secured in on subdirectory (for example secure)
then ini your web.config add

<configuration>
   <location path="secure">
      <system.web>
         <authorization>
            <deny users="?"/>
            <allow users="*"/>
         </authorization>
      </system.web>
   </location>
</configuration>

in the root directory of your application you can set the login.aspx and the other non secure pages
Regards
Martin
Avatar of ExtremeFitness

ASKER

This is my current config...

<authentication mode="Forms">
                  
<forms name=".ASPXAUTH" loginUrl="default.aspx" defaultUrl="secure/default.aspx"
      protection="All" timeout="30" path="/"       requireSSL="false"
      slidingExpiration="true" cookieless="UseDeviceProfile" enableCrossAppRedirects="false">
      <credentials passwordFormat="SHA1" />
</forms>
</authentication>

<authorization>
      <deny users="?" />
      <allow users="*" />
</authorization>

What do I need to change so that items in the root path do not require loggin on?
ASKER CERTIFIED SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
NICE!!!
Glad to be in help
Martin