Thursday, March 31, 2011

Re: [twitter-dev] Could not authenticate with OAuth

This is the error that we would send to you if the user has revoked authorization of your application. It's differentiated from a signature error, invalid timestamp error, or a malformed request -- the server cannot authenticate with OAuth because the credentials (the access token) you are providing is invalid. When this happens, you can attempt to verify this by using the access token to attempt accessing account/verify_credentials. If that also fails with the same error, you should stop attempting your post and consider the user as having revoked your application. Retrying any failed call to the API "forever" is not wise, you should have a back-off strategy implemented.

@episod - Taylor Singletary


On Thu, Mar 31, 2011 at 9:03 AM, Mauro Asprea <mauroasprea@gmail.com> wrote:
Hi guys, I placed an issue reprot here -> http://code.google.com/p/twitter-api/issues/detail?id=2131

I am trying to post a Tweet using the REST endpoint: 1/statuses/update.json. It seems that, somehow, the oauth_token is broken or something, because If the user would have deleted or de-authenticated from my app I would expect another error message. I am retrying this call forever (or until google clears the GAE Task Queue) until have confirmation that this would be working or not, only then I will discard the task. So this request will keep hitting twitter API if you need to debug or something.

I really don't know what is going on. This is the code of the response and the headers:
code=401, 
headers={'status': '401 Unauthorized', 'x-google-cache-control': 'remote-fetch', 'set-cookie': 'k=64.233.172.20.1301586772265895; path=/; expires=Thu, 07-Apr-11 15:52:52 GMT; domain=.twitter.com, guest_id=130158677226961885; path=/; expires=Sat, 30 Apr 2011 15:52:52 GMT, _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCDIBngwvAToHaWQiJTE3YzVhZjIyNGNiMzhi%250AZTAyZTFkOTg0OWJlYTQ3YTdjIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--2c81d715cadd3b68aa2e26aab3e8b3a6d70e86da; domain=.twitter.com; path=/; HttpOnly', 'expires': 'Thu, 31 Mar 2011 15:57:52 GMT', 'vary': 'Accept-Encoding', 'connection': 'close', 'server': 'hi', 'x-runtime': '0.00554', 'via': 'HTTP/1.1 GWA', 'cache-control': 'no-cache, max-age=300', 'date': 'Thu, 31 Mar 2011 15:52:52 GMT', 'content-type': 'application/json; charset=utf-8', 'www-authenticate': 'OAuth realm="http://api.twitter.com"'}, content={"request":"\/1\/statuses\/update.json?oauth_version=1.0&oauth_token=38219986-L9k5mARqijzZbQkMCuXuAoDTQpZM6Fk39C3160Z8Q&oauth_nonce=42ee2e14c60a4448a7aedf3321e0ed14&oauth_timestamp=1301586772&oauth_signature=NgD37QLCIYlsZJGBjNu9Kw9o8PA%3D&oauth_consumer_key=bTnd58yyvq8xTNDyXDyfsA&oauth_signature_method=HMAC-SHA1","error":"Could not authenticate with OAuth."}

Thanks
--
Mauro Sebastián Asprea

E-Mail: mauroasprea@gmail.com
Mobile: +34 654297582
Skype: mauro.asprea
http://www.wishandbam.com/

Algunos hombres ven las cosas como son y se preguntan porque. Otros sueñan cosas que nunca fueron y se preguntan por qué no?.
George Bernard Shaw

--
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

--
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

No comments:

Post a Comment