Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SoulSen opened this issue Jan 12, 2019 · 5 comments
Open

Comments

@SoulSen
Copy link
Contributor

SoulSen commented Jan 12, 2019

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.

@das7pad
Copy link
Contributor

das7pad commented Jan 13, 2019

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

@SoulSen
Copy link
Contributor Author

SoulSen commented Jan 13, 2019

@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```

@tdryer
Copy link
Owner

tdryer commented Jan 15, 2019

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.

@SoulSen
Copy link
Contributor Author

SoulSen commented Jan 16, 2019

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

@Terrance
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants