Code Monkey home page Code Monkey logo

Comments (4)

barriault avatar barriault commented on June 3, 2024

Hey Josh, I actually figured out how to get this to work. You need to use the same secret_token (config/initializers/secret_token.rb) and the same session store key (config/initializers/session_store.rb) across all the apps.

Then in your config/environments you need to set the session domain. For production.rb use:
config.action_controller.session = { :domain => ".mydomain.com" }
And for development.rb use:
config.action_controller.session = { :domain => ".rails.localhost" }
This allows all the apps to share the same cookie. Sweet!

from sso-devise-omniauth-client.

gautamrege avatar gautamrege commented on June 3, 2024

Hey ! Awesome find - I hacked my way around this earlier with a custom /sign_out on the client app redirecting to the provider to '/sign_out'. (yuck!)

This is SWEEET!

from sso-devise-omniauth-client.

barriault avatar barriault commented on June 3, 2024

I noticed in the passenger log when the app started that the config methods above are deprecated. So I moved the code to the config/initializers/session_store.rb file and it looks like this:

 if ENV['RAILS_ENV'] == 'production'
   Home::Application.config.session_store :cookie_store, :key => '_myapp_session', :domain => '.mydomain.com'
 else
   Home::Application.config.session_store :cookie_store, :key => '_myapp_session', :domain => '.rails.localhost'
 end

Oh, and I had to add an entry to my hosts file for rails.localhost. Anyway, just thought I'd pass it on.

from sso-devise-omniauth-client.

gautamrege avatar gautamrege commented on June 3, 2024

Thanks! I'll get the changes made to the repo asap.

from sso-devise-omniauth-client.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.