Forms Authentication errror

From: Sumaira Ahmad (sumaira.ahmad_at_gmail.com)
Date: 10/28/04


Date: 28 Oct 2004 13:03:14 -0700

Hi,

Please help me with this..
I am trying to use Forms Authentication in a sample project. I
basically want to have two folders in my application , one in which
I store pages that can be accesed without authentication and one
which can be accessed only by authenticated users..

In my Anonymous folder:
there is a default.aspx - which is a start up page
I have also included a web.config file in that folder with following
config:
<authentication mode="Forms" />
<authorization>
        <allow users="?" />
</authorization>

My secret folder's web.config is as follows:
<authentication mode="Forms" />
    <authorization>
        <deny users="?" />
</authorization>

My main root directory has a Login page and a web.config file
configured as follows:

<authentication mode="Forms" />
<authorization>
    <allow users="*" />
</authorization>

But when I am trying to run it it gives me error:

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 44: by Microsoft that offers a single logon and core
profile services for member sites.
Line 45: -->
Line 46: <authentication mode="Forms" />
Line 47:
Line 48: <!-- AUTHORIZATION

Source File:
c:\inetpub\wwwroot\FormsAuth1WithFolders\Anon\web.config Line: 46

Is it ok to have more than one web.config files in an application??
DOes some configuration need to be done for it??Please let me know...
I have been loosing sleep over it for the last two days.
My basic aim is to seggregate those pages that can be accessed by
anybody and those that need to be accessed only by authorized
users...I am using the sample provided in ASP.NET Unleashed...

If reqd I can also send me application.. It is a very tiny one, with
only 3 pages..:-)...

Any help would be highly appreciated.

Thanks,
Sumaira



Relevant Pages

  • Re: Forms authentication bug?
    ... I read alot of posts about forms authentication and came ... the name implies NOT open for anonymous users. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: FormsAuthentication
    ... secure folder. ... Examine both web.config files and authentication section in ... >> authorization section is order sensitive and built from top directory ... >> Matjaz Ladava ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: how to let the web.config in the sub-directory to NOT to inherited from Roots web.config.
    ... the authorization mode for that directory, ... You can simply delete the whole authentication section ... >> How to let the sub-directory to avoid the authentication control from Root's webconfig? ... An error occurred during the processing of a configuration file required ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Forms Authentication errror
    ... > I am trying to use Forms Authentication in a sample project. ... > I have also included a web.config file in that folder with following ... > configuration file required to service this request. ... > Source Error: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Forms Authentication error
    ... I can only put the authentication portion in the root directory and this is ... The authorization section can go in any folder. ... >> below and modify your configuration file appropriately. ...
    (microsoft.public.dotnet.framework.aspnet)