single-sign-on authentication using Facebook on Rails — AuthLogic or Devise?-open source projects binarylogic/authlogic

Aaron Scruggs

These days you use oauth2 to auth with facebook. The oauth2 token you get back can be used integrate with the facebook’s graph.

The best approach would be to look at the OmniAuth gem. It will allow you to immediately authenticate with facebook (and then tie in twitter, google, yahoo, etc. later). If the documentation is lacking for that gem, then look at the oauth2 gem which will show you exactly how to do it.

Then, when you want to use the facebook graph, look at the fbgraph gem; it is awesome.