I'm trying to implement Facebook Authentication and I'm stuck. I exactly followed this guide
https://www.crondose.com/2016/12/guide-integrating-omniauth-rails-5-facebook-login-feature/
and get this error
I, [2017-11-07T00:55:47.114884 #12099] INFO -- omniauth: (facebook) Callback phase initiated. E, [2017-11-07T00:55:47.489634 #12099] ERROR -- omniauth: (facebook) Authentication failure! invalid_credentials: OAuth2::Error, :
Facebook API Version v2.10
I am using ruby 2.4.0
and Rails 5.1.4
You are likely getting this error because your App ID or App Secret are incorrect. Make sure your initializer has the correct Facebook API credentials:
Another Tip: Facebook now requires you to specify the fields you want back from Facebook. In other words, if you want the Facebook user's email address, you need to specifically request it. In the past it was returned by default. You can request fields by using the
scope
parameter in the Devise configuration.For example, to request the Facebook user's email and name, do this: