Hi,
I'm porting my HTTP authentication based twitter client to OAuth, and
am having problems constructing a signed call to request_token that
twitter.com will accept. The OAuth implementation has successfully
worked with two different sample servers and MySpace, so I don't think
I'm hitting any underlying bugs in my code. That said, the OAuth
specification skims over encoding so it's possible that there is an
incompatibility.
This is what happens:
> GET
> /oauth/request_token?oauth%5Fconsumer%5Fkey=sPHnVfjaW22jHcGYyHCFA&oauth%5Fsignature=zRmErZcLje9Nns2VEtsyRwzztQE%3D&oauth%5Fsignature%5Fmethod=HMAC%2DSHA1&oauth%5Fnonce=1276674971&oauth%5Ftimestamp=1242721670&oauth%5Fversion=1%2E0
> HTTP/1.1
> Soup-Debug-Timestamp: 1242721670
> Soup-Debug: SoupSessionAsync 1 (0x8f315b8), SoupMessage 1 (0x901d868),
> SoupSocket 1 (0x902f820)
> Host: twitter.com
< HTTP/1.1 401 Unauthorized
< Soup-Debug-Timestamp: 1242721670
< Soup-Debug: SoupMessage 1 (0x901d868)
< Date: Tue, 19 May 2009 08:27:51 GMT
< Server: hi
< Last-Modified: Tue, 19 May 2009 08:27:51 GMT
< Status: 401 Unauthorized
< Pragma: no-cache
< Cache-Control: no-cache, no-store, must-revalidate, pre-check=0,
post-check=0
< Content-Type: text/html; charset=utf-8
< Content-Length: 44
< Expires: Tue, 31 Mar 1981 05:00:00 GMT
< X-Revision: 0056844fe50774f758d59f4d2931e6b31ccbf68f
< X-Transaction: 1242721671-71519-1029
< Set-Cookie:
_twitter_sess=BAh7BzoHaWQiJTkxZTYyNWM2OWMxZWIwMGE3MDczYTI1MTUzMjIwNDE2Igpm
%250AbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAG
%250AOgpAdXNlZHsA--32fb8d8fe9b5a3845060194eb2160f14fe9114c8;
domain=.twitter.com; path=/
< Vary: Accept-Encoding
< Connection: close
<
< Failed to validate oauth signature and token
Anyone got any good ideas? I'm hoping that this isn't an encoding
problem...
Cheers,
Ross