omniauth gowalla 策略错误:String 与 Bignum 的比较失败
据我所知,gowalla 身份验证代码响应包含 expires_at
和 expires_in
但 expires_at 不是有效的日期字符串,因此在比较日期时会抛出错误
任何破解omniauth或gowalla策略的想法都将非常受欢迎!
导轨3.0.9 红宝石 1.9.2
comparison of String with Bignum failed
oauth2 (0.5.0) lib/oauth2/access_token.rb:72:in `<'
oauth2 (0.5.0) lib/oauth2/access_token.rb:72:in `expired?'
oa-oauth (0.3.0) lib/omniauth/strategies/oauth2.rb:67:in `callback_phase'
{
"scope":"read",
"expires_at":"Sun, 09 Oct 2011 12:47:37 -0000",
"username":"altuure",
"expires_in":1172767,
"refresh_token":"XX",
"access_token":"XX"
}
as far as I can get gowalla auth code response contains both expires_at
and expires_in
but
expires_at is not valid date string so it throws error while comparing dates
any idea to hack omniauth or gowalla strategy would be very welcome!!!
rails 3.0.9
ruby 1.9.2
comparison of String with Bignum failed
oauth2 (0.5.0) lib/oauth2/access_token.rb:72:in `<'
oauth2 (0.5.0) lib/oauth2/access_token.rb:72:in `expired?'
oa-oauth (0.3.0) lib/omniauth/strategies/oauth2.rb:67:in `callback_phase'
{
"scope":"read",
"expires_at":"Sun, 09 Oct 2011 12:47:37 -0000",
"username":"altuure",
"expires_in":1172767,
"refresh_token":"XX",
"access_token":"XX"
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你为什么不尽你所能地使用它呢?
expires_in
似乎是一个间隔,所以你可以这样做:也就是说,
expires_at
的日期字符串肯定在 1.9.2-p290 中解析(使用DateTime.parse (str)
)。如果您需要根据给定格式解析日期/时间字符串,则总是有DateTime.strptime
。Why don't you just use whatever you can.
expires_in
appears to be an interval, so you can do:That said, the date string for
expires_at
definitely parses in 1.9.2-p290 (usingDateTime.parse(str)
). There's alwaysDateTime.strptime
if you need to parse a date/time string according to a given format.抱歉耽搁了,但我已将补丁提交到 github,您可以在此处找到详细信息 http://github .com/intridea/omniauth/issues/485 –
sorry for delay but I commited the patch to the github you can find the details over here http://github.com/intridea/omniauth/issues/485 –