Single Sign on from Multipe Domains

2019-08-13 22:39发布

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!!

2条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-13 23:22

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

查看更多
可以哭但决不认输i
3楼-- · 2019-08-13 23:37

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

查看更多
登录 后发表回答