mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #13635] issue: Onedrive Sharepoint filepicker configured to support multi-tenant instead of single-tenant connections #16978
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @erictmnz on GitHub (May 7, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13635
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.6.7
Ollama Version (if applicable)
No response
Operating System
Linux
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The user configures the Onedrive / Sharepoint Client ID, Sharepoint URL and Tenant ID.
When using the Onedrive File Picker -> Sharepoint the user is allowed to pick files just from the current tenant. Users from other tenants are blocked from using the Onedrive filepicker.
Actual Behavior
When a user has configured the App Registration to allow Sharepoint Access it is highly recommended to limit the application to the single (current) tenant for security reasons.
Currently the implementation requires the application to grant multi-tenant access (see below).
This can be fixed by requiring a tenant id and using the organization endpoint (instead of the common endpoint).
This may have to be applied differently for onedrive vs sharepoint.
Steps to Reproduce
Logs & Screenshots
See above
Additional Information
No response
@McNickSistoPro commented on GitHub (May 7, 2025):
Did you use PnP to grant Sharepoint access to the app registration ?
@erictmnz commented on GitHub (May 7, 2025):
No I used the GraphQL API as described under the link that I posted. That worked fine.
@McNickSistoPro commented on GitHub (May 8, 2025):
Did you need admin privileges ?
@erictmnz commented on GitHub (May 8, 2025):
Yes to grant access to a specific site.
@hurxxxx commented on GitHub (May 8, 2025):
I'm looking into this for improvement
@erictmnz commented on GitHub (May 8, 2025):
Much appreciated - will test today! 🚀
@erictmnz commented on GitHub (May 8, 2025):
@hurxxxx and @tjbck it is now working with a single tenant.
However, the application needs to be set up as a SPA and have the url root of Open WebUI defined as a redirect URL.
This should probably be added to the documentation. Would you like me to create a merge request for the doc repo?
@hurxxxx commented on GitHub (May 9, 2025):
@erictmnz That would be greatly appreciated if you could do that!
@almajo commented on GitHub (May 12, 2025):
Hey thanks for the integration! Can one of you maybe update the documentation for a tutorial how to setup the Sharepoint integration? Latest Env variables are missing and also a tutorial on the setup would be highly appreciated.
In addition, as I understand correctly, app registrations with secrets are not supported at the moment, right?
@erictmnz commented on GitHub (May 12, 2025):
Hi @almajo,
Sorry I haven’t had time to fully write this up yet.
This should get you there:
How to Enable OneDrive / SharePoint Integration in Open WebUI
This guide explains how to enable OneDrive and SharePoint integration in Open WebUI (≥ v0.6.8). The same Azure app registration can also be used for Microsoft OAuth login if needed.
1. Register a Microsoft Entra Application
https://ai.example.com)2. Add Microsoft Graph & SharePoint API Permissions
Under API Permissions → + Add permission, add the following delegated scopes for both Microsoft Graph and Sharepoint (as applicable):
Files.ReadFiles.Read.AllSites.Read.AllUser.ReadAllSites.ReadMyFiles.ReadSites.Search.All3. Configure Environment Variables
In your
.envfile or env variables add:@almajo commented on GitHub (May 19, 2025):
Hey @erictmnz thanks for the instructions, that really helped me out a lot!
However, when opening the file picker, the pop-up is blocked by the browser and because of this the auth flow is not working correctly. Only after allowing pop-ups and clicking on OneDrive (work/school) again makes it work.
Do you see this problem, too? I have tried with Chrome and Safari. Do you have an idea how we could circumvent this (running the auth flow not in a pop-up but maybe on the main page)?