cevoaustralia / aws-google-auth

Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
MIT License
537 stars 181 forks source link

ValueError: No JSON object could be decoded after solving CAPTCHA #139

Closed jtatum closed 5 years ago

jtatum commented 5 years ago

Getting "no JSON object could be decoded" on signin, using aws-google-auth 1.5. My account has a few two-factor options, including u2f, Google prompt, and authenticator (TOTP). I get a prompt to solve a captcha. If I fail to solve it, I get a message that says "Invalid captcha." If I solve it correctly, I get this output with debug enabled:

INFO:root:aws_google_auth: SAML cache not found
Google Password:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): accounts.google.com:443
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "GET /o/saml2/initsso?idpid=<IDP ID>&spid=<SP ID>&forceauthn=false HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "GET /ServiceLogin?passive=1209600&continue=https://accounts.google.com/o/saml2/initsso?idpid%3D<IDP ID>%26spid%3D<SP ID>%26forceauthn%3Dfalse%26from_login%3D1%26as%3DRzEnlnoBJuGnB3r40Hii9A&followup=https://accounts.google.com/o/saml2/initsso?idpid%3D<IDP ID>%26spid%3D<SP ID>%26forceauthn%3Dfalse%26from_login%3D1%26as%3DRzEnlnoBJuGnB3r40Hii9A&ltmpl=popup&oauth=1&sarp=1&scc=1 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "POST /signin/v1/lookup HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "POST /signin/challenge/sl/password HTTP/1.1" 200 None
Please visit the following URL to view your CAPTCHA: https://accounts.google.com/Captcha?v=2&ctoken=AAWk9lSp21SXsG4YsTH5Ajf8rC7JLPKn1VIMgMlV-qgHOplHZ1aIEE5qUvlnXGYJfJK-CSG5-oHDxuLG-u6vKVwahGYfbSogSr6a5zG7iF-SYzEJ_bXPu8E7M_uDEs-DGNtl8AuhcIOEFW8BNttP7nH5WwZGoAutAYxjObu67RvfDQyaTRyHWb45orn7HF7vCLiv-2vRK8E4
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): accounts.google.com:443
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "GET /Captcha?v=2&ctoken=AAWk9lSp21SXsG4YsTH5Ajf8rC7JLPKn1VIMgMlV-qgHOplHZ1aIEE5qUvlnXGYJfJK-CSG5-oHDxuLG-u6vKVwahGYfbSogSr6a5zG7iF-SYzEJ_bXPu8E7M_uDEs-DGNtl8AuhcIOEFW8BNttP7nH5WwZGoAutAYxjObu67RvfDQyaTRyHWb45orn7HF7vCLiv-2vRK8E4 HTTP/1.1" 200 None
Captcha (case insensitive): lectiesi
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "POST /signin/challenge/sl/password HTTP/1.1" 302 539
DEBUG:urllib3.connectionpool:https://accounts.google.com:443 "GET /signin/challenge/sk/4?continue=https%3A%2F%2Faccounts.google.com%2Fo%2Fsaml2%2Finitsso%3Fidpid%3D<IDP ID>%26spid%3D<SP ID>%26forceauthn%3Dfalse%26from_login%3D1%26as%3DRzEnlnoBJuGnB3r40Hii9A&sarp=1&scc=1&checkedDomains=youtube&pstMsg=0&TL=APDPHBANbcrgRe8TPhm0-5zwOuToc-z2CAhZr4XF39EJ16dQJt5WOLaPQaoDWXIO HTTP/1.1" 200 None
ERROR:root:No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/aws_google_auth/__init__.py", line 72, in cli
    process_auth(args, config)
  File "/usr/local/lib/python2.7/site-packages/aws_google_auth/__init__.py", line 212, in process_auth
    google_client.do_login()
  File "/usr/local/lib/python2.7/site-packages/aws_google_auth/google.py", line 259, in do_login
    sess = self.handle_sk(sess)
  File "/usr/local/lib/python2.7/site-packages/aws_google_auth/google.py", line 364, in handle_sk
    challenges = json.loads(challenges_txt)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
jtatum commented 5 years ago

Looks like this is a dupe of #128