Dota 2 files failed to validate oauth
Failed to validate oauth signature and token #44
Comments
Copy link Quote reply
anupamabhadani commented Sep 4, 2010
i ‘am using Abraham Williams Twitter OAuth class to connect to twitter
and post through my website.
Earlier it was working fine but nowdays giving error “Failed to validate
oauth signature and token”.
Kindly provide me solution as all thing must be right in my codingg cause
one day before all was working fine.
This comment has been minimized.
Copy link Quote reply
abraham commented Sep 4, 2010
Check that the time on your server matches the time of Twitter’s servers. If they are different by more then 5 minutes Twitter will refuse your connection.
This comment has been minimized.
Copy link Quote reply
anupamabhadani commented Sep 5, 2010
My server timezone is(Amirica/New york). How i can find twitter server time?
This comment has been minimized.
Copy link Quote reply
abraham commented Sep 5, 2010
How to get the time returned from Twitter. If your server is more then 5 minutes out of sync requests will fail.
$connection->http_header[‘date’]
This comment has been minimized.
Copy link Quote reply
anupamabhadani commented Sep 5, 2010
i am getting below in $connection can you say what must be going wrong, as before 1 september it was working fine.
[http_code] => 401 [url] => https://api. twitter. com/oauth/request_token? oauth_callback=http%3A%2F%2Fwww. thehockeyseason. com%2F80hourshockey%2Ftweetcallback. php&oauth_consumer_key=titTQg554Cd7nmTrJCgYA&oauth_nonce=c2e5b74e73e375566e7791ce96379217&oauth_signature=%2B%2BZ6NodO0tfnD6mg7dUF9F3ls8c%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1283702864&oauth_version=1.0 [host] => https://api. twitter. com/1/ [timeout] => 30 [connecttimeout] => 30 [ssl_verifypeer] => [format] => json [decode_json] => 1 [http_info] => Array ( [url] => https://api. twitter. com/oauth/request_token? oauth_callback=http%3A%2F%2Fwww. thehockeyseason. com%2F80hourshockey%2Ftweetcallback. php&oauth_consumer_key=titTQg554Cd7nmTrJCgYA&oauth_nonce=c2e5b74e73e375566e7791ce96379217&oauth_signature=%2B%2BZ6NodO0tfnD6mg7dUF9F3ls8c%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1283702864&oauth_version=1.0 [content_type] => text/html; charset=utf-8 [http_code] => 401 [header_size] => 938 [request_size] => 415 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.263938 [namelookup_time] => 0.008752 [connect_time] => 0.059354 [pretransfer_time] => 0.199736 [size_upload] => 0 [size_download] => 44 [speed_download] => 166 [speed_upload] => 0 [download_content_length] => 44 [upload_content_length] => 0 [starttransfer_time] => 0.263931 [redirect_time] => 0 ) [useragent] => TwitterOAuth v0.2.0-beta2 [sha1_method] => OAuthSignatureMethod_HMAC_SHA1 Object ( ) [consumer] => OAuthConsumer Object ( [key] => titTQg554Cd7nmTrJCgYA [secret] => PhvxOlURzR8lNXSCJlmaeiLhQfXFJSDMVA7usC2QXo [callback_url] => ) [token] => OAuthConsumer Object ( [key] => [secret] => [callback_url] => ) [http_header] => Array ( [date] => Sun, 05 Sep 2010 16:30:01 GMT [server] => hi [status] => 401 Unauthorized [x_transaction] => 1283704201-30489-54105 [last_modified] => Sun, 05 Sep 2010 16:30:01 GMT [x_runtime] => 0.00442 [content_type] => text/html; charset=utf-8 [content_length] => 44 [pragma] => no-cache [x_revision] => DEV [expires] => Tue, 31 Mar 1981 05:00:00 GMT [cache_control] => no-cache, no-store, must-reval > _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCACgu%252BIqAToHaWQiJWQyNGMxYzZjMmJiMmI2%250AZjhiZTAzMmJjNTFiYjI3MDM2IgpmbGFzaElDO > Accept-Encoding [connection] => close )
This comment has been minimized.
Copy link Quote reply
abraham commented Sep 5, 2010
As I said your servers time is different from Twitter’s. Looking here it is off by about 22 minutes.
Twitter’s time: Sun, 05 Sep 2010 16:30:01 GMT aka 1283704201
Your servers time: 1283702864
A difference of 1337 seconds or just over 22 minutes.
Look into using NTP to sync your servers time correctly.
This comment has been minimized.
Copy link Quote reply
anupamabhadani commented Sep 5, 2010
I have no access to change my server time, if i can use date_default_timezone_set() for setting the time zone. what time zone i must pass as the param and if it will work.
This comment has been minimized.
Copy link Quote reply
anupamabhadani commented Sep 5, 2010
date_default_timezone_set() it is not working, can u suggest how to resolved this problem
This comment has been minimized.
Copy link Quote reply
abraham commented Sep 5, 2010
Setting the timezone will not help. You have to change the time (hour/minutes/second) of the server. Get in contact with your server administrator or hosting provider to enable NTP syncing.

