Configure single sign-on with Microsoft Entra ID

Copilot Studio supports single sign-on (SSO). SSO allows agents on your website to sign customers in if they're already signed in to the page or app where the agent is deployed.

For example, the agent is hosted on the corporate intranet or in an app that the user is already signed in to.

There are five main steps to configuring SSO for Copilot Studio:

  1. Configure manual authentication for your agent with Microsoft Entra ID.

  2. Create an app registration in Microsoft Entra ID for your custom canvas.

  3. Authorize the canvas app to use the authentication app's custom scope.

  4. Add the custom scope to your agent configuration.

  5. Configure your custom canvas client-side code for SSO.

Prerequisites

Note

For other OAuth 2.0 providers, learn more in Configure single sign-on with a generic OAuth provider.

Supported channels

The following table lists the channels that support SSO. This article describes SSO for a custom website canvas. For Teams deployments, follow the separate Teams SSO guidance.

Channel Supported
Azure Bot Service channels Not supported
Custom Website Supported
Demo Website Not supported
Facebook Not supported
Microsoft Teams1 Supported
Mobile App Not supported
Omnichannel for Customer Service2 Supported
SharePoint Supported

1 Authenticate with Microsoft provides automatic SSO for supported Teams chats. If your deployment requires manual authentication, follow the app registration and deployment instructions in Configure single sign-on with Microsoft Entra ID for agents in Teams.

2 Only the live chat channel is supported. Learn more in Configure handoff to Dynamics 365 Customer Service.

Important

SSO isn't supported when an agent is published to Power Pages.

Find your agent's token endpoint URL

Both procedures use the agent's token endpoint URL. Record it before you configure the custom canvas.

  1. In Copilot Studio, open your agent and then select Channels.

  2. Select Mobile app.

  3. Under Token Endpoint, select Copy.

    Screenshot of copying the token endpoint URL in Copilot Studio.

Create app registrations for your custom website

To configure SSO, create two separate app registrations:

  • An authentication app registration for Microsoft Entra ID user authentication in your agent.
  • A canvas app registration for your custom web page.

For security reasons, don't reuse the same app registration for both your agent and your custom website.

  1. To create an authentication app registration, follow the instructions in Configure user authentication with Microsoft Entra ID.

  2. Create a second app registration to serve as your canvas app registration.

Add token exchange URL

Use the full scope URI that the authentication app registration exposes as the token exchange URL. If you didn't create a custom scope, follow Configure user authentication with Microsoft Entra ID first.

  1. In the Azure portal on your authentication app's registration page, go to Expose an API.

  2. Under Scopes, select the Copy to clipboard icon.

  3. In Copilot Studio, in the navigation menu under Settings, select Security, and then select the Authentication tile.

  4. For Token exchange URL (required for SSO), paste the scope you copied earlier.

  5. Select Save, and then publish your agent.

Authorize the canvas app to use the authentication app's scope

  1. In the Azure portal, open your canvas app registration and go to Overview.

  2. Copy the Application (client) ID value under Essentials.

  3. Open your authentication app registration, and then select Manage > Expose an API.

  4. Under Authorized client applications, select Add a client application.

  5. In Client ID, paste the canvas app's client ID.

  6. Under Authorized scopes, select the scope you created for token exchange, and then select Add application.

Configure your canvas app registration

  1. Open your canvas app registration and go to Authentication.

  2. Under Platform configurations, select Add a platform, and then select SPA.

  3. Under Redirect URIs, enter the URL for your web page. For example, https://www.contoso.com/index.html.

  4. In the Implicit grant and hybrid flows section, turn on both Access tokens (used for implicit flows) and ID tokens (used for implicit and hybrid flows).

  5. Select Configure.

Configure SSO in your web page

Important

Guest users can't access AI-generated answers from SharePoint and Graph Connector data sources in apps configured for SSO.

Use the complete Microsoft Entra ID SSO sample, including its libraries and Web Chat middleware. Follow the sample's README and update the configuration placeholders in index.html.

  1. In the Azure portal, open your canvas app registration.

  2. On Overview, copy the Application (client) ID and Directory (tenant) ID.

    Screenshot of the App registration Overview page in Azure portal, with Overview, Application ID, and Directory ID highlighted.

  3. Replace the sample's client ID and tenant ID placeholders with the values from the canvas app registration. Don't use the authentication app's client ID here.

  4. Replace the token endpoint placeholder with the agent's token endpoint URL.

  5. If you customize the user ID, keep it within the sample's 64-character limit.

  6. Save your changes.

  7. Host the page at the redirect URL you registered. Sign in by using the sample's sign-in button, and then start a conversation that requires authentication.

    When token exchange succeeds, the agent doesn't ask you to sign in again or copy a validation code into the chat. If it does, check the canvas app identifiers, authorized scope, token exchange URL, and agent publication.

    Note

    The sample's sign-in button establishes the initial signed-in session. In production, your app must manage that initial sign-in. Keep the fallback sign-in card available if token exchange fails.

Register an application in Microsoft Entra ID