Got "AADSTS50012: Authentication failed" error for BeginAuth API of Azure IDP

Yashwanth Lokam 51 Reputation points
2024-04-11T13:50:00.2366667+00:00

I am trying to do Azure login using Postman without using the MSAL libraries. I have done the authorize and login API's to get the multifactor authentication factors of the user and tried to hit the BeginAuth API by providing the below body. I have enabled per-user MFA authentication for user and enrolled for Microsoft Authenticator app.

{
    "AuthMethodId":"PhoneAppNotification", 
    "Method": "BeginAuth",    "ctx":"",
    "flowToken":""
}

I got Authentication failed response from the server.

{"Success":false,"ResultValue":null,"Message":"AADSTS50012: Authentication failed.","AuthMethodId":"PhoneAppNotification","ErrCode":50012,"Retry":false,"FlowToken":"","Ctx":"","SessionId":null,"CorrelationId":"","Timestamp":"","Entropy":0,"ReselectUIOption":0}

Response from the browser when Push notification works and user logins to Azure portal.

{
    "Success": true,
    "ResultValue": "Success",
    "Message": null,
    "AuthMethodId": "PhoneAppNotification",
    "ErrCode": 0,
    "Retry": false,
    "FlowToken": "",
    "Ctx": "",
    "SessionId": "",
    "CorrelationId": "",
    "Timestamp": "",
    "Entropy": 58,
    "ReselectUIOption": 0
}

I have removed all the sensitive data. Please assume that sensitive data is correct and let me know what is wrong and how to fix the issue. Any help is appreciated.

Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
6,812 questions
0 comments No comments
{count} votes

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.