Azure ADB2C unable to update and find the profile photo of user using microsoft graph api

Ajay Palsaniya 1 Reputation point
2021-02-22T06:59:33.71+00:00

Hi there,, I've been struggling to use Graph API to update and find profile photo .

I use "grant_type=client_credentials" to get access token and it works well to get user information and update user's surname.

However, I have some problem with update profile photo of a user with "Directory.AccessAsUser.All, Directory.ReadWrite.All, User.ReadWrite.All" API permission in the setting of Azure AD, App registration. I also grant admin consent for the API permission. I tested the API with postman and got "message": "{\"error\":{\"code\":\"OrganizationFromTenantGuidNotFound\",\"message\":\"The tenant for tenant guid 'abf974f9-e104-46d9-8df6-3f59057043ef' does not exist.\",\"innerError\":{\"oAuthEventOperationId\":\"9d2badb5-4895-43f3-b2b4-e08c97d53338\",\"oAuthEventcV\":\"Ur7jaW+r9EiIoHc0cOcfEw.1.1.1\",\"errorUrl\":\"https://aka.ms/autherrors#error-InvalidTenant\",\"requestId\":\"88767d70-f13c-49ec-ae71-d27523***\",\"date\":\"2021-02-22T06:49:46\"}}}"

Is there any way to solve the problem ?

Thanks

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