Coder Social home page Coder Social logo

officedev / microsoft-teams-samples Goto Github PK

View Code? Open in Web Editor NEW
907.0 66.0 731.0 725.08 MB

Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App!

License: MIT License

C# 100.00%

microsoft-teams-samples's Introduction

Microsoft Teams Samples

Sample code build status

NOTE: These samples are designed to help understand Microsoft Teams platform capabilities and scenarios. If you are looking for production ready apps then please visit App Templates for Microsoft Teams

The easy way to browse through all the samples is to visit the Microsoft 365 Sample Solution Gallery

Sample lists

  1. Copilot for Microsoft 365 plugins samples
  2. Teams Toolkit samples
  3. Getting Started Samples and Tutorials
  4. Tabs samples
  5. Bots samples (using the v4 SDK)
  6. Messaging Extensions samples (using the v4 SDK)
  7. Webhooks and Connectors samples
  8. Graph APIs
  9. Calls and online meetings bots
  10. Meetings samples
  11. Actions Preview
  12. Scenario specific samples
Name Description .NET TypeScript JavaScript
Northwind Inventory Plugin that allows users to query the Northwind Database View
Document Search Plugin that enables Hybrid Search (Vector + Semantic) View View
Product support Plugin that allows users to query the Products held in SharePoint Online team site via Microsoft Graph View
Multi Parameters Plugin that demonstrates how to implement complex utterances and support deep retrieval View View View

The Teams Toolkit is an extension on Visual Studio Code and Visual Studio. It enable Teams developers to create and deploy Teams apps with integrated identity, access to cloud storage, data from Microsoft Graph, and other services in Azure and M365 with a "zero-configuration" approach to the developer experience. And Sample Apps are provided in Teams Toolkit. Download and try it by today! Learn more about Teams Toolkit.

Sample Name Description C# TypeScript App Manifest
1 Hello World Microsoft Teams hello world sample app. View View toolkit-icon View
Sample Name Description C# TypeScript JavaScript App Manifest
1 Personal tabs Sample app showing custom personal Tab with ASP. NET Core MVC, Razor Yeoman Generator View
2 Personal tab quick-start Sample personal tab quick-start app. View toolkit-icon View toolkit-icon
3 Personal tab with SSO quick-start Sample personal tab with SSO hello world app. View View toolkit-icon View toolkit-icon
4 Channel and group tabs Sample app showing custom group and channel Tab with ASP. NET Core MVC, Razor Yeoman Generator View
5 Channel and group tab quick-start Sample channel and group tab hello world app. View toolkit-icon View toolkit-icon View
6 Channel and group tab with SSO quick-start Sample channel and group tab with SSO hello world app. View View toolkit-icon View toolkit-icon
7 SPFx Tab Sample app showing Microsoft Teams tabs using SharePoint Framework View
8 Tab SSO Microsoft Teams sample app for tabs Azure AD SSO View View toolkit-icon
9 Config Tab Authentication Microsoft Teams sample app for config tabs Azure AD authentication View View
10 Deep Link consuming Subentity ID Microsoft Teams sample app for demonstrating deeplink from Bot chat to Tab consuming Subentity ID View View toolkit-icon
11 Integrate graph toolkit component in teams tab Microsoft Teams tab sample app for demonstrating graph toolkit component View View toolkit-icon
12 Device permissions Microsoft Teams tab sample app for demonstrating device permissions View toolkit-icon View
13 Build tabs with Adaptive Cards Microsoft Teams tab sample code which demonstrates how to Build tabs with Adaptive Cards View View toolkit-icon View
14 Tab in stage view Microsoft Teams tab sample app for demonstrating tab in stage view View View toolkit-icon View
15 Create Conversational tab Microsoft Teams tab sample app for demonstrating create conversation tab View View toolkit-icon View
16 Product inspection Demonstrating a feature where user can scan a product and mark it as approved/rejected. View View toolkit-icon View
17 Staggered Permission This sample demos to get staggered graph api permissions. View View toolkit-icon View
18 Tab people picker This is an tab app which shows the feature of client sdk people picker. View View toolkit-icon View
19 Tab channel context This sample shows the contents of tab context object in a private and shared channel. View toolkit-icon
20 Tab app monetization This sample shows how to open purchase dialog and trigger purchase flow using teams-js sdk. View toolkit-icon
21 Personal Tab with Nav-Bar menu Add multiple actions to the upper right in Nav-Bar and build an overflow menu for extra actions in an app. View toolkit-icon
22 App Caching in Meetings This sample shows how to improve the subsequent loading time of an App. View toolkit-icon
23 Tab Multi Hub Interact with the user's calendar, mail, profile, geolocation from personal tabs app. View toolkit-icon
24 tab-ui-templates This sample app can help you better understand how apps should look and behave in Microsoft Teams. The app includes examples of tested, high-quality UI templates that work across common Teams use cases (such as dashboards or forms). View toolkit-icon
25 Tab External Auth This sample illustrates how to implement Google auth using external auth providers. View
26 Tab Meeting Tanscript Recording This sample shows meeting transcripts and recordings. View View toolkit-icon
27 Tab DeepLink Pass Values Microsoft Teams sample which displays deeplinks based on the values passed dynamically to the context. View
28 Nested App Authentication This sample shows nested app authentication (NAA) is a new protocol that simplifies single sign-on (SSO) for single page applications. View toolkit-icon

Bots samples (using the v4 SDK)

NOTE: Visit the Bot Framework Samples repository to view Microsoft Bot Framework v4 SDK task-focused samples for C#, JavaScript, TypeScript, and Python.

Sample Name Description .NET JavaScript Python Java App Manifest
1 Teams Conversation Bot quick-start Messaging and conversation event handling hello world. View toolkit-icon
2 Teams Conversation Bot SSO quick-start Messaging and conversation event handling hello world with SSO. View View toolkit-icon
3 Teams Conversation Bot Messaging and conversation event handling also includes read receipt event functionality in personal scope. View View toolkit-icon View View View
4 Message Reactions Demonstrates how to create a simple bot that responds to Message Reactions View View toolkit-icon View View
5 Authentication with OAuthPrompt Authentication and basic messaging in Bot Framework v4. View View toolkit-icon View View View
6 Teams File Upload Exchanging files with a bot in a one-to-one conversation. View View toolkit-icon View View View
7 Task Module Demonstrating how to retrieve a Task Module and values from cards in it, for a Messaging Extension. View View toolkit-icon View View View
8 Start new thread in a channel Demonstrating how to create a new thread in a channel. View View toolkit-icon View View View
9 Universal bots Teams catering bot demonstrating how to use Universal bots in Teams View
10 Sequential workflow adaptive cards Demonstrating on how to implement sequential flow, user specific view and upto date adaptive cards in bot. View View toolkit-icon View
11 Channel messages with RSC permissions Demonstrating on how a bot can receive all channel messages with RSC without @mention. View View toolkit-icon View
12 Bot with SharePoint file to view in Teams file viewer This sample demos a bot with capability to upload files to SharePoint site and same files can be viewed in Teams file viewer. View View toolkit-icon
13 Type ahead search control on Adaptive Cards This sample shows the feature of type ahead search (static and dynamic) control in Adaptive Cards. View View toolkit-icon View
14 People picker control in Adaptive Cards This sample shows the feature of people picker control in Adaptive Cards. View View toolkit-icon View
15 Proactive Messaging sample This sample shows how to save user's conversation reference information to send proactive reminder message using Bots. This uses Teams toolkit for Visual Studio Code to provide scaffolding experience. View toolkit-icon
16 Proactive Tab Conversations Using a bot to create and store conversations that can be later used inside a sub-entity, tab conversation. This sample includes the details required to proactively message a channel from a bot, set-up and store details for channel tab conversations, and viewing channel conversations from a personal app. View
17 Suggested Actions Bot This sample shows the feature where user can send suggested actions using bot. View View toolkit-icon View
18 Adaptive Card Actions Bot This sample shows the feature where user can send adaptive card with different actions using bot. View View toolkit-icon View
19 SSO for your Adaptive Cards This sample code demonstrates how to get enable SSO authentication for your Adaptive Cards Universal Actions in bot. View View toolkit-icon
20 Different formatting on cards This sample feature shows how to use different formatting on cards using bot. View View toolkit-icon
21 Different types of cards using bot This sample shows the feature where user can interact with different types of cards using bot like Adaptive, hero, list, Office 365 Connector, receipt, sign in, and thumbnail cards and card collections. View View toolkit-icon
22 User specific views in Adaptive cards This sample shows the different ways developers can consume user specific views in Adaptive cards. View View
23 Bot configuration app with type ahead search control. This sample demonstrates the features of bot configuration and reconfiguration for both teams and group chats, including a type-ahead search (static and dynamic) control on Adaptive Cards. View [View][BotConfigurationApp#nodejs
23 Bot configuration app with auth This sample demonstrates the features of bot configuration auth and reconfiguration for both teams and group chats. View View
24 Tag mention bot This sample app demonstrates the use of tag mention funtionality in teams scope using Bot Framework. View View toolkit-icon

Additional samples

Sample Name Description .NET JavaScript
1 Proactive Messaging Sample to highlight solutions to two challenges with building proactive messaging apps in Microsoft Teams. View
2 Sharepoint List Bot This sample app shows the interaction between teams bot and SharePoint List, Bot saves the specified details in SharePoint List as back-end View
3 Teams Virtual Assistant Customized virtual assistant template to support teams capabilities. View

Messaging Extensions samples (using the v4 SDK)

NOTE: Visit the Bot Framework Samples repository to view Microsoft Bot Framework v4 SDK task-focused samples for C#, JavaScript, TypeScript, and Python.

Sample Name Description .NET JavaScript Python Java App Manifest
1 Messaging extensions - search quick-start Hello world Messaging Extension that accepts search requests and returns results. View toolkit-icon View
2 Messaging extensions - search Messaging Extension that accepts search requests and returns results. View View toolkit-icon View View View
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 toolkit-icon View
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 View toolkit-icon View View View
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 View View
6 Messaging extensions - SSO auth Messaging Extension that has a configuration page, accepts search requests and returns results with SSO. View View toolkit-icon
7 Messaging extensions - action preview Demonstrates how to create a Preview and Edit flow for a Messaging Extension. View View toolkit-icon View View View
8 Link unfurling Messaging Extension that performs link unfurling. View View toolkit-icon View View View
9 Messaging extension - Adaptive Card based loop components Demonstrates how to create Messaging extension with adaptive card-based loop components. View View toolkit-icon View
10 Messaging Extensions AI - Sentiment Analysis Messaging Extension with AI capability that performs sentiment analysis (positive/negative/neutral) for messages posted in Microsoft Teams chat View View toolkit-icon
11 Copilot Handoff This sample implements a Teams message extension that can be used as a plugin for Microsoft Copilot for Microsoft 365. The message extension showcases copilot handoff along with allowings users to query the Northwind Database View toolkit-icon

Additional samples

Sample Name Description .NET JavaScript Python
1 Link unfurling demo of Reddit Messaging Extension with Link Unfurling Samples for Reddit Links View
2 Link unfurling - setup a meeting This sample illustrates a common scenario where a user shares a link to a resource with a group of users, and they collaborate to review it in a meeting. View
Sample Name Description C# JavaScript
1 Connectors Sample Office 365 Connector generating notifications to teams channel. View View
2 Generic connectors sample Sample code for a generic connector that's easy to customize for any system which supports webhooks. View
3 Outgoing Webhooks Samples to create "Custom Bots" to be used in Microsoft Teams. View View
4 Authentication in todo Connector App This is a sample app which shows connector authentication and sends notification on task creation. View
5 Incoming Webhook This is a sample used to send card using incoming webhook. View View
Sample Name Description C# JavaScript App Manifest
1 Resource Specific Consent (RSC) This sample illustrates how you can use Resource Specific Consent (RSC) to call Graph APIs. . View View toolkit-icon View
2 Graph API Channel Life Cycle This sample illustrates how you can use Graph API Channel Life Cycle to call Graph APIs. . View View toolkit-icon
3 Graph API Teams App Installation Life Cycle This sample illustrates how you can use Teams App Installation Life Cycle by calling Microsoft Graph APIs. . View View toolkit-icon
4 Graph API Teams App Catalog Life Cycle This sample illustrates how you programmatically manage lifecycle for your teams App in catalog by calling Microsoft Graph APIs. . View View toolkit-icon View
5 Graph API Chat Life Cycle This sample illustrates how you can use Teams App Chat Life Cycle by calling Microsoft Graph APIs. . View View toolkit-icon
6 Activity Feed Notification Microsoft Teams sample app for Sending Activity feed notification using Graph API in a Teams Tab. View View toolkit-icon
7 Proactive installation of App and sending proactive notifications This sample illustrates how you can use Proactive installation of app for user and send proactive notification by calling Microsoft Graph APIs. View View toolkit-icon View
8 Change Notification This sample app demonstrates sending change notifications to user presence in Teams based on user presence status. View View toolkit-icon
9 Graph Pinned Message This is a sample application which demonstrates how to pin messages in chat using Graph api. View View toolkit-icon
10 Graph Bulk Meetings This is an sample application which shows how to create Teams meetings in bulk using Graph api. View View toolkit-icon
11 Graph Meeting Notification This is a sample application which demonstrates the use of online meeting subscription and sends you the notifications in chat using bot. View View toolkit-icon
12 Change Notifications Team/Channel This sample application which demonstrates use of Team/Channel subscription that will post notifications when user create/edit/delete team/channel using Graph api. View View toolkit-icon
13 graph-teams-tag This is a sample application which demonstrates how to use CRUD Graph operations within tab related to team tags. View View toolkit-icon
Sample Name Description C#
1 Calling and Meeting bot This sample app demonstrate how a Bot can create a call, join a meeting and transfer the call View
2 Local Media Samples Local media samples give the developer direct access to the inbound and outbound media streams. View
3 Remote Media Samples The Incident Bot sample is a Remote Media sample demonstrating a simple incident process workflow started by a Calling Bot.. View
Sample Name Description C# JavaScript App Manifest
1 Meetings Extensibility Microsoft Teams meeting extensibility sample: token passing View View toolkit-icon
2 Meetings notification Microsoft Teams meeting extensibility sample for interacting with in-meeting notifications View View toolkit-icon
3 Meetings SidePanel Microsoft Teams meeting extensibility sample for iteracting with Side Panel in-meeting View View toolkit-icon
4 Details Tab in Meetings Microsoft Teams meeting extensibility sample for iteracting with Details Tab in-meeting View View toolkit-icon View
5 Meetings Stage View Enable and configure your apps for Teams meetings to use in stage view View View toolkit-icon View
6 Meeting Events Get real time meeting events View View toolkit-icon View
7 Meeting Recruitment App Sample app showing meeting app experience for interview scenario. View View toolkit-icon View
8 Meeting Transcript App This is a sample application which demonstrates how to get Transcript using Graph API and show it in the task module. View View toolkit-icon
9 Meeting signing programmatic share to stage Demonstrating the programmatic share to stage feature, by means of a document signing in a meeting. View
10 Meeting Live Caption This is a sample meeting side panel application which demonstrates how to enable live caption in the meeting and using the CART link how to send caption in live meeting. View View toolkit-icon
11 Anonymous user support This sample app shows anonymous users support in teams meeting apps. View View toolkit-icon
12 Live coding interview using Shared meeting stage This sample demos a live coding in a teams meeting stage. View View toolkit-icon
13 Meeting-Tabs This sample shows app stage view, Mute/Unmute Teams meeting audio call and Side panel. View View toolkit-icon
14 meetings-attendance-report This is a sample application which demonstrates how to get meeting attendance report using Graph API and send it in meeting chat using bot. View View toolkit-icon
15 meetings-audio-state This is an sample tab (side panel) application which shows how to mute/unmute Teams meeting audio using toggle Incoming Client Audio API. View toolkit-icon
16 meetings-context-app This sample shows the contents of meeting tab context object in a meeting tab and using bot's meeting API, meeting participant details and meeting details are sent to user. View View toolkit-icon
Sample Name Description C# JavaScript App Manifest
1 Actions across Microsoft 365 This sample contains preview documentation for (Microsoft 365 extended Teams apps) Actions in Microsoft 365 app(microsoft365.com). View toolkit-icon

Scenario specific samples

Sample Name Description C# JavaScript App Manifest
1 Task Modules Sample app showing off the Teams Task Module, a way to invoke custom code from a bot, a tab, or both! View View toolkit-icon View
2 Authentication Sample illustrating seamless inline authentication for Microsoft Teams apps. View
3 Complete Samples Sample covering multiple scenarios - dialogs, ME, and facebook auth. View View toolkit-icon
4 Region Selection App This app contains a bot and Tab which is helpful to set the region View View
5 App Localization Microsoft Teams app localization using Bot and Tab View View toolkit-icon View
6 App SSO Microsoft Teams app SSO for Tab, Bot, ME - search, action, linkunfurl View View toolkit-icon View
7 App Installtion using QR code This sample demos app installation using QR code of application's app id View View toolkit-icon View
8 Archive groupchat messages Demonstrating on how a bot can archive groupchat messages and send it to user as a file. View View toolkit-icon
9 App check in location Demonstrating feature where user can checkin with current location and view all previous checkins. View View toolkit-icon View
10 Message reminder setup through messaging extension Demonstrating a feature where user can schedule a task from messaging extension action command and get a reminder card at a scheduled time View View toolkit-icon View
11 Bot daily task reminder This sample demos a feature where user can schedule a recurring task and get a reminder on the scheduled time View View toolkit-icon View
12 Tab request approval Demonstrating a feature where user can raise the requests and manager will be notified about the requests and manager will be redirected to approve/reject the request from received notification. View View toolkit-icon View
13 Bot request approval Demonstrating a feature where user can send task request to his manager using universal adaptive card and manager can approve/reject the request. View View toolkit-icon View
14 Join the Team using QR code This sample demos a feature where user can join a team using QR code containing the team's id. View View toolkit-icon View
15 Activity feed broadcast Demonstrating a feature to notify any message to all members of the organisation using activity feed notification . View View toolkit-icon
16 App complete auth This sample demos authentication feature in bot,tab and messaging extension. View
17 Release Management This is a sample used to send workitem notification using Azure webhook. View View
18 Link unfurling for 'Share to teams' This sample demos the feature of link unfurling for Share to teams. View toolkit-icon
19 App Icon Badging In Microsoft Teams Meetings This sample app shows the feature of sending app icon badging in Teams' meetings. View View toolkit-icon
20 Teams Open AI Embeddings And Redis Search based On Uploaded File Using Bot This Open AI sample app demonstrates the user search functionality using Open AI embeddings and completion APIs. View toolkit-icon
21 Combined Tab and Office Add-in Demonstrates using add-in to take action on specific Office documents and using tab to aggregate data about all those specific actions. View toolkit-icon View
22 Sharepoint tab request approval This sample app demonstrates the usage of SharePoint Embedded for storage in teams. View
22 App HR talent This app simulates connection to a recruiting and talent management system and allows users and teams to create, manage and search positions and candidates. View View

Application templates

App Name Description Code
1 QBot QBot is a solution designed for classroom teaching scenarios which allows teachers, tutors, and students to intelligently answer each other's questions within the Microsoft Teams collaboration platform. View
2 Resource Hub Resource Hub is a solution designed for all the help you need to use Teams, all in one place. View

Submitting issues

The issue tracker is for issues, in other words, bugs and suggestions. If you have a question, feedback or suggestions, please check our support page.

Contributing

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 [email protected] with any additional questions or comments.

microsoft-teams-samples's People

Contributors

abhijeetthakur-msft avatar akatrukhin avatar aosolis avatar asnow003 avatar bhpappir avatar bobgerman avatar chetansharma-msft avatar eoinobrien avatar frankqianms avatar harikrishnan-msft avatar huihuiwu-microsoft avatar hunaidhanfee-msft avatar jegadeesh-msft avatar juna-gupta avatar karthigb avatar keeth avatar keshav-msft avatar microsoftopensource avatar mohammed-msft avatar mtrilbybassett avatar nikitajain-msft avatar pawan-msft avatar pawank-msft avatar prithvi-msft avatar tecton avatar v-kalc avatar vesajuvonen avatar wajeed-msft avatar xzf0587 avatar yukun-dong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microsoft-teams-samples's Issues

Build tabs with Adaptive Cards - Can't build bot

In readme.md, I can't find where the BaseUrl and ConnectionName are. May the tutorial is outdated. Please help me, thanks.

Update the .env configuration for the bot to use the MicrosoftAppId (Microsoft App Id) and MicrosoftAppPassword (App Password) from the Bot Framework registration. Also update BaseUrl according to your code runtime environment and ConnectionName with Bot Channel Registration connection name.

Real time meeting events not firing up

I've been following the sample for real time meeting events (here) in nodejs. I created a new bot just for this, set up ngrok and ran the server. Modified the manifest with my bot id and then created the package to sideload.
Then I created a meeting, added the app and then started it, but I didn't get the notification for meeting start. I can get the other events, like message, memberAdded and memberRemoved. Manifest is in version 1.10, and I tried with and without public dev preview enabled.

I tried several times and checked I have the right permission OnlineMeeting.Readbasic.Chat and I do.

It isn't something about the node code, the thing is that I'm not receiving the POST request on my ngrok server just for those two events (meeting start and meeting end), so I can't really process it.

Can you guys investigate this and see if these notifications are working?

Tab SSO - Not working with Azure deployment

Hi Team,
This is related to the tab-personal-sso-quickstart sample.
I created the same sample by using visual studio toolkit.
**It is working fine with Ngrok but not working with azure app service.

Tried to deploy to azure webapp using following steps:

  • npm run build
  • Deploy to azure web app from visual studio code
  • Created azure front door

Once deployed tried to access app service URL(https://.azurewebsites.net and tried to access https://.azurefd.net)
Showing following error: "You do not have permission to view this directory or page."

Added "build/index.html" in app service configuration-> Default documents.
Able to access index.html. But when tried to access components(https://****.azurewebsites.net/tab), showing below error:
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

Could you please let us know if we are missing some steps? or any other changes required to make it working in azure appservice

Support Workspace Trust

Note: this is in reference to the vscode extension: https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension

Hello 👋 I'm from the VS Code team.

Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.

Why you should care

Your extension is incredibly popular with VS Code users! We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace.

Workspace Trust experience

You can enable the feature with the following setting security.workspace.trust.enabled. Once enabled, you will see the following dialog when opening folders in VS Code.

Workspace Trust Startup Dialog

This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt.

You can follow the development of Workspace Trust and provide feedback in issue #106488.

Workspace trust API

First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.

The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.

You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces capability in package.json.

The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": true
  }
}

The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": false
  }
}

The third option is to declared limited support. There are three tools provided to you when you select the limited option.

First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations array property in untrustedWorkspaces object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.

The following example declares the settings that are restricted in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": "limited",
    "restrictedConfigurations": [
      "markdown.styles"
    ]
  }
}

Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:

export namespace workspace {
  /**
    * When true, the user has explicitly trusted the contents of the workspace.
    */
  export const isTrusted: boolean;
  /**
    * Event that fires when the current workspace has been trusted.
    */
  export const onDidGrantWorkspaceTrust: Event<void>;
}

Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted context key in your when clauses.

A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.

Rollout plan

Workspace Trust will remain disabled for the month of May, but we are planning on enabling this by default in the future. To prepare for that day, we would love for you to try it out and provide feedback.

We'd love your feedback

Since this issue was created in an automated fashion, we won't be monitoring the responses in this issue (our notifications would explode!). Instead we ask you to drop questions, and feedback in issue #120251 as we've mentioned above.

We're excited to see what you do with workspace trust!

To export a team template

Is it possible to export a team template from one tenant and import it in another tenant as we do in the case of MS flow?

connector-github-notification is broken

Hi there,
I've spent a couple of hours trying to run this demo with limited success. Would it be possible for someone to update it to make sure it works? I realise you have a lot of things to do without this, but it's probably a rather trivial task for you. And it's a huge task for many users who are not familiar with the Teams setup.

Some of the issues I encountered:

  • The manifest.json is incorrect. It produces errors when trying to side-load it. (Of the "Manifest parsing failed" variety)
  • "Zip manifest.json file and sideload to any team" option results in githubconnector.azurewebsites.net app being used, not local ngrok, even though I updated urls in default.json. Probably because the config url is associated with the connector id, it does not come from the manifest.
  • When I go for the "Alternative you can set your own connector" option, I manage to access the config page from Teams ("Continue to authenticate to Github"), click "continue" and nothing else happens. Just a blank page. See the screenshot:

Screenshot 2021-04-15 at 11 47 34

This is the part I was unable to get past. - With the githubconnector.azurewebsites.net option, I was able to get slightly farther, but it failed without explanation during the configuration process too.

Some minor issues:

  • Broken link https://msdn.microsoft.com/en-us/microsoft-teams/connectors
  • Broken link aka.ms/teamsdocs
  • Mentioning mongodb setup in the readme would've been nice, for those new to it. ("Download and install mongodb, change connection string to mongodb://localhost/test")
  • I would also appreciate basic instructions on how to test this, how to know if it's working.

Unable to save "***" connector configuration. Please try again.

I'm unsuccessfully trying to create our own connector for Teams. The configuration save button (which I really don't even need since we're in the 21st century and nobody needs to explicitly save anything) just throws an error:
Unable to save "<APP_NAME>" connector configuration. Please try again.

I took the simplest sample from here, uploaded it to Netlify and even that doesn't work (just upload the manifest below and check it yourselves).

my manifest:

{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
  "manifestVersion": "1.3",
  "id": "782543cd-f172-4e70-8289-903f688d3f80",
  "version": "1.0.4",
  "packageName": "com.Aporia",
  "developer": {
    "name": "Aporia (netlify)",
    "websiteUrl": "https://aporia.com",
    "privacyUrl": "https://www.aporia.com/privacy-policy/",
    "termsOfUseUrl": "https://www.aporia.com/terms-of-use/"
  },
  "description": {
    "full": "Aporia's Teams app allows you to display alerts and notifications from your Aporia account easily.",
    "short": "Alerts and notifications from Aporia"
  },
  "icons": {
    "outline": "outline.png",
    "color": "transparent.png"
  },
  "connectors": [
    {
      "connectorId": "782543cd-f172-4e70-8289-903f688d3f80",
      "scopes": ["team"],
      "configurationUrl": "https://vigorous-hamilton-aa2dfa.netlify.app/"
    }
  ],
  "name": {
    "full": "Aporia (netlify)",
    "short": "Aporia (netlify)"
  },
  "accentColor": "#FFFFFF",
  "validDomains": ["vigorous-hamilton-aa2dfa.netlify.app","netlify.app"]
}

P.S Teams has around 20 errors in the devtools when using it normally. What's going on with this product?

Suggestion

It would be good to have a sample for Teams that shows how to use Teams as a agent hub for handoff scenarios. For example a bot service that has two channels WebChat that is used by public users and a Teams channel that is used as an agent hub. I can't find anything reasonable showing how this can be implemented.
Thank you!

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'app-hello-world\nodejs\src\bot' imported from \app-hello-world\nodejs\src\app.js

Hi Dear Community,

Today i have started to develop an teams app and i am following below documentation i have installed all mentioned applications, However i ran into some errors which never mentioned in the documentation about installing 'babel', and after doing so, i ran into another error you can find below,

node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Teams App\Microsoft-Teams-Samples\samples\app-hello-world\nodejs\src\bot' imported from C:\Teams App\Microsoft-Teams-Samples\samples\app-hello-world\nodejs\src\app.js
    at new NodeError (node:internal/errors:371:5)
    at finalizeResolution (node:internal/modules/esm/resolve:416:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1044:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
[nodemon] app crashed - waiting for file changes before starting...

Regards,

require(...) is not a function

I trying to run the Teams-token-app example.

After npm i

I try to run app via npm run start

I get this error

require(...) is not a function

Here's where the error happens

dotenvFiles.forEach(dotenvFile => {
  if (fs.existsSync(dotenvFile)) {
    require('dotenv-expand')(. <===== Here
      require('dotenv').config({
        path: dotenvFile,
      })
    );
  }
});

How to fix that ?

Error installing Teams tab

I'm trying to add Teams tab through App Studio, but it always shows this error.

Screen Shot 2021-02-05 at 5 11 05 PM

In the Console, it says:

Screen Shot 2021-02-05 at 5 11 54 PM

I don't know what's wrong with my URL. This is the manifest.json

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
    "manifestVersion": "1.8",
    "version": "1.0.0",
    "id": "25737c8b-812b-476e-9ad2-d9c649926895",
    "packageName": "com.pete.tada",
    "developer": {
        "name": "Pete",
        "websiteUrl": "https://tada.ngrok.io",
        "privacyUrl": "https://tada.ngrok.io/privacy",
        "termsOfUseUrl": "https://tada.ngrok.io/terms"
    },
    "icons": {
        "color": "color.png",
        "outline": "outline.png"
    },
    "name": {
        "short": "Pete 03",
        "full": ""
    },
    "description": {
        "short": "Testing Teams App",
        "full": "(OK)"
    },
    "accentColor": "#FFFFFF",
    "configurableTabs": [
        {
            "configurationUrl": "https://tada.ngrok.io/config",
            "canUpdateConfiguration": true,
            "scopes": [
                "team"
            ],
            "context": [
                "channelTab"
            ]
        }
    ],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "tada.ngrok.io"
    ]
}

SidePanel tab is not working in-meeting

Discussed in https://github.com/OfficeDev/Microsoft-Teams-Samples/discussions/175

Originally posted by june-dit October 14, 2021
Manifest has the following settings for the sidePanel tab, but the application icon is not showing on the in-meeting toolbar, so there is no way to show the sidePanel, could you help me to figure out is there anything missing in the configuration or code to make the sidePanel work in-meeting? Thanks.

  "configurableTabs": [
    {
      "configurationUrl": "https://{{PUBLIC_HOSTNAME}}/sidePanelTab/config.html?name={loginHint}&tenant={tid}&group={groupId}&theme={theme}",
      "canUpdateConfiguration": true,
      "scopes": [
        "groupchat"
      ],
      "meetingSurfaces": [
        "sidePanel"
      ],
      "context": [
        "meetingSidePanel"
      ]
    }
  ],
```</div>

Tabs-SSO CSharp project authentication Issue

I downloaded the Tabs SSO example for MVC and followed the instructions to get it running

For some reason, running the app straight out of Visual Studio via F5 does not even try to authenticate. After wrestling the dreaded return URL error and a 401 I have it running fine in Teams. On load it displays the user profile data ok.

My questions are:

When running as a standalone web app, should it try to authenticate? Is this expected?
If not expected, where should I start looking for an issue?
If expected, how I do change the app to authenticate by default?

I have a bunch of other functionality written inside a stand alone MVC app that makes extensive calls to Graph API to get presence info and user photo for an internal app. It would be nice to be able test and debug without having the overhead of reloading it in Teams every time.

I have defined all of the extra permissions needed in the manifest. Is there anything else I need to do? A code sample perhaps for requesting additional permissions using the token received via SSO.

Any help greatly appreciated.

Thanks

Mark

CallingBotSample - Bot response "you can't just talk to this bot yet but we are working on it"

I am working on a solution where a call has to be initiated to a bot and the bot then transfers to the configured designated user.

The moment call initiates to the bot since I have placed the code to transfer the call, which is all happening, but at the same time, bot is playing a default voice message "you can't just talk to this bot yet but we are working on it" and call disconnects, and on the other hand, the call was successfully transferred and the person hears nothing since the call was auto disconnected from bot side.

Here is my bot App Id: a1d7c5cb-8a56-4ddd-8eb1-f39ea2cb14a7

We have a release for the client in next week time, and there is the real bottleneck. Any help would be really appreciated.

Thank you.

ASP.NET Core Server Side Sample

I cannot find a server-side only sample.
What's the correct way to configure ASP.NET Core Identity for a Razor Page application used in a Teams Tab?
In other words: how do I know who the logged in user is (server side)?

The readme for the ReceiveMessagesWithRSC sample should mention that the Azure Bot resource must have the MsTeams channel enabled.

Hi. I followed the readme for the ReceiveMessagesWithRSC sample, and got to step 2: "Create a Bot Registration In Azure portal". I clicked that link to double check whether this is an AZ AD App Registration, or an Azure Bot resource. It was the latter. I've created those before, so I quickly created another. I didn't think at the time to configure the MsTeams channel for it...

As a result, I got a "Something went wrong" error later, in Teams, which I eventually tracked down through the logs to an equally vague "AddAppBotToChatRosterFailed". It was a random reply here that led me to the solution.

Since even the Azure Bot documentation doesn't have an explicit reminder like "After creation, make sure to configure the right bot channels for your needs", I figured such a reminder definitely has a place in the readme of the ReceiveMessagesWithRSC sample. Can you please add it?

I had a look randomly through some of the other samples, and they don't seem to need an Azure Bot resource - just an AZ AD registration. I suppose there will be a few I missed, in which case they could do with adding the same reminder, IMO.

Of course, we wouldn't need this reminder if the actual error could be surfaced in the Teams client... Something like: "MsTeams not configured as a bot channel for this app, please check <...>". That github issue I linked to above is also about this, I think.

Thanks

Need clarification on /authorize endpoint

The sample is using the following in the script for Start.cshtml:

let authorizeEndpoint = "https://login.microsoftonline.com/common/oauth2/authorize?" + toQueryString(queryParams);

However the documentation here says:

To get the correct token for Microsoft Teams Free and guest users, it is important that the apps use tenant specific endpoint https://login.microsoftonline.com/**{tenantId}**. You can get tenantId from the bot message or tab context. If the apps use https://login.microsoftonline.com/common, the users will get incorrect tokens and will log on to the "home" tenant instead of the tenant that they are currently signed into.

Can you clarify the scenarios for /common and /tenantID? Also, for multi-tenant apps the endpoints listed in the Application Registration page point to the /organization endpoint. When should that endpoint be used?

Teams Tab SSO Authentication sample - incorrect SSO resource URL

The sample here does not include the /access_as_user path in the value for the "Single-Sign-On" section of the teams manifest:

api://%ngrokDomain%.ngrok.io/00000000-0000-0000-0000-000000000000

However, if /access_as_user is not set, when the tab loads the browser DevTools console with show this error:

0.2-angular-jquery.min-eee9041.js:114 2021-05-09T21:28:16.067Z AUTHMSAL: Attempting to handle auth response: error:invalid_resource|AADSTS500011: The resource principal named api://%ngrokdomain%.ngrok.io/00000000-0000-0000-0000-000000000000 was not found in the tenant named 00000000-0000-0000-0000-000000000000. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant., resource:api://%ngrokdomain%.ngrok.io/00000000-0000-0000-0000-000000000000, error mapped to action:resourceDisabled

0.2-angular-jquery.min-eee9041.js:114 2021-05-09T21:28:16.067Z ExtensionTabService: getAuthTokenForApp: Failed with error - resourceDisabled

This page certainly says to NOT use /access_as_user. Otherwise, can you explain why the above error occurs if it is not set?

Stage view cannot be pinned as a tab

I have followed the steps in the following document to run a teams app.
https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/tab-stage-view/nodejs

When I click the View via Card button,
image

the stage view is displayed as below:
image

But I cannot find there is a way to pin this view as a tab.
And the screenshot of stage view is different with your readme:
https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/tab-stage-view/nodejs#readme

image

Could you please have a look? thanks a lot.

Teams Tab SSO Authentication Sample: Unauthorized/invalid issuer error

I'm following the model laid out in the sample to call the Home/GetUserAccessToken() endpoint, but I'm getting a 401 Unauthorized error when calling it from getServerSideToken and it never completes past that action:

Www-Authenticate: Bearer error="invalid_token", error_description="The issuer 'https://sts.windows.net/{TENANT_ID_SNIP}-840e-4d21-9ed1-52e2f808a245/' is invalid"

The thing is, that's the tenant ID from the current user that's signed into teams. I'm doing the swap out of the TENANT_ID string in SSOAuthHelper.GetValidIssuers() and I can see the correct tenant ID from the tenant containing the Application Registration. Note that I'm testing a multi-tenant app here - does the app's tenant matter here at all?

I'm also using ngrok to test locally - does that factor into the list of valid issuers somehow? Otherwise my Teams app manifest and App Reg (redirect URI) is correctly using the *.ngrok.io domain where needed, and I've added /access_as_user for consent.

Even if I get past this step, I don't see how the prompt=consent token is ever used, as according to https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-aad-sso that explains why this is needed to request additional Graph API permissions. Shouldn't the sample include the prompt parameter in SSOAuthHelper.GetAccessTokenOnBehalfUserAsync??

Error when "yarn package" in samples/tab-ui-templates/ts/README.md

When running "yarn package", the following error shows:
$ yarn package
yarn run v1.22.10
$ gulp manifest
[11:43:06] Using gulpfile ~\Documents\VSCode\Microsoft-Teams-Samples\samples\tab-ui-templates\ts\gulpfile.js
[11:43:06] Starting 'manifest'...
[11:43:06] Starting 'generate-manifest'...
[11:43:06] Finished 'generate-manifest' after 24 ms
[11:43:06] Starting 'schema-validation'...
[11:43:06] Using manifest schema 1.8
[11:43:06] 'schema-validation' errored after 89 ms
[11:43:06] Error in plugin "validate-manifest"
Message:
String does not match pattern ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$:
[11:43:06] 'manifest' errored after 116 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Error while integrating Stage View

Facing Something went wrong. Please try again. when trying to integrate Stage View in an adaptive card and following tab-stage-view sample for reference. I have implemented a personal tab and using it in stage view.

manifest.json

"staticTabs": [
   {
     "contentUrl": "<ngrok-url>/tab-auth/simple",
     "entityId": "simpleAuth",
     "name": "Test Authentication Tab",
     "scopes": [
       "personal"
     ],
     "context": [
       "personalTab",
       "channelTab"
     ],
   }
 ]

adaptiveCardJson

"body": [
  ...,
  {
    type: 'ActionSet',
    actions: [
      {
        type: "Action.Submit",
        title: "Auth Tab",
        data: {
          msteams: {
            type: "invoke",
            value: {
              type: "tab/tabInfoAction",
              tabInfo: {
                contentUrl: "<ngrok-url>/tab-auth/simple",
                websiteUrl: "<ngrok-url>/tab-auth/simple",
                name: "Test Authentication Tab",
                entityId: "simpleAuth"
              }
            }
          }
        }
      }
    ]
  },
]

Error Screenshot
Screenshot 2021-11-15 at 5 33 54 PM

Error while running yarn package

MacBook-Pro-2 ts % yarn package
yarn run v1.19.1
warning ../../../../../../package.json: No license field
$ gulp manifest
[20:45:46] Using gulpfile ~/Repo/Teams/Microsoft-Teams-Samples/samples/tab-ui-templates/ts/gulpfile.js
[20:45:46] Starting 'manifest'...
[20:45:46] Starting 'generate-manifest'...
[20:45:46] Finished 'generate-manifest' after 38 ms
[20:45:46] Starting 'schema-validation'...
[20:45:46] Using manifest schema 1.8
[20:45:47] 'schema-validation' errored after 461 ms
[20:45:47] Error in plugin "validate-manifest"
Message:
String does not match pattern ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$:
[20:45:47] 'manifest' errored after 502 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Error MSB3491 Could not write lines to file "obj\Debug\netcoreapp3.1\staticwebassets\ProactiveAppInstallation.StaticWebAssets.Manifest.cache". Path: obj\Debug\netcoreapp3.1\staticwebassets\ProactiveAppInstallation.StaticWebAssets.Manifest.cache exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. ProactiveAppInstallation C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets

Hi,

I already downloaded the source code and trying to run the C# application in Microsoft-Teams-Samples-main\samples\graph-proactive-installation\csharp folder. I am using VS 2019 and .net core 3.1. When i trying to build the code it shows a message like below.

Error MSB3491 Could not write lines to file "obj\Debug\netcoreapp3.1\staticwebassets\ProactiveAppInstallation.StaticWebAssets.Manifest.cache". Path: obj\Debug\netcoreapp3.1\staticwebassets\ProactiveAppInstallation.StaticWebAssets.Manifest.cache exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. ProactiveAppInstallation C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets

Extension issue

  • Issue Type: Bug
  • Extension Name: ms-teams-vscode-extension
  • Extension Version: 1.2.3
  • OS Version: Windows_NT x64 10.0.19042
  • VS Code version: 1.56.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

MS Teams Toolkit failure in initialization with this error
EPERM: operation not permitted, scandir 'c:\Users<user name>/AppData/Local/Microsoft/Windows/INetCache/Low/Content.IE5'

CallingBotSample System.InvalidOperationException

Hello,
I've tried running the Calling Bot Sample, but every time I start debugging I get the following error: System.InvalidOperationException: 'Failed to convert configuration value at 'Bot:BotBaseUrl' to type 'System.Uri'.'
Inner Exception UriFormatException: Invalid URI: The hostname could not be parsed.

Use Microsoft teams meeting invite link as a Task module in Bot on click of the Button.

I have a Microsoft teams bot and I wanted to use Microsoft meeting invite link i.e ["https://teams.microsoft.com/l/meeting/new?subject="] to open it as a task module inside the teams bot on click of a button.

I have tried putting inside iframe as follow but it is not loading:

`<iframe width="1000" height="700" src="https://teams.microsoft.com/l/meeting/new?subject=" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>

Below is the screenshot of teams behaviour

`
image

can you please tell the fix for the issue.

Add element to an existing Teams App

I have a very simple question that I cannot find an answer to ... Lets say I have an existing Teams App and I want to add another element (Tab, Bot, ...) to it using the VS Code Teams Toolkit ... I know I can add the metadata, but I don't seem to find a way to get automatic scaffolding for the item I added. Is this possible?

installing app via App Studio pre-defined template fails

Steps: Go to Teams > App Studio > UI Tools tab > Sample app > Install to Teams.

Result: Error occurred, details:

Error while reading manifest.json: Invalid value(s) specified for validDomains[1]: "officedev.github.io/microsoft-teams-app-sample/#"

Can't get into the Connectors Portal

It immediately redirects me to an error page, and the "send feedback" button there (which I barely managed to click) has an error too...

image

Something went wrong.
Mailbox address missing in URL
RequestId: ad9c2c60-cdc5-cca4-bcf9-95b4f10b2991
Server: AS8PR09MB5159
Date: 2021-07-29 14:04:37 +0300

I've developed a connector for my company's product and submitted it to the App Store. I did not get a response for over two weeks, could this also be related?

"Could not exchange access token" on tab authentification

I would try to run in meeting app teams sample

When I add the app via + tab I then I'm redirected to authentification pop up I get this error

Tab.js:79 GET https://e3dc-2a01-cb00-831c-8c00-c00c-8141-8522-f53f.ngrok.io/getGraphAccessToken?ssoToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Imwzc1EtNTBjQ0g0eEJWWkxIVEd3blNSNzY4MCJ9.eyJhdWQiOiI4OGFiNDVjNi01ODQ5LTRjYTQtYxxxxxxxx 500 (Internal Server Error)
Tab.exchangeClientTokenForServerToken @ Tab.js:79
Tab.ssoLoginSuccess @ Tab.js:64
successCallback @ Tab.js:54
(anonymous) @ MicrosoftTeams.min.js:1
f @ MicrosoftTeams.min.js:1
u @ MicrosoftTeams.min.js:1
s.messageListener @ MicrosoftTeams.min.js:1
index.js:1 {error: "Could not exchange access token"}

My error is happening here

   */
  exchangeClientTokenForServerToken = async (token) => {

    let serverURL = `${process.env.REACT_APP_TEAMSFX_ENDPOINT}/getGraphAccessToken?ssoToken=${token}`;
    let response = await fetch(serverURL).catch(this.unhandledFetchError); // This calls getGraphAccessToken route in /bot/index.js
    let data = await response.json().catch(this.unhandledFetchError);

    if (!response.ok && data.error === 'consent_required') {
      // A consent_required error means it's the first time a user is logging into to the app, so they must consent to sharing their Graph data with the app.
      // They may also see this error if MFA is required.
      this.setState({ consentRequired: true }); // This displays the consent required message.
      this.showConsentDialog(); // Proceed to show the consent dialogue.
    } else if (!response.ok) { /// getting here 
      // Unknown error
      console.error(data);
      this.setState({ error: true });
    } else {
      // Server side token exchange worked. Save the access_token to state, so that it can be picked up and used by the componentDidMount lifecycle method.
      this.setState({ graphAccessToken: data['access_token'] });
    }
  }

Error Building Microsoft.Teams.Samples.HelloWorld.Web on Mac

I'm following the instructions here: https://docs.microsoft.com/en-us/microsoftteams/platform/tutorials/get-started-dotnet-app-studio.

When I build, I get the following error:

Microsoft.Teams.Samples.HelloWorld.Web.csproj(28, 7): [MSB3073] The command "pwsh Compress-Archive -Path "/Users/haacked/dev/aseriousbiz/Microsoft-Teams-Samples/samples/app-hello-world/csharp/Microsoft.Teams.Samples.HelloWorld.Web/Manifest/*/" -DestinationPath /"/Users/haacked/dev/aseriousbiz/Microsoft-Teams-Samples/samples/app-hello-world/csharp/Microsoft.Teams.Samples.HelloWorld.Web/bin/Debug/netcoreapp3.1/helloworldapp.zip" -Force" exited with code 64.

This line is the culprit:

<Exec Command="powershell.exe Compress-Archive -Path \&quot;$(ProjectDir)Manifest\*\&quot; -DestinationPath \&quot;$(TargetDir)helloworldapp.zip\&quot; -Force" />

Teams token not getting generated on Mobile app but works fine on Web and Desktop

My custom app is in Angular and everything was working fine till a few weeks back. I was able to log in and generate tokens on both Web and Mobile app versions for the custom app but surprisely now, it has stopped working now. I cannot see where the issue is now. I have tested on Android ( Version 11 )

"@microsoft/teams-js": "1.10.0"

Here is my code snippet.

import * as microsoftTeams from '@microsoft/teams-js';

microsoftTeams.initialize(() => {
      this.microsoftAppAuth();
 });

microsoftAppAuth() {
    microsoftTeams.registerOnThemeChangeHandler((theme) => {
      setTheme(theme);
    });

    function setTheme(theme) {
      if (theme) {
        document.body.className =
          'theme-' + (theme === 'default' ? 'light' : theme);
        localStorage.setItem('theme', document.body.className);
      }
    }

    const authTokenRequest = {
      successCallback: (result) => {
        this.authService.setToken(result);
        microsoftTeams.appInitialization.notifySuccess(); // important in case of "showLoadingIndicator": true in manifest file
        localStorage.setItem('msteam', '1');
      },

      failureCallback: (error) => {
        console.log('Inside Teams Login Failure: ' + error);
      },
    };
    microsoftTeams.getContext((context) => {
       if (context) {
        if (context.theme) {
          setTheme(context.theme);
        }
        if (context.locale !== undefined && context.locale !== '') {
          this.translateService.use(context.locale.match(/es|es-ES/) ? 'es' : 'en');
        }
      }
      microsoftTeams.authentication.getAuthToken(authTokenRequest);
    });
  }

Like I mentioned in the title, the above code works fine in the Teams web version the only issue I am facing is on Mobile App.

Tabs Azure AD Single Sign-On Sample: resourceDisabled

I am trying to run your sample: "Microsoft Teams - Tabs Azure AD Single Sign-On Sample"
Like here

Following the steps was not hard and everything worked until I launch my app. In this case I get an error message:

image

Unfortunately I could not find anything with Google and because there is not a lot I could do wrong - the sample instructions are pretty clear - I think something else must be wrong.
How can I start to investigate where the error is coming from? If I inspect the window of the app with DevTools I do not get more information actually...

Just that:

main-f2e44df2875d9103.js:1 AuthenticationService: Authentication - {"context":"ShellService::requestMessage","subContext":"AuthElectron","message":"Received an error from IPC::{"eventName":"aadGetToken","error":"resourceDisabled","correlationId":"8fbcbc8e-d9eb-43ef-b70f-dbcb3b12d37a"}::isOnline-true","errorCode":"RemoteOperationFailed","correlationId":"8fbcbc8e-d9eb-43ef-b70f-dbcb3b12d37a"}

bot : Conversation reference is undefined

I'm running the in meeting app sample.

I have configured the app

  1. Created a meeting.
  2. Added a member.
  3. Added the custom app.
  4. Started the meeting

image

When I try to click on "show in meeting dialog " ,in the bot server I get this error ( botFrameworkAdapter.js ) when calling /getParticipantInfos endpoint

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'serviceUrl' of undefined
    at BotFrameworkAdapter.<anonymous> (/Users/hamzahaddad/Projects/teamsApp/in-meeting-app/bot/node_modules/botbuilder/lib/botFrameworkAdapter.js:193:82)
app.get("/getParticipantInfo", async (req, res) => {
  let participantId = jwt_decode(req.query.ssoToken)["oid"]; // Get the participant ID from the decoded token
  let tenantId = jwt_decode(req.query.ssoToken)["tid"]; // Get the tenant ID from the decoded token
  let meetingId = req.query.meetingId;
  let conversationReference = meetingInfoRepository.getConversationReference(
    req.query.conversationId
  ); // Look up the conversation reference object by conversation Id
  adapter.continueConversation(conversationReference, async (context) => {
    /**
     * Retrieve info using BF SDK
     * Learn more: https://docs.microsoft.com/en-us/javascript/api/botbuilder/teamsinfo?view=botbuilder-ts-latest#getMeetingParticipant_TurnContext__string__string__string_
     */
    let participantInfo = await TeamsInfo.getMeetingParticipant(
      context,
      meetingId,
      participantId,
      tenantId
    );
    console.log("Got role info: ", participantInfo);
    res.send(participantInfo);
  });
});

I see that meetingInfoRepository is undefined
I don't know how to set conversationReference value.

As I see the only place where meetingInfoRepository is set is in onTeamsMembersAddedEvent

    this.onTeamsMembersAddedEvent(
      async (membersAdded, teamInfo, context, next) => {
        meetingInfoRepository.setMeetingContext(
          context.activity.conversation.id,
          context
        );
        await next();
      }
    );

What are the step to be able to set this value and trigger show bot dialog button.

meeting-sidepanel in c#

If I understand well send a message to the bot is required before call anything that require serviceurl.
It'is correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.