omn​​iauth 0.2.3 invalid_credentials

发布于 2024-11-03 03:08:46 字数 895 浏览 2 评论 0原文

我一直在使用 OmniAuth 0.2.3 和 Rails 3.0.7 进行 facebook 身份验证。我已经分别获得了本地主机和托管环境的应用程序 ID。在本地主机中进行测试时,一切都非常顺利。但是,当我在托管服务器上运行 Web 应用程序时,我不断收到错误“invalid_credentials”。

我在托管服务器上的配置如下所示:

Ruby (ruby 1.8.7 (2009-06-08 patchlevel 173) [x86_64-linux])
Ruby on Rails (3.0.7)
OmniAuth (0.2.3)
bundler (1.0.2)

GemFile

gem 'rails', '>= 3.0.6'
gem 'mysql2'
gem 'kaminari'
gem 'omniauth'

config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'app_id', 'app_secret', {:scope => "email, publish_stream", :client_options => {:ssl => {:ca_path => "/etc/pki/tls/certs", :ca_file => "/etc/pki/tls/cert.pem"}}}
end

error url

http://my_url/auth/failure?message=invalid_credentials

任何意见或建议都会有所帮助。谢谢。

I have been using OmniAuth 0.2.3 with Rails 3.0.7 for facebook authentication. I have obtained application ids for localhost and hosting environment separately. When testing in localhost, everything work like a charm. However, when I run my web application on the hosting server, I keep getting the error "invalid_credentials".

My configurations on the hosting server are shown below:

Ruby (ruby 1.8.7 (2009-06-08 patchlevel 173) [x86_64-linux])
Ruby on Rails (3.0.7)
OmniAuth (0.2.3)
bundler (1.0.2)

GemFile

gem 'rails', '>= 3.0.6'
gem 'mysql2'
gem 'kaminari'
gem 'omniauth'

config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'app_id', 'app_secret', {:scope => "email, publish_stream", :client_options => {:ssl => {:ca_path => "/etc/pki/tls/certs", :ca_file => "/etc/pki/tls/cert.pem"}}}
end

error url

http://my_url/auth/failure?message=invalid_credentials

Any advice or suggestion would be helpful. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难以启齿的温柔 2024-11-10 03:08:46

我知道这是一个老问题,顺便说一句我对此很感兴趣。

您是否尝试过更新 Facebook 应用程序设置页面上的凭据?如果您离开“localhost”,那么这就是该错误的原因。

另外,尝试重新生成 API 密钥,然后重试。

干杯

I know it's an old question, by the way I'm interested in it.

did you tried to update credentials on facebook's app settings page? if you left "localhost", then that's the reasong for that error.

also, try to regenerate API keys, and try again.

cheers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文