How to specify the frame graph API version when using devus and omniauth-facebook

I use the devise and omniauth-facebook function in my rails 4. application.

Facebook has moved to the graphical API v2.x. (The deadline for api transition is April 30, 2015).

During authentication, the following message is displayed in the facebook login dialog

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

I realized that this is because omniauth-facebook / devile now uses facebook graph api v1.x.

How do I configure it on v2.x?

+7
ruby-on-rails facebook facebook-graph-api devise omniauth-facebook
source share
1 answer

I found a solution, I hope that this will help someone.

Link https://github.com/mkdynamic/omniauth-facebook/issues/152

The solution is to configure the provider for omniauth-facebook in the initialization file as follows:

  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" } 
+12
source share

All Articles