mardi 29 septembre 2015

Implement single sign on functionality in rails 4

Currently I am trying to implement Single Sign On (SSO) in rails 4.

Consider the I have one main app demo.com and three sub-domain apps (basically each one is separate rails application) sub0.demo.com, sub1.demo.com, sub2.demo.com

Now I have to login all of the application through the demo.com (let consider I have same users on all of the applications)

For this I looked into the this post and tried to implement it.

So I have a following questions

  • Is it the good way for doing this?

  • As per the given link, I am trying to implement the given functionality for this I have did following steps

    1. As I am working on local, set the domain in /etc/hosts/ file

    127.0.0.1 demo.com

    127.0.0.1 sub0.demo.com

    127.0.0.1 sub1.demo.com

    1. Also made changes in the following files from the sub1.demo.com

session_store.rb

Rails.application.config.session_store :cookie_store, :key => '_tourlyapp_session', :domain => "demo.com"

But it is not working even though I have set the same key for all the application.

Is there any thing I am missing.

Aucun commentaire:

Enregistrer un commentaire