Prerequisites

  • Microsoft account (personal or organizational)
  • Access to Azure Portal

Step 1: Create Microsoft App Registration

  1. Visit https://portal.azure.com/ and sign in
  2. Search App registrations → click New registration
  3. Fill out the form:
    • Name: Choose a descriptive app name
    • Supported account types: Select Accounts in any organizational directory and personal Microsoft accounts
    • Redirect URI: https://api.klavis.ai/oauth/onedrive/callback
  4. Click Register
OneDrive App Registration Form

Step 2: Configure API Permissions

Klavis OneDrive MCP Server uses the following OAuth scopes:openid, profile, email, offline_access, Files.ReadWrite.All, User.Read
  1. Go to your app → API Permissions
  2. Click Add a permissionMicrosoft GraphDelegated permissions
  3. Select:
    • openid, profile, email, offline_access
    • Files.ReadWrite.All
    • User.Read
  4. Click Add permissions
  5. (Optional) Click Grant admin consent if you want to approve for all org users
Graph API Permissions

Step 3: Collect Client ID & Secret

  1. Go to Certificates & Secrets tab
  2. Click New client secret → set description + expiry → Add
  3. Copy the Client Secret Value (shown only once)
  4. From Overview tab, copy Application (client) ID
Client ID Secret
You have successfully created a OneDrive OAuth application! You now have your Client ID and Client Secret ready for integration with Klavis AI.

(Optional) Step 4: White Labeling

White labeling allows you to customize the OAuth experience with your own branding instead of Klavis AI’s.
If you want to use your own OneDrive OAuth application with custom branding:
  1. Configure White Labeling: Go to https://www.klavis.ai/home/white-label
  2. Add Your Credentials: Enter your OneDrive Client ID and Client Secret from Step 3
  3. Set Redirect URI: Use https://api.klavis.ai/oauth/onedrive/callback or your custom callback URL
  4. Initiate OAuth: Use your client ID when starting the OAuth flow:
    const authUrl = `https://api.klavis.ai/oauth/onedrive/authorize?instance_id=${instanceId}&client_id=${yourClientId}`;
    
For detailed white labeling implementation and code examples, see our OAuth & White Labeling guide.

Resources