twitter / twurl

OAuth-enabled curl for the Twitter API

Home Page:https://developer.twitter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provided API key & secret, but unable to authorize ("Authorization failed")

michelleran opened this issue · comments

Using the authorize command with my app API key and secret causes twurl to prompt me for my consumer key again, but after entering it, the authentication failed. I've also tried using my access tokens.

Expected behavior

This is my first time using twurl, so I'm going off the readme - it should output a URL I can open in my browser to authorize twurl?

Actual behavior

After entering the command twurl authorize --consumer-key [consumer key] --consumer-secret [consumer secret], it prompts me for the consumer secret. I tried both copying and typing it in, but after hitting enter, it says:

Authorization failed. Check that your consumer key and secret are correct, as well as username and password.
zsh: command not found: [consumer key]

Steps to reproduce the behavior

Environment: OS X 10.15.1

  1. Run gem install twurl
  2. Create a Twitter app (or, in my case, I used an existing one)
  3. Run twurl authorize --consumer-key [consumer key] --consumer-secret [consumer secret] with the API key and secret
  4. Enter the API key when prompted for the consumer key

Any pointers would be appreciated!

Can I just confirm that you're replacing [consumer key] with you own key value (and ditto for secret?) - so, in that case, you're seeing an error of

zsh: command not found: xxxxYourActualConsumerKeyxxxx

It might be an obvious question, but I want to make sure I understand the problem you're seeing. You should indeed see a URL that given back, that you should then visit in your browser to get the PIN from authentication.

Yes, that's correct!

That's really strange. I've just tried this on macOS 10.15.4 and zsh with twurl 0.9.5 which is the current latest version:

twurl authorize -c maYxxxxJKLA -s 2znxxxJo1z8

And get prompted:

Go to https://api.twitter.com/oauth/authorize?oauth_consumer_key=maYzzzKLA&oauth_nonce=0qpczzz7c&oauth_signature=5LszzzQM%253D&oauth_signature_method=HMACSHA1&oauth_timestamp=1585761590&oauth_token=zgxxxxwQ&oauth_version=1.0 and paste in the supplied PIN

(which is the expected output)

I've also tried it with the full --consumer-secret and --consumer-secret options (-c and -s are short versions).

I reinstalled it and it seems to be working now - weird, but thanks for the help!