You can save the JWT authentication token in the cookie / localStorage of the intermediate domain connected to the home page using iframe
Scenario
abc sends the credentials to masterdomain and masterdomain , then authenticates the user, then creates a signed jwt to send back to abc.
abc masterdomain saves this jwt in a cookie.
After some time, if an attempt to log in to the abc system is made on one computer, the system does not request credentials and automatically enters the user into the system.
Finally, when the user enters the second xyz domain, jwt is restored from the masterdomain repository using an iframe, and automatically logs the user
CORS is not a problem because masterdomain.com has access to its repository and iframe communication is allowed if the start and destination are recognized (see http://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage )
To simplify development, we recently released an open source cross-domain SSO project with JWT at https://github.com/Aralink/ssojwt
source share