How to connect OneDrive to Composio

4 min read

Composio connects AI agents to OneDrive so they can find, read, and manage files. Access is limited by the permissions you approve and your account’s existing access.

This guide shows you how to set up OAuth credentials and connect OneDrive to Composio.

Part 1: Connect OneDrive with Composio Managed OAuth

Step 1: Create an Auth Config and Select OneDrive

1. Go to Auth Configs in the Composio Dashboard and click Create.

Auth Configs page in the Composio Dashboard with the Create button

2. Search for OneDrive and select it from the results.

Create Auth Config dialog with OneDrive selected

Step 2: Name the Config and Choose Composio Managed

1. Enter a Config Name for your auth config (the screenshots use OneDrive Managed Guide) and click Next.

Config Name field for the managed OneDrive auth config

2. Under Authentication Method, select OAuth 2.0. Under Credentials, select Composio Managed.

OAuth 2.0 and Composio Managed selected in the OneDrive auth config form

3. Under Scopes, choose permissions required by your integration and supported by your app registration. Click Create Auth Config.

Scopes list for the managed OneDrive auth config with Files.ReadWrite.All, Sites.ReadWrite.All and offline_access selected

Step 3: Connect Your Microsoft Account

1. Open the auth config and click Connect Account. Then open the generated link.

Connect Account button on the managed OneDrive auth config

2. Select the Microsoft account you want to connect and sign in. Make sure it is the account whose OneDrive you intend to use.

Microsoft Pick an account page

3. If Microsoft asks for permissions, review them and click Accept only if they are appropriate for this account. You may not see this prompt if the account has already consented to these permissions. If your organization restricts app consent, an administrator may need to approve the request before the connection can complete.

Microsoft Permissions requested page for the managed Composio OneDrive app

Step 4: Confirm the Connected Account Is Active

1. Back in Composio, open the Accounts tab on the auth config. The connected account should show an Active status. The Enabled status at the top of the page refers to the auth config itself, not to a connected account.

Connected OneDrive account showing Active status in Composio

Part 2: Use your own OAuth credentials

Step 1: Register an App in Microsoft Entra ID

1. Sign in to the Azure portal, open App registrations, and click New registration. Microsoft’s app registration quickstart covers the same steps.

App registrations page in the Azure portal

2. Name the app and choose the supported organizational/personal account audience. Select Web, enter the callback below and click Register.

https://backend.composio.dev/api/v1/auth-apps/add

Register an application form with name, supported account types and Web redirect URI

Step 2: Copy the Client ID and Create a Client Secret

1. On the app’s Overview page, copy the Application (client) ID. This is the Client ID you will enter in Composio.

App Overview page showing the Application (client) ID

2. Open Certificates & secrets and click New client secret.

Certificates and secrets page with the New client secret button

3. Add a description and choose an expiry that fits your rotation policy, then click Add. The screenshots use a 180-day expiry. Plan to rotate the secret before it expires.

Add a client secret panel with description and expiry

4. Copy the secret Value immediately and store it privately. Use the Value, not the Secret ID. Azure shows the Value only once, so if you leave the page without copying it you will need to create a new secret. Do not enable public client flows for this confidential Web client.

Client secrets list showing the Value and Secret ID columns

Step 3: Add Microsoft Graph Permissions

1. Open API permissions and click Add a permission.

API permissions page with the Add a permission button

2. Select Microsoft Graph.

Microsoft Graph selected in Request API permissions

3. Choose Delegated permissions, so the app acts on behalf of the signed-in user.

Delegated permissions option in Request API permissions

4. Choose the delegated permissions needed for the operations your integration will use. Then click Add permissions.

Step 4: Create the Auth Config with Your Own Credentials

1. In the Composio Dashboard, go to Auth Configs, click Create, and select OneDrive. Enter a Config Name (the screenshots use OneDrive Custom Guide) and click Next.

Config Name field for the custom OneDrive auth config

2. Under Authentication Method, select OAuth 2.0. Under Credentials, select Your Own Credentials.

OAuth 2.0 and Your Own Credentials selected in the OneDrive auth config form

3. Paste the Client id and the secret Value from your Entra app into Client secret. The inputs are left empty in the screenshot to keep the credentials private. Leave the Redirect URI exactly as shown; it must match the redirect URI you registered in Step 1. For Microsoft cloud environment, keep global for the commercial Microsoft 365 cloud.

Credentials fields, Redirect URI and Microsoft cloud environment set to global for the custom OneDrive auth config

4. Under Scopes, choose permissions required by your integration and supported by your app registration. Click Create Auth Config.

Permission reference. Basic file reads require Files.Read; file edits require Files.ReadWrite. Broader shared-file or SharePoint operations can require additional permissions. offline_access supports continued access. Choose for your own workflow; the screenshots are examples, not a required scope set. Microsoft permission reference.

Example minimum data permission for reading file metadataScopes selected for the custom OneDrive auth config

Step 5: Connect Your Microsoft Account

1. Open the auth config and click Connect Account. Then open the generated link.

Connect Account button on the custom OneDrive auth config

2. Select the Microsoft account you want to connect and sign in.

Microsoft Pick an account page for the custom OneDrive app

3. Verify your app name, review the permissions and click Accept if appropriate. Leave organization-wide consent unchecked unless an administrator intends tenant-wide approval.

Microsoft Permissions requested page for the unverified custom Composio OAuth Guides app

Step 6: Confirm the Connected Account Is Active

1. After approval, open Accounts and check Active on the connected account. Enabled describes the auth config.

Your OneDrive auth config is ready. Copy the Auth Config ID (ac_...) and use it in your application code or secret manager.

Connected account showing verified Active status

Share