473,657 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different login page for each document...

SB
Hi
I'm trying to get forms-based authentication to authenticate different users
for differet pages, like this:

<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page1.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page2.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>

But here I get this error:
It is an error to use a section registered as
allowDefinition ='MachineToAppl ication' beyond application level.

Many thanks for your help
Simon
Nov 19 '05 #1
4 1971
Hi Simon,

This error would normally indicate that the Virtual Directory for your web
is not set up properly.

1. Go to Start - Settings - Control Panel - Administrative Tools - Internet
Information Services
2. Expand the nodes to see Default Web Site

Do you have node for your web site? If so check the properties or if you are
not sure about this delete it. If it is not there do the following:

3. Right-click the Default Web Site node to bring up the menu and select
New - Virtual Directory
4. Create a new virtual directory and the location is the folder location of
your files..

Try it again. If this isn't the problem and you still get the same error,
I'll look in more detail at your web.config entries.

Regards,

Stuart
MCSD, MCT
"SB" <SB@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Hi
I'm trying to get forms-based authentication to authenticate different
users
for differet pages, like this:

<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page1.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page2.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>

But here I get this error:
It is an error to use a section registered as
allowDefinition ='MachineToAppl ication' beyond application level.

Many thanks for your help
Simon

Nov 19 '05 #2
SB
Hi Stuart

Thank you for your swift answer. The issue is I would like to dedicate an
seperate login page to each page. I can get it to work if I only use one
login page outside the <location> element.

What works:
<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="BØ"/>
<allow users="SB"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login .aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</configuration>

What doesn't work:
<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page1.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>

As you can see when the authentication is placed within the <location>
element, everything goes nuts :).
Best regards
Simon
"Stuart A Hill" wrote:
Hi Simon,

This error would normally indicate that the Virtual Directory for your web
is not set up properly.

1. Go to Start - Settings - Control Panel - Administrative Tools - Internet
Information Services
2. Expand the nodes to see Default Web Site

Do you have node for your web site? If so check the properties or if you are
not sure about this delete it. If it is not there do the following:

3. Right-click the Default Web Site node to bring up the menu and select
New - Virtual Directory
4. Create a new virtual directory and the location is the folder location of
your files..

Try it again. If this isn't the problem and you still get the same error,
I'll look in more detail at your web.config entries.

Regards,

Stuart
MCSD, MCT
"SB" <SB@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Hi
I'm trying to get forms-based authentication to authenticate different
users
for differet pages, like this:

<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page1.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page2.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>

But here I get this error:
It is an error to use a section registered as
allowDefinition ='MachineToAppl ication' beyond application level.

Many thanks for your help
Simon


Nov 19 '05 #3
can you take the approach of a single logon page and in the login, set the
users' Roles? then verify for different roles within the forms? instead of
adding users to each form's permission, you'd ass them to the groups.
Effectively its the mase hting, and its supported by the framework
"SB" <SB@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Hi
I'm trying to get forms-based authentication to authenticate different users for differet pages, like this:

<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page1.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page2.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>

But here I get this error:
It is an error to use a section registered as
allowDefinition ='MachineToAppl ication' beyond application level.

Many thanks for your help
Simon

Nov 19 '05 #4
SB
I would do that by writing the different usergroups in the config file

<allow users="Admins"/>
<allow users="Users"/>

And the when they log in give then the rights

If Admin logs in Then
System.Web.Secu rity.FormsAuthe ntication.Redir ectFromLoginPag e("Admins",
False)
ElseIF User logs in Then
System.Web.Secu rity.FormsAuthe ntication.Redir ectFromLoginPag e("Users",
False)
End If
/Simon
"David Jessee" wrote:
can you take the approach of a single logon page and in the login, set the
users' Roles? then verify for different roles within the forms? instead of
adding users to each form's permission, you'd ass them to the groups.
Effectively its the mase hting, and its supported by the framework
"SB" <SB@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Hi
I'm trying to get forms-based authentication to authenticate different

users
for differet pages, like this:

<configuratio n>
<location path="Member" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page1.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride=" true">
<system.web>
<authorizatio n>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authenticati on mode="Forms">
<forms
name="MyWebsite CookieName"
loginUrl="Login Page2.aspx"
protection="All "
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>

But here I get this error:
It is an error to use a section registered as
allowDefinition ='MachineToAppl ication' beyond application level.

Many thanks for your help
Simon


Nov 19 '05 #5

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

Similar topics

1
1347
by: Peter Rooney | last post by:
Hi, Simple question, I have a login page that asks for a usrname and password if this data exists in the database it creates a session variable for each then redirects to another page, this page checks the user sesion for a value and if it is not empty it displays the page or redirects you back to the login page if the session is empty. When I log in it displays the redirected page correctly but if I follow a subsequent link to...
0
1785
by: Mike | last post by:
I can not figure out what is going on here. I hope somebody can please help!!! I've got an intranet ASP3 application running on a Win2k server. This application requires a login, so the user must first go to the login.asp page before accessing any other .asp page. I have set up a redirection method so that if a user pastes a URL to an internal .asp page, I store the URL in a session variable, then I direct them to the login page. After...
2
2314
by: Gill Bates | last post by:
I'm trying to login to a banking site (https://www.providentconnection.com) using vb.net. I've tried many variations of WebClient and HttpWebRequest; none of which I've got to work. My latest version is: Dim myWebClient As New WebClient Dim nvc As New NameValueCollection nvc.Add("Login", username) nvc.Add("Password", password)
3
2566
by: Itai | last post by:
I have an aspx file named index.aspx which contains two ‘form' sections, one that has the runat=server attribute (e.g From1) and one which is a regular HTML form (e.g SignInForm). I am trying to copy values from two INPUT controls that are located within the Form1 section to hidden INPUT controls located in the SignInForm and post the SignInForm form hidden controls values to a different page (e.g login.aspx) Problem is that after...
3
5782
by: ilockett | last post by:
The background: I have a web app with a simple master page that contains just one content placeholder. I have created a web form that then uses this master page. Within the content placeholder, I have placed a Login control (Login1) and a ValidationSummary control. I have set the ValidationSummary's ValidationGroup property equal to "Login1".
6
2452
by: Jason | last post by:
I have a sticky problem relating to my 'join' registration form inside our authenticatin system... We have just signed up for salesforce.com and I need to somehow integrate the canned web-to-lead form from salesforce inside my login/registraiton system without messing up the existing 'join' form. My registration form is built on top of database while the salesform form is statically generated form which is similiar but not exactly the...
0
2004
by: mankolele | last post by:
Hi I need to have two different users LOG in on to my page.Each of them have their own tables to where their data is stored and I have a separate users table which has username and password,then the username is suposed to link to the other two tables,I do register to each table then when using that data to LOGIN it doesnt work. Is there a way I must do it.Here's my login code.The customer must see a different page from the supplier when...
0
2396
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data doesn't load back to the form. The multiview is located inside the LoginView's Logged-In View ....
43
3412
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
0
8397
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
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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...
1
6167
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
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.