Comments (4)
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.
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.
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.
Thanks! I'll get the changes made to the repo asap.
from sso-devise-omniauth-client.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sso-devise-omniauth-client.