Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify facebook graph API version while using devise and omniauth-facebook

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 ?

like image 214
MKhanal Avatar asked Nov 03 '14 03:11

MKhanal


People also ask

How do I change my Facebook API version?

In the App Dashboard Settings > Advanced, scroll to the Upgrade API Version section.

How do I find my Facebook API version?

The API version is listed with the release of each version of the Facebook SDK for Android. Much like the JavaScript SDK, the version is prepended to any calls you make to the graph API through the Facebook SDK for Android.

Is Facebook Graph API deprecated?

API Version Deprecations: As part of Facebook's Graph API and Marketing API, please note the upcoming deprecations: August 3, 2021: Graph API v3. 3 will be deprecated and removed from the platform. August 25, 2021 Marketing API v9.


Video Answer


1 Answers

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"
    }
like image 145
MKhanal Avatar answered Oct 17 '22 02:10

MKhanal