An idea to support 2FA (Two factor authentication) for Android users
See original GitHub issueOkay so I was going to hack in a text message 2FA like here, however it would be nice to have this natively supported so I looked into android / google’s web messages system messages.google.com/web, and it looks like we could do this not so difficultly by using the chrome driver to load up messages.google.com/web , save the screenshot and output the file location to the user to open, then they would use their phone to “pair” the device (IBeam) with the QR code. This would keep working for quite some time through many logins, each new login attempt will trigger an sms code and the webdriver would load conversations and get the latest one automatically.
My pseudo code would be
if element exists 2fa:
if device not paired:
driver.get(web sms url) driver.save_screenshot
output log filepath
wait for pair
set device paired true
else
driver.get(web sms url)
traverse conversation list, look for "your authentication code"
set form 2fa = code
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (15 by maintainers)
Top Results From Across the Web
The 6 best 2FA apps on Android
Two -factor authentication helps keep your data private. Here our favorite 2FA apps.
Read more >8 Best Two-Factor (2FA) Authentication Apps to Protect Your ...
The most popular two-factor authentication program is Google Authenticator. This is an app to be installed on your mobile phone, and it gives...
Read more >The Best Two-Factor Authentication App of 2022
After interviewing three experts and testing seven apps, we think Authy is the best two-factor authentication app.
Read more >Multi-Factor Authentication: Who Has It and How to Set It Up
Here's how to secure your online accounts with multi-factor authentication (MFA), aka two-factor authentication (2FA).
Read more >Turn on 2-Step Verification - Android - Google Account Help
With 2-Step Verification, also called two-factor authentication, you can add an extra layer of security to your account in case your password is...
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
They broke it, I’ve been running it today with the fixes, so far so good!
Wow @gmcmicken that’s a fantastic contribution! 👏🙌 I greatly appreciate your time you put into developing and submitting this, it puts us all on the right path to solving the 2FA problem.
I’d totally introduce the changes you proposed, although I feel it would be useful to nonetheless abstract the way the 2FA code is being provided. So that everything between lines 201 and 234 in your PR would be abstracted in some way that other users could override with their own method - should they for instance use the method described in #8 using twilio - as well as for potential alternatives natively supported in IBeam in the future.
Making this a passed parameter would ease testing and overriding this method, eg:
Then we’d define the accessor you propose as
ibeam/accessors_2fa/google_msg_accessor.py
:Then we’d call it like this:
Something along these lines, although I’m just hypothesising here - we could figure out how to make using other
some_other_2fa_accessor
more reasonable too. What do you recon?In either case, once again thanks for your input - very useful! 😊