OAuth token not retrieved with Uber API

208 views Asked by At

I am unable to retrieve the token in the OAuth process using the Uber API. Here is my code:

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>"}) %>

Getting:

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'

any idea ? I tried http/https , and code/token on the response type.

thanks, Matt

1

There are 1 answers

0
bolizhou On

Apparently you had the wrong client id, check if it matches the one on your developer dashboard.