Re: [twitter-dev] Problems on production server with same code

2010-09-10 Thread Taylor Singletary
A quirk of our system is that our nonce and time validation are
intertwined. It's most likely that the clock on your production system
is either ahead or behind by Twitter's by +/- 15 minutes..  Your
production machines might need a clock update.

Thanks,
Taylor

On Friday, September 10, 2010, Angelus  wrote:
> Hello, I'm migrating our current sistems that used old basic
> authentication on twitter to OAuth and I'm having quite a problem.
>
> In our php projects I'm using a TwitterOAuth lib, very well written
> and worked perfectly on my development machine.
>
> Unfortunately the same code fails to work on our production
> environment with an error that has absolutely no relation with the
> actual error (whatever it is)
> The error I recieve is:
>
> Invalid / used nonce
>
> but the nonce is generated with timestamp + random number. It's not
> possible to have been already used.
>
> an example of the POST body is here
>
> oauth_consumer_key=<-- THE KEY --
>>&oauth_nonce=607fa4w67ww8433f2ce1ec091e4b1e0daac&oauth_signature=8NrnKsp1YuULvltlu
> %2BJOeG3ysGM%3D&oauth_signature_method=HMAC-
> SHA1&oauth_timestamp=1284129911&oauth_token=<-- THE TOKEN --
>>&oauth_version=1.0&status=Status%20to%20change
>
> The code generating this couldn't be wrong since it works perfectly on
> development environment.
> I can't understand what is wrong
>
> Please, any help is appreciated
>
> --
> 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?hl=en
>

-- 
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?hl=en


Re: [twitter-dev] Problems on production server with same code

2010-09-10 Thread Colin Hill
Angelus,
   I ran into this the other day. Check the clock on your production
system and sync it to your favorite authorotative time source
(tock.usno.navy.mil or whatever) to bring it in line with the twitter
servers which presumably use one of the stratum 1 NTP time sources. Too
large a time skew will result in nonce problems.

-- Colin

On 9/10/10 12:59 PM, Angelus wrote:
> Hello, I'm migrating our current sistems that used old basic
> authentication on twitter to OAuth and I'm having quite a problem.
> 
> In our php projects I'm using a TwitterOAuth lib, very well written
> and worked perfectly on my development machine.
> 
> Unfortunately the same code fails to work on our production
> environment with an error that has absolutely no relation with the
> actual error (whatever it is)
> The error I recieve is:
> 
> Invalid / used nonce
> 
> but the nonce is generated with timestamp + random number. It's not
> possible to have been already used.
> 
> an example of the POST body is here
> 
> oauth_consumer_key=<-- THE KEY --
>> &oauth_nonce=607fa4w67ww8433f2ce1ec091e4b1e0daac&oauth_signature=8NrnKsp1YuULvltlu
> %2BJOeG3ysGM%3D&oauth_signature_method=HMAC-
> SHA1&oauth_timestamp=1284129911&oauth_token=<-- THE TOKEN --
>> &oauth_version=1.0&status=Status%20to%20change
> 
> The code generating this couldn't be wrong since it works perfectly on
> development environment.
> I can't understand what is wrong
> 
> Please, any help is appreciated
> 

-- 
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?hl=en