How to authenticate a user on a domain (with ssl) and redirect and create the session in a different domain?

Viewed 889

I have a multi tenant rails app that let accounts use their own custom domain. The app is hosted on Heroku and the parent domain has a ssl certificate. I want my custom domain users to be able to sign in using the parent domain (www.foo.com) and be redirected to their custom domain (www.bar.com) How can I persist the session on the custom domain when the user signs in?

This is a functionality that's very similar to the way Shopify works.

4 Answers
Related