I keep getting 401 when trying to login via Oauth with Twitter.
I’m using twitter_oauth-0.3.3 with oauth-0.3.6 in rails
It used to work perfectly some time ago, so after some digging, I realised it might have something to do with my timezone.
In the headers of the Twitter response, one of them is:
date:
- Sun, 11 Apr 2010 16:53:34 GMT
Even though the time is actually 17:53:34 BST
I’m assuming the request is signed using BST time, and so it fails.
Anyone had this problem / found a fix for it?
The OAuth timestamp used in the signature is in the epoch time format.
You might want to inspect the
Authorizationrequest header, check for the oauth_timestamp and check what you are sending with this helpful online tool.The difference between your epoch time and Twitter’s (which you get in the response, as you wrote) should be in the +- 300 second frame.
Hope that helps!