{"record":{"id":"3a355d0a170ffde2","repo":"open-webui/open-webui","slug":"onedrive-personal-or-business-client-id-not-config","errorCode":null,"errorMessage":"OneDrive personal or business client ID not configured","messagePattern":"OneDrive personal or business client ID not configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/utils/onedrive-file-picker.ts","lineNumber":54,"sourceCode":"\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tcredentials: 'include'\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error('Failed to fetch OneDrive credentials');\n\t\t}\n\n\t\tconst config = await response.json();\n\n\t\tthis.clientIdPersonal = config.onedrive?.client_id_personal;\n\t\tthis.clientIdBusiness = config.onedrive?.client_id_business;\n\t\tthis.sharepointUrl = config.onedrive?.sharepoint_url;\n\t\tthis.sharepointTenantId = config.onedrive?.sharepoint_tenant_id;\n\n\t\tif (!this.clientIdPersonal && !this.clientIdBusiness) {\n\t\t\tthrow new Error('OneDrive personal or business client ID not configured');\n\t\t}\n\t}\n\n\tpublic async getMsalInstance(\n\t\tauthorityType?: 'personal' | 'organizations'\n\t): Promise<PublicClientApplication> {\n\t\tawait this.ensureInitialized(authorityType);\n\n\t\tif (!this.msalInstance) {\n\t\t\tconst authorityEndpoint =\n\t\t\t\tthis.currentAuthorityType === 'organizations'\n\t\t\t\t\t? this.sharepointTenantId || 'common'\n\t\t\t\t\t: 'consumers';\n\n\t\t\tconst clientId =\n\t\t\t\tthis.currentAuthorityType === 'organizations'\n\t\t\t\t\t? this.clientIdBusiness\n\t\t\t\t\t: this.clientIdPersonal;","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/open-webui/open-webui/blob/01f4282f1ffe0d6212f58d3afbeae21fffd0c4be/src/lib/utils/onedrive-file-picker.ts#L36-L72","documentation":"Thrown by the OneDriveConfig singleton after fetching /api/config: the server response's onedrive object lacks both client_id_personal and client_id_business. Open WebUI only exposes the OneDrive file picker when at least one MSAL app client ID is configured server-side; this error means the integration was never (or incompletely) set up.","triggerScenarios":"Calling openOneDrivePicker() or OneDriveConfig.getInstance().initialize() when the backend's onedrive config block is empty/unset (fresh install, misnamed env vars, or the onedrive section omitted from the config API response).","commonSituations":"Admin enabled the OneDrive picker UI without registering Azure app client IDs; typos in the ONEDRIVE_CLIENT_ID_PERSONAL/ONEDRIVE_CLIENT_ID_BUSINESS env vars; running against a backend whose /api/config strips the onedrive block.","solutions":["Register an app in the Azure portal (personal or organizational) and set the onedrive client_id_personal / client_id_business values in the backend config that /api/config serves","Verify by GET /api/config in the browser and confirming config.onedrive contains a non-empty client_id_personal or client_id_business","If you do not want OneDrive integration, disable the OneDrive picker entry in the UI instead of triggering it"],"exampleFix":"// before: backend config has no onedrive block\n// after (backend config served by /api/config):\n{\n  \"onedrive\": {\n    \"client_id_personal\": \"<your-azure-app-client-id>\"\n  }\n}","handlingStrategy":"validation","validationCode":"async function onedriveConfigured(authorityType?: 'personal'|'organizations'): Promise<boolean> {\n  const res = await fetch('/api/config', { credentials: 'include' });\n  if (!res.ok) return false;\n  const cfg = await res.json();\n  const od = cfg.onedrive ?? {};\n  return authorityType === 'organizations'\n    ? Boolean(od.client_id_business)\n    : Boolean(od.client_id_personal || od.client_id_business);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await openOneDrivePicker(authorityType);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not configured')) {\n    toast.error('OneDrive is not configured. Contact your administrator.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Hide/disable the OneDrive picker menu item based on the /api/config onedrive flags","Smoke-test /api/config after any backend config change before exposing the picker"],"tags":["onedrive","config","msal","integration"],"backgroundTag":null,"analyzedSha":"01f4282f1ffe0d6212f58d3afbeae21fffd0c4be","analyzedAt":"2026-08-14T18:25:22.715Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}