Microsoft Login - Not able to receive response from Microsoft sometimes when MFA is enabled

Ramya Reddy 6 Reputation points
2022-07-28T16:03:12.66+00:00

In our react native app, we have enabled Microsoft authentication using WebView. While authenticating, we collect the parameters such as "code" in the URL ( https://login.microsoftonline.com/common/oauth2/v2.0/authorize). Using those parameters we authenticate the app. But when MFA is enabled, sometimes we don't receive the required params in the URL.

Steps to replicate:

  1. After entering the username and password, the authenticator app sends a notification asking to approve the login.
  2. Instead of clicking the notification button - "Approve", open the authenticator app leaving the current app.
  3. Approve the login and navigate back to the previous app.

App remains as it is, without any parameters added.

What do we expect?
After the above steps are followed, the required parameters need to be added to the URL in order to authenticate.

Additional details:

URL Changes that we are tracking on our end (if needed):

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Authenticator

3 answers

Sort by: Oldest
  1. AmanpreetSingh-MSFT 56,386 Reputation points Moderator
    2022-08-03T10:39:46.977+00:00

    HI @Ramya Reddy • Thank you for reaching out.

    When MFA is not enabled, the code is directly returned in response to the call at https://login.microsoftonline.com/common/login endpoint and based on the response_mode=query parameter, it is sent as URL parameter to the redirect_URI.

    However, when MFA is enabled, after the call at https://login.microsoftonline.com/common/login, a call to the below endpoints happens to perform MFA:

    https://login.microsoftonline.com/common/SAS/BeginAuth  
    https://login.microsoftonline.com/common/SAS/EndAuth  
    https://login.microsoftonline.com/common/SAS/ProcessAuth  
    

    Once the MFA is done, the code should be sent at the redirect_uri. In your case, when the code is being returned, I am suspecting that the response is not successfully returned from these endpoints.

    I would suggest you capture a Fiddler trace to see what response you are getting from the above endpoints and based on that we can help identify the cause of the issue.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    9 people found this answer helpful.

  2. Jemuel angafor 0 Reputation points
    2026-11-23T18:44:31.6666667+00:00

    Was this answer helpful?

    0 comments No comments

  3. Jemuel angafor 0 Reputation points
    2026-11-23T18:44:52.0233333+00:00

    Was this answer helpful?

    0 comments No comments

Your answer

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