tdryer / hangups

the first third-party instant messaging client for Google Hangouts
https://hangups.readthedocs.io/
MIT License
1.71k stars 190 forks source link

Fail after second factor PIN entered #43

Closed uriel1998 closed 9 years ago

uriel1998 commented 9 years ago

I know the request is going through - I used one of my "backup codes" on it, and saw it disappear. However, I'm getting "Login failed (Second factor failed)" consistently.

The setup is workable; I have a throwaway google account (without second factor auth) that can log in just fine.

Fair warning: I know just enough to be dangerous to myself. Would posting the debug logs expose any private info?

tdryer commented 9 years ago

Have you tried with a PIN rather than a backup code? Have you tried logging in with a browser first?

I don't think the auth code logs any private info, but it's not likely to be very helpful either.

uriel1998 commented 9 years ago

Sorry I wasn't clear! Yeah, I was using the PINs generated by Authy. I've never had any problems with that. Successfully logged in with Chrome, Iceweasel (Firefox), and elinks2 to various Google services. I got a password check when trying

https://accounts.google.com/SecondFactor?continue=https%3A%2F%2Ftalkgadget.google.com%2Ftalkgadget%2Fgauth%3Fverify%3Dtrue&checkedDomains=youtube&pstMsg=0&skipvpage=true

which got me a page saying

You have logged in successfully. You can now refresh the page containing the Google Talk gadget and close this window.

But still no dice from hangups. It seems to be getting 301 and 302 errors from the connections at the end of the log. :/

tdryer commented 9 years ago

Can you try logging in with just your Google username rather than the full email address? Might be related to #35.

uriel1998 commented 9 years ago

No-go. :( I'm guessing that if I turn off 2-factor, sign in, and then turn it back on again I'll be back at this same place, huh?

GermainZ commented 9 years ago

Are you using an app specific password? If so, can you try without?

tdryer commented 9 years ago

I'm guessing that if I turn off 2-factor, sign in, and then turn it back on again I'll be back at this same place, huh?

I think so, yes.

Are you using an app specific password? If so, can you try without?

I'm pretty sure app specific passwords don't work.

uriel1998 commented 9 years ago

I've tried both app-specific and using the PIN from Authy. FWIW, I just set up another computer's gcalcli just fine, but it used a different auth method. The app-specific password was recognized as being used, but wasn't accepted. I'll try setting this up on the other system just in case there's something else weird I'm missing.

tdryer commented 9 years ago

If you'd like to use hangups before this gets fixed, here's a template for cookies.json. You can steal the relevant cookies from your browser using the dev tools.

{
  "SSID": "",
  "SAPISID": "",
  "HSID": "",
  "SID": "",
  "APISID": "",
  "NID": ""
}
hughdavenport commented 9 years ago

I played with this last night. I get same issue with PIN, using master password, then code generated by google authenticator. Logging in manually works fine.

I tried using a app specific password, and doesn't work, and trying manually gives an error saying use master password.

Would be good if we could not have to use master password, but we rely on the cookies right? How does the autosignin in chrome/ff on an android phone actually work, as I don't put in my master pass on there at all afaik.

In mean time will grab the cookies. I'm very keen to use this library. Was thinking of making a xmpp gateway type thing so you can have hangup+hughdavenport-joesmith@yourdomain.com where hughdavenport is you, and joesmith is a contact you want to contact via hangups. This approach could work with group chats as well, and you could do this all with your own xmpp server and a gateway to hangouts! (very up in the air on this atm, but keen to work on it over the break).

Cheers,

Hugh

tdryer commented 9 years ago

There's a new auth implementation on the robobrowser-auth branch that might be more reliable. Switching to this branch will require a re-install because of dependency changes.

If it still doesn't work, try logging in from python -m hangups.auth and post the log output from stdout.

HenryHu commented 9 years ago

I hit the same problem that after entering the PIN, it says "second factor failed". After switching to robobrowser-auth it logged in successfully.

uriel1998 commented 9 years ago

Robobrowser worked for me as well.