Groups | Blog | Home
all groups > asp.net security > august 2004 >

asp.net security : web.config in subfolder


Luke Ward
8/12/2004 4:47:48 PM
Hi

I am using remote web space and cannot seem to use my normal web.config file
to secure the folder :-(

<authentication mode="Forms">
<forms name="CATSAuth"
path="PVLTUpdateGrd"
loginUrl="Login.aspx"
protection="All"
timeout="30"/>
</authentication>

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

I only have one bin folder(in the root), where i have to store the Dlls,
does anyone know if I can place a web.config in the root that will secure
web pages in another folder?

Any advice appreciated

Luke

jamesche NO[at]SPAM online.microsoft.com
8/12/2004 6:16:51 PM
Hi Luke,

If you want to specify settings for a different location in your web.config
file, you need to use <location> tags. There is documentation in the .NET
SDK documentation in VS.NET.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
jamesche@online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.


--------------------
[quoted text, click to view]
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
.phx.gbl
[quoted text, click to view]
Luke Ward
8/16/2004 1:06:10 PM
Thanks

[quoted text, click to view]

Daren Hawes
8/18/2004 6:52:02 PM
Hi I have just done that...

Modify your web config like this below.

This will allwo Anon users into your wesite.

<authentication mode="Forms">
<forms loginUrl="Agents_Login.aspx" name="sqlAuthCookie"
timeout="60" path="/" protection="All">
</forms>
</authentication>
<authorization>
<allow users="?" />

</authorization>

Now add this just after the last section of the config file. This will
work.

</system.web>
<!-- Folder
Deny access to this folder
-->
<location path="folder">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>


</configuration>

Thanks Daren

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button