Crashing on missing <input> value
See original GitHub issueI saw this while trying to auth today:
ERROR:root:'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/build/aws_google_auth/__init__.py", line 79, in cli
process_auth(args, config)
File "/build/aws_google_auth/__init__.py", line 243, in process_auth
google_client.do_login()
File "/build/aws_google_auth/google.py", line 325, in do_login
sess = self.handle_prompt(sess)
File "/build/aws_google_auth/google.py", line 621, in handle_prompt
response_page.find('input', {
AttributeError: 'NoneType' object has no attribute 'get'
The code in question:
Running with --save-flow, I looked in aws-google-auth-2021-01-29T001110/ac.go.com~o~saml2~initsso_2.html
and found that I was missing an for checkedDomains
and pstMsg
:
<input type="hidden" name="" value="">
<input type="hidden" name="gxf" value="...">
<input type="hidden" name="continue" value="...">
<input type="hidden" name="followup" value="...">
<input type="hidden" name="ltmpl" value="popup">
<input type="hidden" name="scc" value="1">
<input type="hidden" name="sarp" value="1">
<input type="hidden" name="oauth" value="1">
<input type="hidden" name="faa" value="1">
<input id="profile-information" name="ProfileInformation" type="hidden" value="">
<input id="session-state" name="SessionState" type="hidden" value="...">
<input name="flowName" type="hidden" value="...">
<input type="hidden" id="_utf8" name="_utf8" value="☃"/>
<input type="hidden" name="bgresponse" id="bgresponse" value="js_disabled">
I got past this locally by skipping over those fields:
diff --git a/aws_google_auth/google.py b/aws_google_auth/google.py
index 398eff5..6b35966 100644
--- a/aws_google_auth/google.py
+++ b/aws_google_auth/google.py
@@ -561,6 +561,7 @@ class Google:
return self.post(challenge_url, data=payload)
def handle_prompt(self, sess):
response_page = BeautifulSoup(sess.text, 'html.parser')
challenge_url = sess.url.split("?")[0]
@@ -616,16 +617,8 @@ class Google:
response_page.find('input', {
'name': 'sarp'
}).get('value'),
- 'checkedDomains':
- response_page.find('input', {
- 'name': 'checkedDomains'
- }).get('value'),
'checkConnection':
'youtube:1295:1',
- 'pstMsg':
- response_page.find('input', {
- 'name': 'pstMsg'
- }).get('value'),
'TL':
response_page.find('input', {
'name': 'TL'
@@ -642,6 +635,14 @@ class Google:
}).get('value'),
'TrustDevice':
'on',
}
return self.post(challenge_url, data=payload)
Which got me credentials, and they work, but I don’t know what I’m doing when I skip adding those fields to the request, nor can I speak to why they’re not in the payload Google handed back to me today.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Program crashes when no value is entered - Stack Overflow
I have created a program and have come across a problem. when I debug the program and don't enter a value e.g. a...
Read more >Missing tablet input app causing (easyanticheat protected)
Missing tablet input app causing (easyanticheat protected) games to crash. I have unistalled the tablet input app when debloating my os.
Read more >Crash on clear time input value · Issue #1670 - GitHub
Open DatePicker popup Click on the clear button in the time input (or enter invalid value use 'delete' or 'backspace' buttons)
Read more >How to Prevent Android App From Crashing Due to Invalid Input
0:00 Talking about the video topic1:09 Creating the if-statement to prevent invalid input from being parsed2:33 Using the if-statement with ...
Read more >Detect and diagnose crashes - Android Developers
There are many situations that can cause a crash in your app. Some reasons are obvious, like checking for a null value or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have also run into the same problem with the most recent 0.0.37 version.
Confirming @LucasSymons’s post, I was having the same problem. Downgraded to version 0.0.36 and it worked.