Googe account login with Selenium on Chrome or FireFox

BlackxHat

Power Member
Joined
Oct 6, 2009
Messages
729
Reaction score
89
Every time i try to login with selenium on either browser, it asks for 2FA verification.

Does anyone know a way to by pass the 2FA verification? Please post the code
 
Disable 2FA in your google account and make sure your account allow access to less secure apps
 
There are also services that will solve them for you. It's not too hard to integrate and very cheap. Search for 2captcha.
 
Disable 2FA in your google account and make sure your account allow access to less secure apps

The selenium script can now login after I did that. But now will i need to always have the 2FA off? I guess the only thing i can do now is just to have a really strong password in order to keep my account safe?
 
...2FA verification.

Whoops. I don't know how I read Captcha from that. Ignore my prev comment. Lol.

The selenium script can now login after I did that. But now will i need to always have the 2FA off? I guess the only thing i can do now is just to have a really strong password in order to keep my account safe?

Selenium or any other automation library is simply doing the same things that a human would normally do. If you have 2FA enabled on your account, then it's going to show 2FA to any user (or automation) that tries to log in. That being said, you could incorporate 2FA handling into your system:

1) Set up a Twilio number to receive 2FA.
2) Forward the messages from this number to your phone so that it still works for normal use.

Then have your system:

3) Visit the site and log in.
4) Poll the Twilio API for 2FA messages.
5) Enter the 2FA and continue on normally.

This seems ridiculously complicated though. I would just use a strong password.
 
Last edited:
Back
Top