Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > <location> doesn't work when parent directory of path doesn't exi

Reply
Thread Tools

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

 
 
Tilman
Guest
Posts: n/a
 
      03-19-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a function that can test if a path is in a directory or oneof its sub-directory (recursively)? Peng Yu Python 0 11-06-2009 03:41 AM
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
physical path to virtual path under virtual directory =?Utf-8?B?SmVmZiBCZWVt?= ASP .Net 4 08-01-2007 02:59 PM
virtual directory name? or unc directory path? Steve Singer ASP .Net 0 02-15-2005 10:26 PM



Advertisments