{"id":2085,"date":"2024-11-01T05:41:29","date_gmt":"2024-11-01T12:41:29","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/identity\/?p=2085"},"modified":"2024-11-01T05:41:29","modified_gmt":"2024-11-01T12:41:29","slug":"integrate-copilot-studio-with-external-id","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/identity\/integrate-copilot-studio-with-external-id\/","title":{"rendered":"Allow your customers to access your copilots by integrating Copilot Studio with Microsoft Entra External ID"},"content":{"rendered":"<p>Providing secure and seamless access to applications is essential, especially when those applications leverage the power of AI-driven copilots. Copilot Studio is an innovative platform that allows you to create and customize AI copilots. However, if you\u2019re trying to allow customers to access your Copilot-powered apps through Microsoft Entra External ID, you\u2019ve probably noticed that there is no out-of-the-box integration.<\/p>\n<p>Using the Generic OAUTH 2.0 service provider option within Copilot, this tutorial will guide you step-by-step on how to integrate Copilot and Microsoft Entra External ID\u2014ensuring your customers can securely access your Copilot-powered applications.<\/p>\n<h3>Prerequisites<\/h3>\n<p>Before we dive in, make sure you have the following prerequisites in place:<\/p>\n<ul>\n<li>A <a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-copilot\/microsoft-copilot-studio\">Copilot Studio<\/a> account. <\/li>\n<li>A published Copilot. <\/li>\n<li>An external tenant on the <a href=\"https:\/\/entra.microsoft.com\/#home\">Microsoft Entra Admin center<\/a> \n<ul>\n<li>If you don\u2019t have one, you can create one using our <a href=\"https:\/\/aka.ms\/ciam\/freetrial-info\">30-day free trial<\/a> or <a href=\"https:\/\/aka.ms\/ExternalIDConsumerApps\">create an external tenant<\/a> with an Azure subscription. <\/li>\n<\/ul>\n<\/li>\n<li>An account with at least <a href=\"https:\/\/learn.microsoft.com\/en-us\/entra\/identity\/role-based-access-control\/permissions-reference#cloud-application-administrator\">Cloud Application Administrator<\/a> role. <\/li>\n<\/ul>\n<h2>Step 1: Obtain the redirect URL for the Copilot Studio chat bot<\/h2>\n<p>In Copilot Studio, select the appropriate copilot and navigate to <strong>Settings<\/strong> > <strong>Security<\/strong> > <strong>Authentication<\/strong>.<\/p>\n<ul>\n<li>Select <strong>Authenticate manually<\/strong>.<\/li>\n<li>Make sure that the <strong>Require users to sign in<\/strong> option is selected. <\/li>\n<li>Click <strong>Copy<\/strong>, and save the redirect URL for use in the next steps. <\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/11\/Copilot-studio-settings.png\" alt=\"redirect url for copilot studio chat bot\" \/><\/p>\n<h2>Step 2: Configure Microsoft Entra External ID<\/h2>\n<p>Now that you have the redirect URL, it\u2019s time to set up and configure Microsoft Entra External ID.<\/p>\n<p>Navigate to the <a href=\"https:\/\/entra.microsoft.com\/#home\">Microsoft Entra Admin Center<\/a>, click <strong>Applications<\/strong> and then select \u2018App registrations\u2019.<\/p>\n<ul>\n<li>Register an app using the redirect URL obtained in the previous step. Refer to our docs for <a href=\"https:\/\/learn.microsoft.com\/en-us\/entra\/identity-platform\/quickstart-register-app?tabs=client-secret\">quickstart guidance on registering an app<\/a>. \n<ul>\n<li>For <strong>Account type<\/strong>, select \u2018Accounts in this organizational directory only\u2019. <\/li>\n<li>Select \u2018Web Platform\u2019, and make sure you use the redirect URL obtained in Step 1. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/10\/Redirect-uri-information.png\" alt=\"screenshot\" \/><\/p>\n<ul>\n<li>\n<p>Create a secret following the \u201cAdd Credentials\u201d section in the <a href=\"https:\/\/learn.microsoft.com\/en-us\/entra\/identity-platform\/quickstart-register-app?tabs=client-secret\">quick start guide on registering an app<\/a>. Copy it for use later.<\/p>\n<\/li>\n<li>\n<p>Once the app is registered, copy and save the \u2018client id\u2019, \u2018tenant name\u2019, and \u2018tenant id\u2019 for the next step.<\/p>\n<\/li>\n<\/ul>\n<h2>Step 3: Configure Authentication settings in Copilot Studio<\/h2>\n<p>For this step, make sure that the redirect URL from Step 1 is URL encoded as shown below (you can copy and paste the below).<\/p>\n<pre><code>http%3A%2F%2Ftoken.botframework.com%2F.auth%2Fweb%2Fredirect\n<\/code><\/pre>\n<p>Let\u2019s configure the Authentication options within Copilot Studio.<\/p>\n<ul>\n<li>Go to <strong>Settings<\/strong> > <strong>Security<\/strong> > <strong>Authentication<\/strong> <\/li>\n<li>Select <strong>Authenticate Manually<\/strong> <\/li>\n<li>Select the <strong>Require users to sign in<\/strong> option. <\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/11\/Copilot-studio-settings.png\" alt=\"copilot studio authentication options\" \/><\/p>\n<ul>\n<li><strong>Redirect URL:<\/strong> Make sure this is the redirect URL from Step 1 (unencoded). <\/li>\n<li><strong>Service Provider:<\/strong> Select \u2019Generic OAuth2\u2019. <\/li>\n<li><strong>Client ID:<\/strong> Use the client id obtained from the app registration in the previous step. <\/li>\n<li><strong>Client Secret:<\/strong> Use the client secret obtained from the app registration in the previous step. <\/li>\n<li><strong>Scope List Delimiter:<\/strong> use a comma (,). <\/li>\n<li><strong>Authorization URL Template:<\/strong> Replace the &#8216;tenant name&#8217; and &#8216;tenant id&#8217; to obtain the value.<\/li>\n<\/ul>\n<p>The Authorization URL template should look like the below.<\/p>\n<pre><code>https:\/\/&lt;&lt;TenantName&gt;&gt;.ciamlogin.com\/&lt;&lt;TenantName&gt;&gt;.onmicrosoft.com\/oauth2\/v2.0\/authorize\n<\/code><\/pre>\n<ul>\n<li><strong>Authorization URL query string template:<\/strong> Replace <code>&lt;&lt;ClientId&gt;&gt;<\/code> with the &#8216;client id&#8217; obtained from the app registration in the previous step. Replace <code>&lt;&lt;RedirectUri&gt;&gt;<\/code> with the encoded value, as outlined above.<\/li>\n<\/ul>\n<p>See code sample:<\/p>\n<pre><code>?client_id=&lt;&lt;ClientId&gt;&gt;&amp;redirect_uri=&lt;&lt;RedirectUri&gt;&gt;&amp;scope=openid%20profile&amp;response_type=code&amp;state={state}\n<\/code><\/pre>\n<blockquote>\n<p><strong>Note:<\/strong> Make sure to include the state={state} as shown above. Do not replace {state} with any value as this will be done automatically.<\/p>\n<\/blockquote>\n<ul>\n<li><strong>Token URL template:<\/strong> Replace the &#8216;tenant name&#8217; and &#8216;tenant id&#8217; to obtain the value.<\/li>\n<\/ul>\n<p>The token URL template should look like the below.<\/p>\n<pre><code>https:\/\/&lt;&lt;TenantName&gt;&gt;.ciamlogin.com\/&lt;&lt;TenantName&gt;&gt;.onmicrosoft.com\/oauth2\/v2.0\/token\n<\/code><\/pre>\n<ul>\n<li>\n<p><strong>Token URL query string template:<\/strong> use a question mark (?).<\/p>\n<\/li>\n<li>\n<p><strong>Token body template:<\/strong> Replace <code>&lt;&lt;ClientId&gt;&gt;<\/code> with the &#8216;client id&#8217; obtained from the app registration. Replace <code>&lt;&lt;RedirectUri&gt;&gt;<\/code> with the encoded value, as outlined above.<\/p>\n<\/li>\n<\/ul>\n<p>See code sample.<\/p>\n<pre><code>client_id=&lt;&lt;ClientId&gt;&gt;&amp;redirect_uri=&lt;&lt;RedirectUri&gt;&gt;&amp;grant_type=authorization_code&amp;code={code}\n<\/code><\/pre>\n<ul>\n<li><strong>Refresh URL template:<\/strong> Replace the &#8216;tenant name&#8217; to obtain the value.<\/li>\n<\/ul>\n<p>The refresh URL template should look like the below.<\/p>\n<pre><code>https:\/\/&lt;&lt;TenantName&gt;&gt;.ciamlogin.com\/\/&lt;&lt;TenantName&gt;&gt;.onmicrosoft.com\/oauth2\/v2.0\/token\n<\/code><\/pre>\n<ul>\n<li>\n<p><strong>Refresh URL query string template:<\/strong> use a question mark (?).<\/p>\n<\/li>\n<li>\n<p><strong>Refresh body template:<\/strong> Replace <code>&lt;&lt;ClientId&gt;&gt;<\/code> with the &#8216;client id&#8217; obtained from the app registration in the previous step. Replace <code>&lt;&lt;RedirectUri&gt;&gt;<\/code> with the encoded value, as outlined above.<\/p>\n<\/li>\n<\/ul>\n<p>See code sample.<\/p>\n<pre><code>client_id=&lt;&lt;ClientId&gt;&gt;&amp;redirect_uri=&lt;&lt;RedirectUri&gt;&gt;&amp;grant_type=refresh_token&amp;refresh_token={refresh_token}\n<\/code><\/pre>\n<h2>Step 4: Test the Integration<\/h2>\n<ul>\n<li>Visit the bot\u2019s demo website and click <strong>Login<\/strong>.<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/10\/Bot-demo-website-login.png\" alt=\"bot demo website login\" \/><\/p>\n<ul>\n<li>Log in via External ID \n<ul>\n<li>Use any of the available authentication options provided by External ID, such as username and password, email OTP, Facebook, or Google. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/10\/External-id-login.png\" alt=\"external id login\" \/><\/p>\n<ul>\n<li>After logging in, you will be redirected to a validation code page. Copy the code generated. <\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/10\/Sign-in-validation-code-screen.png\" alt=\"sign in validation code page\" \/><\/p>\n<ul>\n<li>Return to Copilot Studio\u2019s authentication process and enter the code validator provided in previous step. <\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/identity\/wp-content\/uploads\/sites\/74\/2024\/10\/Copilot-studio-code-validator-authentication-process.png\" alt=\"copilot studio code validator authentication process\" \/><\/p>\n<h2>Let\u2019s recap<\/h2>\n<p>Congratulations! You\u2019ve successfully integrated Copilot Studio with Microsoft Entra External ID using the Generic OAuth 2.0 service provider. By following the steps in this tutorial, you\u2019ve enabled external users to securely access your copilot-powered applications.<\/p>\n<p>If you found this tutorial helpful or have questions and feedback, feel free to leave a comment below. You can also use our feedback form to <a href=\"https:\/\/forms.office.com\/r\/BSKw8PqX4V\">share your thoughts and suggest new features<\/a> to enhance External ID. We also encourage you to <a href=\"https:\/\/ux.microsoft.com\/Panel\/MicrosoftEntraExternalID?utm_campaign=ExternalID&amp;utm_source=AppService&amp;utm_medium=Blog\">join our research panel<\/a> to receive invites to participate in customer research.<\/p>\n<p>To learn more and test out features in the Microsoft Entra portfolio, visit our\u202f<a href=\"https:\/\/aka.ms\/dev\/external-id\">developer center<\/a>. Make sure you subscribe to the\u202f<a href=\"https:\/\/aka.ms\/devblog\/external-id\">Identity developer blog<\/a> for more insights and to keep up with the latest on all things Identity. And, follow us on\u202f<a href=\"https:\/\/www.youtube.com\/@MicrosoftSecurity\/playlists\">YouTube<\/a> for video overviews, tutorials, and deep dives.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to securely integrate Microsoft Entra External ID with Copilot-powered applications in this step-by-step tutorial. Using the Generic OAuth 2.0 service provider in Copilot Studio, this guide shows you how to grant customers seamless access to your AI copilots.<\/p>\n","protected":false},"author":161557,"featured_media":2087,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[48],"tags":[59,38,44,65,16,46],"class_list":["post-2085","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-ai","tag-authentication","tag-authorization","tag-copilot-studio","tag-entra","tag-entra-id"],"acf":[],"blog_post_summary":"<p>Learn how to securely integrate Microsoft Entra External ID with Copilot-powered applications in this step-by-step tutorial. Using the Generic OAuth 2.0 service provider in Copilot Studio, this guide shows you how to grant customers seamless access to your AI copilots.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/posts\/2085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/users\/161557"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/comments?post=2085"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/posts\/2085\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/media\/2087"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/media?parent=2085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/categories?post=2085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/identity\/wp-json\/wp\/v2\/tags?post=2085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}