@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
md 6.84 KB

How do I set up custom OAuth credentials for Microsoft Word?

Use your own Microsoft Entra ID app registration when you want the Microsoft consent screen to show your app's name and you want to control which permissions Microsoft Word requests.

Create the Microsoft Entra app

  1. Sign in to the Azure portal, open App registrations, and click New registration.

Azure App registrations page with the New registration button

  1. Enter a Name. Under Supported account types, choose Accounts in any organizational directory and personal Microsoft accounts (shown as Any Entra ID Tenant + Personal Microsoft accounts) if you want to connect both work or school and personal accounts. Choose a single-tenant or multitenant organizational option if you only connect work or school accounts.
  2. Under Redirect URI, select the Web platform, enter https://backend.composio.dev/api/v1/auth-apps/add, and click Register.

Entra Register an application form with Any Entra ID Tenant + Personal Microsoft accounts, the Web platform and the Composio redirect URI

  1. On the app's Overview page, copy the Application (client) ID.

Entra app Overview page with the client, object and tenant IDs censored

  1. Open Certificates & secrets and click New client secret. Add a description, choose an expiry that fits your rotation policy (for example, 180 days), and click Add. Rotate the secret before it expires.

Certificates & secrets page with the New client secret button

Add a client secret panel with a description and the 180-day expiry

  1. Copy the secret Value right away. Use the Value, not the Secret ID. Azure shows the full value only once; if you lose it, create a new secret.

Client secrets list with the Value and Secret ID censored

  1. Open API permissions, click Add a permission, select Microsoft Graph, and choose Delegated permissions so the app acts as the signed-in user. Add Files.ReadWrite.All (create, read, and edit documents), Sites.Read.All (read documents in SharePoint sites), and offline_access (refresh tokens). User.Read is already listed by default, then click Add permissions.

API permissions page with the Add a permission button

Request API permissions panel with Microsoft Graph under Microsoft APIs

Microsoft Graph permission type choice with Delegated permissions

Microsoft Graph delegated permissions with Files.ReadWrite.All selected

Microsoft Graph delegated permissions with Sites.Read.All selected

Microsoft Graph delegated permissions with offline_access selected

Configured permissions list with Files.ReadWrite.All, offline_access, Sites.Read.All and User.Read

  1. If your tenant restricts user consent, have a tenant admin click Grant admin consent for your tenant on the API permissions page. Adding a permission to the app registration doesn't grant consent by itself.

The redirect URI you register must exactly match the oauth_redirect_uri field in your Composio auth config (default https://backend.composio.dev/api/v1/auth-apps/add).

Entra Authentication page listing the Composio Web redirect URI

Create the auth config in Composio

  1. In the Composio dashboard, go to Auth Configs, click Create, and select Microsoft Word. Enter a config name and click Next.

Composio Auth Configs page with the Create button

Create Auth Config dialog with Microsoft Word selected

Auth config name field with the Next button

  1. Select OAuth 2.0 and Your Own Credentials. Paste the Application (client) ID into Client id and the secret value into Client secret. Leave Redirect URI as shown.

Composio OAuth 2.0 form with empty Client id and Client secret fields and the v1 redirect URI

  1. Under Scopes, select the same permissions you added in Azure, then click Create Auth Config.

Composio scopes list with offline_access, User.Read, Files.ReadWrite.All and Sites.Read.All selected

  1. Open the auth config and click Connect Account. Sign in with the Microsoft account you want to connect and click Accept. Leave Consent on behalf of your organization unchecked unless you're an admin granting tenant-wide consent. An unverified label is expected for a custom app without a verified publisher.

Microsoft Word auth config panel with the Connect Account button

Microsoft Pick an account page with the accounts censored

Microsoft consent prompt for file and site access with organization consent unchecked

  1. Back on the auth config's Connected Accounts tab, confirm the account shows Active. The Enabled label at the top of the page describes the auth config, not the account.

Auth config Accounts tab with the Word account showing Active

For the general flow, see custom auth configs.

Scopes

The default auth config requests offline_access, User.Read, Files.ReadWrite.All, and Sites.Read.All. Word calls go through Microsoft Graph at https://graph.microsoft.com/v1.0/.

Revoke access