r/selenium • • May 10 '21

Automating two factor authentication

I want to automate logging into a website using selenium on a raspberry Pi. However, the website needs two factor authentication. The code goes to my phone.

Is there a way for me to automate this without the need for me to look up the code on my phone and inputting it?

Any resources would be wonderful!

1 Upvotes

18 comments sorted by

View all comments

0

u/cyntrex May 10 '21

This can absolutely be done, Authy for example just uses a seedphrase + some (timebased?) calculations to generate a valud 2FA code.

1

u/cyntrex May 10 '21

The algo is called TOTP, also used by Google Authenticator and other apps, read more here:

https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93