【发布时间】:2013-07-10 23:13:41
【问题描述】:
我的应用程序是用 ruby on rails 制作的,它使用了omniauth 和omniauth-facebook gems。它由一个“使用 Facebook 登录”按钮组成。它在 localhost 中运行良好——人们可以使用 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"
我已更改“生产”中的 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 应用程序部分更改一些东西,它给了我 id 和秘密?任何帮助将不胜感激。
【问题讨论】:
-
您的应用程序域设置是什么?是
example.com吗? -
在 Facebook 中显示“App Domains”的地方,我有 www.example.com。
-
在“使用 Facebook 登录的网站,网址:”我有 example.com