'https://graph.microsoft.com/v1.0/me' Api 404 with code=ErrorUserResolutionFailedUserDoesNotExist

Vitalii Batuchenko 5 Reputation points
2023-09-11T12:04:00.5533333+00:00

We use microsoft authentication on our website. If the user selects an account at https://login.microsoftonline.com/common/oauth2/v2.0/authorize that exists in the Microsoft system, we have the correct behavior. But if the user creates microsoft account at https://login.microsoftonline.com/common/oauth2/v2.0/authorize page, we get a 404 with code=ErrorUserResolutionFailedUserDoesNotExist in the request 'https://graph.microsoft.com/v1.0/me' after return to our website.

Recent requests in this flow:

  1. https://login.live.com/oauth20_authorize.srf 302 to our web page
  2. Our backend gets an access token by code https://login.microsoftonline.com/common/oauth2/v2.0/token
  3. Our backend makes a request to https://graph.microsoft.com/v1.0/me with the access token, that we got in step 2, to get the user information.
  4. https://graph.microsoft.com/v1.0/me return 404 with response body:
{
    "error":{
        "code":"ErrorUserResolutionFailedUserDoesNotExist",
        "message":"ProfileException",
        "innerError":{
            "timestamp":"2023-08-22T15:47:13.1089064Z",
            "request-id":"640caa11-7315-4172-8179-46bc9c62df22",
            "date":"2023-08-22T15:47:13",
            "client-request-id":"640caa11-7315-4172-8179-46bc9c62df22"
        }
    }
}
Microsoft Entra
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. 2023-09-12T17:40:31.28+00:00

    Hello @Vitalii Batuchenko , I understand the ErrorUserResolutionFailedUserDoesNotExist error is beig met after a user has created a personal account . The aforementioned error may happen due to the data not yet being available. Workaround is to read claims form an id or access token or to poll the endpoint until it is available.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.


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.