jgoerzen / twidge

Command-line twitter/identica client [Haskell]
http://wiki.github.com/jgoerzen/twidge/
GNU General Public License v2.0
220 stars 29 forks source link

'twdige setup' fails #15

Open ndndn opened 13 years ago

ndndn commented 13 years ago

hi,

apologies for no patch, I'm too new to haskell!

This is with Twidge, version 1.0.4.

running 'twidge setup' and following the instructions always ends with:

twidge: user error (HTTP/1.1 401 Unauthorized)

jgoerzen commented 13 years ago

Please run with -d and see what sort of details you can get about it.

ndndn commented 13 years ago

running with -d added no extra info that I could see:

twidge -d setup CP /home/me/.twidgerc exists? False

Welcome to twidge. We will now configure twidge for your use with Twitter (or a similar service). This will be quick and easy!

Please wait a moment while I query the server...

ignite done. trying request 1. reqres params: oauth_token=croLwShbMcvRZvAhFcqnhc9C6yvLgLp8Ophv9390tA&oauth_token_secret=eSr9Y4PNzbQLNP7b8O68JXdKRnqCOe9ymzdlOq3v6o&oauth_callback_confirmed=true

request 1 failed. attempting workaround. reqres params: oauth_token=F7YqOPf6gWc0P3GA3QmcLHFcImdZBZbdgViciEWONCc&oauth_token_secret=v7oJI96KdHlHpc0cqNqoIcXDHnekrFFgMDc83AIiGk&oauth_callback_confirmed=true OK, next I need you to authorize Twidge to access your account. Please cut and paste this URL and open it in a web browser:

https://twitter.com/oauth/authorize?oauth_token=F7YqOPfg6Wc0P3AG3QmcHLFIcmdZBbdZgViciEWONCc

Click Allow when prompted. You will be given a numeric key in your browser window. Copy and paste it here. (NOTE: some non-Twitter services supply no key; just leave this blank if you don't get one.)

Authorization key: 1145943 twidge: user error (HTTP/1.1 401 Unauthorized)

jgoerzen commented 13 years ago

I was really hoping there'd be some output right around the 401 error. It's odd that there isn't. The other thing you could try is to remove the https (just use http) and throw a tcpdump across the network so we can see the HTTP headers.

ndndn commented 13 years ago

ok, have done, what should I be looking for? i see very little between 'successfully granted access to twidge!" and the 401, only the GET to GET /statuses/friends_timeline.xml?count=1 HTTP/1.1\r\n - which results in the 401 response...

williamsonday commented 13 years ago

Hi, just wanted to let you know that I am having the same difficulty. I am not sure exactly how to do the tcpdump you are asking for, but I would be willing to try if you point me in the direction of some reasonable instructions.

jgoerzen commented 13 years ago

What version of hoauth do you have installed? If not 0.2.3, can you try it again with that one?

ndndn commented 13 years ago

just tried again after downgrading to hoauth-0.2.3 - same results as with 0.2.5

jgoerzen commented 13 years ago

Drat. Well I will do some more testing tomorrow and try to duplicate it.

jgoerzen commented 13 years ago

Guys, I just can't duplicate this. I'm baffled by what you're seeing. Can you:

ndndn commented 13 years ago

hi,

1) yes, every time, over many days 2) yes, with curl-1.3.5 3) ghc-pkg list output: http://dpaste.com/233937/ 4) have done 5) also have done, in above comment 6) also have done, in above comment

with regard to 5) I just dumped the headers, maybe this was wrong, exactly what tcpdump output will help?

cheers everso.

jgoerzen commented 13 years ago

I don't see any headers or anything else after you pasted your key, which are the bits that are relevant. Headers and body both matter. Actually you haven't posted headers either. I'm lloking for every byte sent to or from the twitter servers.

jgoerzen commented 13 years ago

Also I notice you are on GHC 6.10. Most of the stack used by twidge is currently really only deployed on GHC 6.12. You might also try that version of GHC and look for a change.

ndndn commented 13 years ago

no, I did not post the ouput of tcpdump, i looked through it, and commented above. I did not want to paste a massive cap file. I will try upgrading to ghc 6.12 before tcpdumping again.

I was finding it awkward to narrow the twitter hosts down, to try and limit the cap file to only relavent stuff, I'll try again after a ghc upgrade.

ndndn commented 13 years ago

ghc 6.12 is still compiling - but for what it is worth, should I send you a cap file?

jgoerzen commented 13 years ago

Yes, that would be helpful.

ndndn commented 13 years ago

sent to your email address (i hope)

jgoerzen commented 13 years ago

I am not certain, but there is a chance that twidge 1.0.5 and the tips here http://wiki.github.com/jgoerzen/twidge/frequentlyaskedquestions will fix the issue for you. Can you try?

jgoerzen commented 13 years ago

For the record -- ndndn and I looked at his dumps and eventually discovered that the binary I have posted here worked fine for him while the one he compiled didn't. We haven't isolated the difference yet.

ndndn commented 13 years ago

hi, I've installed twidge 1.0.5, gone through that URL, and unfortunately I get the same 401 error attempting to sign up. no errors during build. I am going to try this build on other machines, given your binary worked.

aisamu commented 13 years ago

Hi! Just to let you know that I have the exactly the same issue! Running from a clean Haskell Package 2010.2, installed from cabal (twidge version 1.0.4 - had to force hoauth < 0.3). Twitter says I successfully authorized twidge, but twidge gives me the HTTP 401.

jgoerzen commented 13 years ago

It is probable that you see the revoked key problem. Try 1.0.6

RFDAJE commented 13 years ago

I am still having the exact problem on twidge git lastest, opening the auth link and tried input the pin always failed.

twidge -d setup CP /home/xxx/.twidgerc exists? False

Welcome to twidge. We will now configure twidge for your use with Twitter (or a similar service). This will be quick and easy!

Please wait a moment while I query the server...

ignite done. trying request 1. reqres params: oauth_token=j6T9v6Nb1DZoAJ6i5njJ7HCMiyQkUlZM7G6Ev6o&oauth_token_secret=Uk6fq45pmknbSQ89eLEhSE6E4b43IvnVrlYsbuNNKg&oauth_callback_confirmed=true request 1 failed. attempting workaround. reqres params: oauth_token=IdBGiIvOEUUoFteK2wwI4bvcxciPPmY7y8TH0jSVg&oauth_token_secret=Wh4S1ERHJkOABI6gugV1k7GcscXHuQepHvqzPoNjOb8&oauth_callback_confirmed=true OK, next I need you to authorize Twidge to access your account. Please cut and paste this URL and open it in a web browser:

https://api.twitter.com/oauth/authorize?oauth_token=IdBGiIvOEUUoFteK2wwI4bvcxciPPmY7y8TH0jSVg

Click Allow when prompted. You will be given a numeric key in your browser window. Copy and paste it here. (NOTE: some non-Twitter services supply no key; just leave this blank if you don't get one.)

Authorization key: 7074776 twidge: user error (HTTP/1.1 401 Unauthorized)

RFDAJE commented 13 years ago

and I also tried to use my own api key in ~/.twidgerc

$ cat ~/.twidgerc

[DEFAULT]

oauthconsumerkey=xxx oauthconsumersecret=xxx

but after input the pin, failed with 401, too.

jgoerzen commented 13 years ago

seenxu: what version are you using, and did you try my binaries posted here on this site?

RFDAJE commented 13 years ago

@jgoerzen I am using git latest, and twidge-1.0.6-linux-x86_64.bin works fine for me.

jgoerzen commented 13 years ago

OK. I am going to need someone to figure out why my builds work while yours don't. Obviously I can't reproduce the problem here...

RFDAJE commented 13 years ago

@jgoerzen I don't really know how oauth works, only guess, can it be dependency's problem, haskell-curl, haskell-sha, etc? which are caused to generate wrong auth token?

dequegorg commented 13 years ago

Hi there,

Same issue on setup:

CP /home/benjamin/.twidgerc exists? False

Welcome to twidge. We will now configure twidge for your use with Twitter (or a similar service). This will be quick and easy!

Please wait a moment while I query the server...

ignite done. trying request 1. reqres params: error HTTP/1.1 401 Unauthorized request 1 failed. attempting workaround. reqres params: error HTTP/1.1 401 Unauthorized twidge: user error (Error from oauthRequest: "HTTP/1.1 401 Unauthorized")

jean commented 13 years ago

Hehe, this was my first stop after installing twidge (Ubuntu 10.10, twidge 1.0.2). Anyone after me, https://github.com/jgoerzen/twidge/wiki/frequentlyaskedquestions and http://blog.nelhage.com/2010/09/dear-twitter/ pertains.