cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PhilKD
Frequent Visitor

Office365Users.SearchUser error for Guest users

Hi,

I'm using Office365Users.SearchUser to provide people picker functionality in a Power App. Works fine for users but guests receive the error below.

 

Gallery items:  If(!IsBlank(Trim(txtGasEngineerSearch.Text)), Office365Users.SearchUser({searchTerm: Trim(txtGasEngineerSearch.Text), top: 15}))

 

Error: Office365Users.SearchUser failed: { "status": 403, "message": "Insufficient privileges to complete the operation.\r\nclientRequestId: ae24f5b2-489d-4b01-8d57-############", "error": { "message": "Insufficient privileges to complete the operation." }, "source": "office365users-ukw.azconn-ukw-01.p.azurewebsites.net" } 

 

Is this perhaps something that has been locked down on our tenancy or is this a known limitation, ie Guest users cannot search Office 365 Users?

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @PhilKD :

That's the expected behavior, because guests are limited users.

I suggest you to use the following alternative:

Create a userlist that populate by the Office365-userslist on SharePoint and then use this list as your data source.

I think this link will help you a lot:

Office365 Users Searchuser error Status 403

In addition, restricting the access rights of guests helps protect the information security of your organization.I suggest you to evaluate the security of this operation.

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @PhilKD :

That's the expected behavior, because guests are limited users.

I suggest you to use the following alternative:

Create a userlist that populate by the Office365-userslist on SharePoint and then use this list as your data source.

I think this link will help you a lot:

Office365 Users Searchuser error Status 403

In addition, restricting the access rights of guests helps protect the information security of your organization.I suggest you to evaluate the security of this operation.

Best Regards,

Bof

Thanks Bof,

 

I had considered your alternative but had hoped that there was way of using the Office365Users.SearchUser functionality. 

 

Our guests are from the same group of companies but on a different tenant. I wouldn't consider sharing the user list with any company outside our group.

 

I've just noticed that the People Search on SharePoint also doesn't work for Guests.

 

Thanks again for your suggestions.

Hi All, 

 

We have encountered this issue on our tenant whilst trying to do a lookup of a B2B guest account.

Although our issue is that the external user who is unable to look up their own information.

We have a simple call 

Office365Users.SearchUser({searchTerm:varCurrentUserEmail})
Which will bring back a user object of that user. From there we make use of the users display name and given name for populating the form that users use request access to the rest of the app amongst other things.
 
Whilst I do agree that since they are a guest account restricting access to our internal AD is a good thing. But surely a B2B user can lookup their own information or at least other B2B user info?
 
Thanks, 
Andrew

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,956)