Authenticating a user for a single app with multiple domains

Posted by hofnarwillie on Stack Overflow See other posts from Stack Overflow or by hofnarwillie
Published on 2012-06-21T09:04:40Z Indexed on 2012/06/21 9:16 UTC
Read the original article Hit count: 153

I have one asp.net web application, but two different domains point to this web app. For instance: www.one.com and www.two.com both point to the same web app.

I have an issue where I need certain pages to be on a specific domain (due to some security requirements from our online payment provider - a third party website). So let's say page1.aspx needs to be called on www.two.com

The process is as follows:

  1. A user logs into www.one.com
  2. The authentication cookie is saved to the browser
  3. The user then navigates to page1.aspx and, if on the wrong domain, gets redirected to the correct domain. (this redirection happens on page1.aspx in the page_load event)
  4. Then asp.net redirects the user to the login screen, because the authentication cookie is not sent to www.two.com.

How can I track the user and keep him/her logged in between the two domains?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about authentication