page_type | description | products | languages | extensions | urlFragment | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
Microsoft Teams meeting extensibility sample - token passing |
|
|
|
officedev-microsoft-teams-samples-meetings-token-app-csharp |
The Meeting Token Generator app is a sample Microsoft Teams app that extends meetings in Teams. Through this app, meeting participants can request a "token", which is generated sequentially so that each participant has a fair opportunity to interact. This can be useful in situations like scrum meetings, Q&A sessions, etc. This application also shows the implementation of Live Share SDK to update the data in real-time for all participants in meeting.
NOTE: This capability is currently available in developer preview only.
-
.NET Core SDK version 6.0
determine dotnet version
dotnet --version
-
Ngrok (For local environment testing) Latest (any other tunneling software can also be used)
-
Teams Microsoft Teams is installed and you have an account
** This app should work in developer preview only**
-
Register a new application in the Azure Active Directory � App Registrations portal.
-
Setup for Bot
-
Register a AAD aap registration in Azure portal.
-
Also, register a bot with Azure Bot Service, following the instructions here.
-
Ensure that you've enabled the Teams Channel
-
While registering the bot, use
https://<your_ngrok_url>/api/messages
as the messaging endpoint.NOTE: When you create your app registration, you will create an App ID and App password - make sure you keep these for later.
- Setup NGROK
- Run ngrok - point to port 3978
# ngrok http -host-header=rewrite 3978
- Setup for code
-
Clone the repository
git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
-
Set up the appsettings.json with the following keys:
"MicrosoftAppId"
: Application (client) ID of the bot's Azure AD application"MicrosoftAppPassword"
: client secret of the bot's Azure AD application"AzureAd"."TenantId"
: Tenant ID of the tenant where the app will be used. Note that the sample will only work in this tenant."AzureAd"."ApplicationId "
: Set to the same value asMicrosoftAppId
above."ContentBubbleUrl "
: Content bubble iframe url (default.https://[WebAppDomain]/contentBubble.html
). Remember that[WebAppDomain]
will be your ngrok domain, so the content bubble URL will be similar tohttps://f631****.ngrok.io/contentBubble.html
.
-- Build and run the service You can build and run the project from the command line or an IDE:
A) From a command line:
```bash
# run the server
cd TokenApp
dotnet run
```
B) From an IDE:
1. Launch Visual Studio
2. File > Open > Project/Solution
3. Navigate to the `TokenApp` folder
4. Select `TokenApp.csproj` file
5. Press `F5` to run the project
1. Set `manifestVersion` to "devPreview"
1. Add your bot configuration, with the app id of the bot generated from the previous steps
1. Fill-in the following `webApplicationInfo` section, using `MicrosoftAppId` and `WebAppDomain` values from the previous section.
```json
"webApplicationInfo": {
"id": "[MicrosoftAppId]",
"resource": "api://[WebAppDomainName]/[MicrosoftAppId]"
}
```
- Setup Manifest for Teams
-
This step is specific to Teams.
- Edit the
manifest.json
contained in the ./Manifest folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) everywhere you see the place holder string{{Microsoft-App-Id}}
(depending on the scenario the Microsoft App Id may occur multiple times in themanifest.json
) - Edit the
manifest.json
forvalidDomains
and replace{{domain-name}}
with base Url of your domain. E.g. if you are using ngrok it would behttps://1234.ngrok.io
then your domain-name will be1234.ngrok.io
. - Zip up the contents of the
Manifest
folder to create amanifest.zip
(Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package)
- Edit the
-
Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")
- Go to Microsoft Teams. From the lower left corner, select Apps
- From the lower left corner, choose Upload a custom App
- Go to your project directory, the ./Manifest folder, select the zip folder, and choose Open.
- Select Add in the pop-up dialog box. Your app is uploaded to Teams.
-- Enable developer preview in your desktop Teams client Follow these instructions to enable developer preview. Note that Developer preview mode must be enabled on each Teams client app or browser.
In-meeting tabs are only available in the Teams desktop client. They will not be visible when you run Teams in a web browser.
-- Sideload the app in a Teams desktop client 1. Create a meeting with few test participants, ideally with a mix of Presenters and Attendees. 1. Once meeting is created, go to the meeting details page and click on the "Add tab" (+) button. 1. In the pop-up that opens, click on "Manage apps". 1. Click on "Upload a custom app" and upload the .zip file that was created in the previous steps. This adds the app to the meeting. 1. Click on the "Add tab" button again. Now in the app selection page, the app should be visible as a "Meeting optimized tab". 1. Select the Meeting Token app. 1. Now the app will be visible in the meeting chat. 1. Start the meeting and the icon should be visible in the meeting control bar.
- Display the current token that is being serviced in the meeting
- Display the user list sorted by the token number in ascending order
- Generate a token for the user upon request
- Display the current user's token number
- Mark a token as done by the user
- Skip the current token for the organizer of the meeting
- Token - Requests a token for the user
- Done - Acknowledges that the user is done with the token
- Skip - Skips the current user and moves on to the next person in line for a token. This button is only shown to users with the meeting Organizer role.
We assume working knowledge of the following technologies to gain full understanding of the app
- C#
- ECMAScript6
- Asp.NET core version 3.1
- React.JS version 16+
The app uses the Teams extensibility features described on the following pages:
- Apps in Teams meetings
- Create apps for Teams meetings
- Tab single sign-on to get the identity of the user accessing the tab, in a way that can be verified in the server APIs
The sample app uses an in-memory store to maintain token information and the service URL for the tenant. If you restart the project, you must run the following command to recapture the service URL: @[BotName] reset
In your own projects, please use a durable storage mechanism to store the service URL for the tenant.
- Teams Tabs experience
- Tabs SSO
- Bot Framework Documentation
- Bot Basics
- Activity processing
- Azure Bot Service Introduction
- Azure Bot Service Documentation
- .NET Core CLI tools
- Azure CLI
- Azure Portal
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.