title: Single sign-on, multiple domains on same server, ruby on rails
body: <p>If I have a single server with multiple domains, what is the preferred method for implementing a single-sign-on solution on the same domain. I am currently using devise, have a few million cookies in place on separate domains, and am stuck. On top of just implementing SSO, I also need to migrate the various cookies to a central domain. Regarding the various servers, they only have one single page that requires me to show different states depending on whether or not the user is logged in. </p>
  
  <p>I have tried the following: </p>
  
  <ol>
  <li><p>CORS: pick one domain as the central auth hub. From all other domains make cross domain checks to see if the user is logged in. For migrating cookies, detect if there's a "current_user" object, send it to the client, make a CORS request, sign the user in and kill the token. Works Great! BUT... After building it for 2-3 weeks, it TOTALLY FAILS in IE. Even IE11, I'm noticing the default setting is disabling this behavior. </p></li>
  <li><p>tried tinkering with the session store at</p>
  
  <pre><code> Rails.application.config.session_store
  </code></pre></li>
  </ol>
  
  <p>with no luck. </p>
  
  <p>I am currently experimenting with the following: </p>
  
  <ol start="3">
  <li><p>JSONP: I have someone right now trying to convert the above to JSONP instead while I try some other options: </p></li>
  <li><p>Set up a custom OAUTH provider. Like before, it will be the "central domain" if the person is signed in, return to the requested domain with a token from which the users can make requests. <a href="https://github.com/songkick/oauth2-provider">https://github.com/songkick/oauth2-provider</a></p></li>
  <li><p>Looking at this but it looks outdated? <a href="https://github.com/rubycas/rubycas-client">https://github.com/rubycas/rubycas-client</a>. I also get the feeling this could have been a solution if I rolled this out from the get-go, but given how far we are into the project, it's unclear to me how I'd transfer the existing cookies. Also it's unclear if this requires two applications for me to get up and running ( one for client(s), one for auth server) </p></li>
  </ol>
  
  <p>As I go through each of these possibilities, if anyone has had any experience doing what I'm doing, please do inform me and save me a whole lot of work :)</p>