Forms Authentication for multiple subapplications

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,836
Latest member
BuyBlissBitesCBD

Latest Threads

Top