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

问题描述:

我想设置omniauth以允许用户使用Facebook登录到我的网站。我收到以下错误,当我在按钮上的日志点击下面的Github TutorialRails OmniAuth Facebook的'重定向URL必须是绝对的'

enter image description here

在我devise.rb文件后,我有:

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

我使用ngrok所以我能够使用本地主机的URL进行测试。生成的URL是http://46cbf60d.ngrok.io

在Facebook的仪表盘设置我有: enter image description here enter image description here

而在Facebook的仪表盘 '产品/ Facebook登录' 我有 enter image description here

有谁知道如何解决这个错误?

+0

给https://开头版本的URL来自同一ngrok服务器。而且你还需要提高ngrok .. :) –

devise.rb文件,“CALLBACK_URL”需要在回调URL代替,如http://demo-app.herokuapp.com/users/auth/facebook/callback

+0

还值得指出的是,如果你传递一个路径而不是一个完整的url,你将会看到相同的错误 – stephenmurdoch