473,387 Members | 1,700 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,387 software developers and data experts.

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:

<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage2.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='MachineToApplication' beyond application level.

Many thanks for your help
Simon
Nov 19 '05 #1
4 1961
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**********************************@microsof t.com...
Hi
I'm trying to get forms-based authentication to authenticate different
users
for differet pages, like this:

<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage2.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='MachineToApplication' 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:
<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="BØ"/>
<allow users="SB"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="Login.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</configuration>

What doesn't work:
<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.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**********************************@microsof t.com...
Hi
I'm trying to get forms-based authentication to authenticate different
users
for differet pages, like this:

<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage2.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='MachineToApplication' 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**********************************@microsof t.com...
Hi
I'm trying to get forms-based authentication to authenticate different users for differet pages, like this:

<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage2.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='MachineToApplication' 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.Security.FormsAuthentication.RedirectFr omLoginPage("Admins",
False)
ElseIF User logs in Then
System.Web.Security.FormsAuthentication.RedirectFr omLoginPage("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**********************************@microsof t.com...
Hi
I'm trying to get forms-based authentication to authenticate different

users
for differet pages, like this:

<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage2.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='MachineToApplication' 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
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...
0
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...
2
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...
3
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...
3
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...
6
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...
0
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...
0
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...
43
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.