0

I been facing this problem recently. I receive this error in my browser.

enter image description here

In my cygwin it keep redirect me and end up showing

ERROR -- omniauth: (facebook) Authentication failure! csrf_detected:                       
OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
E, [2015-04-16T11:21:15.660929 #10056] ERROR -- omniauth: (facebook) 
Authentication failure! invalid_credentials:  
OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detecte

I tried various method suggested but failed to solve my problem.

After some testing, I think is my configuration problem but still have no idea how to fix it. It seem WardenOmniAuth could not receive the callback from facebook which keep looping and redirecting until the time spam killed it.

Here is my coding in my app.rb

failure = lambda{|e| Rack::Resposne.new("Can't login", 401).finish }

use Rack::Session::Cookie

use Warden::Manager do |config|
  config.failure_app = failure
  config.default_strategies :omni_facebook
end

use OmniAuth::Strategies::Facebook, ENV["APP_ID"], ENV["APP_SECRET"]

use WardenOmniAuth do |config|
  config.redirect_after_callback = "/home"
end
Community
  • 1
  • 1
Dennis
  • 130
  • 1
  • 6

1 Answers1

1

I found the solution. It seem that the Warden_OmniAuth gem have bug. It goes haywire when reach the callback point and cause a repeating loop of calling the callback.

So I change to using Warden gem, OmniAuth gem and OmniAuth-facebook gem. By using a builder and the warden strategie.

Dennis
  • 130
  • 1
  • 6