How to add an exception to ASP.NET Forms based authentication

My website is setup using "Forms" based authentication using the code shown below in my Web.config file.

I want to add a page to the website that does not require that authentication but cannot figgure out how to do it. Is this possible or must I do somethign special to allow one form to be non-secured?
<authentication mode="Forms">
        <forms name=".BLAUTH" loginUrl="Login.aspx"/>
    </authentication>

Open in new window

dxproz232Asked:
Who is Participating?
 
SoLostConnect With a Mentor Commented:
Normally your web.config would have entries in it like this :

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="Login.aspx" name=".BLAUTH">
    </forms>
  </authentication>
  <authorization>
    <deny users="?" />
  </authorization>
</system.web>

<location path="SomePage.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
</location>


What you need to do is to add another section after the system.web section as shown above.  In the example above all users can access "SomePage.aspx" because the "allws users" has been set to "*"

Repeat this for as many pages or directories as you need.
0
 
dxproz232Author Commented:
Works perfectly, thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.