If your Microsoft account is set for two-factor authentication, you need to use the app password in order to interact with it. For more details, read the information provided on this webpage: Manage app passwords for two-step verification - Microsoft Support.
In this article, we show how to manage this Multi-factor authentication method using Office 365 Portal. Check it out!
Follow these instructions to create app passwords:
Sign in to your account → Go to the My Account page → Click "Security info"
Select "Add method" → choose "App password" from the list → Click "Add"
Enter a name for the app password, and then click "Next"
Copy the password from the "App password" page → Select "Done"
On the "Security info" page, make sure your app password is listed
After that, you may use the app password in place of your current Password. The login is still the same.