Skip to main content

Authentication Method

  • oauth_2 - OAuth 2.0 (Microsoft identity platform)

OAuth App Setup

Step 1: Register an App in Azure

  1. Go to the Azure portal
  2. Navigate to Azure Active DirectoryApp registrations
  3. Click New registration
  4. Fill in the app name and select Accounts in any organizational directory and personal Microsoft accounts
  5. Add a redirect URI (e.g., http://localhost:3456/callback) under Web
  6. Click Register

Step 2: Configure API Permissions

  1. Go to API permissionsAdd a permissionMicrosoft Graph
  2. Add the permissions your app needs:
    • Files.ReadWrite — Read and write files
    • Files.ReadWrite.All — Full file access
    • Sites.ReadWrite.All — Access SharePoint sites

Step 3: Create a Client Secret

  1. Go to Certificates & secretsNew client secret
  2. Give it a description and expiry
  3. Copy the Value immediately — you won’t see it again

Step 4: Store Credentials

pnpm corsair setup --plugin=onedrive client_id=your-application-id client_secret=your-client-secret

Step 5: Authorize

pnpm corsair auth --plugin=onedrive
This opens a browser window to complete the Microsoft OAuth flow. Tokens are saved automatically.

Required Credentials Summary

CredentialRequired ForWhere to Find
Application (Client) IDOAuth flowAzure App registration → Overview
Client SecretOAuth flowAzure App registration → Certificates & secrets
For general information about how Corsair handles authentication, see Authentication.