4

Calling the search API or using search web parts is no longer returning People results, when logged in as an external user. This was working for years for me, and stopped in early November 2017. I have verified this in three tenants both as an internal and external user to those tenants. Microsoft Support has been giving me the run-around for more than a month now, and most of them are having difficulty understanding that I'm not talking about people pickers (which continue to work).

Is anyone aware of a change deployed by Microsoft which might have caused this (i.e. was it intentional)? Is there a workaround for this?

Example URL: https://mytenant.sharepoint.com/sites/demo/_api/search/query?querytext='Bob'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&clienttype='ContentSearchRegular'

The sourceid guid of b09a7990-05ea-4af9-81ef-edfab16c4e31 is for "Local People Results," which is scoped to ContentClass=urn:content-class:SPSPeople. I've also reproduced this by configuring search web parts with that ContentClass against the regular result source.

As an internal user, I get a result back from the above URL. As an external user, even one with site collection administrator permissions, I get no error from the search API, but I also get no results back.

4
  • Could be an issue with licenses. Check this link Jan 24, 2018 at 5:33
  • Thanks @GautamSheth. That's not the issue in this case. Also in one of the sites where I'm an external user, we tried assigning a license to my account in the portal just to test this. It didn't make a difference.
    – Chris Romp
    Jan 24, 2018 at 17:08
  • Any luck with this? I noticed that external users are not getting any results back on people search. Apr 20, 2018 at 14:18
  • Unfortunately still getting the runaround from MS support on this so I've given up, and I will implement my workaround when I have time. We're also seeing other oddities when logging in as an external for things that "used to work." I've considered adding something on UserVoice in hopes that the product team is more likely to see it than responding to something that comes from the support channel, but work continues...
    – Chris Romp
    Apr 23, 2018 at 17:57

2 Answers 2

4

Well, Microsoft Support is still giving me the runaround on this, but their official answer is that searching People as an external user isn't supposed to work, even though it used to, and they won't provide any documentation to that end. So either someone decided it's a security issue they don't want to document, or the support channel just gave up and gave me a BS answer. ¯\_(ツ)_/¯

As a workaround, based on this blog post I've found that I can still query the /_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser endpoint, even with a partial search string, and get results back.

For my custom user-picker control, now instead of using the /_api/search endpoint, I'm using the above one. Here's some sample code if it's helpful for anyone else.

var url = _spPageContextInfo.webAbsoluteUrl + '/_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser';
$.ajax({
    'url': url,
    'method': 'POST',
    'data': JSON.stringify({
        'queryParams': {
            '__metadata': {
                'type': 'SP.UI.ApplicationPages.ClientPeoplePickerQueryParameters'
            },
            'AllowEmailAddresses': true,
            'AllowMultipleEntities': true,
            'AllUrlZones': false,
            'MaximumEntitySuggestions': 50,
            'PrincipalSource': 15,
            'PrincipalType': 15,
            'QueryString': 'Romp'
            //'Required':false,
            //'SharePointGroupID':null,
            //'UrlZone':null,
            //'UrlZoneSpecified':false,
            //'Web':null,
            //'WebApplicationID':null
        }
    }),
    'headers': {
        'accept': 'application/json;odata=verbose',
        'content-type': 'application/json;odata=verbose',
        'X-RequestDigest': $('#__REQUESTDIGEST').val()
    },
    'success': function(data) {
        var userData = JSON.parse(data.d.ClientPeoplePickerSearchUser);
        console.log(userData);
    },
    'error': function(err) {
        console.error(err);
    }
});

And this is the response that comes back, which includes everything I need for my control (though if it didn't, I could use the Key value and call EnsureUser to get the SP user ID).

[{
    "Key": "i:0#.f|membership|chris.romp_XXX.com#ext#@MYCLIENT.onmicrosoft.com",
    "Description": "i:0#.f|membership|chris.romp_XXX.com#ext#@MYCLIENT.onmicrosoft.com",
    "DisplayText": "Chris Romp",
    "EntityType": "",
    "ProviderDisplayName": "",
    "ProviderName": "",
    "IsResolved": false,
    "EntityData": {
        "Email": "chris.romp@XXX.com",
        "SPUserID": "24",
        "AccountName": "i:0#.f|membership|chris.romp_XXX.com#ext#@MYCLIENT.onmicrosoft.com",
        "PrincipalType": "User"
    },
    "MultipleMatches": []
}]
2
  • 1
    👏👏👏 Well done on getting around this. I see that Microsoft do say that external users do not have access to the search centre, but I don't believe they should have limited access to people searches as it severely hampers user experience. support.office.com/en-us/article/… If you find an existing or make a new request at sharepoint.uservoice.com post it here so that other users can support it.
    – J. Doe
    Jan 26, 2018 at 9:19
  • Yep, and initially some of the support folks thought this was related to the search center, but it broke abruptly in November with no config changes at my client, and I later reproduced it in an environment where my account (as an external) did have access to the search center. I thought about posting something on UserVoice. We'll see. :)
    – Chris Romp
    Jan 26, 2018 at 17:07
0

Per my test in my SharePoint online environment, it will return the external users when searching from the local people Results(System) by search box or search API.

To troubleshoot the issue, you could check if the external users are in the active users in admin center.

1
  • To clarify, when searching AS an external user, no results come back. See the last paragraph of my original post. I'll update the rest of the post to be more specific. :)
    – Chris Romp
    Jan 18, 2018 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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