I am working on my RoR4 application to allow users to log in through an existing facebook account. I registered the facebook application (live and verified version) and saved its api and secret in development.rb . I used omniauth-facebook and invented gems and ran into the " Csrf detected " problem.
My application code is very inspired by this blog: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/
I saw the solution from a stackoverflow post from 2 years ago ( Rails + omniauth + facebook - csrf detected ) - but the latest version of omniauth-facebook is much bigger than the published one. In any case, I tried to return to omniauth-facebook gem before version 1.4.1, and I still ran into this problem.
Gems
oauth2 (1.0.0) omniauth (1.2.2) omniauth-facebook (2.0.1) omniauth-oauth2 (1.3.1)
Ideas?
Error log
(facebook) Callback phase initiated. (facebook) Callback phase initiated. (facebook) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
source share