473,782 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ 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:

FormsAuthentica tion.SetAuthCoo kie(myUserName, false);
string uniqueKey = MyCryptoCode.En crypt(id.ToStri ng(), MY_COOKIE_KEY);
HttpCookie authCookie =
HttpContext.Cur rent.Request.Co okies[FormsAuthentica tion.FormsCooki eName];
FormsAuthentica tionTicket ticket =
FormsAuthentica tion.Decrypt(au thCookie.Value) ;
ticket = new FormsAuthentica tionTicket(
ticket.Version,
ticket.Name,
ticket.IssueDat e,
ticket.Expirati on,
ticket.IsPersis tent,
uniqueKey,
ticket.CookiePa th);
authCookie.Valu e = FormsAuthentica tion.Encrypt(ti cket);
Response.SetCoo kie(authCookie) ;

Thanks

-- Jake

Nov 19 '05 #1
1 1355
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*******@disc ussions.microso ft.com> wrote in message
news:67******** *************** ***********@mic rosoft.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:

FormsAuthentica tion.SetAuthCoo kie(myUserName, false);
string uniqueKey = MyCryptoCode.En crypt(id.ToStri ng(), MY_COOKIE_KEY);
HttpCookie authCookie =
HttpContext.Cur rent.Request.Co okies[FormsAuthentica tion.FormsCooki eName];
FormsAuthentica tionTicket ticket =
FormsAuthentica tion.Decrypt(au thCookie.Value) ;
ticket = new FormsAuthentica tionTicket(
ticket.Version,
ticket.Name,
ticket.IssueDat e,
ticket.Expirati on,
ticket.IsPersis tent,
uniqueKey,
ticket.CookiePa th);
authCookie.Valu e = FormsAuthentica tion.Encrypt(ti cket);
Response.SetCoo kie(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
4841
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
2005
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 have all applications running under v1.1. However, I need the login page and a few apps to be running under using v1.0 with other applications running under v1.1. Now my authentication cookie is no longer being accepted anywhere other than by...
9
4639
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...
1
3510
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 web.config file is configured as such: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" name="myApplication"/> </authentication>
4
2656
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 user and some others, like the home page is not required. I specified the <deny users="?" /> on the web.config, but this is causing ALL pages require the authentication. How can I mix both, without loosing the web.config setup? I know that I can...
2
2416
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 web site to an ASP .NET Forms Authentication approach with SQL Server. I'm just getting comfortable with ASP .Net, but strong in Classic ASP.
2
2501
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 answer as to why it happens. I have two separate web apps sat on different sub domains of the same company realm. eg:
4
3604
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" >
5
3568
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 creation of content which adjusts based on the user. I have several pages which require a user to be logged on and several which do not. Prior to this point in time I have used 2 different master pages. one with a control which checks a session...
0
10313
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...
1
10080
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
8968
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
7494
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
6735
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
5378
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.