Rails OmniAuth Facebook'重定向网址必须是绝对的'

时间:2016-08-05 13:30:31

标签: ruby-on-rails devise omniauth facebook-oauth callbackurl

我正在尝试设置omniauth以允许用户使用facebook登录我的网站。按照Github Tutorial

后点击登录按钮时出现以下错误

enter image description here

在我的devise.rb文件中,我有:

  config.omniauth :facebook, "*****", "*****",
            callback_url: "CALLBACK_URL"

我正在使用ngrok,所以我可以使用不是localhost的网址进行测试。生成的网址为http://46cbf60d.ngrok.io

在Facebook仪表板设置中,我有: enter image description here enter image description here

并在Facebook仪表板' products / facebook登录'我有 enter image description here

有人知道如何修复此错误吗?

1 个答案:

答案 0 :(得分:2)

devise.rb文件中,'CALLBACK_URL'需要替换为回调网址,例如http://demo-app.herokuapp.com/users/auth/facebook/callback

相关问题