hangups icon indicating copy to clipboard operation
hangups copied to clipboard

get_auth & get_auth_stdin stuck at email prompt + manual stuck at loading

Open SoulSen opened this issue 6 years ago • 5 comments

I'm not sure how I'm supposed to fix this tried pdb but I can't get any debug info of it since it's stuck or something.

SoulSen avatar Jan 12 '19 22:01 SoulSen

We are using the stdlib logging module. And you should see debug information on the logging level DEBUG.

Add this on top of your entry point (the script you pass to $ python3 ...) and choose one config:

import logging

# use the name passed to `logging.getLogger(...)`
# 2019-01-13 09:38:27,942 DEBUG __main__: Message
logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s %(levelname)s %(name)s: %(message)s",
)

# or

# use the path and line which called the logging method.
# 2019-01-13 09:39:07,787 DEBUG /tmp/demo.py:13: Message
logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s %(levelname)s %(pathname)s:%(lineno)d: %(message)s",
)

# your code goes here

das7pad avatar Jan 13 '19 08:01 das7pad

@das7pad

2019-01-13 09:37:55,373 INFO hangups.auth: Loading refresh_token from 'file.txt'
2019-01-13 09:37:55,376 DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): accounts.google.com:443
2019-01-13 09:38:17,399 DEBUG urllib3.connectionpool: https://accounts.google.com:443 "POST /o/oauth2/token HTTP/1.1" 400 None
2019-01-13 09:38:17,400 INFO hangups.auth: Failed to authenticate using refresh token: Token request failed: 400 Client Error: Bad Request for url: https://accounts.google.com/o/oauth2/token
2019-01-13 09:38:17,401 INFO hangups.auth: Authenticating with credentials
2019-01-13 09:38:17,468 DEBUG urllib3.connectionpool: https://accounts.google.com:443 "GET /o/oauth2/programmatic_auth?scope=https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthLogin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&client_id=936475272427.apps.googleusercontent.com HTTP/1.1" 302 0
2019-01-13 09:38:17,573 DEBUG urllib3.connectionpool: https://accounts.google.com:443 "GET /ServiceLogin?passive=1209600&continue=https://accounts.google.com/o/oauth2/programmatic_auth?scope%3Dhttps://www.google.com/accounts/OAuthLogin%2Bhttps://www.googleapis.com/auth/userinfo.email%26client_id%3D936475272427.apps.googleusercontent.com%26from_login%3D1%26as%3DyyaBht7uz7HC2jDdDDTmsA&followup=https://accounts.google.com/o/oauth2/programmatic_auth?scope%3Dhttps://www.google.com/accounts/OAuthLogin%2Bhttps://www.googleapis.com/auth/userinfo.email%26client_id%3D936475272427.apps.googleusercontent.com%26from_login%3D1%26as%3DyyaBht7uz7HC2jDdDDTmsA&ltmpl=embedded&oauth=1&sarp=1&scc=1 HTTP/1.1" 200 None
Sign in with your Google account:
Email: [VALID EMAIL]
2019-01-13 09:38:36,170 INFO hangups.auth: Submitting form on page 'https://accounts.google.com/ServiceLogin'
2019-01-13 09:38:36,172 INFO hangups.auth: Page contains forms: ['gaia_loginform']
2019-01-13 09:38:36,174 INFO hangups.auth: Page contains inputs: [None, None, None, None, None, None, None, None, None, 'profile-information', 'session-state', None, '_utf8', 'bgresponse', 'Email', 'Passwd-hidden', 'next']
2019-01-13 09:38:36,284 DEBUG urllib3.connectionpool: https://accounts.google.com:443 "POST /signin/v1/lookup HTTP/1.1" 200 None```

SoulSen avatar Jan 13 '19 17:01 SoulSen

Google may be prompting for something that hangups doesn't expect. If you can't get it to working, I recommend using the manual login method instead.

tdryer avatar Jan 15 '19 05:01 tdryer

@tdryer The problem is, I want to be creating an app with this library

SoulSen avatar Jan 16 '19 02:01 SoulSen

Then you need to expose a method for users to complete the manual auth method in the app, or ask that they do this separately (e.g. hangups -m auth) and pass your app the token file.

Google is making the login form increasingly difficult to automate, so automatic login is probably best not relied on.

Terrance avatar Jan 16 '19 09:01 Terrance