Rails + omniauth + facebook - csrf detected

后端 未结 3 1061
庸人自扰
庸人自扰 2021-01-06 04:01

I\'m working on logging in a site via existing facebook account. So I registered a facebook application and stored api and secret

3条回答
  •  不知归路
    2021-01-06 04:28

    For me, I needed to add provider_ignores_state: true to my Omniauth config:

    config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'], {
      strategy_class: OmniAuth::Strategies::Facebook,
      provider_ignores_state: true
    }
    

    This is on omniauth-facebook gem version 1.6.0.

    There is more info also at https://github.com/mkdynamic/omniauth-facebook/issues/73

提交回复
热议问题