Skip to main content

SSO Setup

This section describes how to configure the Azure Bot Service (ABS), the Entra App Registration and the Teams manifest to enable Single-Sign-On (SSO) for your Teams app.

Let an AI assistant run this for you

The teams-dev skill can orchestrate the full SSO setup for you — install it in your AI coding assistant and say "set up SSO for my Teams bot".

Prerequisites​

Before starting SSO configuration, ensure you have:

  • An Azure-managed Azure Bot Service resource and its associated Entra App Registration (Application ID / Client ID and Tenant ID).

  • To set up using CLIs: the az CLI and the Teams Developer CLI installed and authenticated.

    CLI users: migrate first if your bot is Teams-managed

    SSO requires an Azure-managed bot because the OAuth connection lives in Azure Bot Service. If you registered with teams app create (default Teams-managed), migrate your bot first:

    teams app bot migrate <appId> --subscription <id> --resource-group <rg>

    Your CLIENT_ID, CLIENT_SECRET, and TENANT_ID stay the same. See Bot Locations for details.

Configure the Entra App Registration for SSO​

You need an Entra ID App Registration to configure the OAuth Connection in Azure Bot Service. If you don't already have one, follow the Create the Entra App Registration guide first.

  1. Add the Bot Framework redirect URI. From your App Registration, navigate to Authentication and add a Web platform redirect URI with the value https://token.botframework.com/.auth/web/redirect

Entra auth redirect

  1. Configure the API. From Expose an API, click Add to Application ID URI and set the value to api://<Your-Application-Id>. Add the scope access_as_user and select who can consent.

Entra oauth scopes

  1. Authorize the client applications for SSO. To enable the Teams clients, desktop and web, to perform the SSO flow you must add the following client applications to the scope defined before: Teams Desktop 1fec8e78-bce4-4aaf-ab1b-5451cc387264 and Teams Web 5e3ce6c0-2b1f-4285-8d4b-75ee78787346

Entra oauth authorize client app

Create the OAuth connection in Azure Bot Service​

You need to add a new OAuth connection to your Azure Bot Service resource.

  1. From the Bot service resource in the Azure Portal, navigate to Settings/Configuration and Add OAuth Connection settings.
  2. Provide a name for your connection e.g. graph, and select the Service Provider Azure Active Directory v2
  3. Populate the TenantId/ClientId/ClientSecret from the values obtained in the previous section. Configure the Token Exchange URL with the Application ID URI (e.g. api://<Your-Application-Id>), and add the Scopes you need e.g. User.Read

ABS OAuth connection

Configure the App Manifest​

The Teams application manifest needs to be updated to include webApplicationInfo with the Application Id and Application ID URI.

Add *.botframework.com to validDomains and add the webApplicationInfo section to your manifest.json:

"validDomains": [
...
"*.botframework.com"
],
"webApplicationInfo": {
"id": "<Your-Application-Id>",
"resource": "api://<Your-Application-Id>"
}

Troubleshooting​

If you encounter SSO errors, see the Troubleshooting guide for common issues and solutions.