views:

140

answers:

1

I have 2 rails apps on the same domain. i want the single sign on feature to be added to them. i would prefer to maintain separate database for each app..

Can anyone please tell me how to do this?

Thanks in advance, Ak

+2  A: 

You might want to look into OpenID and RubyCas.

But since your apps run on the same domain you can share sessions by setting the domain name in config/environments/production.rb (assuming sub domains):

ActionController::Base.session = {
  :domain => ".example.org"
}

Don't forget to set the same session_key and secret across the apps.

config.action_controller.session = {
    :session_key => 'my_shared_session_key',
    :secret      => 'awesome_super_secret_key'
}
Michel de Graaf
I am also looking into an internal system that would be single sign-on like, and considered masqerade (http://github.com/dbloete/masquerade/tree/master) as an internal OpenID server, but the learning curve I think would be high for my users (not to mention, me.)
Dan McNevin
Oh, I also have a question regarding this solution... with this only work with cookie store or will it also work with activerecord session store?
Dan McNevin