Forms Authentication error

T

Thomas Scheiderich

I am trying to set up forms authentication in my IIS pages.

I have a folder inside of my root folder I am trying to protect and I am
getting an error when a page in the folder is accessed.

The error is:
****************************************************************************
****
Server Error in '/' Application.
----------------------------------------------------------------------------
----

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: 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.

Source Error:

Line 1: <configuration>
Line 2: <system.web>
Line 3: <authentication mode="Forms">
Line 4: <forms name="ASPXAUTH" loginUrl="password.aspx">
Line 5: <credentials />


Source File: c:\inetpub\wwwroot\contour\VDW\web.config Line: 3


****************************************************************************
****

I am not really sure what this means. My root directory is set as a virtual
folder directory with the application field set.

The web.config file in my folder is:

****************************************************************************
**************
<configuration>
<system.web>
<authentication mode="Forms">
<forms name="ASPXAUTH" loginUrl="password.aspx">
<credentials />
</forms>
</authentication>
</system.web>
</configuration>
****************************************************************************
**************

I am racing a deadline here, and don't understand why this won't work.

Thanks,

Tom
 
T

Thomas Scheiderich

I can seem to get it to work if I put the authentication code in the
web.config in the root directory, but not in the sub directory, which is the
only one I want to protect.

If I put the web.config file in the root directory/folder, all the folders
will get the logon message.

How do I get around this?

Thanks,

Tom.
 
T

Thomas Scheiderich

I figured part of this out.

I can only put the authentication portion in the root directory and this is
good for all the folders under it.

The authorization section can go in any folder. This is what allows me to
control which folders are controlled.

Tom.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top