while using FormsAuthentication exempt a directory

G

Guest

I want to exempt an entire subdirectory "/help" from the need for
FormsAuthentication. How can I do it?

I am using .Net FormsAuthentication to require login to all non member pages
in my application via
<authentication mode="Forms">
<forms loginUrl="loginPage.aspx" name="AuthorizationCookie"
requireSSL="false" slidingExpiration="true" timeout="20" path="/"
protection="All" >
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>

I allow access to a particular page via

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

this is all for the root directory.

I want to exempt an entire subdirectory "/help" from the need for
FormsAuthentication. How can I do it?

Thanks
Mike
 
G

Guest

Create a web.config file in the sub directory.

And add the following code in it:

<configuration>
<system.web>
<authentication mode="none" />
</system.web>
</configuration>

And thats all that should be in the file.
This will override the authentication settings from the parent folder.

Darshan
 
G

Guest

Darshan,

Thank you for answering my question

Darshan Mehta said:
Create a web.config file in the sub directory.

And add the following code in it:

<configuration>
<system.web>
<authentication mode="none" />
</system.web>
</configuration>

And thats all that should be in the file.
This will override the authentication settings from the parent folder.

Darshan
 

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

Top