0

I'm displaying users photos by using the below url

https://outlook.office365.com/owa/service.svc/s/GetPersonaPhoto?email=XXX.com&UA=0&size=HR64x64&sc=1500867903362

It works perfectly in Chrome always and the pictures display:) But never works in IE and Edge :)

Any ideas why I'm getting the 401 unauthorized?

Thanks in Advance

1

The correct URL to get user's photo is:

https://tenant.sharepoint.com/_layouts/15/userphoto.aspx?
size=L&accountname=user.name%40tenant.onmicrosoft.com

You can change the size to S or M or L which stands for Small or Medium or Large.

Most likely your ajax request is cross domain and will be blocked by browser's Same origin policy.

Not 100% sure why its working in chrome, did you try it Chrome's InCognito mode as well ? Could be that you have visited the profile page once and this set some cookies which allowed you to get the profile picture.

Try and visit the user profile page in IE/Edge and then you will also be able to view the image.

To get around this problem, use the URL mentioned above.

  • Hi Gautam, Do have an idea where the actual pic is stored in SharePoint?.As after changing it no pic come up :( – naijacoder Feb 19 '18 at 5:44
  • Check this and this link. In my experience, after you change your profile picture it takes anything from couple of hours to 3-4 days for the updated profile picture to be reflected. – Gautam Sheth Feb 19 '18 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.