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

Support 2FA for Android users #11

Closed
wants to merge 1 commit into from
Closed

Conversation

gmcmicken
Copy link
Contributor

Support 2FA (Two factor authentication) for Android users using google web messages.

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")
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@Voyz
Copy link
Owner

Voyz commented Feb 16, 2021

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:
Copy link
Owner

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.

Copy link
Contributor Author

@gmcmicken gmcmicken Feb 16, 2021

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():

Copy link
Owner

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?

Copy link
Owner

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got this sorted 👍

@Voyz
Copy link
Owner

Voyz commented Feb 16, 2021

@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:
https://github.com/Voyz/ibeam/tree/feature/2fa-addition

Thanks! 😊

@Voyz Voyz closed this in #12 Jun 21, 2021
@alquantica
Copy link

@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?

Capture

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

Successfully merging this pull request may close these issues.

None yet

3 participants