@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, 06:00 UTC

next
md 77 lines 6.22 KB
Rendered Raw
1 ## How do I set up custom OAuth credentials for Excel?
2
3 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 Excel requests.
4
5 ### Create the Microsoft Entra app
6
7 1. Sign in to the [Azure portal](https://portal.azure.com/), open **App registrations**, and click **New registration**.
8 2. 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.
9 3. Under **Redirect URI**, select the **Web** platform, enter `https://backend.composio.dev/api/v1/auth-apps/add`, and click **Register**.
10
11 ![Entra Register an application form with Any Entra ID Tenant + Personal Microsoft accounts, the Web platform and the Composio redirect URI](/images/toolkits/shared/1iIDmPCxFpXJP7zt73rUtnOLkxc.webp)
12
13 4. On the app's **Overview** page, copy the **Application (client) ID**.
14
15 ![Entra app Overview page with the client, object and tenant IDs censored](/images/toolkits/shared/XrRJcE8kllnTRDHzOTTTl8s9oxc.webp)
16
17 5. 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.
18
19 ![Add a client secret panel with a description and the 180-day expiry](/images/toolkits/shared/eZiGGdUoPbOHKz4sCPqGdS04k.webp)
20
21 6. 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.
22
23 ![Client secrets list with the Value and Secret ID columns censored](/images/toolkits/shared/hiQJlSSKAljLV6UM2Wu8e5sUCzU.webp)
24
25 7. 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`, `Sites.ReadWrite.All`, `offline_access`, and `User.Read`, then click **Add permissions**. If you reuse an existing app, keep the permissions its other integrations rely on.
26
27 ![API permissions page with the Add a permission button](/images/toolkits/excel/add-a-permission.webp)
28
29 ![Request API permissions panel with Microsoft Graph under Microsoft APIs](/images/toolkits/shared/P6j2HSVMJwSq5F11Whsyl5lgvM.webp)
30
31 ![Microsoft Graph permission type choice with Delegated permissions](/images/toolkits/shared/SHZSEmH6MtzuytgGtV6w538oSZ8.webp)
32
33 ![Microsoft Graph delegated permissions with Files.ReadWrite selected](/images/toolkits/excel/files-readwrite-permission.webp)
34
35 ![Configured Files.ReadWrite delegated permission details](/images/toolkits/excel/files-readwrite-details.webp)
36
37 8. 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.
38
39 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`).
40
41 ### Create the auth config in Composio
42
43 1. In the Composio dashboard, go to **Auth Configs**, click **Create**, and select **Excel**. Enter a config name and click **Next**.
44
45 ![Composio Auth Configs page with the Create button](/images/toolkits/excel/composio-auth-configs.webp)
46
47 ![Create Auth Config dialog with Excel selected](/images/toolkits/excel/composio-toolkit-picker.webp)
48
49 ![Auth config name field with the Next button](/images/toolkits/excel/composio-config-name.webp)
50
51 2. 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.
52 3. Under **Scopes**, select the same permissions you added in Azure, then click **Create Auth Config**.
53 4. Open the auth config and click **Connect Account**. Sign in with the Microsoft account that can access your workbooks and accept the consent prompt. The request grants file read and write access; it isn't read-only. 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.
54
55 ![Excel auth config page with the Connect Account button](/images/toolkits/excel/composio-connect-account.webp)
56
57 ![Microsoft Pick an account page with the accounts censored](/images/toolkits/excel/microsoft-account-picker.webp)
58
59 ![Microsoft consent prompt for file access with organization consent unchecked](/images/toolkits/excel/microsoft-consent.webp)
60
61 5. 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.
62
63 ![Connected Accounts tab with the Excel account showing Active](/images/toolkits/excel/connected-account-active.webp)
64
65 For the general flow, see [custom auth configs](/docs/auth-configuration/custom-auth-configs).
66
67 ### Scopes
68
69 The default auth config requests `Files.ReadWrite`, `Sites.ReadWrite.All`, `offline_access`, and `User.Read`. Microsoft requires `Files.ReadWrite` for workbook operations, even read operations such as listing worksheets. See Microsoft's [list worksheets](https://learn.microsoft.com/en-us/graph/api/workbook-list-worksheets?view=graph-rest-1.0) reference.
70
71 ### Restrict sign-in to one tenant
72
73 The connection's tenant field (`issuer`) defaults to `common`. To restrict sign-in to one tenant, set it to your **Directory (tenant) ID** from the app's **Overview** page or a verified tenant domain.
74
75 ### App-only access (client credentials)
76
77 Excel also supports an app-only auth mode (`S2S_OAUTH2`) that runs without a signed-in user. It takes the **Client id**, the **Client secret** value, and your Microsoft Entra **tenant ID** (`generic_id`) as a GUID, found under **Microsoft Entra ID** > **Overview** > **Tenant ID**. For this mode, add **Application permissions** instead of delegated permissions on the app registration, and have an admin grant admin consent.