cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mengting
Level: Powered On

Re: Office365Users.UserPhoto() AuthenticationError

I get the right answer from a Microsoft Support as below. But the issue is not resolved, instead I post an idea in the community: https://powerusers.microsoft.com/t5/Flow-Ideas/PowerApps-Office365Users-UserPhoto-AuthenticationErro... 

 

Description of root cause

The reason the images would not show are usually because the URL that is used to get the image is a url to the actual site on SPO. e.g.

 

https://microsoft.sharepoint.com/:i:/r/teams/appPlatform/PowerApps/PowerAppsClient/PhotoLibrary/Pict...? csf=1

 

 

When PowerApps binds an Image control to this URL, the request for the image is NOT authenticated.

Only URLs that come from supported data types from within the SharePoint connector get rewritten so that PowerApps will be able to authenticate them safely.

Why does it work in browsers (sometimes) then?

The reason it can sometimes work in browsers (e.g. when using Web Authoring or Web Player) is that browsers utilize cookies to perform authentication.

So when the browser makes the request to the sharepoint.com URL, it's not using PowerApps authentication tokens to authorize the request; it's using cookies stored by the browser for that domain.

 

 

Mitigations

 

Method 1 - Add the files as SharePoint list attachments.

  1. Create a new SharePoint list.
  2. For each file you need to access, create an item.
  3. When creating the item, add the file as an attachment of the list item.
  4. On the PowerApps access the list item attachment and use it on a media control. For example: a. App has a gallery control. Gallery2.Items is set to "listmp3", where "listmp3" is a SharePoint list that has mp3 file attached to the items. There is one list item per file. b. App has an audio control . Audio1.Media is set to "First(Gallery2.Selected.Attachments).Value". This will obtain the attached file on the item selected on Gallery2.

 

My reason why this issue couldn't be resolved, because my company has 500+ employees, it’s hard for me to create a separate database for employee items with image as attachment. And it is double work, if the information is already existing somewhere, and I should utilize the existing information.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,743)