@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 72 lines 5.72 KB
Rendered Raw
1 ## How do I set up custom OAuth credentials for Microsoft Advertising?
2
3 Microsoft Advertising has no Composio-managed app, so you need your own Microsoft Entra ID app registration and a production developer token 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 **Accounts in any organizational directory and personal Microsoft accounts** (shown as **Any Entra ID Tenant + Personal Microsoft accounts**). Microsoft's Advertising app registration guide calls for this option, and Advertising accepts both work or school and personal Microsoft identities.
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. Keep **Allow public client flows** disabled on the **Authentication** page. This is a confidential Web client.
26 8. Sign in to [Microsoft Advertising developer settings](https://ads.microsoft.com/cc/Settings/DevSettings) with a Super Admin account and copy the production **Developer token** (request one if you don't have it). It is separate from the client secret. Sandbox tokens don't work with this toolkit. Don't regenerate a working token just to add another connection.
27
28 ![Microsoft Advertising Developer settings page with the developer token censored](/images/toolkits/microsoft_advertising/developer-settings.webp)
29
30 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`).
31
32 ### Create the auth config in Composio
33
34 1. In the Composio dashboard, go to **Auth Configs**, click **Create**, and select **Microsoft Advertising**. Enter a config name and click **Next**.
35
36 ![Composio Auth Configs page with the Create button](/images/toolkits/microsoft_advertising/composio-auth-configs.webp)
37
38 ![Create Auth Config dialog with Microsoft Advertising selected](/images/toolkits/microsoft_advertising/composio-toolkit-picker.webp)
39
40 ![Auth config name field with the Next button](/images/toolkits/microsoft_advertising/composio-config-name.webp)
41
42 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.
43
44 ![Composio OAuth 2.0 form with empty Client id and Client secret fields and the v1 redirect URI](/images/toolkits/microsoft_advertising/composio-oauth-credentials.webp)
45
46 3. Under **Scopes**, select the same permissions you added in Azure, then click **Create Auth Config**.
47
48 ![Composio auth config with the v1 redirect URI and the msads.manage and offline_access scopes](/images/toolkits/microsoft_advertising/composio-scopes.webp)
49
50 4. Open the auth config and click **Connect Account**. Paste the production developer token (`generic_secret`), not the client secret, and click **Connect Account**. Sign in with the Microsoft identity that is already a user of the advertising account, complete any MFA, and review the consent prompt before accepting.
51
52 ![Microsoft Advertising auth config page with the Connect Account button](/images/toolkits/microsoft_advertising/composio-connect-account.webp)
53
54 ![Composio connection form with an empty Developer Token field](/images/toolkits/microsoft_advertising/developer-token-field.webp)
55
56 ![Microsoft Pick an account page with the accounts censored](/images/toolkits/microsoft_advertising/microsoft-account-picker.webp)
57
58 ![Microsoft consent prompt for Microsoft Advertising API access and continued access](/images/toolkits/microsoft_advertising/microsoft-consent.webp)
59
60 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.
61
62 ![Connected Accounts tab with the Microsoft Advertising account showing Active](/images/toolkits/microsoft_advertising/connected-account-active.webp)
63
64 For the general flow, see [custom auth configs](/docs/auth-configuration/custom-auth-configs).
65
66 ### Scopes
67
68 The default auth config requests `https://ads.microsoft.com/msads.manage` and `offline_access`. The connected identity's Advertising account roles still decide what it can view or change. See Microsoft's [OAuth consent](https://learn.microsoft.com/en-us/advertising/guides/authentication-oauth-consent?view=bingads-13) guide.
69
70 ### Why do I get `AADSTS650052`?
71
72 For an organizational identity, Microsoft can require tenant-admin setup before Advertising authorization works. Ask the tenant admin to review the **Application behavior** section of Microsoft's Advertising app registration guide.