0

我无法使用 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 `request'

任何想法 ?我在响应类型上尝试了 http/https 和 code/token 。

谢谢,马特

4

1 回答 1

0

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

于 2015-07-15T06:55:13.313 回答