Closed dmundra closed 5 years ago
Hi @dmundra, sorry for the very late response!
User.Identity.Name
contains the username which is not always the email address.
Getting user's profile picture is only partially supported with the v1.0 endpoint:
Note This operation in version 1.0 supports only a user's work or school mailboxes and not personal mailboxes.
https://docs.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0
Hi,
When I try the application for 'User.Identity.Name' I get full name instead of email. So I changed the ger users's email line to
email = email ?? User.FindFirst(Startup.UpnType)?.Value;
where
public const string UpnType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn";
For GetPictureStream in the first catch I was getting Request_ResourceNotFound but nothing would happen so I added
Then the second catch would work and I got the default image. I am not sure why v1.0 is not returning an image. Any ideas?