page_type | description | products | languages | extensions | contentType | createdDate | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
sample |
Messaging Extension that has a configuration page, accepts search requests and returns results with SSO. |
|
|
samples |
07-07-2021 13:38:27 |
Bot Framework v4 sample for Teams expands the 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, it shows how to use a Messaging Extension configuration page, as well as how to sign in from a search Messaging Extension.
- Ensure that you've enabled the Teams Channel
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.
Refer to Bot SSO Setup document.
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.)
Under the root of this sample folder, build and run by commands:
npm install
npm start
-
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.
-
Manually update the manifest.json
- Edit the
manifest.json
contained in theappPackage/
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 themanifest.json
) - Zip up the contents of the
appPackage/
folder to create amanifest.zip
- Upload the
manifest.zip
to Teams (in the left-bottom Apps view, click "Upload a custom app")
- Edit the
-
**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.
To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.