Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails: Best way to add Facebook login, Twitter login, OpenID login, etc

I'm currently running on a Ruby on Rails app with Authlogic handling my authentication and user management.

I'm struggling to find up to date information on the best way to add 3rd party login methods to my site, supplementing the standard sign up and login. There are a number of tutorials out there, but all seem to be outdated or incomplete. Could I get some recommendations on the best way to add multiple 3rd party login methods to Authlogic?

Authlogic appears to be built from the ground up for this type of thing, but it's very poorly documented, and it's own page seems very outdated on this.

They seem to recommend for Facebook using authlogic_facebook_connect plugin, which in turn relies upon the outdated Facebooker gem, which has been replaced by Facebooker2. Is there a way to use Facebooker2 with Authlogic?

I have also found on Google authlogic_oauth2, which is a more modern plugin that can login using Facebook credentials using OAuth2. Unfortunately, the author states that this plugin cannot be used alongside Authlogic plugins for OAuth (Twitter) and OpenID due to conflicts.

What are the recommended gems or plugins I can use together to allow login to my site via Facebook, Twitter, and OpenID?

like image 550
William Jones Avatar asked Aug 21 '10 05:08

William Jones


3 Answers

This looks interesting. Planning to give it a shot.

https://github.com/plataformatec/devise/wiki/Extensions

Edit:

I tried it and I am using devise and omniauth together to handle this:

Check out these links:

http://railscasts.com/episodes/209-introducing-devise

http://railscasts.com/episodes/210-customizing-devise

http://railscasts.com/episodes/235-omniauth-part-1

http://railscasts.com/episodes/236-omniauth-part-2

It is a very good solution

like image 110
Nirav Shah Avatar answered Sep 28 '22 01:09

Nirav Shah


Devise now has built-in OAuth that you can use with Facebook, Github, Twitter, etc. The documentation is quite helpful.

like image 20
jpadvo Avatar answered Sep 28 '22 02:09

jpadvo


I haven't used it yet, but this one looks promising: http://github.com/viatropos/authlogic-connect

It seems you can handle multiple oauth logins in a single db table, and the example includes keys for facebook, twitter, google etc etc so looks promising on the multiple-applications front

like image 32
Taryn East Avatar answered Sep 28 '22 03:09

Taryn East