SharePoint File Picker White Box Issue #10907
Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
|
Solved for users in one tenant, for second connected tenant still same error. |
Beta Was this translation helpful? Give feedback.
-
Solution for SharePoint File Picker "White Box" IssueI had the same problem and found a solution. The root cause is an incomplete OBO (On-Behalf-Of) flow configuration in Azure AD. The critical points:
I've documented a complete step-by-step guide with Azure CLI commands, Terraform examples, and a troubleshooting section here: |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
My state of the art Librechat deployment failing on SharePoint File Picker White Box Issue
Environment
Configuration
Working Components
✅ OpenID authentication working (multi-tenant)
✅ Token reuse enabled: `OPENID_REUSE_TOKENS=true`
✅ Users can login successfully from multiple tenants
✅ File picker button appears in UI
Non-Working Component
❌ SharePoint file picker displays blank white box
❌ Graph API token exchange failing
Environment Variables (.env)
```bash
OpenID Configuration
OPENID_ENABLED=true
OPENID_CLIENT_ID=
OPENID_ISSUER=https://login.microsoftonline.com/organizations/v2.0
OPENID_SCOPE=api://.default openid profile email offline_access
OPENID_REUSE_TOKENS=true
OPENID_ON_BEHALF_FLOW_FOR_USERINFO_REQUIRED=true
OPENID_ON_BEHALF_FLOW_USERINFO_SCOPE=user.read
OPENID_USE_PKCE=true
OPENID_AUTO_REDIRECT=false
OPENID_REDIRECT_URI=https:///oauth/openid/callback
Microsoft Graph Configuration
MICROSOFT_GRAPH_CLIENT_ID=1___
MICROSOFT_GRAPH_CLIENT_SECRET=[REDACTED]
MICROSOFT_GRAPH_TENANT_ID=f___
SharePoint Configuration
ENABLE_SHAREPOINT_FILEPICKER=true
SHAREPOINT_BASE_URL=https://.sharepoint.com
SHAREPOINT_PICKER_CLIENT_ID=
SHAREPOINT_PICKER_CLIENT_SECRET=[REDACTED]
SHAREPOINT_PICKER_TENANT_ID=f___
SHAREPOINT_PICKER_SHAREPOINT_SCOPE=https://___.sharepoint.com/AllSites.Read
SHAREPOINT_PICKER_GRAPH_SCOPE=Files.Read.All
Proxy Configuration (Cloudflare tunnel)
TRUST_PROXY=1
COOKIE_SECURE=false
Debug
DEBUG_OPENID=true
```
librechat.yaml Configuration
```yaml
fileConfig:
sources:
- "sharepoint"
- "local"
```
Azure App Registration Configuration
App Details
Exposed API
API Permissions (All granted with admin consent)
Microsoft Graph (Delegated):
SharePoint (Delegated):
Custom API (ChatGraphIntegration):
Redirect URIs
Observed Behavior
What Works
What Doesn't Work
Error Logs (PM2)
```
[GraphTokenService] Failed to acquire Graph API token for user: server responded with an error in the response body
[graphTokenController] Failed to obtain Graph API token: Graph token acquisition failed: server responded with an error in the response body
```
Note: The error message is vague and doesn't include the actual Azure error response.
Analysis
Root Cause
The On-Behalf-Of (OBO) token exchange is failing when LibreChat tries to exchange the user's access token for a Microsoft Graph API token. This prevents the SharePoint picker from accessing SharePoint sites.
Expected Behavior
The SharePoint picker should:
What's Likely Happening
Possible Causes
Questions for LibreChat Team
OBO Scope Configuration: Should `OPENID_ON_BEHALF_FLOW_USERINFO_SCOPE` use the custom API scope instead of just `user.read`?
Error Logging: Can the GraphTokenService error handling be enhanced to log the actual Azure error response? Currently it only logs "server responded with an error in the response body" without details.
Required Scopes: What is the exact scope configuration required for SharePoint OBO flow to work? Should the initial `OPENID_SCOPE` include Graph API scopes, or only the custom API scope?
Debug Mode: Is there a way to enable more verbose logging for the OBO token exchange process?
Multi-tenant: Are there any known issues with SharePoint picker in multi-tenant configurations?
Attempted Troubleshooting
What We Tried
✅ Verified all Azure API permissions granted
✅ Created custom API scope (`access_user`) and added to app
✅ Updated `OPENID_SCOPE` to use `api://.../.default`
✅ Enabled token reuse (`OPENID_REUSE_TOKENS=true`)
✅ Enabled OBO flow (`OPENID_ON_BEHALF_FLOW_FOR_USERINFO_REQUIRED=true`)
✅ Verified tenant IDs match across all configuration
✅ Added SharePoint to `fileConfig.sources` in librechat.yaml
✅ Upgraded to latest main branch (from v0.8.1-rc2)
✅ Cleared browser cache completely
✅ Tested in fresh incognito windows
✅ Verified Cloudflare proxy settings (`TRUST_PROXY=1`, `COOKIE_SECURE=false`)
What Didn't Help
❌ Changing tenant IDs
❌ Different scope combinations
❌ Browser cache clearing
❌ Restarting services
Request
Could the LibreChat team please:
Additional Context
Thank you for any assistance!
Beta Was this translation helpful? Give feedback.
All reactions