Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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:
Configure manual authentication for your agent with Microsoft Entra ID.
Create an app registration in Microsoft Entra ID for your custom canvas.
Authorize the canvas app to use the authentication app's custom scope.
Add the custom scope to your agent configuration.
Configure your custom canvas client-side code for SSO.
Prerequisites
- Configure user authentication with Microsoft Entra ID
- Add an authentication topic to your agent
- Use a custom canvas
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 |
| 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.
In Copilot Studio, open your agent and then select Channels.
Select Mobile app.
Under Token Endpoint, select Copy.
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.
To create an authentication app registration, follow the instructions in Configure user authentication with Microsoft Entra ID.
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.
In the Azure portal on your authentication app's registration page, go to Expose an API.
Under Scopes, select the Copy to clipboard icon.
In Copilot Studio, in the navigation menu under Settings, select Security, and then select the Authentication tile.
For Token exchange URL (required for SSO), paste the scope you copied earlier.
Select Save, and then publish your agent.
Authorize the canvas app to use the authentication app's scope
In the Azure portal, open your canvas app registration and go to Overview.
Copy the Application (client) ID value under Essentials.
Open your authentication app registration, and then select Manage > Expose an API.
Under Authorized client applications, select Add a client application.
In Client ID, paste the canvas app's client ID.
Under Authorized scopes, select the scope you created for token exchange, and then select Add application.
Configure your canvas app registration
Open your canvas app registration and go to Authentication.
Under Platform configurations, select Add a platform, and then select SPA.
Under Redirect URIs, enter the URL for your web page. For example,
https://www.contoso.com/index.html.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).
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.
In the Azure portal, open your canvas app registration.
On Overview, copy the Application (client) ID and Directory (tenant) ID.
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.
Replace the token endpoint placeholder with the agent's token endpoint URL.
If you customize the user ID, keep it within the sample's 64-character limit.
Save your changes.
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.