How to solve AADSTS50158 error when using Username and Password authentication for Office365 Scope.
Issue description:
When using the username and password as authentication method for the Microsoft Office365 Scope, the following error appears:
"AADSTS50158: External security challenge not satisfied. User will be redirected to another page or authentication provider to satisfy additional authentication challenges."
Resolution:
The username and password authentication method does not work with MFA.
In order to resolve this issue, reach out to your Azure (Entra ID) admin to disable MFA for the account.
Note: Username and password authentication is not recommended and should only be used for Legacy reasons (it goes against the principles of modern authentication).