Show SharePoint User Profile Image Without My-site Login


 Assume that you have a team site in the following URL and you have my-site web application at the following URL

 When you open your team site at without login to my-site, all users’ profile images will be shown as a cracked images until you logged into my-site web application or the windows authentication will be requested twice for the same reason.

 The problem behind that is that the users’ profile images will be added to html with my-site web-application URL such as

<img src=”; />

 Even if single sign on has been configured via ADFS or other trusted providers user must open both of them in two different tabs in order to display it as ADFS doesn’t support cross-domain resource sharing

 SharePoint 2013 have an awesome configuration that can change this default behavior and solve the problem as following:

  1. Remote login to your SharePoint server
  2. Open SharePoint Management PowerShell as administrator
  3. Run the following command after modifying it with your correct URL

    $web = Get-SPWebApplication
    $web.CrossDomainPhotosEnabled = $true

  4. Open your site again and the problem will be solved

 Actually if you inspect the user profile image it will be shown in a different way than before as following

<img src=’; />

 You can imagine that as a local proxy for users’ profile images

Note: For other resources (not users’ profile images), you can add a hidden iframe to provide the authentication behind the scenes but you have to configure Single sign on to provide an excellent user experience

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s