473,624 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ='MachineToAppl ication' 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: <authenticati on mode="Forms">
Line 108: <forms name=".ASPXAUTH " loginUrl="Login .aspx" timeout="30"/>
Line 109: </authentication>

Here's my config:
<!-- *** This is the original lines **** -->
<authenticati on 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
(unauthenticate d) users.
-->

<authorizatio n>
<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>
<authenticati on mode="Forms">
<forms name=".ASPXAUTH " loginUrl="Login .aspx" timeout="30"/>
</authentication>

<authorizatio n>
<deny users = "?"/>

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

If I comment out the <authenticati on 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 7737
Hi Joe,

Welcome to ASPNET newsgroup.
As for the Authentication Mode error, it is because <authentication >
setting is a MachineToApplic ation 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 <authorizatio n> 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:

<configuratio n>
<location path="~/admin.aspx">
<system.web>
<authorizatio n>
<deny users="?"/>
</authorization>
</system.web>
</location>
#<authorization > Element
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/gngrfauthorizat ionsection.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*******@noem ail.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 69.37.58.70.ads l.snet.net 69.37.58.70
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3700 29
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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 ='MachineToAppl ication' 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: <authenticati on mode="Forms">
| Line 108: <forms name=".ASPXAUTH " loginUrl="Login .aspx" timeout="30"/>
| Line 109: </authentication>
|
| Here's my config:
| <!-- *** This is the original lines **** -->
| <authenticati on 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
| (unauthenticate d) users.
| -->
|
| <authorizatio n>
| <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>
| <authenticati on mode="Forms">
| <forms name=".ASPXAUTH " loginUrl="Login .aspx" timeout="30"/>
| </authentication>
|
| <authorizatio n>
| <deny users = "?"/>
|
| </authorization>
| </system.web>
| </location>
|
| If I comment out the <authenticati on 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
4815
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 Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and the other named Public. I placed my web.config file in my
1
2509
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 /myapp/admin/admin_login.aspx /myapp/admin/admin_page_1.aspx /myapp/admin/admin_page_2.aspx
4
5560
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? Thank You for any input on this matter!
1
1398
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 read and execute. Also, ASPNET user has the permission to read and execute. I changed my web.config and machine.config of my application to <authentication mode="None" /> but it is still asking users from other client Username and password....
3
4861
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 protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
4
10565
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 application so that users who try to access a page in the application, get redirected to login.aspx where they have to sign in. (And the "signing in" is handled in the codebehind page of
1
1621
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 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
3
4688
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 don't require authentication.. thus the user is not redirected to my default login url..when they ('pages') are requested.
2
2376
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 I just navigate in my browser to: localhost/test2/Default.aspx i get Configuration Error: Server Error in '/' Application. Source Error:
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8620
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.