GithubHelp home page GithubHelp logo

officedev / microsoft-teams-samples Goto Github PK

View Code? Open in Web Editor NEW
889.0 67.0 719.0 706.07 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

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 keshav-msft avatar microsoftopensource avatar mohammed-msft avatar mtrilbybassett avatar nikitajain-msft avatar pawan-msft avatar pawank-msft avatar prithvi-msft avatar rick-kirkham avatar tecton avatar v-kalc avatar vesajuvonen avatar wajeed-msft avatar yukun-dong avatar zyxiaoyuer 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  avatar

microsoft-teams-samples's Issues

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.

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?

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.

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)?

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

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/#"

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,

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>

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"
    ]
}

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?

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

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

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?

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

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.

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.

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

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.

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.

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?

"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'] });
    }
  }

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?

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 ?

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.

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?

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.

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?

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.

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"}

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??

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!

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.

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'

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 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 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?

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.