I am trying to figure out how to sync authlogic persistence tokens across servers.
I have 4 servers, and I have many apps on all 4, the authentication is working across all the apps on one server. I can even get them to work on different servers if I copy the persistence token from one to the other 3.
The only issue I can think of is users may login to one server and not the other, but I still w开发者_高级运维ant them to be able to be synced in case they do go to that other server. For example:
Joe logs into server 1
Joe also logs into server 2
Jane only logs into server 1
Fred only logs into server 2
I would need a 2 way sync from each of the servers. I don't care which persistence token they get as long as they are all the same.
This also uses LDAP for authentication in case that matters.
I am open to pretty much any suggestion, including something non-rails related.
Edit
To update this, I cannot remove LDAP authentication. I really have no desire to replace authlogic. I was thinking of something like a rake task or shell script to handle the syncing.
I am perfectly fine coming up with my own idea, just want to see if someone knows the best way.
Thank you all for any help.
You might really be looking for a central authentication service (CAS) -- something that will enable Single Sign On (SSO).
This enables you to log on to different services. It will work something like
- User requests http://server1
- server1 checks if the user is authenticated against the local store. If not:
- server1 redirects user to something like http://casserver?return=server1
- casserver actually gets the username/password or credentials, authenticates them, and:
- casserver redirects to http://server1
Then:
- User requests http://server2
- server2 redirects user to http://casserver?return=server2
- casserver redirects user to http://server2 with the authtoken
That way the user does not enter credentials more than once.
OAuth works like this (over-simplified)
People have used the java based CAS . Some posts:
- http://weblog.plexobject.com/?p=1682
- http://thinkrelevance.com/blog/2007/01/08/cas-sso-and-rails.html
精彩评论