--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk
Hi Taylor,
I’m using the TweetSharp library.
Here are my requests…
Getting the request token works:
UTC now: 21/03/2011 2:15:44 PM
https://api.twitter.com/oauth/request_token
GET /oauth/request_token HTTP/1.1
Authorization: OAuth oauth_callback="...",oauth_consumer_key="...",oauth_nonce="...",oauth_signature="...",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1300716944",oauth_version="1.0"
User-Agent: TweetSharp
Host: api.twitter.com
Connection: Keep-Alive
200 OK
X-Transaction: 1300716948-77667-49892
X-Runtime: 0.00938
Pragma: no-cache
X-Revision: DEV
Content-Length: 144
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: text/html; charset=utf-8
Date: Mon, 21 Mar 2011 14:15:48 GMT
Expires: Tue, 31 Mar 1981 05:00:00 GMT
ETag: "00fdd191cfa579128843a85a7a58be9f"
Last-Modified: Mon, 21 Mar 2011 14:15:48 GMT
Set-Cookie: k=124.169.147.184....; path=/; expires=Mon, 28-Mar-11 14:15:48 GMT; domain=.twitter.com,guest_id=...; path=/; expires=Wed, 20 Apr 2011 14:15:48 GMT,admobuu=...; domain=.m.twitter.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT,_twitter_sess=...; domain=.twitter.com; path=/; HttpOnly
Server: hi
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
oauth_token=...&oauth_token_secret=...&oauth_callback_confirmed=true
Getting the access token straight away fails with 401:
UTC now: 21/03/2011 2:15:46 PM
https://api.twitter.com/oauth/access_token
POST /oauth/access_token HTTP/1.1
Authorization: OAuth oauth_consumer_key="...",oauth_nonce="...",oauth_signature="...",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1300716946",oauth_token="...",oauth_verifier="...",oauth_version="1.0"
Content-Type: application/x-www-form-urlencoded
User-Agent: TweetSharp
Host: api.twitter.com
Content-Length: 0
401 Unauthorized
X-Transaction: 1300716950-90707-10498
X-Runtime: 0.00684
Pragma: no-cache
X-Revision: DEV
Content-Length: 1
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: text/html; charset=utf-8
Date: Mon, 21 Mar 2011 14:15:50 GMT
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Mon, 21 Mar 2011 14:15:50 GMT
Set-Cookie: k=124.169.147.184....; path=/; expires=Mon, 28-Mar-11 14:15:50 GMT; domain=.twitter.com,guest_id=...; path=/; expires=Wed, 20 Apr 2011 14:15:50 GMT,admobuu=...; domain=.m.twitter.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT,_twitter_sess=...; domain=.twitter.com; path=/; HttpOnly
Server: hi
Vary: Accept-Encoding
Trying the same request again 10 minutes later works (only oauth_timestamp changed):
UTC now: 21/03/2011 2:25:42 PM
https://api.twitter.com/oauth/access_token
POST /oauth/access_token HTTP/1.1
Authorization: OAuth oauth_consumer_key="...",oauth_nonce="...",oauth_signature="...",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1300717542",oauth_token="...",oauth_verifier="...",oauth_version="1.0"
Content-Type: application/x-www-form-urlencoded
User-Agent: TweetSharp
Host: api.twitter.com
Content-Length: 0
Connection: Keep-Alive
200 OK
X-Transaction: 1300717546-72934-39621
X-Runtime: 0.03056
Pragma: no-cache
X-Revision: DEV
Content-Length: 163
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: text/html; charset=utf-8
Date: Mon, 21 Mar 2011 14:25:46 GMT
Expires: Tue, 31 Mar 1981 05:00:00 GMT
ETag: "9ac6161371b0ee90ef8f6db5322287df"
Last-Modified: Mon, 21 Mar 2011 14:25:46 GMT
Set-Cookie: k=124.169.147.184.1300717546945450; path=/; expires=Mon, 28-Mar-11 14:25:46 GMT; domain=.twitter.com,guest_id=130071754695116305; path=/; expires=Wed, 20 Apr 2011 14:25:46 GMT,admobuu=989196f7fa5728c90e815cc8f97cd56a; domain=.m.twitter.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT,_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCMitztguAToHaWQiJTk4NDllMmVhZTM1OTJk%250ANzQ0MGFlMWM2YzQ1ZTU2MDg4IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--dad7912a647454357cfa6f0d07804b5c4b5d6ae4; domain=.twitter.com; path=/; HttpOnly
Server: hi
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
oauth_token=...&oauth_token_secret=...&user_id=14051560&screen_name=tathamoddie
I’m noting that the time offset here is only about 4 seconds, however it certainly takes longer than that to work.
You can see this for yourself trying to sign in to http://ivebeen.to
--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 213 280 3556, skype: tathamoddie
If you’re printing this email, you’re doing it wrong. This is a computer, not a typewriter.
Sorry, what hack is that? I've heard a bunch of advice on working
around this, but nothing conclusive.