【问题标题】:OAuth token not retrieved with Uber API优步 API 未检索到 OAuth 令牌
【发布时间】:2015-08-30 13:50:45
【问题描述】:

我无法使用 Uber API 在 OAuth 流程中检索令牌。 这是我的代码:

require 'oauth2'
<%   client = OAuth2::Client.new('<client id>', '<client secret>', 
      :site => 'http://login.uber.com/oauth/authorize?response_type=code') %>
<%   token = client.auth_code.get_token('authorization_code_value', 
     :redirect_uri => 'http://localhost:4567/callback', 
     :headers => {'Authorization' => "Token <token>"}) %>

获取:

OAuth2::Error - invalid_client: {"error": "invalid_client"}: /Library/Ruby/Gems/2.0.0/gems/oauth2-1.0.0/lib/oauth2/client.rb:113:in `请求'

有什么想法吗?我在响应类型上尝试了 http/https 和 code/token。

谢谢, 马特

【问题讨论】:

    标签: oauth uber-api


    【解决方案1】:

    显然您的客户端 ID 有误,请检查它是否与您的开发者仪表板上的匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-28
      • 1970-01-01
      • 2012-11-06
      • 2015-05-28
      • 1970-01-01
      • 2016-08-28
      • 2015-06-10
      相关资源
      最近更新 更多