0
votes

I have been toying around with the twitter API over the last few days, but seem to be stuck at requesting a "request token". (flow A)

enter image description here

Over at the twitter api, I should be hitting the following end point (https://api.twitter.com/oauth/request_token) and on a successful request this should net me an oauth_token, oauth_token_secret and oauth_callback_confirmed (should match what I pass). I attempted to just use my private key, but this of course is failing. Is my understanding of how to generate this request wrong?

I believe my issue is the way I am generating the oauth_signature. Reading the documentation at twitter, everything seems straight forward until I need to generate signing key documented Here. It states that the signing key should be Consumer Secret & OAuth token secret, but to me this is a circular reference. The response, for this request, should contain the oauth_token_secret.

1

1 Answers

1
votes

With this request an empty oauth_token_secret is expected. Signing key should be consumer_secret&, the trailing & must be included.

Relevant quote from https://tools.ietf.org/html/rfc5849#section-3.4.2:

An "&" character (ASCII code 38), which MUST be included even when either secret is empty.