Re: Protected folder with forms authentication

From: Teemu Keiski (joteke_at_aspalliance.com)
Date: 07/28/03


Date: Mon, 28 Jul 2003 14:36:28 +0300


First,In the <system.web> section of the main application folder's
web.config file specify authorization to allow access to the main folder.

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

Now all users, despite are they authenticated or not, can access the main
folder(could be <allow users="?" /> as well)

Second: Outside the web.config file's <system.web> element but inside
<configuration> element, create a <location> tag that matches the subfolder.
i.e this can be set in the main web.config file.

<location path="manager">
    <system.web>
        <authorization>
            <deny users="?" />
        </athorization>
    </system.web>
</location>

This should prevent unauthenticated users from accessing the subfolder. You
can again refine this for pages in the subfolder, if such is needed, with
the relevant syntax for the path attribute say:
path="manager/specificpage.aspx" and so on.

Hope this helps.

-- 
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi
AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
"Harley" <harleyobrien%40hotmail.com> wrote in message
news:e0XSdo9UDHA.656@tk2msftngp13.phx.gbl...
> i have a VB.NET ASP.NET application. the front end is working fine, and
know
> im developing the manager options. this options have to be in a subfolder
> server.com/manager.
> how do i protect only that subfolder and its sub-sub-folders?
> i thought setting the path param in the authentication - forms section of
> web.config to path="/manager" will work.... but its not working.
> everything works ok when i set the path to "/", so there is no problem
with
> the code... but i protect the whole site...
> any help?
>
>


Relevant Pages

  • Protected folder with forms authentication
    ... im developing the manager options. ... how do i protect only that subfolder and its sub-sub-folders? ... i thought setting the path param in the authentication - forms section of ... but i protect the whole site... ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Forms Security Problem
    ... I have a site I am trying to protect using forms based security ... I then copied my web.conf file to a subfolder, and changed it so that the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Password Protect a webpage
    ... we presently have a subfolder protected but the ... protect, to that protected subfolder is the most "logical" solution to ... I asked the same question (password protect a webpage) to my ISP. ... Presently we have a link on the site to a password protected folder. ...
    (microsoft.public.publisher.webdesign)
  • Re: reach secure files in subfolder
    ... trying to use SSL to protect a subfolder of your site? ... Check the "Require secure ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Explorer
    ... Folder customizations ... Protect your PC! ... "Lance" wrote in message ... > When I left click on a subfolder the search screen is launched. ...
    (microsoft.public.windowsxp.customize)