Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Web.config <location> not redirecting

Reply
Thread Tools

Web.config <location> not redirecting

 
 
T-1000
Guest
Posts: n/a
 
      03-29-2006
I have a website with a /Admin subdir I want to protect via a
signin.aspx page (which is in the Admin dir.)

This is the entire contents of the web.config file located at the root
of the website:

<?xml version="1.0"?>
<configuration
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="CunePressDB" connectionString="Data
Source=66.235.176.128;Initial Catalog=CunePress;User
ID=dotstorefront;Password=storefront"
providerName="System.Data.SqlClient"/>
</connectionStrings>

<system.web>
<compilation debug="true"/>
<authentication mode="None"/>
</system.web>

<location path="~/Admin">
<system.web>
<authentication mode="Forms">
<forms name="CunePress" loginUrl="~/Admin/SignIn.aspx"
path="/Admin"/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>

What am I missing? Everything located between the <location> tags used
to work, when the Admin directory was a seperate application process
running in IIS. I am attempting to roll the client and Admin side into
a single application that can be developed using the .Net development
server on a developer's computer.

 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      03-29-2006
just use

<location path="Admin">

also - i would not recommend using a cookie path - they are case sensitive,
so for e.g. if a user types in /admin - the browser will not send the cookie
and the user has to reauthenticate.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> I have a website with a /Admin subdir I want to protect via a
> signin.aspx page (which is in the Admin dir.)
>
> This is the entire contents of the web.config file located at the root
> of the website:
>
> <?xml version="1.0"?>
> <configuration
> xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
> <appSettings/>
> <connectionStrings>
> <add name="CunePressDB" connectionString="Data
> Source=66.235.176.128;Initial Catalog=CunePress;User
> ID=dotstorefront;Password=storefront"
> providerName="System.Data.SqlClient"/>
> </connectionStrings>
> <system.web>
> <compilation debug="true"/>
> <authentication mode="None"/>
> </system.web>
> <location path="~/Admin">
> <system.web>
> <authentication mode="Forms">
> <forms name="CunePress" loginUrl="~/Admin/SignIn.aspx"
> path="/Admin"/>
> </authentication>
> <authorization>
> <deny users="?" />
> </authorization>
> </system.web>
> </location>
> </configuration>
> What am I missing? Everything located between the <location> tags
> used to work, when the Admin directory was a seperate application
> process running in IIS. I am attempting to roll the client and Admin
> side into a single application that can be developed using the .Net
> development server on a developer's computer.
>



 
Reply With Quote
 
 
 
 
T-1000
Guest
Posts: n/a
 
      03-29-2006
if I do that I get:

"Error 25 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. C:\Documents and Settings\Administrator\My
Documents\Visual Studio 2005\WebSites\CunePress\Web.Config 15"

 
Reply With Quote
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      03-29-2006
you also need to set authentication mode to forms...

is you base dir marked as an application in IIS?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> I have a website with a /Admin subdir I want to protect via a
> signin.aspx page (which is in the Admin dir.)
>
> This is the entire contents of the web.config file located at the root
> of the website:
>
> <?xml version="1.0"?>
> <configuration
> xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
> <appSettings/>
> <connectionStrings>
> <add name="CunePressDB" connectionString="Data
> Source=66.235.176.128;Initial Catalog=CunePress;User
> ID=dotstorefront;Password=storefront"
> providerName="System.Data.SqlClient"/>
> </connectionStrings>
> <system.web>
> <compilation debug="true"/>
> <authentication mode="None"/>
> </system.web>
> <location path="~/Admin">
> <system.web>
> <authentication mode="Forms">
> <forms name="CunePress" loginUrl="~/Admin/SignIn.aspx"
> path="/Admin"/>
> </authentication>
> <authorization>
> <deny users="?" />
> </authorization>
> </system.web>
> </location>
> </configuration>
> What am I missing? Everything located between the <location> tags
> used to work, when the Admin directory was a seperate application
> process running in IIS. I am attempting to roll the client and Admin
> side into a single application that can be developed using the .Net
> development server on a developer's computer.
>



 
Reply With Quote
 
T-1000
Guest
Posts: n/a
 
      03-29-2006
it already is set to forms...

and I am not using IIS, I am running it with the .net Development
Server...

when you say base path, are you refering to Admin?

as I said, I am trying to run the admin and client side together using
the development server... having to install IIS on the development
machine is a PITA, and I am trying to avoid it. If I was running IIS
on my development machine, I could have a totally seperate web.config
in the Admin dir, with controls its authentication seperately.

Also, the Admin and Client sides have to access common files, such an
images directory. So, having them packaged together in the same
application space will make that much easier.

 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      03-31-2006
You are getting that error because you haven't configured your deirectory
you can do that
in IIS by clicking on create
Patrick

"T-1000" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> if I do that I get:
>
> "Error 25 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. C:\Documents and Settings\Administrator\My
> Documents\Visual Studio 2005\WebSites\CunePress\Web.Config 15"
>



 
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
Redirect... Not redirecting =?Utf-8?B?U2hhcmsgQmFpdA==?= ASP .Net 1 02-17-2005 02:20 PM
Handling errors and not redirecting to a custom error page =?Utf-8?B?Sm9yZ2UgTWF0b3M=?= ASP .Net 2 10-29-2004 06:17 PM
Forms Authentication - Not timing out, not redirecting. AVance ASP .Net Security 3 08-19-2004 02:07 PM
Forms Authentication - Not timing out, not redirecting. AVance ASP .Net 1 07-28-2004 08:23 PM
not redirecting to login page while using forms authentication Pradeep Pise ASP .Net 0 07-09-2004 07:27 AM



Advertisments