Wednesday, October 9, 2013

Twitter OAuth PHP

I recently needed to integrate the 'Sign in with twitter' option for one of my apps built with PHP.

I downloaded this PHP library which takes all of the hassle out of the process

https://github.com/abraham/twitteroauth

I created the twitter app from https://dev.twitter.com, got my Consumer Key, Consumer Secret, added them to the twitter oauth library, ran the sample app, and everything was working great except for one thing : every time I signed into twitter, I was asked to authorize the app to access my twitter account.

So what did i miss ?

There is a setting in the twitter app configuration that needs to be checked and I forgot to check it

The setting is


After checking that setting, I launched the twitter oauth sample again and after signing into twitter, I was simply signed in without having to authorize the app again.

Hope this helps someone out there :)