Configure user authentication with Microsoft Entra ID
Important
Power Virtual Agents capabilities and features are now part of Microsoft Copilot Studio following significant investments in generative AI and enhanced integrations across Microsoft Copilot.
Some articles and screenshots may refer to Power Virtual Agents while we update documentation and training content.
Adding authentication to your copilot allows users to sign in, giving your copilot access to a restricted resource or information.
This article covers how to configure Microsoft Entra ID as your service provider. To learn about other service providers and user authentication in general, see Configure user authentication.
If you have tenant administration rights, you can configure API permissions. Otherwise, you need to ask a tenant administrator to do it for you.
Prerequisites
You complete the first several steps in the Azure portal, and complete the final two steps in Copilot Studio.
Create an app registration
Sign in to the Azure portal, using an admin account in the same tenant as your copilot.
Go to App registrations, either by selecting the icon or searching in the top search bar.
Select New registration and enter a name for the registration.
It can be helpful later to use the name of your copilot. For example, if your copilot is called "Contoso sales help," you might name the app registration "ContosoSalesReg."
Under Supported account types, select Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).
Leave the Redirect URI section blank for now. Enter that information in the next steps.
Select Register.
After the registration is complete, go to Overview.
Copy the Application (client) ID and paste it in a temporary file. You need it in later steps.
Add the redirect URL
Go to Authentication, and then select Add a platform.
Under Platform configurations, select Add a platform, and then select Web.
Under Redirect URIs, enter
https://token.botframework.com/.auth/web/redirect
andhttps://europe.token.botframework.com/.auth/web/redirect
.
Note
The authentication configuration pane in Copilot Studio might show the following redirect URL: https://unitedstates.token.botframework.com/.auth/web/redirect
. Using that URL makes the authentication fail; use the URI instead.
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.
Generate a client secret
Go to Certificates & secrets.
In the Client secrets section, select New client secret.
(Optional) Enter a description. One is provided if left blank.
Select the expiry period. Select the shortest period that's relevant for the life of your copilot.
Select Add to create the secret.
Store the secret's Value in a secure temporary file. You need it when you configure your copilot's authentication later on.
Tip
Don't leave the page before you copy the value of the client secret. If you do, the value is obfuscated and you must generate a new client secret.
Configure manual authentication
In Copilot Studio, in the navigation menu under Settings, select Security. Then select the Authentication card.
Select Manual (for any channel including Teams) then turn on Require users to sign in.
Enter the following values for the properties:
Service provider: Select Microsoft Entra ID.
Client ID: Enter the application (client) ID that you copied earlier from the Azure portal.
Client secret: Enter the client secret you generated earlier from the Azure portal.
Scopes: Enter
profile openid
.
Select Save to finish the configuration.
Configure API permissions
Go to API permissions.
Select Grant admin consent for <your tenant name>, and then select Yes. If the button isn't available, you may need to ask a tenant administrator to do enter it for you.
Note
To avoid users from having to consent to each application, a Global Administrator, Application Administrator, or Cloud Application Administrator can grant tenant-wide consent to your app registrations.
Select Add a permission, and then select Microsoft Graph.
Select Delegated permissions.
Expand OpenId permissions and turn on openid and profile.
Select Add permissions.
Define a custom scope for your copilot
Scopes allow you to determine user and admin roles and access rights. You create a custom scope for the canvas app registration that you create in a later step.
Go to Expose an API and select Add a scope.
Set the following properties. You can leave the other properties blank.
Property Value Scope name Enter a name that makes sense in your environment, such as Test.Read
Who can consent? Select Admins and users Admin consent display name Enter a name that makes sense in your environment, such as Test.Read
Admin consent description Enter Allows the app to sign the user in.
State Select Enabled Select Add scope.
Configure authentication in Microsoft Copilot Studio
In Copilot Studio, under Settings, select Security, and then select Authentication.
Select Manual (for custom website).
Turn on Require users to sign in.
Set the following properties.
Property Value Service provider Select Microsoft Entra ID Client ID Enter the application (client) ID that you copied earlier in the Azure portal Client secret Enter the client secret you generated earlier in the Azure portal Scopes Enter profile openid
Select Save.
Tip
The token exchange URL is used to exchange the On-Behalf-Of (OBO) token for the requested access token. For more information, see Configure single sign-on for your custom website.
Test your copilot
Publish your copilot.
In the Test copilot pane, send a message to your copilot.
When the copilot responds, select Login.
A new browser tab opens, asking you to sign in.
Sign in, and then copy the displayed validation code.
Paste the code in the copilot chat to complete the sign-in process.
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre