You need to use one domain as the main login system (keyDomain). Then for each other domain2, you query the keyDomain for a temporary key, use this key to log to the domain2. The server of domain2 will check the key on keyDomain.
You need two methods on keyDomain.
- One to build the keys. They must be time dependent and valid for 5min.
- One to check the key, check the given key against the current one, and then agains the previous one in case the time slot have changed between query and check. (Both current key and previous one are valid so it make a 10min validity).
The key is simply a string containing time+user_ID+salt, all encoded.
You should look at how facebook connect work.