473,473 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Forms Authentication for multiple subapplications

Hello,

I have a series of applications that have URLS like the following:

http://www/root/app1
http://www/root/app2
http://www/root/app3

All have the same domain and root URL, but different application node names.

I need to have a single sign-on for all of the web applications. I've tried
using the same cookie name in the forms authentication configuration, but
that doesn't work. is there something I should be doing? I encode my custom
user login ID into the forms authentication cookie using the following code:

FormsAuthentication.SetAuthCookie(myUserName, false);
string uniqueKey = MyCryptoCode.Encrypt(id.ToString(), MY_COOKIE_KEY);
HttpCookie authCookie =
HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(authCookie.Value);
ticket = new FormsAuthenticationTicket(
ticket.Version,
ticket.Name,
ticket.IssueDate,
ticket.Expiration,
ticket.IsPersistent,
uniqueKey,
ticket.CookiePath);
authCookie.Value = FormsAuthentication.Encrypt(ticket);
Response.SetCookie(authCookie);

Thanks

-- Jake

Nov 19 '05 #1
1 1340
In the Machine.Config, you need to update the machineKey setting. If you
are on a single web server, just remove the IsolateApps setting. If you are
in a web far, you have to set the validationKey and decryptionKey to their
values. To generate these values see the MSKB
http://support.microsoft.com/default...b;en-us;312906.

Jeff

"javatopia" <ja*******@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
Hello,

I have a series of applications that have URLS like the following:

http://www/root/app1
http://www/root/app2
http://www/root/app3

All have the same domain and root URL, but different application node
names.

I need to have a single sign-on for all of the web applications. I've
tried
using the same cookie name in the forms authentication configuration, but
that doesn't work. is there something I should be doing? I encode my
custom
user login ID into the forms authentication cookie using the following
code:

FormsAuthentication.SetAuthCookie(myUserName, false);
string uniqueKey = MyCryptoCode.Encrypt(id.ToString(), MY_COOKIE_KEY);
HttpCookie authCookie =
HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(authCookie.Value);
ticket = new FormsAuthenticationTicket(
ticket.Version,
ticket.Name,
ticket.IssueDate,
ticket.Expiration,
ticket.IsPersistent,
uniqueKey,
ticket.CookiePath);
authCookie.Value = FormsAuthentication.Encrypt(ticket);
Response.SetCookie(authCookie);

Thanks

-- Jake

Nov 19 '05 #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: JC | last post by:
I have several applications that use forms authentication and they are currently setup to use a single login page. Everything works fine under v1.0 of the framework and everything works fine if I...
9
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...
1
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
4
by: MR. UNDERHILL | last post by:
I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated...
2
by: Joe Rigley | last post by:
Help Please! I've been tasked with converting a portion of the corporate web site that currently utilizes local user accounts and NTFS via Basic Authentication to access certain files on the...
2
by: code | last post by:
Hi, I have stumbled across an interesting problem regarding forms authentication over multiple sub domains. The topic has been covered in various forms online but never really gets a definitive...
4
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...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
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
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...
0
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...
0
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.