Omniauth与FourSquare问题 [英] Omniauth with FourSquare issue

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

问题描述

更新2011/05/01: 后来我仔细阅读了FourSquare的API文档,发现它说:

UPDATE 2011/05/01: I later carefully read through FourSquare's API document, and found it says:

(请注意,请求参数不是JSON,它们是标准的HTTP密钥和值.)所有身份验证均通过OAuth2进行,这意味着所有请求都必须为https.

(Note that the request parameters are not JSON, they are standard HTTP keys and values.) All authentication is via OAuth2, which means that all requests MUST be https.

这可能是我的开发计算机中没有SSL连接的问题吗?

大家好!我试图通过Omniauth连接FourSquare,我遵循下面的Railscast toturial,并将提供程序更改为foursquare.但是返回始终是"invalid_credentials".我四处搜寻,发现在GitHub上有关于此的讨论(下面的链接),但似乎还没有结论. 任何人都知道出了什么问题吗?

Hi all! I am trying to connect FourSquare via Omniauth, I followed the Railscast toturial below, and change the provider into foursquare. But the return is always "invalid_credentials". I googled around and find that there's a discussion about this on GitHub(links below), but seems no conclusion yet. Anyone has idea what went wrong?

Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, "XXXXXXX","XXXXXXX"
provider :foursquare, 'XXXXXXX',
'XXXXXXX'
end

RailsCast链接

推荐答案

尝试修改提供程序初始化程序以指向系统的证书路径(在Ubuntu上为"/etc/ssl/certs")

try to modify your provider initializer to point to your system's certificate path ("/etc/ssl/certs" on Ubuntu)

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :twitter, "XXXXXXX","XXXXXXX"
    provider :foursquare, 'XXXXXXX', {:client_options => {:ssl => {:ca_path => "/etc/ssl/certs"}}}
end

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

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