Topic-icon Twitter Login OAUTH ERROR

Active Subscriptions:

None
12 years 5 months ago #39634 by trawel
Replied by trawel on topic Twitter Login OAUTH ERROR
Because my website sits on a VPS server I was able to log into WHM and see the actual time. It is set to UTC which right now is Fri Dec 13 20:03:48 UTC 2013. The same setting is made in the Joomla backend. I tried Twitter authentication again after verifying these settings and I'm completely stumped at this point. I will send you FTP credentials to my backend so that you can manipulate the code. Will it be configured as an override so that it's not wiped out in future upgrades?
The topic has been locked.
Active Subscriptions:

None
12 years 5 months ago #39652 by Axel
Replied by Axel on topic Twitter Login OAUTH ERROR
Hello.

I was having this problem and I found this:

dev.twitter.com/discussions/392

So, i did two things:

Sign in with Twitter: Yes
Callback URL: I filled this field with a valid URL.

And worked for me..

I hope this can help you.
The topic has been locked.
Active Subscriptions:

None
12 years 5 months ago #39659 by trawel
Replied by trawel on topic Twitter Login OAUTH ERROR
I appreciate the suggestion Axel. Unfortunately that didn't work. After several hours of doing research I suspect the problem is due to the server date timestamp issue. I have used WHM to set my VPS server's time to UTC and synchronized. Sadly it's still not working. One thing that is puzzling to me is not knowing what timezone to set my server to so that it's within the 5 minutes of Twitter's server timestamp. That would require me to know what Twitter's server is set to and I can't figure out how to make a call to the API to make that determination. Talk about frustrating. I would really like to get Twitter authentication working, especially given the fact that the target audience of some of our sites are Twitter users.

Still hoping Alex has a recommendation or a code fix that can help me get around this issue.
The topic has been locked.
Support Specialist
12 years 5 months ago #39663 by alzander
Replied by alzander on topic Twitter Login OAUTH ERROR
Tracy,
Good news! We've found the issue. It's definitely your server time. Your time, right now, is set to:
Sun, 15 Dec 2013 18:14:12 GMT
Twitter's server is set to:
Sun, 16 Dec 2013 01:17:01 GMT

So, there's a 7 hour, 3 minute and 11s difference in your times.

I actually went into our code and added 25369 seconds to our "timestamp" and things started to work.. so, it's definitely the time.

For now, you'll have to fix the time on the server.. and, unfortunately, tweak it a bit if you can't get it right. Hopefully, you'll get it the first time.

On a side note, our JLinked extension (for LinkedIn) actually has a similar issue where the timestamp can cause issues. We have some code built-in to that to check LinkedIn's timestamp and automatically 'adjust' the value we use in case the server is off. That's worked well for JLinked, and we'll be bringing that feature over to JFBConnect in a future release as well. That helps with time drift and other oddities that can happen. We just hadn't heard of this in Twitter yet.

Please test, and let me know. If you can't get the time going, just let me know. I can check again and get you the exact time difference again as well if necessary.

Best of luck, and thanks for your patience!
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 5 months ago #39667 by trawel
Replied by trawel on topic Twitter Login OAUTH ERROR
Alex,

It's comforting to know that we've isolated the issue. I attempted to adjust the server time on my VPS server (using WHM) but was unable to get it working. I'm wondering what you think about providing a temporary code fix for me until you are able to include the timestamp adjustment code in a future upgrade? Adjusting the timestamp on the server would only be a band-aid to the problem and would ultimately result in a bad user experience for my members who choose to use Twitter login when drift happens. It sounds like your code fix is a permanent solution which is always preferable. :D

Thanks for all of your time in helping resolve this.
Tracy
The topic has been locked.
Support Specialist
12 years 5 months ago #39674 by alzander
Replied by alzander on topic Twitter Login OAUTH ERROR
We don't have a robust code fix available that I can give you. It's not developed for JFBConnect yet. I can give you the quick and dirty change I made, which hard-codes the timestamp we generate to be the same as the difference between your server and Twitter when I generated it. That won't prevent your server from getting out of sync in the future if it's clock is wonky. That would require our automatic adjustment code to be implemented in the next major release.

If you want me to do that, just let me know and I can FTP in and make the change. If your server time changes too much though (by more than about 5 minutes), it will need to be updated again.

The other thing I'd recommend is contacting your host or investigating how to setup an NTP sync. NTP is the "Network Time Pool" and is a method for servers to find out exactly what time it is. It's also what Twitter (and most other servers) use to make sure they are all as close to in-sync as possible. Usually it's a service that needs to be disabled on a VPS instead of one that needs to be enabled since its usually that important to have the proper time, always.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 5 months ago #39684 by trawel
Replied by trawel on topic Twitter Login OAUTH ERROR
Alex,

Based on various tests I've run my hunch is that overriding the timezone on my server through the use of .htaccess or the WHM server is disable but my hosting company is looking into the configuration to verify the root cause.

That leaves me with making a code adjustment to compensate for now. Can you please install the quick and dirty code through FTP and let me know which file you made the adjustment in so that I can comment it out should they correct my server issues? It would also be a huge help if there were a script that you could provide to allow myself, and others who may read this in the future, to run and determine what the current Twitter server time is. I was never able to find such code on the internet when looking.

Thanks
Tracy
The topic has been locked.
Support Specialist
12 years 5 months ago #39709 by alzander
Replied by alzander on topic Twitter Login OAUTH ERROR
I just went to make the change on your site, but tested first, just to make sure. When I did, the Twitter button logged me in as expected.

Not sure if you fixed it since your last message, or it just started working.. either way.. it's going now. Yay!

If you're still having issues or have any questions, please let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 5 months ago #39712 by trawel
Replied by trawel on topic Twitter Login OAUTH ERROR
Thanks Alex!

This is the first time I've seen it working since I embarked on this journey almost a week ago. I'd like to think it will remain working but I'm not completely confident in my hosting company yet. It seems they are tinkering around on the back end still and happened to get the server timezone set to UTC, which appears to have got Twitter working. I hope that they don't screw it up again over the next day or so.

Do you have any idea when the automatic time adjustment code will be rolled out in an update?

Tracy
The topic has been locked.
Active Subscriptions:

None
12 years 5 months ago #39713 by trawel
Replied by trawel on topic Twitter Login OAUTH ERROR
By the way, thank you for the suggestion about the NTP "Network Time Pool". The reason Twitter OAuth started working on my server is because they enabled NTP. I hope this thread helps others in the future as this was quite a frustrating issue to work through. Couldn't have solved it without your suggestion Alex. Thank you! Not only do you have a First Class Joomla Extension but your support is phenomenal!

Tracy
The topic has been locked.