SharePoint : Broken user picture – SP or PH Add-ins

In any hosted add-ins if you want to get & display user picture, the image Url would be something like this from the user properties.


Referencing the same Url to an image element will results in as broken image due to cross domain authentication issue while downloading the picture.

Work around for this would be

Construct the Url using “userphoto.aspx” as mentioned below which will download you the picture in different sizes like M or L.

https://{SPurl}/_layouts/15/userphoto.aspx?size=L&[email protected]

Happy Learning !!

© 2023 | WordPress Theme: Annina Free by CrestaProject.