473,699 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms Authentication for multiple applications

I have several applications all on the same server. I would like them
to all use the same login page.

Example:
http://server1/customers/app1.aspx
http://server1/suppliers/byregion/app2.aspx

I have a login page located in the root of the same server:
http://server1/login.aspx

None of these are virtual directories.

The web.config file for customers/ and suppliers/byregion/ looks like
this:

<authenticati on mode="Forms">
<forms loginUrl="/login.aspx" name=".ASPXAUTH " timeout="30" path="/"
protection="All ">
</forms>
</authentication>
<authorizatio n>
<deny users="?" />
<allow users="*" />
</authorization>

The web.config for the root web looks like this
<authenticati on mode="Forms">
<forms loginUrl="login .aspx" name=".ASPXAUTH " timeout="30" path="/"
protection="All ">
</forms>
</authentication>
<authorizatio n>
<deny users="?" />
<allow users="*" />
</authorization>

Both apps are configured to allow anonymous in iis.

The login page code looks like this:

Dim tkt As FormsAuthentica tionTicket
tkt = New FormsAuthentica tionTicket(1, Me.txtUser.Text , DateTime.Now(),
DateTime.Now.Ad dMinutes(30), True, "<group info would go here>")
Dim cookiestr As String
cookiestr = FormsAuthentica tion.Encrypt(tk t)
Dim ck As HttpCookie
ck = New HttpCookie(".AS PXAUTH", cookiestr)
ck.Expires = tkt.Expiration
ck.Path = "/"
Response.Cookie s.Add(ck)
Dim strRedirect As String
strRedirect = Request("Return URL")
Response.Redire ct(strRedirect)

When I request a page in customers, like
http://server1/customers/app1.aspx, I am redirected to the login page
(good), bet when I click logon and run the above code, it just returns
to the login page again (bad).
The "ReturnURL" is correct, as I have seen in debug mode.

I'm guessing that app1 is rejecting my cookie, and returning me to the
login page again, but why?

I must be missing something simple. Any ideas?

Nov 19 '05 #1
1 2530
If anyone is interested, I found the answer here.

http://weblogs.asp.net/hernandl/arch...formsauth.aspx

Basically, it had to do with the "IsolateApp s" setting and the machine
key settings in the machine.config file.

Nov 19 '05 #2

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

Similar topics

9
4633
by: Hermit Dave | last post by:
Hi, I am making a web application (rather two applications) one which is host and used by customers when they are just browsing through products. The second application resides on a secure server. This is going to hold all account related information for the customers and will also be used for admin The login is implemented using forms authentication and i was just reading up about that... but as everyone already knows.... its all...
7
2493
by: dave | last post by:
I have one application that is used within our intranet that places a forms auth cookie for our domain (for intranet purposes only). All other applications rely on this cookie for authentication and user identification. i.e. on the 2nd applications if the cookie does not exist the user is redirected back to the primary app to get the forms authentication cookie Now, if i want to run locally the 2nd application it is looking for a...
2
259
by: Brian Shannon | last post by:
I have an intranet site I created when I first began .NET and it is very basic. Now that I have developed my skills I am looking to revamp the old with something new. I really like the idea of using forms authentication. My problem is with assigning roles. The documents I have read talks about assigning roles in the web.config file. This seems like it would be very tedious to manage. Currenly I have all roles stored in a SQL 2000 DB...
2
1514
by: Vaibhav Gadodia | last post by:
Hello, I am trying to build an application which has forms authnetication enabled. I have a non-persistent authentication cookie which is exactly what i want. The problem is when i use two independent browser windows to access the application. Both of them require authentication. Is there any way where i have to login only once from a given machine
1
1727
by: Jéjé | last post by:
Hi, I have to implement a security like this: 1. The user is logged into a home made extranet in PHP, a directory server is used (not the active directory) (its a form based authentication) 2. the user click on a link on the extranet application and jump to another server & application which is my ASPX application I want to be able to keep the login of the user, so the user is directly authenticated.
1
2398
by: o0JoeCool0o | last post by:
I currently have forms authentication set up for my application, I have 2 different projects in the solution and I have one single login page residing in solution #1 My web.config is the same in both projects and works fine in IE you can login the one page and the authentication works when your try redirect to any page in either project. However in firefox if I login in project1 and then try to load a page from project 2 I get booted to...
2
2123
by: o0JoeCool0o | last post by:
Has anyone else tried this? I have been messing with this for a week and cant figure it out, for some reason firefox will not read an authentication cookie unless it was set by the applciation that your trying to load. Where as IE will read the authentication cookie if it has the same name (as specified in web.config) regardless of which application your in.
4
1762
by: David | last post by:
Hi all, I have a problem with Forms Auth. I am not using the protected folder method, rather, I want some parts of the page to be shown depending on the authentication state. Basically, I have a dashboard application. In the dashboard, I have various hyperlinks and linkbuttons. I have also created roles and each user will be assigned a role and the buttons in the dashboard will depend on the role. If the person is not authenticated,...
4
3598
by: =?Utf-8?B?RmFyaWJh?= | last post by:
It know that we can use the following method http://msdn2.microsoft.com/en-us/library/eb0zx8fc.aspx to form authenticate across multiple applications. I have created an asp.net application that supports form authentication. My application is going to be called by another legacy application (HTML) which does the initial authentication.Something like this: <form name="form1" action="auth.asp" method="post" >
2
2047
by: TimVtoo | last post by:
Hi, thanks for your time. I have 2 almost identical asp.net (vb) applications. 1 Development and 1 Production. They use forms authentication that is configured to run in SQL server. Both apps use the same aspnetdb database but have different application names. The problem I have is: I have an Identical login for each app (same username, same password), but If I change profile information for that user in the development app, the changes...
0
8706
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
9055
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
8944
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,...
1
6550
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
5889
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
4391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4638
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2364
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.