Search code examples
asp.net-mvcazureoffice365azure-active-directoryoffice365-restapi

Accessing users' photos from Outlook using REST API (MVC 5)


Is there a way to use the Outlook User photo REST API using Azure AD & OAuth or do we have to use the Azure AD v2 authentication endpoint way to retrieve photos?

Is there any other way to retrieve user photos from Outlook.com so I can use it in my web app?

I am using Azure AD to authenticate users at the moment and want to use the Azure portal only, not the Microsoft Application Registration portal.

Thanks.


Solution

  • The difference between Azure portal and Microsoft Application Registration portal is that Microsoft Application Registration portal supports Azure AD V2.0 endpoint.

    The Azure AD v2.0 endpoint supports both Microsoft accounts and Azure Active Directory accounts.

    So, it depends on which users' photo you want to acquire. If you want the app only support the users from Azure AD tenant, it is well to select Azure portal to register the app.

    And here is the Microsoft Graph REST API about get the photo in user's mailbox on Exchange Online for your reference(Get photo):

    GET https://graph.microsoft.com/v1.0/me/photo/$value