【发布时间】: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。
谢谢, 马特
【问题讨论】: