Configure end-user authentication in Power Virtual Agents
You can configure a Power Virtual Agents bot to provide authentication capabilities, so users can sign in with any OAuth2 identity provider, such as Azure Active Directory (Azure AD), a Microsoft account, or Facebook.
To learn how to add authentication to a bot topic, see Add user authentication to a Power Virtual Agents bot.
Power Virtual Agents supports any identity provider that is compliant with the OAuth2 standard.
Registering a new app with your identity provider
You will need to register a new app with your identity provider and get a Client ID and Client Secret before you can configure authentication in Power Virtual Agents.
Make sure to configure the redirect URL to be
https://token.botframework.com/.auth/web/redirect, and that the assigned API permissions and scopes for the app are the same permissions you need the bot to access.
Your app registration redirect URL must be
Ensure that the app has the correct API permissions and its related scopes.
In Power Virtual Agents, select Manage on the side navigation pane, and then go to the Authentication tab.
Enter the information as described for each of the fields in the following table. The information required depends on your setup and provider. If you have questions about the required information, contact your administrator or identity provider.
Click Save to finish the configuration.
The examples provided below are for an Azure AD common endpoint.
|Connection name||Friendly name for your identity provider connection. This can be any string, but can't be changed once configured.|
|Service Provider||This field cannot be edited because Power Virtual Agents only supports generic OAuth2 providers.|
|Client ID||Your Client ID obtained from the identity provider.|
|Client Secret||Your Client Secret obtained from the identity provider registration.|
|Scope List delimiter||The separator character for the scope list. Empty spaces (' ') are not supported in this field, but can be used in the Scopes field if required by the identity provider. In that case, use a comma (',') for this field, and spaces (' ') in the Scopes field.|
|Authorization URL Template||URL template for authorization, defined by your identity provider.
|Authorization URL Query String Template||Query template for authorization, provided by your identity provider.
Keys in the query string template will vary depending on the identity provider.
|Token URL Template||URL Template for tokens, provided by your identity provider.
Note: You must replace this with your Identity Provider URL. For Azure Apps, you need to replace the base URL with your Azure App URL.
|Token URL Query String Template||Query string separator for the token URL. Usually a question mark '?'.|
|Token Body Template||Template for the token body.
|Refresh URL Template||URL template for refresh.
Note: You must replace this with your Identity Provider URL. For Azure Apps, you want to replace the base URL with your Azure App URL.
|Refresh URL Query String Template||Refresh URL query string separator for the token URL. Usually a question mark '?'.|
|Refresh Body Template||Template for the refresh body.
|Scopes||List of scopes you want authenticated users to have once signed in. Make sure you are only setting the necessary scopes, and follow the Least privilege access control principle.|
Test your configuration
After the setup steps are complete, save your configuration and test it by creating a new topic using authentication.
Remove the authentication configuration
Select Manage on the side navigation pane, and then go to the Authentication tab.
Select Delete connection.
If authentication is being used in a topic, you will receive a warning that the connection cannot be deleted until references to it are removed from the affected topics. A list of the affected topics will be provided in the warning note.
Permanently remove the authentication configuration
Deleting the authentication information from the bot does not remove it from Azure Bot Service. If you want to clear the configuration from Azure Bot Service, you will need to contact your subscription owner, who will need to follow these steps. If these steps can't be followed, contact your Microsoft Support manager to have the issue resolved.
Sign in to the Azure Portal.
Go to Bot Services.
Select the connection to be deleted.
Delete the connection.