我的应用程序是用ruby on rails开发的,使用omniauth和omniauth-facebook的gem。它由一个“用Facebook登录”按钮组成。它在本地主机上运行得很好--人们可以登录Facebook --但我不能让它在我的实时服务器上运行。据我所知,我已经更改了相关的细节,但是我是否遗漏了什么?
正如我所说的,它在localhost:3000中工作得很好。我已经更改了这些细节,以尝试在www.example.com上运行,但我一直收到错误消息:
Given URL is not permitted by the application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.在我的config/oauth.yml文件中有:
development:
facebook:
app_id: "12345"
app_secret: "abcde"
options:
scope: "email"
display: "page"
staging: &staging
facebook:
app_id: "12345"
app_secret: "abcde"
options:
scope: "email"
display: "page"
test:
<<: *staging
production:
facebook:
app_id: "12345678"
app_secret: "abcdefgh"我已经更改了“production”中的app_id和app_secret,以匹配我在Facebook中创建的应用程序的id和密钥。
在environments/production.rb中,我放入:
# Need this here for mailing purposes
config.action_mailer.default_url_options = { :host => 'www.example.com' }在environments/development.rb中,我放入:
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'www.example.com' }我是不是忽略了什么?也许我需要在我的Facebook Apps部分更改一些东西,在那里它给了我id和秘密?任何帮助都将不胜感激。
发布于 2013-07-11 16:24:51
在具有Facebook的网站上,登录网站url应设置为您网站的URL,而在应用程序域上,应设置为您的主机,例如:
应用程序域::example.com
网站网址:http://example.com/
在environments/production.rb中,你应该放入:
config.action_mailer.default_url_options = { :host => 'example.com' }发布于 2014-12-02 19:45:47
当我正确完成所有设置时,同样的事情也会发生在我身上。原来,在我的Facebook仪表板上,App ID和App Secret不知何故发生了变化。您可能在仪表板上进行了更改,以某种方式更改了ID,然后Secret.Just再次确认这些详细信息
https://stackoverflow.com/questions/17582521
复制相似问题