Https://dev.twitter.com/docs/api/1/get/oauth/authorize not working


#1

I am totally lost. I want to allow my users to “connect” to Twitter so I can tweet on their behalf. This is a web application and the first step I understand is to simply do a GET, which just means point the users browser to https://dev.twitter.com/docs/api/1/get/oauth/authorize?oauth_token=XXXXX

No matter what key I use - I keep getting the stupid “Whoa there!” error.

Whoa there!

The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.

I just can’t find any good documentation that clearly says how I am supposed to prompt the user to authorize my app. Is it just pointing the browser and what of the 4 keys I have do I use? What am I missing?


#2

Check out [node:3062] – it describes how to have users authorize your application.

It’s typically a three step process: first your application sends a signed request to api.twitter.com/oauth/request_token to obtain what’s called a “request token.” After you have the request token, you send your end-user to api.twitter.com/oauth/authorize?oauth_token=the-request-token-you-got-in-the-last-step. The user then approves your application and is then redirected to your application. You then issue a request to api.twitter.com/oauth/access_token exchanging the request token from the first step for a long-lived access token that represents the end user and their relationship with your application.

It’s a little more complicated than that when you get to the nitty gritty of it – really recommend using a well-supported third party library for OAuth.