Okay, more information for you to consider...
 - I am using HTTPS in the requests
 - I am using the api subdomain in the OAuth requests

First, the failed attempt:

I fetched the request token:
   oauth_timestamp: 1300825895
   Date header in response: [Tue, 22 Mar 2011 20:31:36 GMT]
I then authorized and exchanged for the access token and it failed
with a 401:
   oauth_timestamp: 1300825900
   Date header in response: [Tue, 22 Mar 2011 20:31:40 GMT]
My code immediately tried again after the failure and it worked the
2nd time:
   oauth_timestamp: 1300825900
   Date header in response: [Tue, 22 Mar 2011 20:31:40 GMT]

Notice that there was only a 4 second time lapse between obtaining the
request token and exchanging for the access token. I then tried again
with a ~15 second delay:

I fetched the request token:
   oauth_timestamp: 1300825933
   Date header in response: [Tue, 22 Mar 2011 20:32:13 GMT]
I then waited at the authorization screen for over 15 seconds before
clicking accept...then tried to exchange for the access token...and it
worked:
   oauth_timestamp: 1300825976
   Date header in response: [Tue, 22 Mar 2011 20:32:56 GMT]

So, again in summary: If there is less than 15 seconds of delay
between obtaining the request token and the access token, it always
fails. If there is a >15 second delay, it always works. And, when it
fails, trying to exchange the request token and verifier a 2nd time
will always work.

On Mar 21, 9:04 am, Taylor Singletary <taylorsinglet...@twitter.com>
wrote:
> If you're experiencing this issue, can you please provide these additional
> details:
>   * are the OAuth URLs you are using http or https?
>   * do your OAuth URLs contain the api subdomain? (you really should be if
> you aren't)
>   * what OAuth library (if any) are you using to sign your requests?
>   * If you're observing the response HTTP headers on failed requests, what
> server time is presented in the "Date" HTTP header? What is your OAuth
> timestamp?
>
> Thanks!
>
> @episod <http://twitter.com/episod> - Taylor Singletary - Twitter Developer
> Advocate
>
> On Mon, Mar 21, 2011 at 6:24 AM, Taylor Singletary <
>
> taylorsinglet...@twitter.com> wrote:
> > Thanks everyone for the detailed information in these reports; they'll help
> > a lot while we track down the issue. Will update this thread when we know
> > more.
>
> > @episod <http://twitter.com/episod> - Taylor Singletary - Twitter
> > Developer Advocate
>
> > On Mon, Mar 21, 2011 at 6:03 AM, Tatham Oddie <tat...@oddie.com.au> wrote:
>
> >> Please go and star this issue:
> >>http://code.google.com/p/twitter-api/issues/detail?id=2118
>
> >> On Mar 19, 11:47 pm, Trevor Dean <trevord...@gmail.com> wrote:
> >> > Is anyone else experiencing any 401 errors all of a sudden?  I was doing
> >> > some testing this morning and was logging in fine using twitter and then
> >> 10
> >> > min later I started getting 401 unauthorized errors.
>
> >> > Thanks,
>
> >> > Trevor
>
> >> --
> >> 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

Reply via email to