Getting error "AuthenticationError" when accessing user photo using Graph API

Viewed 94

We have an application that uses the MS Graph API to access users information along with getting user photo. Application has been working fine until 2 months ago. Now we're seeing an error "Error authenticating with resource" when accessing photo

Tried getting photo via MS Graph explorer using https://graph.microsoft.com/beta/me/photo/$value. All delegated permissions have been granted. Got an error:

{
    "error": {
        "code": "AuthenticationError",
        "message": "Error authenticating with resource",
        "innerError": {
            "date": "2020-08-10T20:10:18",
            "request-id": "cf458687-6aa9-49a6-a346-964daafefcc2"
        }
    }
}

The same result was using Postman with access_token. Accesss token contains all needed permissions: https://www.screencast.com/t/BNeKELVaYEt

{
  "error": {
    "code": "AuthenticationError",
    "message": "Error authenticating with resource",
    "innerError": {
      "date": "2020-08-10T20:22:49",
      "request-id": "704bd253-0953-48e1-857e-ec51f7651ed5"
    }
  }
}

Getting user profile works fine in both places.

We're also experiencing problem updating image in user list in Azure AD. When we change user profile photo based on https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-users-profile-azure-portal, photo is not updated in user profile, however when adding user as owners to API registration, image is shown correctly. Another strange thing that logged in user's photo(in top right corner) is different from the photo of same user from the list. https://www.screencast.com/t/60rTsONZjzs

Still I am able to see correct image by accessing https://account.activedirectory.windowsazure.com. Src for photo from there is /UserProfileImage/UserProfileImage?objectId={user_id}

Could you help me to figure out whether I am doing something wrong, or something does not work properly.

Thank you in advance!

0 Answers
Related