Rails 3.2 + Facebook auth + CSRF FAILURE

This is the error that I see when I try to log in via facebook, I always see this error. It seems he cannot get rid of him:

Failed to authorize you from Facebook because "Csrf detected."

I missed:

skip_before_filter :verify_authenticity_token

in the Omniauth callback, but still I get the error. This happens in both local and prod (heroku) environments. I set the heroku environment variables. Any idea?

+5
source share
3 answers

I found that the problem was that this stone was too new and passed the STATE header to facebook, which fb did not want. I returned omniauth-facebook gem version and worked

+6
source

, ! , - , . , omniauth . .

: facebook,.....

config/initializers/devise.rb .

, , .

+7

You are sending the p3p header, maybe add ...

before_filter :set_p3p
private

def set_p3p
  headers['P3P'] = 'CP="ALL DSP COR CURa ADMa DEVa OUR IND COM NAV"'
end

for your application controller

0
source

All Articles