API sounds better.. Just like in the case of facebooker plugin a facebook user can login into another application.
On Jan 4, 11:39 pm, Martin Emde <[email protected]> wrote: > We use a single sign-on system at Engine Yard for AppCloud. It uses Open ID > that we generate and serve, and the login server owns the User information. > Look athttps://github.com/atmos/hancockfor more information (this is not > our login system, but it's a partial extraction by one of the guys who wrote > it) > > Good luck, > > Martin Emde > > > > > > > > On Tue, Jan 4, 2011 at 9:55 AM, David <[email protected]> wrote: > > Hello SD > > > Suppose I have app "A" with a user model and various associated > > models. Now in app "B" I want to be able to sign up and sign in users > > that exist in app "A". What's the best/sanest way of doing this. > > > Some ideas I'm tossing around: > > - Engine - Pull users model and minimum requirements (ie validations > > and associated models) for signup into a Rails Engine and include that > > in "A" and "B". > > - Redirect - redirect users to a page on app "A" for signup/sign in > > then redirect back to "B", sharing cookie sessions between apps. All > > validations and etc stay in app "A". > > - API - have the controllers on app "B" communicate with app "A" via > > XML/JSON. Similar to the redirect in that all validations and etc stay > > in app "A". > > - Shared db - share the app "A" db with app "B" and copy across the > > models from app "A" into app "B". In other words just duplicate the > > models. Probably putting restful_auth on app "B" to handle user > > sessions. > > > A couple of notes: > > App "A" uses the restful_auth plugin. > > The apps are both Rails 2.3.x > > We have validations on the user model and associated models. Quite a > > lot of them actually. > > It's quite possible that in the future we'll have more apps, so > > something that's reusable is high on the list of priorities. > > Sign up from app "B" does not include credit card details. > > The stakeholder is quite keen on universal sessions between the apps, > > but isn't a priority at the moment. > > > So in a nutshell, because the users are held in a foreign database I > > can't use (or don't think I can use) a standard Rails authentication > > pattern. What do I do? > > > Tips, feedback, 2cents and horror stories welcomed! > > > David > > > -- > > SD Ruby mailing list > > [email protected] > >http://groups.google.com/group/sdruby -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
