Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied for guest users with Search API #1851

Open
EinmalIM opened this issue Jun 26, 2024 · 0 comments
Open

Permission denied for guest users with Search API #1851

EinmalIM opened this issue Jun 26, 2024 · 0 comments

Comments

@EinmalIM
Copy link

We cannot use the Graph search API in SharePoint sites when logged on with a guest account.

[x] bug

Using the Graph Search API (https://graph.microsoft.com/v1.0/search/query) with internal users works as expected.

Executing the same query with a guest user results in http 403 with this response body:

"error": {
"code": "Forbidden",
"message": "The service is not authorized for provided user credentials",
"target": "",
"httpCode": 403
}

We tested with Sites.Read.All, Sites.ReadWrite.All and Sites.FullControl.All - always the same 403.

External sharing is enabled for anyone in the sites collections with used for testing.

We found this closed issue which ends without a solution: #1039

Expected or Desired Behavior

We expect that guest users can use the Graph Search API

Observed Behavior

Guest users receive http 403 forbissen, when they use the Graph Search API

{
"error": {
"code": "Forbidden",
"message": "The service is not authorized for provided user credentials",
"target": "",
"httpCode": 403
},
"Instrumentation": {
"TraceId": "fc9aa73d-57a9-d86c-6007-abdf6535959f"
}
}

utc time 13:06

Steps to Reproduce

We can reproduce this with Graph Explorer.

To login with a guest account make sure to add the target tenant as a query param in the Graph Explorer URL, like so:

https://developer.microsoft.com/en-us/graph/graph-explorer?tenant=SOMETENANT.onmicrosoft.com

Login with a guest account. Consent Sites.Read.All
Make sure the guest user has access to at least one site collection

POST v1.0 to https://graph.microsoft.com/v1.0/search/query

{
"requests": [
{
"entityTypes": [
"list"
],
"query": {
"queryString": "Vertrag"
}
}
]
}

Results in 403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant