Disable FORMS AUTHENTICATION selectively in 2.0

B

Ben

Hi,
I have implemented a .NET 2.0 app which uses Forms Authentication, sets
a cookie upon succesful validation from DB etc. Everything works as
expected and all pages go to the login page before being sent to the
requested page etc.
Now the requirements have changed and I need to allow certain pages to
not require login. How do I accomplish this?
This is the relevant code in web.config

<forms loginUrl="login.aspx" protection="All" timeout="30"
name="TEST_AUTH" path="/" requireSSL="false" slidingExpiration="true"
defaultUrl="help.aspx" cookieless="UseDeviceProfile"
enableCrossAppRedirects="false"/>

Thanks,
Ben
 
J

Joe Kaplan

Instead of just setting the authorization element in web.config to require
authentication for all pages, you need to use the <location> element to set
different authorization settings for different paths. The .NET Framework
documentation has the exact schema documentation and examples for you to
follow.

Joe K.
 
B

Ben

Thank you. That helped. Can i add a list of files (Comma separated)
instead of a folder?

Thanks,
Ben
 
J

Joe Kaplan

Yes, sometimes it is helpful to reorganize your cotent so all of the
protected resources are in a single part of the path hiearchy to make this
less of a configuration hassle. That is often a painful change to add after
the fact, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,191
Latest member
BuyKetoBeez

Latest Threads

Top