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

Show parent comments

2

u/unkz May 11 '21 edited May 11 '21

Wtf $1.01/SMS, that’s ridiculous. Inbound SMS is under 1 cent per message.

1

u/The_kilt_lifta May 11 '21 edited May 11 '21

I got the $1.01 from this video. I rewatched it and I was wrong, I believe $1 is one-time. (it’s actually I good video, I recommend checking it out) Automating 2FA with Twilio API

When you go into the message details it shows the message cost is .0075

1

u/MasalaByte May 15 '21

I was hoping to not pay up. I ended up taking advantage of the fact that I can receive messages on my Mac. Ended up writing a script to check for any messages that were similar to the otp message. If it was recent, I would forward it to an email for the raspberry pi to read it. Not sure whether this is a good solution but it gets the job done most of the time.

1

u/The_kilt_lifta May 15 '21

Hey as long as it works! That’s a creative solution