I want to connect two sites which are not on the same domain and allow uses to be logged in to both, by logging in to only one site.
I found a huge number of topics and plugins but most of them deal with the subdomains of one parent domain (site1.domain.com and site2.domain.com) which is not what I want.
Both sites will be on the same server, so accessing the database from either of them won't be a problem.
I am thinking of the custom plugin which will do the following:
When a user is logged to one site, generate a hash, store in DB, redirect to the other domain/sso with an ID and if the IDs match, login there as well and redirect back to the first site. This way I will avoid all browser troubles with cross domain cookies and iframes/other hacks. From security point of view, all hashes will expire in 1 minute so automatic (brute force) check of IDs will be impossible. I can even mix it with an IP address and cookie/session to make it more secure.
My questions are:
- What is the best approach for this? Is there an existing solution for what I am trying to do?
- Is there a plugin I should use?
Thanks!