Single Sign on from Multipe Domains

2019-08-13 22:43发布

问题:

I have one domain such as http://www.mydomain.com and I have multple domains pointing to the same location in IIS by defining host headers, such as http://www.myONEdomain.com, http://www.myTWODomain.com, etc.

In the code I use Request.Url.Host to determine which url the user came from and then I act differently in each page based on the domain.

HOWEVER, if the user logs in at www.mydomain.com, they also need access to myONEdomain, myTWOdomain, etc.

Does anyone know how I can acheive this in .net authentication?

Obvisously, the login from the first domain works correctly, but as soon as the user clicks on a link that redirects them to a different domain, there is some functions that they are unable to do because the IsAuthenticated method returns false.

I hope I explained the situation well and that it makes sense, if not please ask.

Thanks in advance!!

回答1:

Ironically I came across a rather extensive document of this just yesterday. I personally use a behind the scene API to pass a session from the main login gateway to sister sites, but this explains the process in great detail:

http://www.codeproject.com/KB/aspnet/CrossDomainSSOExample.aspx



回答2:

The first thing that comes to my mind is to make a cross-domain cookie.