Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Troubled authentication in subdirectories

Reply
Thread Tools

Troubled authentication in subdirectories

 
 
Benton
Guest
Posts: n/a
 
      03-24-2007
Hi there,

I want to have an unrestricted root directory and some protected
subdirectories on my ASP.NET 2.0 application. I want each subdirectory to
have its own Login.aspx page.

The following article is a good start, but it uses a single Login.aspx
located in the root directory to protect a subdirectory:

http://www.theserverside.net/tt/arti...Authentication

The technique described in the article uses a "location" section in
web.config, where a custom "system.web" section is defined for the protected
subdirectory.

Now if I put the "authentication mode" section inside this custom
"system.web" for the subdirectory (so I can define the subdirectory Login
page), I get a compiler error on the "authentication" section:

Error 1 It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS. D:\WebSites\RegencyWeb\web.config 42

If I put the "authentication" section in the root "system.web" (outside of
the location's "system.web") then the application compiles fine, but I'm
limited to a single Login.aspx for the application.

So how can I solve this?

Thanks for any insight,

-Benton

 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      03-24-2007
You can only have one authentication section in a web application. You don't
solve this, it's by design. The only thing you can do is alter the login
page based upon where the user is coming from, ie: which subdirectory. The
only other way is to make the subdirectories their own independent
application spaces. Of course, you can specify whatever authorization
limitations you want in the specific subdirectories, that doesn't matter,
just keeping in mind there can only be one authentication section and one
logon page.


--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Benton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> I want to have an unrestricted root directory and some protected
> subdirectories on my ASP.NET 2.0 application. I want each subdirectory to
> have its own Login.aspx page.
>
> The following article is a good start, but it uses a single Login.aspx
> located in the root directory to protect a subdirectory:
>
> http://www.theserverside.net/tt/arti...Authentication
>
> The technique described in the article uses a "location" section in
> web.config, where a custom "system.web" section is defined for the
> protected subdirectory.
>
> Now if I put the "authentication mode" section inside this custom
> "system.web" for the subdirectory (so I can define the subdirectory Login
> page), I get a compiler error on the "authentication" section:
>
> Error 1 It is an error to use a section registered as
> allowDefinition='MachineToApplication' beyond application level. This
> error can be caused by a virtual directory not being configured as an
> application in IIS. D:\WebSites\RegencyWeb\web.config 42
>
> If I put the "authentication" section in the root "system.web" (outside of
> the location's "system.web") then the application compiles fine, but I'm
> limited to a single Login.aspx for the application.
>
> So how can I solve this?
>
> Thanks for any insight,
>
> -Benton



 
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
apwvnd Dr. Michael E. Kan: deeply troubled and incompetent, a very ill man. dhebv Fritz Wuehler Digital Photography 0 07-14-2011 05:40 PM
Re: help! Troubled when embed python into C++ A. Cavallo Python 0 05-24-2009 12:05 PM
Raymond Karczewski: A Brother and a Troubled Man Abraham.Karczewski@googlemail.com Computer Support 2 09-01-2007 12:32 PM
hi groupers, i got troubled with linux and tomcat 5.x omm1979@gmail.com Java 3 09-23-2006 12:53 PM



Advertisments