I think this is a fairly easy question but I can't find the answer anywhere. I want to leave the root directory of my application open to the world, but secure the /members directory using Forms Auth with a db. How can I secure just one directory instead of
the entire application using the Web.Config file? Thanks
Yes, but I did't really understand your answer and I thought that maybe I had asked the question in the wrong way. I just want to secure one directory, not the entire app. Can I do this all in 1 Web.Config file in the root directory? If so, what would this
1 Web.Config file look like ?
I think i found the answer but I'm not home to test it right now... This would be the Web.Config file in the root dir.
<forms name="AuthCookie" path="/" loginUrl="/members/login.aspx" protection="All" timeout="10">
</forms>
' looks like you can use the location tag to secure an entire dir
Perhaps you should have said that in the particular thread at the first place. Yes, you can. Specify the as you normally would in the root web.config (inside . Just set to or that is to allow normal access for everyone at root level. Then separate tag, in the
very same web.config file, outside the element but inside as I instructed and as only thing specify there that anonymous access is disabled, that is . That does secure the subdirectory but let access to main app. Here is a complete example of such web.config
file:
Great, thank you very much. At first, I wasn't aware that I could do it all in one web.config but your comment on the first thread took me in that direction. Thanks again.
Shlap
Member
311 Points
67 Posts
Using Forms Auth to secure just one directory.
Aug 13, 2003 04:39 PM|LINK
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: Using Forms Auth to secure just one directory.
Aug 13, 2003 05:23 PM|LINK
Teemu Keiski
Finland, EU
Shlap
Member
311 Points
67 Posts
Re: Using Forms Auth to secure just one directory.
Aug 13, 2003 05:55 PM|LINK
Shlap
Member
311 Points
67 Posts
Re: Using Forms Auth to secure just one directory.
Aug 13, 2003 05:59 PM|LINK
<forms name="AuthCookie" path="/" loginUrl="/members/login.aspx" protection="All" timeout="10"> </forms> ' looks like you can use the location tag to secure an entire dirjoteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: Using Forms Auth to secure just one directory.
Aug 13, 2003 06:02 PM|LINK
Teemu Keiski
Finland, EU
Shlap
Member
311 Points
67 Posts
Re: Using Forms Auth to secure just one directory.
Aug 13, 2003 06:06 PM|LINK