Omniauth-facebook keeps reporting invalid_credentials Omniauth-facebook keeps reporting invalid_credentials ruby-on-rails ruby-on-rails

Omniauth-facebook keeps reporting invalid_credentials


It seems like omniauth-facebook v1.4.1 introduced an issue with CSRF. A temporary fix is to just roll back to v1.4.0. In your Gemfile, change the omniauth-facebook line to:

gem 'omniauth-facebook', '1.4.0'

I've reported the issue: https://github.com/mkdynamic/omniauth-facebook/issues/73


I had a similar issue where it was working for 1 user but getting the Authenticating error for the 2nd user.

Disabling the Sandbox mode (Apps > Settings > Advanced) seems to have fixed it.


In your omniauth.rb add code:

OmniAuth.config.on_failure = Proc.new do |env| new_path = "/auth/failure" [302, {'Location' => new_path, 'Content-Type'=> 'text/html'}, []]end