How to programatically generate Bearer Token using Azure AD when Multifactor Authentication is enabled

Viewed 1868

I am following the example https://github.com/Azure-Samples/active-directory-dotnet-native-headless to authenticate a user against Azure AD in which the user sends his user credentials (uname,pwd) to acquire a bearer access Token(grant_type set to password). This token will be sent in the Authorization header to the internal Rest API. The REST API uses the token to get the details of the user using ClaimPrincipal and to authorize the user against AD Security group using Graph-API.

Now the problem is, we have Multi factor authentication (MFA) enabled, in this case how shall I able to generate the Token using Azure Oath APIs and get the above program to work.

0 Answers
Related