ERROR - omniauth: (facebook) Authentication error

I am getting the following error using the last stone Omniauth Facebook

:

ERROR -- omniauth: (facebook) Authentication failure! invalid_credentials: OAuth2::Error, :

My credentials are correct and I seem to hit facebook ok but callback errors.

Any ideas?

+3


source to share


1 answer


The problem was that my app was using an older version of the facebook API. Omniauth-facebook is using the default API version, 2.4 in my case, but my app needs a newer version because that's what my Facebook developer console said. In my case, all I needed to do was update the omniauth-facebook gem to version 4.0.

If you want, you can set the version of the Facebook API you want to use instead of using the default like this (omniauth-facebook docs):

use OmniAuth::Builder do
  provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
    client_options: {
      site: 'https://graph.facebook.com/v3.0',  # this is the example API version
      authorize_url: "https://www.facebook.com/v3.0/dialog/oauth"
    }
end

      



You can check which API your app is testing by going to facebook developer console. enter image description here

You can learn more about the omniauth-facebook API here: http://www.rubydoc.info/gems/omniauth-facebook/4.0.0#API_Version

+3


source







All Articles