cevoaustralia / aws-google-auth

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

NoneType' object has no attribute 'text' Error (via CAPTCHA Based Login Only) #194

Closed bhargavamin closed 4 years ago

bhargavamin commented 4 years ago

I think the issue is back, many people from out organisation are also facing same issue again.

This time it’s mainly with the users trying to login using Captcha.

May be some thing changed Google side?

Error trace:

Captcha` (case insensitive): noustrumb
ERROR:root:'NoneType' object has no attribute 'text'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/aws_google_auth-0.0.36-py3.8.egg/aws_google_auth/__init__.py", line 78, in cli
    process_auth(args, config)
  File "/usr/lib/python3.8/site-packages/aws_google_auth-0.0.36-py3.8.egg/aws_google_auth/__init__.py", line 242, in process_auth
    google_client.do_login()
  File "/usr/lib/python3.8/site-packages/aws_google_auth-0.0.36-py3.8.egg/aws_google_auth/google.py", line 270, in do_login
    response_page = BeautifulSoup(sess.text, 'html.parser')
AttributeError: 'NoneType' object has no attribute 'text' 

Version 0.0.36 Python 3.8.3 and 3.8.0

Any ideas how to fix ?

Thanks in advance

Originally posted by @bhargavamin in https://github.com/cevoaustralia/aws-google-auth/issues/164#issuecomment-673332562

bhargavamin commented 4 years ago

I tried to reproduce this issue on my local system where I disabled all the following login options one-by-one and all at once from my Google account.

Also, used Python 3.8.5 and 3.7.7

But I never got a prompt for CAPTCHA.

So I wonder why there is a difference in Bgresponse from Google Auth when all the Google Accounts are apart of the same Organization and 2FA policies.

It would help to know when does Google asks for CAPTCHA Authentication and why.

Any explanations?

bhargavamin commented 4 years ago

The issue was fixed with latest release.