open-webui/open-webui · error · Error

OneDrive personal or business client ID not configured

Error message

OneDrive personal or business client ID not configured

What it means

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.

Source

Thrown at src/lib/utils/onedrive-file-picker.ts:54

			headers: {
				'Content-Type': 'application/json'
			},
			credentials: 'include'
		});

		if (!response.ok) {
			throw new Error('Failed to fetch OneDrive credentials');
		}

		const config = await response.json();

		this.clientIdPersonal = config.onedrive?.client_id_personal;
		this.clientIdBusiness = config.onedrive?.client_id_business;
		this.sharepointUrl = config.onedrive?.sharepoint_url;
		this.sharepointTenantId = config.onedrive?.sharepoint_tenant_id;

		if (!this.clientIdPersonal && !this.clientIdBusiness) {
			throw new Error('OneDrive personal or business client ID not configured');
		}
	}

	public async getMsalInstance(
		authorityType?: 'personal' | 'organizations'
	): Promise<PublicClientApplication> {
		await this.ensureInitialized(authorityType);

		if (!this.msalInstance) {
			const authorityEndpoint =
				this.currentAuthorityType === 'organizations'
					? this.sharepointTenantId || 'common'
					: 'consumers';

			const clientId =
				this.currentAuthorityType === 'organizations'
					? this.clientIdBusiness
					: this.clientIdPersonal;

View on GitHub (pinned to 01f4282f1f)

Solutions

  1. 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
  2. Verify by GET /api/config in the browser and confirming config.onedrive contains a non-empty client_id_personal or client_id_business
  3. If you do not want OneDrive integration, disable the OneDrive picker entry in the UI instead of triggering it

Example fix

// before: backend config has no onedrive block
// after (backend config served by /api/config):
{
  "onedrive": {
    "client_id_personal": "<your-azure-app-client-id>"
  }
}
Defensive patterns

Strategy: validation

Validate before calling

async function onedriveConfigured(authorityType?: 'personal'|'organizations'): Promise<boolean> {
  const res = await fetch('/api/config', { credentials: 'include' });
  if (!res.ok) return false;
  const cfg = await res.json();
  const od = cfg.onedrive ?? {};
  return authorityType === 'organizations'
    ? Boolean(od.client_id_business)
    : Boolean(od.client_id_personal || od.client_id_business);
}

Try / catch

try {
  await openOneDrivePicker(authorityType);
} catch (e) {
  if (e instanceof Error && e.message.includes('not configured')) {
    toast.error('OneDrive is not configured. Contact your administrator.');
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of open-webui/open-webui@01f4282f1f (2026-08-14). Data as JSON: /api/errors/3a355d0a170ffde2. Report an issue: GitHub.