OAuth Signature Invalid

236 views
Skip to first unread message

skbach

unread,
Apr 23, 2012, 9:51:42 PM4/23/12
to car2go OpenAPI
Hi there,

I'm having a hell of a time getting a successful request token, and
after spending a couple days trying everything, I thought I'd post it
here to see if someone can guide me in the right direction.

I am sending the following url via GET:

https://www.car2go.com/api/reqtoken?oauth_callback=oob&oauth_consumer_key=MyKey&oauth_nonce=6201190&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1330364789&oauth_version=1.0&oauth_signature=MyEncodedSignature

I keep getting 401, signature_invalid errors.

What I'm doing to calculate the signature is:

I take the following string:

GET&encodedUri&encodedParams

(where encodedUri is the encoded version of: https://www.car2go.com/api/reqtoken

and encodedParams is the encoded version of:

oauth_callback=oob&oauth_consumer_key=MyKey&oauth_nonce=6201190&oauth_signature_method=HMAC-
SHA1&oauth_timestamp=1330364789&oauth_version=1.0 (not including the
oauth_signature param).

I then sign the above string using my shared secret key as the HMAC-
SHA1 key.

Can someone provide some insight into what is going wrong here?

I've basically had to piece together information from various sources,
none of them being particularly helpful, and so it's likely that one
or more of the above assumptions is wrong.

Thanks.

skbach

unread,
Apr 24, 2012, 1:04:05 PM4/24/12
to car2go OpenAPI
I should add that I do a final Get request using the original param
string, but with one final paramater (oauth_signature) appended to the
end of the request.

Thanks.

On Apr 23, 6:51 pm, skbach <doyouunderst...@gmail.com> wrote:
> Hi there,
>
> I'm having a hell of a time getting a successful request token, and
> after spending a couple days trying everything, I thought I'd post it
> here to see if someone can guide me in the right direction.
>
> I am sending the following url via GET:
>
> https://www.car2go.com/api/reqtoken?oauth_callback=oob&oauth_consumer...

Scott Klarenbach

unread,
Apr 24, 2012, 2:57:14 PM4/24/12
to car2go OpenAPI
Ok, figured out my particular issue.

I was not appending an "&" to the end of my shared secret key, since during the request token phase, I don't have a token secret yet.

Painful.  :)
--
Talk to you soon,

Scott Klarenbach

PointyHat Software Corp.
www.pointyhat.ca
p 604-568-4280
e sc...@pointyhat.ca
#308 - 55 Water St.
Vancouver, BC V6B1A1

_______________________________________
To iterate is human; to recurse, divine

Caterina Tormo

unread,
Jul 12, 2013, 5:20:51 AM7/12/13
to car2go-...@googlegroups.com
Hi there,
 
Did you solve your problem? Now, I've the same problem as you had. Could you tell how did you solve it?
 
Thanks in advance,
Caterina
Reply all
Reply to author
Forward
0 new messages