I'm using the MS Graph API in a web page to get the information of a user logged in to an application using a Microsoft account linked to an Azure AD directory user.
I can get their name and basic profile info using 'https://graph.microsoft.com/v1.0/me' but attempting to get their profile picture using 'https://graph.microsoft.com/v1.0/me/photo' or 'https://graph.microsoft.com/beta/me/photo' returns 404
However the Microsoft login page that appears during the login redirect does show the user's account profile picture, which also appears if that account is used to log into the Graph explorer.
The account is a Hotmail account, I don't know whether this makes it a 365 account or not. The User account in the Azure portal shows no profile picture in the User's details in the Directory - Users view, although when logged into Azure using that account the profile picture does appear in the Azure portal nav bar.
So how do I get the profile picture of a basic Microsoft account?
UPDATE
So after wading through more documentation I learned that only the beta graph api works to return the photo of a personal acount, and it only works on the data endpoint ($value) not the metadata endpoint.
So with that in mind I tested it using the Graph Explorer.
In the Graph Explorer the endpoint https://graph.microsoft.com/beta/me/photo/$value correctly returns my account's profile image, but the same request from Javascript returns 404.
Looking at the request in the Graph Explorer and browser devtools there's nothing obviously different from the request being made by the Graph Explorer and the one I'm making from Javascript, but the call from Javascript just isn't working.
Also a call to https://graph.microsoft.com/beta/me from my Javascript does work, which suggests that I'm doing nothing wrong my end.
UPDATE 2
The Graph beta API appears to work differently depending on whether the access token is retrieved for a single-tenant or multi-tenant application as described here https://github.com/microsoftgraph/microsoft-graph-explorer-v4/issues/1077
The effect of this is that you can get the profile picture for a private MS account via a multi-tenant application but not via a single tenant application. Which makes no sense at all, is not documentated, and seems like a bug.
The Graph API has had weakenesses in this area that have not been addressed for years, despite assurances.
https://github.com/microsoftgraph/microsoft-graph-docs/issues/3990
For this reason I suspect MS Identity Platform is going the same way as Azure Devops, years of development and promise, but ultimately never delivering a complete useful product.

