Twitter Authentication for public timeline feed


#1

I’m currently working on client side app where I would like to get a feed of a public user timeline without the user of the app being required to have a twitter account.

I am successfully able to do this using v1 of the API and it all works perfectly. Making a request to http://api.twitter.com/1/statuses/user_timeline.json?screen_name=username retrieves all the information that is required.

However, since v1 has been deprecated and v1.1 requires authentication for each request, I get a bad authorization error. Having looked at the Twitter documentation and how to generate OAuth request headers, I don’t fully understand the “Getting a signing key” section of the documentation in the link below. (please bare in mind, this is my first time working with Twitter’s API and OAuth)

https://dev.twitter.com/docs/auth/creating-signature

As I understand it, the consumer secret can be found when logging into twitter.com/apps but I’m not sure where I would get the “OAuth Token Secret” in order to generate a valid signing key. Is this specific for the user? Or can this be my twitter “apps” token secret? (if so, where can this be found?)

Any help would be appreciated.

Thanks


#2

Hi,

Yeah this took me a bit of time to figure out as well - you can use your own twitter account to setup apps to use within client sites. When you create a new app, at http://dev.twitter.com/apps you can get all the 4 keys\tokens you need.

Check out the below for more info :slight_smile:
https://dev.twitter.com/docs/auth/oauth/single-user-with-examples and
http://www.tom-elliott.net/php/authenticating-twitter-feed-timeline-oauth/