473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

authentication mode error

Joe
What I want to do is make only one page require a login. The application
itself works fine.

I'm getting the following error:
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 105: <location path="LoginTest.aspx">
Line 106: <system.web>
Line 107: <authentication mode="Forms">
Line 108: <forms name=".ASPXAUTH" loginUrl="Login.aspx" timeout="30"/>
Line 109: </authentication>

Here's my config:
<!-- *** This is the original lines **** -->
<authentication mode="Forms">

</authentication>

<!-- AUTHORIZATION
This section sets the authorization policies of the application.
You can allow or deny access
to application resources by user or role. Wildcards: "*" mean
everyone, "?" means anonymous
(unauthenticated) users.
-->

<authorization>
<allow users="*" /> <!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>

<!-- *** I added these lines at the end of my file just ahead of the closing
</configuration> *** -->

<location path="LoginTest.aspx">
<system.web>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login.aspx" timeout="30"/>
</authentication>

<authorization>
<deny users = "?"/>

</authorization>
</system.web>
</location>

If I comment out the <authentication mode="Forms"> section, I get my login
screen but right after that I get the Windows login screen.

Any ideas?

Thanks,
Joe
Jan 11 '06 #1
1 7716
Hi Joe,

Welcome to ASPNET newsgroup.
As for the Authentication Mode error, it is because <authentication>
setting is a MachineToApplication level setting which means it can only be
configured at machine .config or only once in each asp.net application's
main web.config. It can not be configured multiple times by using sub
dir's web.config or the <location > element as you used....

For your scenario, you'd like to grant access protection to an individule
page (or a sub folder), we can configure using the <authorization> element
, this is used for user or role based access permission to pages and can
be configured for individual pages or sub dirs. e.g:

<configuration>
<location path="~/admin.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
#<authorization> Element
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/gngrfauthorizationsection.asp

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Joe" <jb*******@noemail.noemail>
| Subject: authentication mode error
| Date: Wed, 11 Jan 2006 05:42:33 -0500
| Lines: 66
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <up*************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 69.37.58.70.adsl.snet.net 69.37.58.70
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:370029
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| What I want to do is make only one page require a login. The application
| itself works fine.
|
| I'm getting the following error:
| 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 105: <location path="LoginTest.aspx">
| Line 106: <system.web>
| Line 107: <authentication mode="Forms">
| Line 108: <forms name=".ASPXAUTH" loginUrl="Login.aspx" timeout="30"/>
| Line 109: </authentication>
|
| Here's my config:
| <!-- *** This is the original lines **** -->
| <authentication mode="Forms">
|
| </authentication>
|
| <!-- AUTHORIZATION
| This section sets the authorization policies of the
application.
| You can allow or deny access
| to application resources by user or role. Wildcards: "*" mean
| everyone, "?" means anonymous
| (unauthenticated) users.
| -->
|
| <authorization>
| <allow users="*" /> <!-- Allow all users -->
| <!-- <allow users="[comma separated list of users]"
| roles="[comma separated list of roles]"/>
| <deny users="[comma separated list of users]"
| roles="[comma separated list of roles]"/>
| -->
| </authorization>
|
| <!-- *** I added these lines at the end of my file just ahead of the
closing
| </configuration> *** -->
|
| <location path="LoginTest.aspx">
| <system.web>
| <authentication mode="Forms">
| <forms name=".ASPXAUTH" loginUrl="Login.aspx" timeout="30"/>
| </authentication>
|
| <authorization>
| <deny users = "?"/>
|
| </authorization>
| </system.web>
| </location>
|
| If I comment out the <authentication mode="Forms"> section, I get my
login
| screen but right after that I get the Windows login screen.
|
| Any ideas?
|
| Thanks,
| Joe
|
|
|

Jan 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
1
by: MJ | last post by:
I'm building an application that has a file structure similar to the following: /myapp/user_login.aspx /myapp/user_page_1.aspx /myapp/user_page_2.aspx /myapp/user_page_3.aspx...
4
by: Jay | last post by:
I have authentication set for my site but I need one page to be an exception case. Namely my forgot password page. How do I tell the webconfig file to authenciate all pages except one page? ...
1
by: Winnie | last post by:
I am having issues with setting up the authentication for .net. I have an aspx page in e:\myApp. I have set the virtual directory "MyApp" in IIS and give IUSER_XXX and ANONYMOUS USER permission to...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
4
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the...
1
by: Sumaira Ahmad | last post by:
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...
3
by: Adam J Knight | last post by:
Hi all, I have an app that mostly requires authentication. However there are a couple of pages that don't require authentication.. What do i need in my web.config, to specify these pages...
2
by: wiktor.dzierzecki | last post by:
I try to build a simple web aplication in ASP.NET in Visual Studio 5. When I run finished web aplication from inside VS5: localhost:1675/test2/Default.aspx everything is OK, works good. But when...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.