'How do I get an email bot past 2-step authentication?
I am trying to set up a bot that is capable of sending emails from my outlook account. I am using python on repl.it with imapclient. I can get it to work with a standard gmail account but the problem is that my outlook account has 2-step verification and requires me to allow it on my phone, because it is a school email I cannot disable the 2 step verification. I know my username and password but cannot get the bot past 2-step. If anyone knows how to get a bot logged into the email even with 2-step enabled any help would be greatly appreciated!
Solution 1:[1]
Instead of trying to bypass the bot (and assume that you cannot), use the correct authentication approach:
As with most service providers with 2FA, set up an App Password which allows using a different generated password for such apps.
Read Using app passwords with apps that don't support two-step verification.
Another option is to provide your app with your 2FA token which you see when setting up 2FA (or set it up again). Then use an HOTP generator which will provide the correct entry code using the given token and the current time. But this is more effort than it's worth, and requires providing account details to your app which is unnecessary. Use App Passwords.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
