diff --git a/3rdPartySSOWithOKTA/README.md b/3rdPartySSOWithOKTA/README.md new file mode 100644 index 00000000..b1aeb8c4 --- /dev/null +++ b/3rdPartySSOWithOKTA/README.md @@ -0,0 +1,101 @@ +# 3rd Party SSO with OKTA + +This custom canvas demonstates how an access token obtained from a 3rd party identity provider, like OKTA, can be used in the context of a Copilot Studio sign-in flow. + +## Getting started + +To run this sample, including the end-to-end SSO flow with OKTA, you will need to: + +1. Deploy [index.html](./public/index.html) and [signout.html](./public/signout.html) on a remote or local server +2. Create an OKTA developer account, or use an existing one +3. Create a new app integration in OKTA +4. Configure the default access policy in the OTKA authorization server +5. Retrieve the token endpoint for a custom copilot that is configured with manual authentication +6. Update configuration values in index.html + +## Detailed instructions + +### Deploy the sample files + +Deploy [index.html](./public/index.html) and [signout.html](./public/signout.html) on a local or a remote server, so they are availabe via two URLs. For example: [http://localhost:8080/index.html](http://localhost:8080/index.html) and [http://localhost:8080/signout.html](http://localhost:8080/signout.html) + +### Configure OKTA + +1. Sign up for an [OKTA developer account](https://developer.okta.com/signup/) +2. Sign in to the OKTA admin dashboard at **https://{your domain}-admin.okta.com/** and create a new app integration with the following details. + + +| Application Property | Value | +| ---------------------- | ------------------------------------------------------------------- | +| Sign-in method | OIDC - OpenID Connect | +| Application type | Single-Page Application | +| Grant type | Authorization Code, Interaction Code | +| Sign-in redirect URIs | the URL to index.html | +| Sign-out redirect URIs | the URL to signout.html | +| Trusted origins | your base URL, for example http://localhost:8080 | +| Assignments | allow access to specific users or groups based on your requirements | + +3. After creating the app integration, note its Client ID +4. **Index.html** uses the OKTA sign-in widget which relies on the Interaction Code sign-in flow. To enable the Interaction Code flow: + + 1. Navigate to the API settings page in **https://{your domain}.okta.com/admin/oauth2/as** + 2. Under Authorization Servers, edit the default authorization server + 3. Under Access Policies, edit the default policy rule + 4. Under "IF Grant type is" -> Other grants, click on **Interaction Code**. + 5. Update the rule + + +5. You should also make shoure that CORS has been enabled for your base URL. In the OKTA admin center, navigate to Security -> API -> Trusted Origins. You base url (e.g. http://localhost:8080) should appear under "Trusted Origins" with CORS enabled. In case your base url is missing, add the url with CORS enabled. + + +### Configure authentication in Copilot Studio, and obtain the token endpoint + +1. This SSO pattern will work for copilots configured with [manual authentication and any OAuth authentication provider](https://learn.microsoft.com/en-us/microsoft-copilot-studio/configuration-end-user-authentication#manual-authentication-fields). Since it is a passthrough pattern, in which the token is sent to Copilot Studio, but not validated, it will even work when no values are provided for an authentication provider. To configure manual authentication without providing any real values, select "Azure Active Directory v2" and enter **placeholder** in both client ID and secret. + +
+
+
+ Manual authentication without real values
+
+
+
+ The OKTA sign-in widget
+
+
+
+ System.User.AccessToken is set
+
The user has been successfully signed out.
+ + \ No newline at end of file diff --git a/README.md b/README.md index 245737b5..d785cf45 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,30 @@ This repository contains samples and artifacts for Microsoft Copilot Studio. | Sample Name | Description | View | | --- | --- | --- | -| BotConnectorApp | Demonstrates how to connect your bot to a custom app for example mobile-device app | [View][cs#1]| -| BuildYourOwnCanvasSamples | Demonstrates how to connect your bot to a custom canvas with various functionality | [View][cs#2] | -| ConnectToEngagementHub | Demonstrates how to detect a handoff activity during a bot conversation and read conversation context | [View][cs#3] | -| CustomAnalytics | This solution allows customers to create a custom Power BI dashboard on top of their copilots analytics data | [View][cs#4] | -| HumanVerificationSample | Identify if the user on the other side is a human or a bot by sending an email to the user with a verification code | [View][cs#5] | -| ImplementationGuide | The implementation guide document provides a framework to do a 360-degree review of a Copilot Studio project. Through probing questions, it highlights potential risks and gaps, aims at aligning the project with the product roadmap, and shares guidance, best practices and reference architecture examples | [View][cs#6] | -| MultilingualBotSample | Sample implementation of a middleware translation relay bot to do real-time translations using Azure services | [View][cs#7] | -| RelayBotSample | Demonstrates how to connect your bot to existing Azure Bot Service channels | [View][cs#8] | -| SharePointSSOComponent | A Sharepoint component demonstrating how copilots can be deployed to SharePoint sites with SSO enabled | [View][cs#9] | -| TestFramework | Run tests against a bot using Direct Line channel and validate that the bot works as expected | [View][cs#10] | - - -[cs#1]:./BotConnectorApp -[cs#2]:./BuildYourOwnCanvasSamples -[cs#3]:./ConnectToEngagementHub -[cs#4]:./CustomAnalytics -[cs#5]:./HumanVerificationSample -[cs#6]:./ImplementationGuide -[cs#7]:./MultilingualBotSample -[cs#8]:./RelayBotSample -[cs#9]:./SharePointSSOComponent -[cs#10]:./PVATestFramework +| 3rdPartySSOWithOKTA | Demonstrates how to implement a seamless SSO experience with a 3rd party authentication provider | [View][cs#1]| +| BotConnectorApp | Demonstrates how to connect your bot to a custom app for example mobile-device app | [View][cs#2]| +| BuildYourOwnCanvasSamples | Demonstrates how to connect your bot to a custom canvas with various functionality | [View][cs#3] | +| ConnectToEngagementHub | Demonstrates how to detect a handoff activity during a bot conversation and read conversation context | [View][cs#4] | +| CustomAnalytics | This solution allows customers to create a custom Power BI dashboard on top of their copilots analytics data | [View][cs#5] | +| HumanVerificationSample | Identify if the user on the other side is a human or a bot by sending an email to the user with a verification code | [View][cs#6] | +| ImplementationGuide | The implementation guide document provides a framework to do a 360-degree review of a Copilot Studio project. Through probing questions, it highlights potential risks and gaps, aims at aligning the project with the product roadmap, and shares guidance, best practices and reference architecture examples | [View][cs#7] | +| MultilingualBotSample | Sample implementation of a middleware translation relay bot to do real-time translations using Azure services | [View][cs#8] | +| RelayBotSample | Demonstrates how to connect your bot to existing Azure Bot Service channels | [View][cs#9] | +| SharePointSSOComponent | A Sharepoint component demonstrating how copilots can be deployed to SharePoint sites with SSO enabled | [View][cs#10] | +| TestFramework | Run tests against a bot using Direct Line channel and validate that the bot works as expected | [View][cs#11] | + + +[cs#1]:./3rdPartySSOWithOKTA +[cs#2]:./BotConnectorApp +[cs#3]:./BuildYourOwnCanvasSamples +[cs#4]:./ConnectToEngagementHub +[cs#5]:./CustomAnalytics +[cs#6]:./HumanVerificationSample +[cs#7]:./ImplementationGuide +[cs#8]:./MultilingualBotSample +[cs#9]:./RelayBotSample +[cs#10]:./SharePointSSOComponent +[cs#11]:./PVATestFramework ## Contributing