Unable to retrieve photos from the Graph API

Jaspreet Bakshi 6 Reputation points
2021-12-21T16:47:24.117+00:00

Our app uses the following link to obtain photos from the Graph API.

https://graph.microsoft.com/beta/users/USER_ID/photo/$value

and this was working well until recently. 3-4 days ago we noticed that guest users in our Azure AD no longer have access to any profile images in the system, and get the following error:

{
    "error": {
        "code": "UnknownError",
        "message": "{\r\n  \"errorCode\": \"ErrorAccessDeniedForUser\",\r\n  \"message\": \"Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileUnauthorizedException' was thrown.\",\r\n  \"target\": null,\r\n  \"details\": null,\r\n  \"innerError\": null,\r\n  \"instanceAnnotations\": []\r\n}",
        "innerError": {
            "date": "2021-12-21T14:25:36",
            "request-id": "9684bb8a-c2d9-4ecc-a97c-e2ea683038d6",
            "client-request-id": "9684bb8a-c2d9-4ecc-a97c-e2ea683038d6"
        }
    }
}

"Regular" users are still able to access the profile images, it is just the guest users who cannot.

We also tried the same with the new, non-beta endpoint

https://graph.microsoft.com/v1.0/users/USER_ID/photo/$value

But we get the same result. We know that this was working until recently but no longer does.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,981 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 41,941 Reputation points
    2021-12-22T02:41:15.267+00:00

    Hi @Jaspreet Bakshi

    It should be that the default access permissions of the guest user are restricted. You can log in to the Azure portal as a global administrator, then find User settings>External collaboration settings, and then choose Guest users have the same access as members (most inclusive).
    1.
    159799-401.png
    2.
    159922-image.png
    Another method is to grant guest users the role of user administrator.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Vandy 1 Reputation point
    2022-10-27T15:04:04.033+00:00

    Whats the word thunderbird? Any updates??

    0 comments No comments

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.