How to use Curl utility to trigerr the MFA authentication

Safura M 1 Reputation point
2022-07-27T08:07:31.617+00:00

Hi,

We have a tenant "ABC" and user say "xyz@harsh.com .com" created on the Azure active directory.
The user is enabled with MFA using per user "MFA" option in Azure AD.
When we use "AZ login" command by installing AZ command line on Linux machine it opens Mozilla browser and ask for the credentials to be entered. After the credentials are validated it sends MFA passcode to the registered mobile number and upon successful authentication it login the user to the account.
Currently all the stuff happens over the browser.
But we want to run curl utility which will takes the URL and user credentials and triggers the MFA and on successful authentication to post JSON or any form of output (but no browser opening).

Could you pls. let us know how can we achieve this using the curl utility communicating with Azure AD MFA ?

Thanks,
Safura M

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Carlos Solís Salazar 18,191 Reputation points MVP Volunteer Moderator
    2022-07-27T12:47:25.263+00:00

    Hi @Safura M

    Thank you for asking this question on the **Microsoft Q&A Platform. **

    I think that you can do it with one of these options:

    1. You can use Azure AD authentication methods API overview
    2. You can create an Azure AD application and service principal that can access resources

    Hope this helps,
    Carlos Solís Salazar

    ----------

    Accept Answer and Upvote, if any of the above helped, this thread can help others in the community looking for remediation for similar issues.
    NOTE: To answer you as quickly as possible, please mention me in your reply.


    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.