7

I'm using devise and omniauth-facebook authentication in my rails 4 application.

Facebook has moved on to v2.x graph API. (deadline for api migration is April 30, 2015).

During authentication, facebook's login dialog show the following message

"You must upgrade this app to Graph API v2.x
v1.0 will be deprecated on April 30, 2015
Learn how to upgrade"

I figured this is because omniauth-facebook/devise right now uses facebook graph api v1.x.

How do I configure it to point to v2.x ?

MKhanal
  • 384
  • 3
  • 15

1 Answers1

12

Found the solution, hope it helps someone as well

The link is https://github.com/mkdynamic/omniauth-facebook/issues/152

Solution is to configure provider for omniauth-facebook in initializer file as:

 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
    :scope => 'email,read_stream',
    :client_options => {
      :site => 'https://graph.facebook.com/v2.0',
      :authorize_url => "https://www.facebook.com/v2.0/dialog/oauth"
    }
MKhanal
  • 384
  • 3
  • 15
  • I don't get it to work or at least I don't see any change, because I still receive the "username" field from the FB API response, and this field is suposed to be removed on API versions >2.0. Any clue on how can I check it for sure if it is making calls to the v2.0 or not? – alexmarles Dec 17 '14 at 14:07