Rails : Omniauth: (facebook) Authentication failure! invalid_credentials: OAuth2::Error, :

Rails : Omniauth: (facebook) Authentication failure! invalid_credentials: OAuth2::Error, :

I just realized that the facebook authentication is failing, this is the error I get in heroku:

2017-04-20T16:23:30.596766+00:00 app[web.1]: I, [2017-04-20T16:23:30.596716 #7]  INFO -- omniauth: (facebook) Callback phase initiated.
2017-04-20T16:23:30.647209+00:00 app[web.1]: E, [2017-04-20T16:23:30.647151 #7] ERROR -- omniauth: (facebook) Authentication failure! invalid_credentials: OAuth2::Error, :

and the way to fix the problem is:

Updating the `omniauth-facebook` gem to:

gem 'omniauth-facebook', '= 4.0.0'

Then

bundle update omniauth-facebook

In your `config/initializers/devise.rb` file you should have something like this:

  config.omniauth :facebook, ENV["FACEBOOK_KEY"], ENV["FACEBOOK_SECRET"],
    scope: 'email',
    secure_image_url: true,
    auth_type: 'https',
    info_fields: 'email,name,first_name,last_name'

There you go now is working again.

No Comments

Post A Comment