A cloud-based identity and access management service for securing user authentication and resource access
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.