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

Fix lost bg_response option #251

Closed johngrib closed 2 years ago

johngrib commented 2 years ago

249

https://github.com/cevoaustralia/aws-google-auth/issues/248#issuecomment-1102707053

I too suffered from the same problem.

And I found that js_enabled can solve the NoneType problem.

So, if I use this command, it proceeds normally until to input captcha.

aws-google-auth \
  -u johngrib.lee@greenlabs.co.kr \
  -R ap-northeast-2 \
  -I C.... \
  -S 8.... \
  -p sinsun-backend \
  -d 3600 \
  --bg-response js_enabled

However, from then on, the NoneType error occurs again because js_enabled has lost.

image

So I tried to re-enter the js_enabled value in the payload, and the problem was solved.

Renjie-d1g1t commented 2 years ago

I added js_enabled, however it is still giving me errors like below :

-k -p default --bg-response js_enabled Google Password: Please visit the following URL to view your CAPTCHA: https://accounts.google.com/Captcha?v=2&ctoken=AAWk9lSXXahGTVie5CcbJlEpHwsscQjYaV4eFjsABMY_PV8PuYopQgzxhxfDOBj98yyP6wQqCAlA8l3VzTt_uTQL7K8MrDcK-Kgx1GYzxHsKyllTJak57rP7kiADvsAkRWrVRkaf0__DygWyieK7TobPkjKiiDdyhAd3Tc5eU5Z9Q9N5KATiBH4 Captcha (case insensitive): ducarnshes ERROR:root:'NoneType' object has no attribute 'find_all' Traceback (most recent call last): File "C:\Users\Renjie Li\Downloads\Anaconda\lib\site-packages\aws_google_authinit.py", line 79, in cli process_auth(args, config) File "C:\Users\Renjie Li\Downloads\Anaconda\lib\site-packages\aws_google_authinit.py", line 243, in process_auth google_client.do_login() File "C:\Users\Renjie Li\Downloads\Anaconda\lib\site-packages\aws_google_auth\google.py", line 291, in do_login sess = self.handle_captcha(sess, payload) File "C:\Users\Renjie Li\Downloads\Anaconda\lib\site-packages\aws_google_auth\google.py", line 432, in handle_captcha for tag in form.find_all('input'): AttributeError: 'NoneType' object has no attribute 'find_all'

wbrgss commented 2 years ago

@Renjie-d1g1t I recommend patching your local installation of aws-google-auth with ezequielsbarros's solution, at least until his PR https://github.com/cevoaustralia/aws-google-auth/pull/250 is merged. This, combined with the --bg-response js_enabled option, solved the problem for me.

Renjie-d1g1t commented 2 years ago

@Renjie-d1g1t I recommend patching your local installation of aws-google-auth with ezequielsbarros's solution, at least until his PR #250 is merged. This, combined with the --bg-response js_enabled option, solved the problem for me.

hey man thanks for sharing ! Yes I did add --bg-response js_enabled to the end of the command, before it I didnt even get the captcha,and now I can get it. but after filling the captcha, the error continued to occur.

wbrgss commented 2 years ago

@Renjie-d1g1t In addition to adding that option, you need to patch your local installation of aws-google-auth with @ezequielsbarros' code. You need to edit the google.py on your computer with his change. It's a bugfix that hasn't been merged/released yet.

Renjie-d1g1t commented 2 years ago

@Renjie-d1g1t In addition to adding that option, you need to patch your local installation of aws-google-auth with @ezequielsbarros' code. You need to edit the google.py on your computer with his change. It's a bugfix that hasn't been merged/released yet.

really appreciate for the explanation, finally got it worked !!!! a lot of thanks man!!

johngrib commented 2 years ago

A similar PR already exists, so close this PR.

https://github.com/cevoaustralia/aws-google-auth/pull/250