# Roll Out Dtwo in Microsoft 365 Copilot

Roll out your Dtwo gateway to everyone in your organization in Microsoft 365 Copilot.

## Overview

This guide walks you through rolling out Dtwo to your whole organization in Microsoft 365 Copilot and turning off every other connector, so all tool access goes through Dtwo.

People can't add their own MCP servers in Microsoft 365 Copilot. Instead, an admin adds the gateway once as a custom MCP connector in the Microsoft 365 admin center and rolls it out. Each person then turns it on in Copilot and signs in.

You need:

- The Global Administrator or AI Administrator role in the [Microsoft 365 admin center](https://admin.microsoft.com).
- Access to the [Teams Developer Portal](https://dev.teams.microsoft.com).
- Microsoft 365 Copilot licenses for the people who'll use the gateway. Free Copilot Chat can't use custom connectors.

## Roll out Dtwo to your organization in Microsoft 365 Copilot

Select how your gateway signs people in.

<div class="doc-tabs" data-tabs>

<div class="doc-tablist doc-tablist-cards" role="tablist" aria-label="Sign-in type">
<button type="button" role="tab" class="doc-tab" data-tab="entra" aria-selected="true"><img src="/logos/azure.svg" alt="" width="36" height="36" data-no-lightbox>Microsoft Entra ID</button>
<button type="button" role="tab" class="doc-tab" data-tab="okta"><img src="/logos/okta.png" alt="" width="36" height="36" data-no-lightbox>Okta</button>
</div>

<div class="doc-tabpanel" data-panel="entra" role="tabpanel">

<p class="doc-step">Step 1: Get Microsoft 365 Copilot's client ID and secret from Microsoft Entra ID</p>

If you've already registered Microsoft 365 Copilot as an app in Microsoft Entra ID, go to **App registrations** and open the Microsoft 365 Copilot app. From its **Overview** page, copy the **Application (client) ID** — this is your `<ClientId>` — and the **Directory (tenant) ID** — this is your `<TenantId>`. You'll also need the client secret you created when you registered it — this is your `<ClientSecret>`. If you no longer have it, create a new one under **Certificates & secrets**.

If you haven't registered Microsoft 365 Copilot in Microsoft Entra ID yet, follow [Register Microsoft 365 Copilot in Microsoft Entra ID](/docs/register-m365-copilot-entra), then come back here.

<p class="doc-step">Step 2: Register the OAuth connection in the Teams Developer Portal</p>

Microsoft 365 Copilot keeps the client ID and secret in an OAuth registration in the Teams Developer Portal. The connector you create in the next step points to it.

1. Go to the [Teams Developer Portal](https://dev.teams.microsoft.com) and open **Tools → OAuth Client Registration**. Select **+ New OAuth connection**.
2. Fill in the registration:
   - **Name**: `Dtwo Gateway`
   - **Base URL**: `<GatewayURL>`
   - **Restrict usage by organization**: **My organization only**
   - **Restrict usage by Teams app**: **Any Teams app**. With the default, **Existing Teams app**, you can't save the registration.
   - **Client ID**: `<ClientId>`
   - **Client secret**: `<ClientSecret>`
   - **Authorization endpoint**: `https://login.microsoftonline.com/<TenantId>/oauth2/v2.0/authorize`
   - **Token endpoint**: `https://login.microsoftonline.com/<TenantId>/oauth2/v2.0/token`
   - **Refresh endpoint**: `https://login.microsoftonline.com/<TenantId>/oauth2/v2.0/token`
   - **Scopes**: `<GatewayURL>/mcp offline_access`
   - **Proof Key for Code Exchange (PKCE)**: on

   Replace the placeholders:

   - `<GatewayURL>`: your gateway's MCP URL. Copy it from your gateway's **Overview** tab in the Dtwo UI. It must start with `https://`. The scope is that URL followed by `/mcp`, so it ends in `/mcp/mcp`. That's intended.
   - `<ClientId>`, `<ClientSecret>`, and `<TenantId>`: the values from Step 1.

3. Select **Save** and copy the **OAuth client registration ID**. This is your `<RegistrationId>`.

<p class="doc-step">Step 3: Add the gateway as a connector and roll it out</p>

**Add the connector**

1. In the [Microsoft 365 admin center](https://admin.microsoft.com), go to **Copilot → Connectors** and open the **Gallery** tab.
2. Under **Created by your org**, select **Create a new connector**. On **Custom connector**, under **Connect to MCP server**, select **Add**.
3. Fill in the connector:
   - **Display name**: the name people will see for the gateway in Copilot, for example `Dtwo`.
   - **Description**: what people can do through the gateway, for example "Work with Salesforce, HubSpot, and Slack through Dtwo." Copilot uses it to decide when to call the gateway, so name the tools behind it.
   - **Base URL**: `<GatewayURL>`
   - **Authentication**: **OAuth 2.0**
   - **OAuth registration ID**: `<RegistrationId>` from the previous step
   - The developer name, website, privacy policy, and terms of use URLs. Use your own organization's.
4. Select **Authorize** and sign in with your work account. Then select **Create**.

**Roll it out**

1. Go to **Copilot → Connectors → Your connections** and select the gateway connector.
2. Select **Staged rollout** and add yourself or a small test group first.
3. Once it works for them, select **Deploy to all users**.

**Deploy to all users** only reaches people allowed under **Agents → Settings → User access**, and only people with a Microsoft 365 Copilot license. Changes can take up to 10 minutes.

Each person turns the gateway on once: in Copilot, open **Settings → Sources**, find the gateway, select **Connect**, and sign in with their work account.

<p class="doc-step">Step 4: Turn off other connectors</p>

Microsoft 365 Copilot only lets people use connectors and agents an admin allows, so this comes down to turning off everything except your gateway.

1. In the [Microsoft 365 admin center](https://admin.microsoft.com), go to **Agents → Settings → Agent and plugin access**.
2. Keep **Allow agents and plugins built by your organization** on, since your gateway connector is one of them.
3. Turn off **Allow agents and plugins built by external publishers**. This blocks partner connectors and agents, including ones people already added.
4. Go to **Copilot → Connectors → Your connections**. For every connector other than your gateway, select it and choose **Disable**. This covers Microsoft's prebuilt connectors and any other custom ones your organization created. If you'd rather block all of Microsoft's at once, turn off **Allow agents and plugins built by Microsoft** in step 3 instead.
5. When someone asks for a new connector, add that MCP server to your Dtwo gateway instead, so people use it through Dtwo.

Changes can take up to 10 minutes. Disabled connectors disappear from **Settings → Sources**.

<p class="doc-step">Step 5: Check the rollout</p>

1. Sign in to Copilot as someone in the rollout, open **Settings → Sources**, and confirm your gateway is listed and connected.
2. In a chat, ask a question that names the gateway, for example "Using Dtwo, which tools do you have?" It should list the tools from the MCP servers behind your gateway.
3. If you turned off other connectors, check that **Settings → Sources** lists only your gateway.

</div>

<div class="doc-tabpanel" data-panel="okta" role="tabpanel">

<p class="doc-step">Step 1: Get Microsoft 365 Copilot's client ID and secret from Okta</p>

If you've already registered Microsoft 365 Copilot as an app in Okta, go to **Applications and Resources → Applications** and open the Microsoft 365 Copilot app integration. On its **General** tab, copy the **Client ID** — this is your `<ClientId>` — and the **Client secret** — this is your `<ClientSecret>`.

If you haven't registered Microsoft 365 Copilot in Okta yet, follow [Register Microsoft 365 Copilot in Okta](/docs/register-m365-copilot-okta), then come back here.

<p class="doc-step">Step 2: Register the OAuth connection in the Teams Developer Portal</p>

Microsoft 365 Copilot keeps the client ID and secret in an OAuth registration in the Teams Developer Portal. The connector you create in the next step points to it.

1. Go to the [Teams Developer Portal](https://dev.teams.microsoft.com) and open **Tools → OAuth Client Registration**. Select **+ New OAuth connection**.
2. Fill in the registration:
   - **Name**: `Dtwo Gateway`
   - **Base URL**: `<GatewayURL>`
   - **Restrict usage by organization**: **My organization only**
   - **Restrict usage by Teams app**: **Any Teams app**. With the default, **Existing Teams app**, you can't save the registration.
   - **Client ID**: `<ClientId>`
   - **Client secret**: `<ClientSecret>`
   - **Authorization endpoint**: `<Issuer>/v1/authorize`
   - **Token endpoint**: `<Issuer>/v1/token`
   - **Refresh endpoint**: `<Issuer>/v1/token`
   - **Scopes**: `openid profile email offline_access`
   - **Proof Key for Code Exchange (PKCE)**: on

   Replace the placeholders:

   - `<GatewayURL>`: your gateway's MCP URL. Copy it from your gateway's **Overview** tab in the Dtwo UI. It must start with `https://`.
   - `<ClientId>` and `<ClientSecret>`: the values from Step 1.
   - `<Issuer>`: the **Issuer URI** of the authorization server your gateway uses, for example `https://<OktaDomain>/oauth2/<ServerId>`. Find it under **Security → API → Authorization Servers**.

3. Select **Save** and copy the **OAuth client registration ID**. This is your `<RegistrationId>`.

<p class="doc-step">Step 3: Add the gateway as a connector and roll it out</p>

**Add the connector**

1. In the [Microsoft 365 admin center](https://admin.microsoft.com), go to **Copilot → Connectors** and open the **Gallery** tab.
2. Under **Created by your org**, select **Create a new connector**. On **Custom connector**, under **Connect to MCP server**, select **Add**.
3. Fill in the connector:
   - **Display name**: the name people will see for the gateway in Copilot, for example `Dtwo`.
   - **Description**: what people can do through the gateway, for example "Work with Salesforce, HubSpot, and Slack through Dtwo." Copilot uses it to decide when to call the gateway, so name the tools behind it.
   - **Base URL**: `<GatewayURL>`
   - **Authentication**: **OAuth 2.0**
   - **OAuth registration ID**: `<RegistrationId>` from the previous step
   - The developer name, website, privacy policy, and terms of use URLs. Use your own organization's.
4. Select **Authorize** and sign in with your work account. Then select **Create**.

**Roll it out**

1. Go to **Copilot → Connectors → Your connections** and select the gateway connector.
2. Select **Staged rollout** and add yourself or a small test group first.
3. Once it works for them, select **Deploy to all users**.

**Deploy to all users** only reaches people allowed under **Agents → Settings → User access**, and only people with a Microsoft 365 Copilot license. Changes can take up to 10 minutes.

Each person turns the gateway on once: in Copilot, open **Settings → Sources**, find the gateway, select **Connect**, and sign in with their work account.

<p class="doc-step">Step 4: Turn off other connectors</p>

Microsoft 365 Copilot only lets people use connectors and agents an admin allows, so this comes down to turning off everything except your gateway.

1. In the [Microsoft 365 admin center](https://admin.microsoft.com), go to **Agents → Settings → Agent and plugin access**.
2. Keep **Allow agents and plugins built by your organization** on, since your gateway connector is one of them.
3. Turn off **Allow agents and plugins built by external publishers**. This blocks partner connectors and agents, including ones people already added.
4. Go to **Copilot → Connectors → Your connections**. For every connector other than your gateway, select it and choose **Disable**. This covers Microsoft's prebuilt connectors and any other custom ones your organization created. If you'd rather block all of Microsoft's at once, turn off **Allow agents and plugins built by Microsoft** in step 3 instead.
5. When someone asks for a new connector, add that MCP server to your Dtwo gateway instead, so people use it through Dtwo.

Changes can take up to 10 minutes. Disabled connectors disappear from **Settings → Sources**.

<p class="doc-step">Step 5: Check the rollout</p>

1. Sign in to Copilot as someone in the rollout, open **Settings → Sources**, and confirm your gateway is listed and connected.
2. In a chat, ask a question that names the gateway, for example "Using Dtwo, which tools do you have?" It should list the tools from the MCP servers behind your gateway.
3. If you turned off other connectors, check that **Settings → Sources** lists only your gateway.

</div>

</div>

---

Having trouble? Email [support@dtwo.ai](mailto:support@dtwo.ai).