AzureAD / microsoft-authentication-library-for-python

Microsoft Authentication Library (MSAL) for Python makes it easy to authenticate to Microsoft Entra ID. General docs are available here https://learn.microsoft.com/entra/msal/python/ Stable APIs are documented here https://msal-python.readthedocs.io. Questions can be asked on www.stackoverflow.com with tag "msal" + "python".
https://stackoverflow.com/questions/tagged/azure-ad-msal+python
Other
788 stars 194 forks source link

Does msal support 2FA Authentication #377

Closed AmitKulkarni9 closed 3 years ago

AmitKulkarni9 commented 3 years ago

Can we acquire a token for 2FA authentication

rayluo commented 3 years ago

You bet. Some APIs (auth code flow and interactive auth) naturally support 2FA during the interaction. It is more about what your app is, and what pattern it would use. You can probably find some sample from this "map".

AmitKulkarni9 commented 3 years ago

Thanks Ray. Can we get the token for 2MFA user having Password and then enter OTP without user interaction through MSAL ? End-to-end automation.

Regards, Amit

rayluo commented 3 years ago

In a sense, the "Desktop app" in the "map" is guiding user to sign in through browser, during which process the end user could be prompted to input password and complete 2FA.

Perhaps you can try first choose your app's scenario from the map, and then we discuss whether/how the corresponding sample does (not?) meet your requirement.