diff --git a/BotSSOSetup.md b/BotSSOSetup.md new file mode 100644 index 0000000000..5242f577c6 --- /dev/null +++ b/BotSSOSetup.md @@ -0,0 +1,134 @@ +## Bot SSO Setup +This document show how to setup AAD and Azure Bot Services, which are the prerequisites steps to enable Bot SSO. + +### 1. Create and configure AAD app + +#### 1.1 Create AAD app for SSO + +This step will create an AAD app, it will be reused wherever it needs AAD throughout this sample to simpler the steps. + +- Navigate to [Azure _App Registration_ Blade](https://ms.portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) + +- Click "New Registration" on the upper left corner + +- Fill out name and select third option for supported account type +- Set Redirect Uri to "https://token.botframework.com/.auth/web/redirect" and click "Register": + + ![App Registration Organization](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/AppRegistration.png) + +- Navigate to the AAD app you just created, _copy and paste the Application ID(will referred as **AppId** in this document) somewhere safe_. You'll need it in a future step: + ![Save Application ID](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/AppId.png) + +#### 1.2 Create Client Secret + +- Navigate to the "Certificates & secrets" blade and add a client secret by clicking "New Client Secret" + + ![New Secret](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/ClientSecret.png) +
+ +- _Copy and paste the secret somewhere safe_. You'll need it in a future step + +#### 1.3. Expose API endpoint + +- Click "_Expose an API_" in the left rail + + - Update your application ID URL to include your bot id - api://botid-, where is the id of the bot that will be making the SSO request and found in your Teams Application Manifest, which is the same you create and saved in step1.1: + ![Application ID URI](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/AppIdUri.png) + + - Click "_Add a scope_" + + - access_as_user as the Scope name. + + - Set Who can consent? to Admins and users + + - Fill in the fields for configuring the admin and user consent prompts with values that are appropriate for the access_as_user scope. Suggestions: + + - Admin consent title: Teams can access the user’s profile + + - Admin consent description: Allows Teams to call the app’s web APIs as the current user. + + - User consent title: Teams can access your user profile and make requests on your behalf + + - User consent description: Enable Teams to call this app’s APIs with the same rights that you have + + - Ensure that State is set to Enabled + + - Select Add scope (Note: The domain part of the Scope name displayed just below the text field should automatically match the Application ID URI set in the previous step, with /access_as_user appended to the end) + + ![Add Scope](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/CreateScope.png) + +#### 1.4. Authorize client applications + +Add the following Ids as authorized clients for your application + +- 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application) + +- 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application) + + ![Add Client Application](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/AddClient.png) + +#### 1.5. Add any necessary API permissions for downstream calls + +- Navigate to "API permissions" blade on the left hand side + +- Add any user delegated permissions that your app will need to downstream APIs. This quick start only requires User.Read. + + ![Add Permissions](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/image013.png) + +#### 1.6. Enable implicit grant + +- Navigate to "Authentication" + +- Check the *Access tokens* and *ID tokens* boxes.. + +#### 1.7 +- Navigate to "Manifest" +- Confirm the config item: `"accessTokenAcceptedVersion": 2`, if not, change its value to 2, click "save". (If you are already in testing your bot in Teams, you need to signout this app and signout Teams then signin again to see this change work). + + +### 2. Setup bot in Azure Bot Service + +#### 2.1. Run ngrok - point to port 3978 + +```bash +ngrok http -host-header=rewrite 3978 +``` + +#### 2.2. Create new Bot Channel Registration resource in Azure + +Create [Bot Channels registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure +- For the "_Messaging endpoint_", use the current `https` URL you were given by running ngrok. Append with the path `/api/messages`: +- For "Microsoft App ID and password", click "Create New", fill in the AppId and client secret you created in step1.1 and step 1.2: + ![Create Bot Channels Registration](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/CreateBot.png) + + ![Create Bot Channels Registration2](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/CreateBot2.png) + +- After you select *Create*, it will take a few moments for your bot service to be provisioned. Once you see a notification indicating the validation process is complete, navigate back to *Home > Bot Services* to find your bot. You may have to refresh the page to see your bot listed. +- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0) + +### 3. Setup Bot Service Connection (TokenStore) + +- In the Azure Portal, navigate back to the Bot Channels Registration created in Step 2 + + +- Switch to the "Settings" blade and click "Add Setting" under the OAuth Connection Settings section + + ![Add OAuth Settings](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/AddOauth.png) + +- Fill out the Connection Setting form + + - Enter a name for your new Connection setting. This will be the name that gets referenced inside the settings of your bot service code in step 5 + + - In the Service Provider dropdown, select Azure Active Directory V2 + + - Enter in the client id and client secret obtained in step 2 + + - For the Token Exchange URL use the Application ID URL obtained in step 2 + + - Specify "common" as the Tenant ID + + - Add all the scopes configured when specifying permissions to downstream APIs in step 2 + + - Click "Save" + + ![SSO Connection Settings](https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-conversation-sso-quickstart/js/sso_media/image017.png) diff --git a/README.md b/README.md index e6f51cae75..f36c957ac9 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,9 @@ |3|Messaging extensions - action quick-start | Hello world Messaging Extension that accepts parameters and returns a card. Also, how to receive a forwarded message as a parameter in a Messaging Extension. | | [View][msgext-action-quickstart#js] | | |4|Messaging extensions - action | Messaging Extension that accepts parameters and returns a card. Also, how to receive a forwarded message as a parameter in a Messaging Extension. | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/51.teams-messaging-extensions-action) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/51.teams-messaging-extensions-action) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/51.teams-messaging-extensions-action) | |5|Messaging extensions - auth and config | Messaging Extension that has a configuration page, accepts search requests and returns results after the user has signed in. | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/52.teams-messaging-extensions-search-auth-config) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/52.teams-messaging-extensions-search-auth-config) | -|6|Messaging extensions - action preview | Demonstrates how to create a Preview and Edit flow for a Messaging Extension. | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/53.teams-messaging-extensions-action-preview) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/53.teams-messaging-extensions-action-preview) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/53.teams-messaging-extensions-action-preview) | -|7|Link unfurling | Messaging Extension that performs link unfurling. | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/55.teams-link-unfurling) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/55.teams-link-unfurling) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/55.teams-link-unfurling) | +|6|Messaging extensions - auth and config | Messaging Extension that has a configuration page, accepts search requests and returns results with SSO. | | [View][msgext-search-sso-config#js] | +|7|Messaging extensions - action preview | Demonstrates how to create a Preview and Edit flow for a Messaging Extension. | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/53.teams-messaging-extensions-action-preview) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/53.teams-messaging-extensions-action-preview) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/53.teams-messaging-extensions-action-preview) | +|8|Link unfurling | Messaging Extension that performs link unfurling. | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/55.teams-link-unfurling) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/55.teams-link-unfurling) | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/55.teams-link-unfurling) | #### Additional samples @@ -129,6 +130,7 @@ [msgext-link-unfurl#cs]:samples/msgext-link-unfurling-reddit/csharp [msgext-action-quickstart#js]:samples/msgext-action-quickstart/js [msgext-search-quickstart#js]:samples/msgext-search-quickstart/js +[msgext-search-sso-config#js]:samples/msgext-search-sso-config [tab-sso#ts]:samples/tabs-sso/nodejs [tab-sso#cs]:samples/tab-sso/csharp diff --git a/samples/msgext-search-sso-config/.env b/samples/msgext-search-sso-config/.env index 7dc5295e35..68b404929e 100644 --- a/samples/msgext-search-sso-config/.env +++ b/samples/msgext-search-sso-config/.env @@ -1,4 +1,4 @@ -MicrosoftAppId=d9dd7f95-ce59-4c16-abf2-378569eee647 -MicrosoftAppPassword=81n5x5.lGyE1p_OKN5oJt2F4__w_32FNqz -connectionName=YifeBotConnect -SiteUrl=https://5bc254477ba4.ngrok.io \ No newline at end of file +MicrosoftAppId= +MicrosoftAppPassword= +connectionName= +SiteUrl= \ No newline at end of file diff --git a/samples/msgext-search-sso-config/README.md b/samples/msgext-search-sso-config/README.md index da4d3805e5..2ce0cf0cc3 100644 --- a/samples/msgext-search-sso-config/README.md +++ b/samples/msgext-search-sso-config/README.md @@ -1,6 +1,6 @@ -# Teams Search Auth Config Bot +# Teams Search SSO Config Bot -Bot Framework v4 sample for Teams expands the [50.teams-messaging-extensions-search](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/50.teams-messaging-extensions-search) sample to include a configuration page and Bot Service authentication. +Bot Framework v4 sample for Teams expands the [52.teams-messaging-extensions-search-auth-config](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/52.teams-messaging-extensions-search-auth-config) sample to include a configuration page and Bot Service SSO authentication. This bot has been created using [Bot Framework](https://dev.botframework.com), it shows how to use a Messaging Extension configuration page, as well as how to sign in from a search Messaging Extension. @@ -15,48 +15,33 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i > Note these instructions are for running the sample on your local machine, the tunnelling solution is required because the Teams service needs to call into the bot. -1) Clone the repository +### 1. Setup for Bot SSO +Refer to [Bot SSO Setup document](../../../BotSSOSetup.md). - ```bash - git clone https://github.com/Microsoft/botbuilder-samples.git - ``` +### 2. Configure this sample -1) In a terminal, navigate to `samples/javascript_nodejs/52.teams-messaging-extensions-search-auth-config` + Update the `.env` configuration for the bot to use the Microsoft App Id and App Password from the Bot Framework registration. The `SiteUrl` is the URL that generated by ngrok and start with "https". (Note the MicrosoftAppId is the AppId created in step 1.1, the MicrosoftAppPassword is referred to as the "client secret" in step1.2 and you can always create a new client secret anytime.) -1) Install modules +### 3. Run your bot sample +Under the root of this sample folder, build and run by commands: +- `npm install` +- `npm start` - ```bash - npm install - ``` +### 4. Configure and run the Teams app +- **Using App Studio** + - Open your app in App Studio's manifest editor. + - Open the *Bots* page under *Capabilities*. + - Choose *Setup*, then choose the existing bot option. Enter your AAD app registration ID from step 1.1. Select any of the scopes you wish to have the bot be installed. + - Open *Domains and permissions* from under *Finish*. Enter the same ID from the step above in *AAD App ID*, then and append it to "api://botid-" and enter the URI into *Single-Sign-On*. + - Open *Test and distribute*, then select *Install*. -1) Run ngrok - point to port 3978 - - ```bash - ngrok http -host-header=rewrite 3978 - ``` - -1) Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure - - Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample - - Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0) - - __*If you don't have an Azure account*__ you can use this [Bot Framework registration](https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams#register-your-web-service-with-the-bot-framework) - -1) Update the `.env` configuration for the bot to use the Microsoft App Id and App Password from the Bot Framework registration. (Note the App Password is referred to as the "client secret" in the azure portal and you can always create a new client secret anytime.) - -1) __*This step is specific to Teams.*__ - - **Edit** the `manifest.json` contained in the `teamsAppManifest` folder to replace your Microsoft App Id (that was created when you registered your bot earlier) *everywhere* you see the place holder string `<>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) - - **Zip** up the contents of the `teamsAppManifest` folder to create a `manifest.zip` - - **Upload** the `manifest.zip` to Teams (in the Apps view click "Upload a custom app") - -1) Run your bot at the command line: - - ```bash - npm start - ``` - -## Interacting with the bot in Teams - -Once the Messaging Extension is installed, click the icon for **Config Auth Search** in the Compose Box's Messaging Extension menu to display the search window. Right click to choose **Settings** and view the Config page. +- **Manually update the manifest.json** + - Edit the `manifest.json` contained in the `appPackage/` folder to replace with your MicrosoftAppId (that was created in step1.1 and is the same value of MicrosoftAppId in `.env` file) *everywhere* you see the place holder string `{TODO: MicrosoftAppId}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) + - Zip up the contents of the `appPackage/` folder to create a `manifest.zip` + - Upload the `manifest.zip` to Teams (in the left-bottom *Apps* view, click "Upload a custom app") +- **Interacting with the Message Extension in Teams + Once the Messaging Extension is installed, find the icon for **Config Auth Search** in the Compose Box's Messaging Extension menu. Right click to choose **Settings** and view the Config page. Click the icon to display the search window, type anything it will show your profile picture. ## Deploy the bot to Azure To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions. diff --git a/samples/msgext-search-sso-config/teamsAppManifest/icon-color.png b/samples/msgext-search-sso-config/appPackage/icon-color.png similarity index 100% rename from samples/msgext-search-sso-config/teamsAppManifest/icon-color.png rename to samples/msgext-search-sso-config/appPackage/icon-color.png diff --git a/samples/msgext-search-sso-config/teamsAppManifest/icon-outline.png b/samples/msgext-search-sso-config/appPackage/icon-outline.png similarity index 100% rename from samples/msgext-search-sso-config/teamsAppManifest/icon-outline.png rename to samples/msgext-search-sso-config/appPackage/icon-outline.png diff --git a/samples/msgext-search-sso-config/teamsAppManifest/manifest.json b/samples/msgext-search-sso-config/appPackage/manifest.json similarity index 84% rename from samples/msgext-search-sso-config/teamsAppManifest/manifest.json rename to samples/msgext-search-sso-config/appPackage/manifest.json index 09d411ede2..b36b42f23f 100644 --- a/samples/msgext-search-sso-config/teamsAppManifest/manifest.json +++ b/samples/msgext-search-sso-config/appPackage/manifest.json @@ -1,9 +1,9 @@ { - "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json", - "manifestVersion": "1.5", - "version": "1.0.0", - "id": "d9dd7f95-ce59-4c16-abf2-378569eee647", - "packageName": "com.microsoft.teams.sample", + "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json", + "manifestVersion": "1.8", + "version": "1.0.2", + "id": "{TODO: MicrosoftAppId}", + "packageName": "com.microsoft.teams.samples.msgExt", "developer": { "name": "Microsoft", "websiteUrl": "https://dev.botframework.com", @@ -15,8 +15,8 @@ "outline": "icon-outline.png" }, "name": { - "short": "Messaging Extension Auth", - "full": "ME Auth for Search, Action and link unfurling" + "short": "Messaging Extension SSO", + "full": "ME SSO for Search, Action and link unfurling" }, "description": { "short": "ME Authentication for Search, Action and Link unfurling", @@ -25,7 +25,7 @@ "accentColor": "#FFFFFF", "composeExtensions": [ { - "botId": "d9dd7f95-ce59-4c16-abf2-378569eee647", + "botId": "{TODO: MicrosoftAppId}", "canUpdateConfiguration": true, "commands": [ { @@ -110,7 +110,7 @@ "*.botframework.com" ], "webApplicationInfo": { - "id": "d9dd7f95-ce59-4c16-abf2-378569eee647", - "resource": "api://botid-d9dd7f95-ce59-4c16-abf2-378569eee647" + "id": "{TODO: MicrosoftAppId}", + "resource": "api://{TODO: SiteUrlDomain}/botid-{TODO: MicrosoftAppId}/{TODO: MicrosoftAppId}" } } \ No newline at end of file diff --git a/samples/msgext-search-sso-config/bots/teamsMessagingExtensionsSearchAuthConfigBot.js b/samples/msgext-search-sso-config/bots/teamsMessagingExtensionsSearchAuthConfigBot.js index d238500527..22765b7aeb 100644 --- a/samples/msgext-search-sso-config/bots/teamsMessagingExtensionsSearchAuthConfigBot.js +++ b/samples/msgext-search-sso-config/bots/teamsMessagingExtensionsSearchAuthConfigBot.js @@ -4,8 +4,13 @@ const { TeamsActivityHandler, CardFactory, - ActionTypes, + ActionTypes } = require('botbuilder'); + +const { + ExtendedUserTokenProvider +} = require('botbuilder-core') + const axios = require('axios'); const querystring = require('querystring'); const { SimpleGraphClient } = require('..\\simpleGraphClient.js'); @@ -63,7 +68,7 @@ class TeamsMessagingExtensionsSearchAuthConfigBot extends TeamsActivityHandler { return { composeExtension: { - type: 'silentAuth', + type: 'auth', suggestedActions: { actions: [ { @@ -142,7 +147,7 @@ class TeamsMessagingExtensionsSearchAuthConfigBot extends TeamsActivityHandler { '' ); - if (userSettings && userSettings.includes('email')) { + if (!userSettings || userSettings.includes('profile')) { // When the Bot Service Auth flow completes, the query.State will contain a magic code used for verification. const magicCode = query.state && Number.isInteger(Number(query.state)) @@ -179,36 +184,13 @@ class TeamsMessagingExtensionsSearchAuthConfigBot extends TeamsActivityHandler { }; } - // The user is signed in, so use the token to create a Graph Clilent and search their email + // The user is signed in, so use the token to create a Graph Clilent and show profile + console.log(tokenResponse.token); const graphClient = new SimpleGraphClient(tokenResponse.token); - const messages = await graphClient.searchMailInbox(searchQuery); - - // Here we construct a ThumbnailCard for every attachment, and provide a HeroCard which will be - // displayed if the user selects that item. - messages.value.forEach((msg) => { - const heroCard = CardFactory.heroCard( - msg.from.emailAddress.address, - msg.body.content, - null, - null, - { subtitle: msg.subject } - ); - const preview = CardFactory.thumbnailCard( - msg.from.emailAddress.address, - `${msg.subject}
${msg.bodyPreview.substring( - 0, - 100 - )}`, - [ - 'https://raw.githubusercontent.com/microsoft/botbuilder-samples/master/docs/media/OutlookLogo.jpg', - ] - ); - attachments.push({ - contentType: heroCard.contentType, - content: heroCard.content, - preview: preview - }); - }); + const profile = await graphClient.GetMyProfile(); + const userPhoto = await graphClient.GetPhotoAsync(tokenResponse.token); + const thumbnailCard = CardFactory.thumbnailCard(profile.displayName, CardFactory.images([userPhoto])); + attachments.push(thumbnailCard); } else { const response = await axios.get( `http://registry.npmjs.com/-/v1/search?${querystring.stringify({ @@ -359,28 +341,23 @@ class TeamsMessagingExtensionsSearchAuthConfigBot extends TeamsActivityHandler { } async onInvokeActivity(context) { - console.log('fyt, onInvoke, '+ context.activity.name); + console.log('onInvoke, ' + context.activity.name); const valueObj = context.activity.value; if (valueObj.authentication) { - console.log('fyt, onInvoke, has authentication'); const authObj = valueObj.authentication; if (authObj.token) { - console.log('fyt, onInvoke, has token'); // If the token is NOT exchangeable, then do NOT deduplicate requests. - if (await tokenIsExchangeable(context)) { + if (await this.tokenIsExchangeable(context)) { return await super.onInvokeActivity(context); } else { const response = { status: 412 }; - console.log('fyt can not exchange token, 412'); return response; } } - console.log('fyt, onInvoke, noToken'); } - console.log('fyt no authentication, run super.onInvoke()'); return await super.onInvokeActivity(context); } @@ -389,18 +366,22 @@ class TeamsMessagingExtensionsSearchAuthConfigBot extends TeamsActivityHandler { try { const valueObj = context.activity.value; const tokenExchangeRequest = valueObj.authentication; + console.log("tokenExchangeRequest.token: " + tokenExchangeRequest.token); + tokenExchangeResponse = await context.adapter.exchangeToken(context, process.env.connectionName, context.activity.from.id, { token: tokenExchangeRequest.token }); + console.log('tokenExchangeResponse: ' + JSON.stringify(tokenExchangeResponse)); } catch (err) { - console.log('fyt tokenExchange error: ' + err); + console.log('tokenExchange error: ' + err); // Ignore Exceptions // If token exchange failed for any reason, tokenExchangeResponse above stays null , and hence we send back a failure invoke response to the caller. } if (!tokenExchangeResponse || !tokenExchangeResponse.token) { return false; } + console.log('Exchanged token: ' + tokenExchangeResponse.token); return true; } diff --git a/samples/msgext-search-sso-config/package-lock.json b/samples/msgext-search-sso-config/package-lock.json index 5ed49d0214..94245bdbc5 100644 --- a/samples/msgext-search-sso-config/package-lock.json +++ b/samples/msgext-search-sso-config/package-lock.json @@ -157,9 +157,9 @@ } }, "@types/node": { - "version": "10.17.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.54.tgz", - "integrity": "sha512-c8Lm7+hXdSPmWH4B9z/P/xIXhFK3mCQin4yCYMd2p1qpMG5AfgyJuYZ+3q2dT7qLiMMMGMd5dnkFpdqJARlvtQ==" + "version": "14.14.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.35.tgz", + "integrity": "sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==" }, "@types/tunnel": { "version": "0.0.0", @@ -426,59 +426,104 @@ "dev": true }, "botbuilder": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/botbuilder/-/botbuilder-4.11.1.tgz", - "integrity": "sha512-6VtAtJzkAuuBXz2TwPT49yNeLkhpjfGouys24qPNZSBdl5UWkhniKo1t3DdIU8wPjlyGfqxmW8DQfUmfGI9elQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/botbuilder/-/botbuilder-4.12.0.tgz", + "integrity": "sha512-OE5Lo4tBzbbiejG4l+LV2MiX0rfcB13zwMMjLwYsh6kNfa+oMo4vTHMqsxcUtqgyKKXYzLVqMQK8xqHWdrghvg==", "requires": { "@azure/ms-rest-js": "1.9.1", - "@types/node": "^10.17.27", "axios": "^0.21.1", - "botbuilder-core": "4.11.1", - "botframework-connector": "4.11.1", - "botframework-streaming": "4.11.1", + "botbuilder-core": "4.12.0", + "botframework-connector": "4.12.0", + "botframework-streaming": "4.12.0", + "dayjs": "^1.10.3", "filenamify": "^4.1.0", "fs-extra": "^7.0.1", - "moment-timezone": "^0.5.28" + "uuid": "^8.3.2" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } } }, "botbuilder-core": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/botbuilder-core/-/botbuilder-core-4.11.1.tgz", - "integrity": "sha512-Vtv2cUSXjVHZ3x081KFbqb/CpWfU24k2x89AAgsLWbTUytNW0QTRNgByjdznNl4CqV3b98mI6qJsk/fqFGnq4w==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/botbuilder-core/-/botbuilder-core-4.12.0.tgz", + "integrity": "sha512-PURNeGbYMxQ+NqbrRDanVpCmVOqbG0kzZ2QasWUweakYCKiysvM7Xp4qkh32De/5EAxBKO7AKeK0RKqTp7jHsg==", "requires": { "assert": "^1.4.1", - "botframework-connector": "4.11.1", - "botframework-schema": "4.11.1" + "botbuilder-stdlib": "4.12.0-internal", + "botframework-connector": "4.12.0", + "botframework-schema": "4.12.0", + "uuid": "^8.3.2" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } } }, + "botbuilder-stdlib": { + "version": "4.12.0-internal", + "resolved": "https://registry.npmjs.org/botbuilder-stdlib/-/botbuilder-stdlib-4.12.0-internal.tgz", + "integrity": "sha512-AwtWOZlgTaQte+uBeDOAy83veksMOzKHR62k3UYgUeqgsUamtqi6+OGV633hLi49ZmF/Gs8dP4iid2jCLDEQBg==" + }, "botframework-connector": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/botframework-connector/-/botframework-connector-4.11.1.tgz", - "integrity": "sha512-oaQHGoF35kjTgczUM8MhJu9A4PWuUYVSvM6w0KKvVRL0You9ivHa0FT1JrUodxzLCY0ZWNVWdYijstXEq8feSQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/botframework-connector/-/botframework-connector-4.12.0.tgz", + "integrity": "sha512-H4UOqBswIkiRF9Z1/6HpqLVE660SJS2+xHjEHtQJ2vvvutpOAiSWl7FSQpazAMpCVIhYpekofNPhaayRxJitvw==", "requires": { "@azure/ms-rest-js": "1.9.1", "@types/jsonwebtoken": "7.2.8", + "@types/node": "^10.17.27", "adal-node": "0.2.1", "base64url": "^3.0.0", - "botframework-schema": "4.11.1", + "botframework-schema": "4.12.0", "cross-fetch": "^3.0.5", "jsonwebtoken": "8.0.1", "rsa-pem-from-mod-exp": "^0.8.4" + }, + "dependencies": { + "@types/node": { + "version": "10.17.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.55.tgz", + "integrity": "sha512-koZJ89uLZufDvToeWO5BrC4CR4OUfHnUz2qoPs/daQH6qq3IN62QFxCTZ+bKaCE0xaoCAJYE4AXre8AbghCrhg==" + } } }, "botframework-schema": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/botframework-schema/-/botframework-schema-4.11.1.tgz", - "integrity": "sha512-RDDEuh1yHnCqVppUIOh6pv51OQ7mN7wTPiBSvhIjhLW6zSJxDn7ho9QbJl1KJRnpQj4qnNvh1ZlrqTiL9QBIjA==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/botframework-schema/-/botframework-schema-4.12.0.tgz", + "integrity": "sha512-W0/0xvrxafRrusWfGsGiwK2X4FOoIL7obvitkS+3XZfwhr6XeDKLClkQMbaU0GCawVF6DtbiPKErHpPUhd2Oig==", + "requires": { + "botbuilder-stdlib": "4.12.0-internal" + } }, "botframework-streaming": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/botframework-streaming/-/botframework-streaming-4.11.1.tgz", - "integrity": "sha512-XZHQrsClzLzIIqWiv1FOrZri7vW21+xfIgrl4pueLmXZT8YM2FytW2EwnAyYIgooEk1CYbLZ/wmmgjxClLSATA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/botframework-streaming/-/botframework-streaming-4.12.0.tgz", + "integrity": "sha512-RB7uUq66Qs5PbwINXX7muHN8Q6EEKuwkjIax4h9iaI/5KtLyW3VlIsPlpOx569qjVKpLd14zR1eWCdKmJlApuA==", "requires": { + "@types/node": "^10.17.27", "@types/ws": "^6.0.3", - "uuid": "^3.4.0", + "uuid": "^8.3.2", "ws": "^7.1.2" + }, + "dependencies": { + "@types/node": { + "version": "10.17.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.55.tgz", + "integrity": "sha512-koZJ89uLZufDvToeWO5BrC4CR4OUfHnUz2qoPs/daQH6qq3IN62QFxCTZ+bKaCE0xaoCAJYE4AXre8AbghCrhg==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } } }, "boxen": { @@ -783,9 +828,9 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cross-fetch": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz", - "integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.2.tgz", + "integrity": "sha512-+JhD65rDNqLbGmB3Gzs3HrEKC0aQnD+XA3SY6RjgkF88jV2q5cTc5+CwxlS3sdmLk98gpPt5CF9XRnPdlxZe6w==", "requires": { "node-fetch": "2.6.1" } @@ -846,6 +891,11 @@ "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", "integrity": "sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q=" }, + "dayjs": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.4.tgz", + "integrity": "sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==" + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2291,15 +2341,8 @@ "moment": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" - }, - "moment-timezone": { - "version": "0.5.33", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", - "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", - "requires": { - "moment": ">= 2.9.0" - } + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "optional": true }, "ms": { "version": "2.1.3", @@ -3436,9 +3479,9 @@ } }, "underscore": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", - "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==" + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" }, "unique-string": { "version": "2.0.0", @@ -3650,9 +3693,9 @@ } }, "ws": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz", - "integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==" + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", + "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==" }, "xdg-basedir": { "version": "4.0.0", @@ -3675,9 +3718,9 @@ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" }, "xmldom": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.4.0.tgz", - "integrity": "sha512-2E93k08T30Ugs+34HBSTQLVtpi6mCddaY8uO+pMNk1pqSjV5vElzn4mmh6KLxN3hki8rNcHSYzILoh3TEWORvA==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==" }, "xpath.js": { "version": "1.1.0", diff --git a/samples/msgext-search-sso-config/package.json b/samples/msgext-search-sso-config/package.json index 8c56c0d69e..c97e731503 100644 --- a/samples/msgext-search-sso-config/package.json +++ b/samples/msgext-search-sso-config/package.json @@ -18,7 +18,7 @@ "dependencies": { "@microsoft/microsoft-graph-client": "~2.0.0", "axios": "^0.21.0", - "botbuilder": "~4.11.0", + "botbuilder": "~4.12.0", "dotenv": "^8.2.0", "isomorphic-fetch": "^3.0.0", "restify": "~8.5.1" diff --git a/samples/msgext-search-sso-config/public/searchSettings.html b/samples/msgext-search-sso-config/public/searchSettings.html index 8b323dce14..cecd28cbb8 100644 --- a/samples/msgext-search-sso-config/public/searchSettings.html +++ b/samples/msgext-search-sso-config/public/searchSettings.html @@ -4,7 +4,7 @@
What would you like to search? Nuget
- Email (requires AAD Authentication)
+ Profile (requires AAD Authentication)

diff --git a/samples/msgext-search-sso-config/simpleGraphClient.js b/samples/msgext-search-sso-config/simpleGraphClient.js index 674350ab99..edf7826f4e 100644 --- a/samples/msgext-search-sso-config/simpleGraphClient.js +++ b/samples/msgext-search-sso-config/simpleGraphClient.js @@ -30,8 +30,7 @@ class SimpleGraphClient { async searchMailInbox(searchQuery) { // Searches the user's mail Inbox using the Microsoft Graph API return await this.graphClient - .api('me/mailfolders/inbox/messages') - .search(searchQuery) + .api(`me/messages?$search=\"${searchQuery}\"`) .get(); } async GetMyProfile() { diff --git a/samples/msgext-search-sso-config/teamsAppManifest/icon-color.zip b/samples/msgext-search-sso-config/teamsAppManifest/icon-color.zip deleted file mode 100644 index 30a8639ed6..0000000000 Binary files a/samples/msgext-search-sso-config/teamsAppManifest/icon-color.zip and /dev/null differ