与Facebook的omniauth不生产 [英] omniauth with facebook not working on production

查看:112
本文介绍了与Facebook的omniauth不生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用omniauth在我的rails应用程序中,我有facebook和twitter按钮的标志,当我在网站url中提交localhost:3000的facebook时,所有工作,但是当我上传网站到heroku和改变网站的网址sitename.heroku.com,twiiter登录按钮工作,但facebook按钮不工作...

i'm working with omniauth in my rails app, i have sign with facebook and twitter button, when i'm putting in facebook in the site url filed localhost:3000, all is working, but when i'm uploading the site to heroku and changing in the site url to sitename.heroku.com, the twiiter login button working but the facebook button don't working...

推荐答案

您可能需要向我们提供更多信息(您的意思是Facebook按钮无法正常工作?您是否收到错误消息?如果是,那是什么?您的日志说什么?)

You probably need to give us more information (What do you mean the facebook button isn't working? Are you getting an error message? If so, what? What are your logs saying?)

但是,这很可能是您的问题:在heroku上使用omniauth facebook身份验证存在已知问题。您需要在config / initializers / omniauth.rb文件中添加对SSL证书文件的明确引用。更改你的Facebook配置行以包含'client_options'哈希值,如下所示:

BUT, there's a good chance this is your problem: there is a known issue using omniauth facebook authentication on heroku. You need to add an explicit reference to the SSL certificates file in the config/initializers/omniauth.rb file. Change your facebook config line to include the 'client_options' hash like so:

provider :facebook, 'YOUR_APP_ID', 'YOUR_SECRET_KEY', 
           {:scope => 'PERMISSION_1, PERMISSION_2, PERMISSION_3...', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}

这篇关于与Facebook的omniauth不生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆