Josh Naylor Josh Naylor - 18 days ago 10
HTML Question

Mulitple Domain Single Sign On

I'm currently trying to join 2 web apps on different domains example1.com and ex.example2.net so that you can login to example1 and click on a link to example2 and be instantly signed in as it would be more convenient for customers to just login the once and go between the sites.

I've researched various means ie. php sessions, openID, JOSSO and Kerberos but what would be a secure and easy way to implement this.

Answer

You can have one application handle logins for both sites using php sessions.

example1.com user logs in and php session cookie is stored.

ex.example2.net check example1.com and validate session cookie. if it does not exist redirect to example1.com login page or a custom login page on example1.com. If it does exist, then log the user into ex.example2.net.

If you only want a link then you generate a hash and pass that to the second app once they have logged onto the first. If the hash validates, then log them in.