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,578 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful