<location> doesn't work when parent directory of path doesn't exi

Discussion in 'ASP .Net Security' started by Tilman, Mar 19, 2008.

  1. Tilman

    Tilman Guest

    Hi,

    I'm having a problem setting up web.config to challenge for authentication
    on some pages, but not others.

    Here is what I'm doing:

    <configuration>

    ....
    <system.web>

    ....
    <authentication mode="Windows" />
    <authorization>
    <allow users="*"/>
    </authorization>

    ....
    </system.web>
    <location path="server/local" allowOverride="false">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>
    </configuration>

    I.e. i'd like to allow all users on all pages, except on all pages below
    the server/local directory, where I'd like IIS to challenge anonymous users
    for authentication. The odd thing is that this only seems to work if the
    parent directory of 'local', i.e. 'server' exists on disk.

    The thing is, that I'm working with a custom IHttpHandler that generates
    pages dynamically, and uses the path to pages to decide which pages to create
    (not ideal, maybe, but it's something I haven't got control over). That is,
    neither the 'server' nor the 'local' directory exist on disk, and so pages
    are returned without challenge. I can create some directories manually, as
    they are fairly static, but others are created dynamically.

    So, my question is, am I doing something wrong, or is it a bug. Or is this
    how it's supposed to work, and if so, is there a work around?

    Cheers,
    Tilman
     
    Tilman, Mar 19, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leon
    Replies:
    1
    Views:
    10,201
    Boban Dragojlovic
    Jun 24, 2003
  2. Steve Singer
    Replies:
    0
    Views:
    542
    Steve Singer
    Feb 15, 2005
  3. Oren
    Replies:
    1
    Views:
    551
    Michael D. Ober
    Apr 29, 2007
  4. =?Utf-8?B?SmVmZiBCZWVt?=

    physical path to virtual path under virtual directory

    =?Utf-8?B?SmVmZiBCZWVt?=, Aug 1, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,047
    Eliyahu Goldin
    Aug 1, 2007
  5. Peng Yu
    Replies:
    0
    Views:
    338
    Peng Yu
    Nov 6, 2009
Loading...

Share This Page