omniauth 0.2.3 invalid_credentials
我一直在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是一个老问题,顺便说一句我对此很感兴趣。
您是否尝试过更新 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