Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | ## How do I set up custom OAuth credentials for Microsoft Entra ID? |
| 2 | |
| 3 | Microsoft Entra ID has no Composio-managed app, so you need your own app registration to connect it. |
| 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 an organizational option: **Accounts in this organizational directory only** (single tenant) or **Accounts in any organizational directory** (multitenant). |
| 9 | 3. Under **Redirect URI**, select the **Web** platform, enter `https://backend.composio.dev/api/v1/auth-apps/add`, and click **Register**. |
| 10 | 4. On the app's **Overview** page, copy the **Application (client) ID**. |
| 11 | |
| 12 |  |
| 13 | |
| 14 | 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. |
| 15 | |
| 16 |  |
| 17 | |
| 18 | 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. |
| 19 | |
| 20 |  |
| 21 | |
| 22 | 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 `User.Read` and `offline_access`, plus the directory permissions your workflow needs, then click **Add permissions**. |
| 23 | |
| 24 |  |
| 25 | |
| 26 |  |
| 27 | |
| 28 |  |
| 29 | |
| 30 |  |
| 31 | |
| 32 | 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. |
| 33 | |
| 34 | 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`). |
| 35 | |
| 36 | ### Create the auth config in Composio |
| 37 | |
| 38 | 1. In the Composio dashboard, go to **Auth Configs**, click **Create**, and select **Microsoft Entra ID**. Enter a config name and click **Next**. |
| 39 | |
| 40 |  |
| 41 | |
| 42 |  |
| 43 | |
| 44 |  |
| 45 | |
| 46 | 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. Keep **Microsoft cloud environment** (`microsoft_cloud`) set to `global` for commercial Microsoft 365, or set `gcc_high` for Microsoft 365 US Government GCC High. The app registration must live in that cloud. |
| 47 | |
| 48 |  |
| 49 | |
| 50 |  |
| 51 | |
| 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 to the tenant that holds the directory you want to use and review the consent prompt. Directory administration also needs the matching Entra roles on the signed-in account. 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 |  |
| 56 | |
| 57 |  |
| 58 | |
| 59 |  |
| 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 |  |
| 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 `User.Read` and `offline_access`. Directory operations need operation-specific Graph permissions and roles. See Microsoft's [get user](https://learn.microsoft.com/en-us/graph/api/user-get?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 | Microsoft Entra ID 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** (`issuer`) 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. In this mode the tenant field also accepts a verified tenant domain. |