In my application, I'm getting the list of all sites with this search API call:
/_api/search/query?querytext='contentclass:STS_Site'
However, it does not work for external users, despite having all permissions for certain sites. (It does not work either if external users have access to all sites.) This is the response:
{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Attempted to perform an unauthorized operation."}}
Is there a way to enable searching for external users? (I'd expect the call lists only the sites the user has access to.)
https://tenant.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site'&selectproperties='Title,Path'