-
Notifications
You must be signed in to change notification settings - Fork 100
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
Support 2FA for Android users #11
Conversation
Support 2FA (Two factor authentication) for Android users using google web messages.
@@ -119,12 +136,12 @@ def new_chrome_driver(driver_path, headless: bool = True): | |||
options.add_argument('--no-sandbox') | |||
options.add_argument('--ignore-ssl-errors=yes') | |||
options.add_argument('--ignore-certificate-errors') | |||
options.add_argument("--remote-debugging-port=9222") | |||
#options.add_argument("--remote-debugging-port=9222") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I'm wondering - why are you commenting this one out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I had to do this because when creating a second instance of web driver, that port was used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to resolve it properly.
Hey @gmcmicken - would you be okay if I introduced these changes on a branch made off master, instead of your fork? I'm thinking to implement a few more tweaks in the logic to reduce complexity while we introduce the 2FA handlers. I'd still credit you as the contributor of the changes you introduced. No worries if not, I can push this in anyhow and do further tweaks later if needed. |
|
||
two_factor_el = driver.find_elements_by_id(_TWO_FAC_EL_ID) | ||
|
||
if two_factor_el: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we'll need to tweak this logic. The 'chlginput' element is visible on the page all the time, therefore checking for it does not indicate whether 2FA was requested. Any idea what else changes when 2FA is requested? I can't reproduce it on my end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay we can do this I think
if two_factor_el[0].is_displayed():
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice suggestion!
And how could we go over this bit?
two_factor_input_present = EC.presence_of_element_located((By.ID, var.TWO_FAC_EL_ID))
WebDriverWait(driver, var.OAUTH_TIMEOUT).until(AnyEc(success_present, two_factor_input_present))
Here it is checking for presence of chlginput
which is present at that point already. Ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I think I got it: element of id twofactbase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got this sorted 👍
@gmcmicken I've got the PR with the implementation ready: #12 🎉! Could I ask you to try it out whenever you'd have some time? This is the branch: Thanks! 😊 |
@gmcmicken thanks for this contribution! I had used it briefly last year to test with my live account, now I come to try it this year and it is not working. The process gets to the stage where it is supposed to give me a URL which generates a QRC. I get the SMS with the code, but the command window just sits in this state indefinitely. Any idea what it could be? |
Support 2FA (Two factor authentication) for Android users using google web messages.