Getting "The tenant for tenant guid" when trying to get profile photo for B2C user

Daniel Friesen 21 Reputation points
2020-09-30T05:22:53.167+00:00

I'm using Azure AAD B2C and trying to get the profile photo of a user. The guides are a mess but I got this far.

First I make the following request to get an access token to use as the bearer Authorization header in the subsequent requests.

POST https://login.microsoftonline.com/aureliuspod.onmicrosoft.com/oauth2/v2.0/token
client_id=<client id>
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret=<secret>
&grant_type=client_credentials

Calling https://graph.microsoft.com/v1.0/users successfully gets me a list of the users in the B2C tenant.

Calling https://graph.microsoft.com/v1.0/users/<oid> also successfully gets me the user information.

However when I try to call https://graph.microsoft.com/v1.0/users/<oid>/photo/$value I get the following error:

{
  "error": {
    "code": "OrganizationFromTenantGuidNotFound",
    "message": "The tenant for tenant guid '...' does not exist.",
    "innerError": {
      "requestId": "...",
      "date": "2020-09-30T05:20:40",
      "request-id": "...",
      "client-request-id": "..."
    }
  }
}
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,775 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2020-09-30T18:44:52.247+00:00

    The photo endpoint is not part of the supported MS Graph operations.

    --
    Please let us know if this answer was helpful to you. If so, please remember to mark it as the answer so that others in the community with similar questions can more easily find a solution.

    3 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful