0
votes

I want to integrate facebook with my Ruby on Rails application. the facebook login should be the only way to register on the site.

The information I need to get from facebook is the name and the profile pictures of the users.

What gems/plugins you suggest I use ? (I assume that I will need a gem for the authentication, and a gem for the facebook integration)

Thanks,

Oded

2

2 Answers

3
votes

I found Devise with the help of Omniauth fairly effective. With a little more patience than I have, you could get things working with just Omniauth.

The devise version that you would need lives on GitHub, and as of the current version, you need a github version of omniauth as well.

From my gemfile:

gem 'devise', :git => 'https://github.com/plataformatec/devise.git'

#oath enables facebook login, for one
gem 'omniauth', :git => 'https://github.com/intridea/omniauth.git'
gem 'oa-oauth', :require => "omniauth/oauth"

#openid enables google login, and openid generally
gem 'oa-openid', :require => 'omniauth/openid'

There's a decent tutorial on one possible way to use Devise with Facebook here: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

Facebook will return an email address with sample code provided in the link above; I presume you can ask it for a profile picture as well, though I haven't explored the authorization API much yet.

0
votes

devise/omniauth can be used for authentication. Alternatively look here: Rails 3 facebook plugin/gem?

To interact with facebook API you can need http://facebooker.rubyforge.org/