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

Cannot authenticate with Google, won't redirect to challenge page #184

Open
james-welly opened this issue Apr 21, 2020 · 9 comments
Open

Comments

@james-welly
Copy link

james-welly commented Apr 21, 2020

Have been using the docker image with this repo to authenticate with Google for some time. As of yesterday it stopped working with the following error message:

ERROR:root:'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/build/aws_google_auth/__init__.py", line 78, in cli
    process_auth(args, config)
  File "/build/aws_google_auth/__init__.py", line 242, in process_auth
    google_client.do_login()
  File "/build/aws_google_auth/google.py", line 235, in do_login
    passwd_challenge_url = 'https://accounts.google.com' + form.get('action')
AttributeError: 'NoneType' object has no attribute 'get'

I have removed the image and downloaded the latest version and still get the error. I have also created a virtual environment with the latest python packages and run the following command and still no joy.

aws-google-auth -k -p ${AWS_PROFILE_NAME} -I ${GOOGLE_IDP_ID} -S ${GOOGLE_SP_ID} -R ${AWS_DEFAULT_REGION} --resolve-aliases -q

I have exported the challenge page to html (attached). Everyone else in my organisation is still able to use the repo to authenticate. Any thoughts? It appears to be a similar comments in #160

Screenshot 2020-04-21 at 10 49 56

out2.html.zip

@dgcgh
Copy link

dgcgh commented Apr 22, 2020

I'm seeing a similar error that looks like this:
ERROR:root:'NoneType' object has no attribute 'get' Traceback (most recent call last): File "/home/davidgcheney/.local/lib/python3.7/site-packages/aws_google_auth/__init__.py", line 76, in cli process_auth(args, config) File "/home/davidgcheney/.local/lib/python3.7/site-packages/aws_google_auth/__init__.py", line 233, in process_auth google_client.do_login() File "/home/davidgcheney/.local/lib/python3.7/site-packages/aws_google_auth/google.py", line 238, in do_login passwd_challenge_url = 'https://accounts.google.com' + form.get('action') AttributeError: 'NoneType' object has no attribute 'get'
Screenshot 2020-04-22 at 12 53 55

I have multple accounts and profiles and strangely this is consistent for one of those accounts while the other one works properly. Guessing it's bot detection, but this is very frustrating.

@Zlender
Copy link

Zlender commented Apr 23, 2020

I'm seeing same error

ERROR:root:'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-google-auth/0.0.35/libexec/lib/python3.8/site-packages/aws_google_auth/__init__.py", line 76, in cli
    process_auth(args, config)
  File "/usr/local/Cellar/aws-google-auth/0.0.35/libexec/lib/python3.8/site-packages/aws_google_auth/__init__.py", line 233, in process_auth
    google_client.do_login()
  File "/usr/local/Cellar/aws-google-auth/0.0.35/libexec/lib/python3.8/site-packages/aws_google_auth/google.py", line 235, in do_login
    passwd_challenge_url = 'https://accounts.google.com' + form.get('action')
AttributeError: 'NoneType' object has no attribute 'get'

I can't seem to find a way around it.

@tlvince
Copy link

tlvince commented Apr 28, 2020

Duplicate of #179

@stevemac007
Copy link
Contributor

Is this resolved with the latest build 0.0.36 which has the fixed for captcha.

Please let us know if this resolves your issue.

@williamcoates
Copy link

My whole team is getting this error with 0.0.36
Screenshot 2020-09-16 at 10 35 59

@Frietziek
Copy link

Frietziek commented Sep 24, 2020

Hello, I'm getting the same problem @james-welly. Do you find any solution to it?

I'm not familiar with the code base of the project, but looking quickly I can see that the problem is here, in google.py file:

        if challenge_page.find('form', {'id': 'gaia_loginform'}):
            form = challenge_page.find('form', {'id': 'gaia_loginform'})
            passwd_challenge_url = form.get('action')
        else:
            # sometimes they serve up a different page
            logging.info("Handling new-style login page")
            form = challenge_page.find('form', {'id': 'challenge'})
            passwd_challenge_url = 'https://accounts.google.com' + form.get('action')

form doesn't get any value. It look like the webscrapping is failing, I'm not sure how to help tough @stevemac007

@Frietziek
Copy link

Frietziek commented Oct 25, 2020

Not sure if it helps someone, but in my case, the problem seem to be that at my company we are using something called MobileIron as second factor authentication with our smarthphone, and when aws-google-auth code is doing this on google.py:

# POST to account login info page, to collect profile and session info
sess = self.post(account_login_url, data=payload)

It is getting this html:
image

Which doesn't have the following expected form:

form = challenge_page.find('form', {'id': 'challenge'})
passwd_challenge_url = 'https://accounts.google.com' + form.get('action')

So it breaks:

ERROR:root:'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/aws_google_auth/__init__.py", line 78, in cli
    process_auth(args, config)
  File "/usr/local/lib/python3.8/dist-packages/aws_google_auth/__init__.py", line 242, in process_auth
    google_client.do_login()
  File "/usr/local/lib/python3.8/dist-packages/aws_google_auth/google.py", line 235, in do_login
    passwd_challenge_url = 'https://accounts.google.com' + form.get('action')
AttributeError: 'NoneType' object has no attribute 'get'

@rama3319
Copy link

rama3319 commented Apr 26, 2022

My whole team started getting below error with aws-google-auth. We tried resetting cookies, uninstalled & installed aws-google-auth but did not help. Can some please shed some light on it. It was working fine until yesterday.
image

@rmirandarj
Copy link

My whole team started getting below error with aws-google-auth. We tried resetting cookies, uninstalled & installed aws-google-auth but did not help. Can some please shed some light on it. It was working fine until yesterday. image

I was getting the same problem, but I just added this flag --bg-response js_enabled, running the latest version of aws-google-auth (0.0.38).

aws-google-auth --bg-response js_enabled

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

No branches or pull requests

9 participants