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

Any ideas on handling 2FA? #251

Open
drjimmyjiang opened this issue May 28, 2024 · 2 comments
Open

Any ideas on handling 2FA? #251

drjimmyjiang opened this issue May 28, 2024 · 2 comments

Comments

@drjimmyjiang
Copy link

The website I need to interact with will be introducing mandatory 2FA. Are there any clever ways on handling 2FA? There is a feature to trust the computer you're logging on from for 30 days, but now sure how this would be relevant to running the selenium script on AWS. Any guidance would be much appreciated!

@wigeria
Copy link

wigeria commented Jun 17, 2024

This isn't really related to this project, but depending on how your particular site is handling that 30 day session (I'm assuming with cookies?), you could technically do a manual login once a month, store those cookies in S3, load those inside the Lambda function and plug those into Selenium on init.

There are other methods based on the type of 2FA as well. For example, if the 2FA is via SMS, you could look into getting a Twilio (or another service) number and receive the 2FA there, which could then fire a webhook to do put it somewhere the Lambda function could read from.

@timvy
Copy link

timvy commented Aug 1, 2024

You could use pyotp, add the OTP secret with pyotp.parse_uri and then generate the OTP just before you need to fill it in.
Works for me.
https://medium.com/@olutomilayodolapo/how-to-retrieve-otp-from-authy-google-authenticator-with-python-53544575bcef

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

No branches or pull requests

3 participants