OAuth

256 views
Skip to first unread message

NicoWitteman

unread,
Feb 26, 2012, 12:31:25 PM2/26/12
to car2go OpenAPI
Hello there,
when trying to get OAuth working, I keep getting a 401
"signature_invalid" response from https://www.car2go.com/api/reqtoken.
Any tips from the community?

Claus Näveke

unread,
Feb 27, 2012, 8:18:00 AM2/27/12
to car2go OpenAPI
On 26 Feb., 18:31, NicoWitteman <nico.witte...@gmail.com> wrote:

Hi Nico,

> when trying to get OAuth working, I keep getting a 401
> "signature_invalid" response fromhttps://www.car2go.com/api/reqtoken.
> Any tips from the community?

The signature has to be calculated over ALL request parameters and
those have to be sorted by parameter name. What does your signature
string look like?

Nico Witteman

unread,
Feb 27, 2012, 12:57:12 PM2/27/12
to car2go-...@googlegroups.com
Hi Claus,
It looks like this:

"ZhkjjdbXaXwiZMADNDfd5o4Hd5g%3d"

And this is the parameterstring:
"oauth_callback=http%3a%2f%2fwww.car2go.com&oauth_consumer_key=NicoWitteman&
oauth_nonce=6201190&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1330364
789&oauth_version=1.0"

Am I right in assuming that also the oath_callback parameter must be
present? If so, what value should I give it, or does it not matter, since
you document that it is ignored anyway?

Kind regards,

Nico


-----Oorspronkelijk bericht-----
Van: car2go-...@googlegroups.com
[mailto:car2go-...@googlegroups.com] Namens Claus Näveke
Verzonden: maandag 27 februari 2012 14:18
Aan: car2go OpenAPI
Onderwerp: Re: OAuth

Andreas Kern

unread,
Feb 27, 2012, 1:31:06 PM2/27/12
to car2go-...@googlegroups.com
Hello Nico.

You have to set the oauth_callback parameter to oob (out-of-band) like specified here:
http://tools.ietf.org/html/draft-hammer-oauth-08#section-2.1

Greetings, Andreas.

PS: Your consumer key is now public.

Andreas Kern

unread,
Feb 27, 2012, 1:35:16 PM2/27/12
to car2go-...@googlegroups.com
Sorry, this was the link to the draft.

Just for the correctness the link to the RFC:
http://tools.ietf.org/html/rfc5849#section-2.1


Greetings, Andreas.

Am 27.02.2012 um 18:57 schrieb Nico Witteman:

Nico Witteman

unread,
Feb 27, 2012, 2:27:52 PM2/27/12
to car2go-...@googlegroups.com
Dear Andreas,
Thank you so much. This did the trick. A typical case of "if all else fails,
read the manual".

Kind reagrds,
Nico


-----Oorspronkelijk bericht-----
Van: car2go-...@googlegroups.com
[mailto:car2go-...@googlegroups.com] Namens Andreas Kern
Verzonden: maandag 27 februari 2012 19:35
Aan: car2go-...@googlegroups.com
Onderwerp: Re: OAuth

Reply all
Reply to author
Forward
0 new messages