Failed to validate oauth signature and token


Hi all,

I built a little twitter app a while back based on Abraham Williams OAuth PHP example. All has been working great with it for the past year or so. It has not been used very much over the past few months. Today, when I went to set up a new account using it, I got an error message. When ever I try to request a token form Twitter the error occurs and I get the following:

[Failed to validate oauth signature and token] =>

I presume I missed some critical update that twitter made and need to make changes to my code. Can anyone shed some light on this for me?



Heh, I got it figured out now… And boy I feel silly. My server’s internal clock was not set correctly. So the timestamps that were sent with the requests for a new token were incorrect. Updated the server’s internal clock to the correct time and everything is working again!


Can you tell us exactly how you updated your server’s internal clock?


I’m having the same issue and also using the same library. I know how to update my clock, but I don’t see that much of a time difference. What was the offset of your clock?


Setting a system clock varies from environment to environment.

In a UNIX-based environment, you can set the clock using the “date” command. Most Linux distros, Mac & Windows should all have options to sync your clock with a NTP server.

You should be within about 5 minutes of our servers. You can determine the delta between your machine and ours by examining the Date HTTP header we send in response to every request. By converting that to UTC epoch time in seconds and comparing to your current UTC epoch time in seconds, you can determine how many seconds behind your clock is from ours.


Hey i am just new to this and trying to learn authentication…and i am not able to figure out how to construct oauth_signature…in php can anyone explain please…?


Here’s a great article on getting started with using tmhOAuth for PHP:


I am using…

About url as GET just to see what is output on webpage. and getting error "Failed to validate oauth signature and token"
At the end I have to use Same url as POST in my App.
Can anyone please help me… and let me know where I am going wrong?




Hi, if anyone can help me out, I am using Google’s App Inventor website, and for a class project I need to make a twitter app, and well, I am having a lot of difficulty since I am new to all this, any help I can get will be very appreciated


If It Fails, Try using Another Computer. If It Fails Again, You Can Update Your Server’s Internal Clock… It Should Be Working Good Again After You Do These 2 Options…


Hi there, guys I have same problem, even dont know what to do, in my local it works fine , but on server I am getting that popular error “Failed to validate oauth signature and token”, I tried to fix server clock, but it’s ok, and I can see more then 5 minutes delta.I am just thinking, I am in GMT+4 timezone, can this effect on this???


It’s possible this is still timezone conversion related… when you’re checking the delta, how are you comparing times? Are you looking at the Date header we’re sending in our responses, then either converting the string into epoch time in seconds or converting your local time object into epoch time in seconds, and comparing?


Como faço para minha conta ser verificada ? Eu preciso ! Por favor …


I failed to get Oauth ways today. It turned out that my Ubuntu has updated its time automatically with Windows system (I install both systems on my laptop). As I traveled abroad and I changed my time zone on my Windows. Linux changed with the Windows at the same time. But it did not change the time zone. Thus today I failed many times to get authentication. Finally I changed the time zone and time manually. And it gets to work again…
Yet I still don’t know why ubuntu would change with my windows since they are separated systems.


i was set date_default_timezone_set(‘America/New_York’); but still i amhaving this http code 401 & reply text as could not connect, refresh the page.


try: date_default_timezone_set(‘UTC’);… solved for me


How to get request token for an access token? let me know if any one worked on it…
thanks in advance…


that same error like “failed to validate oauth signature and token”


is there any new update in my php info() to avoid the error “Failed to validate oauth signature and token” ?