开发者

Authentication across different domains

I am running a Wordpress site but i feel that the solution to this question is possibly more generic so am asking for help here.

I have set up LDAP authentication. My website is running on http://a.com (for example), the authentication must happen over an SSL connection and the SSL address is https://b.com (points to the same server). The LDAP authentication works fine, i can be certain of that. The problem 开发者_开发问答is when i log in, it all goes well, authenticates, and then redirects back to a.com where all of a sudden i am not logged in. I am guessing this is to do with the cookies but don't know how to check or how to solve it.

Is this sort of setup possible? Any idea how to get it working properly?

Thanks in advance!


Cookies set on one domain cannot be read by another. You don't want my site to read your banking site usernames.

Here's a possible setup for you: Instead of redirecting back to http://a.com after logging in on https://b.com, redirect to http://a.com?authtoken=abcde. Your code on a.com grabs that token from the URL, and uses it to check a database to see what user just logged in on b.com and was assigned that token. Expire the tokens after they're used.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜