Gus
Gus

Reputation: 1923

OAuth token request through GET

I am trying to get an OAuth request token from Twitter with a GET request. I'm not sure if this is possible, but I generate my parameters with this: http://oauth.googlecode.com/svn/code/javascript/example/signature.html

I leave the consumer secret, token, and token secret fields blank. HTTP method is GET. I hit generate, it gives me the normalized parameters, and I copy/paste that in after the URL in my browser like this: https://api.twitter.com/oauth/request_token? + normalized parameters. However, I keep getting the error "Failed to validate oauth signature and token".

Is this impossible, or am I doing something wrong?

If it's impossible, might there be any other possible route to get a request token through pure JavaScript? (not concerned about security)

Thanks!

Upvotes: 0

Views: 500

Answers (1)

Jon Susiak
Jon Susiak

Reputation: 4978

Twitter's documentation states that you must obtain a request token using a POST request. However I don't think that you fully understand the construction of the OAuth request. Firstly You must include both the consumer key and consumer secret in the signature generator you are using, and then the Authorization header of the request must be set to the value generated at the bottom of the page. You cannot use your browser address bar to make this request, use something like Fiddler for testing instead.

Upvotes: 1

Related Questions