OfficeDev / Microsoft-Teams-Samples

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!
MIT License
949 stars 751 forks source link

onMembersAdded Event Not Triggering on an App Service with Authentication Enabled #1380

Open hirokika opened 2 weeks ago

hirokika commented 2 weeks ago

Hi,

I am developing a notification bot in TypeScript based on the Teams Toolkit sample code.

I use the NotificationBot#findMember method to identify users and send notifications to those who have installed the bot.
https://learn.microsoft.com/en-us/javascript/api/@microsoft/teamsfx/botbuildercloudadapter.notificationbot?view=msteams-client-js-latest

Everything was working fine until I enabled Microsoft IdP authentication on the App Service for access control. Since then, the bot has stopped sending notifications.

While investigating the issue, I tried logging a message to the console when the bot is installed, but noticed that no messages are output when authentication is enabled. Below is an example of the debugging code:

this.onMembersAdded(async (turnContext, next) => {     
   await turnContext.sendActivity("Welcome!! You can receive notifications.");     
   await next();  
});

It also appears that the bot is not writing the user’s connection information to the connected storage.

Could there be any possible causes for this? When adding the bot in Teams, do I need to explicitly allow the request? If so, could you please provide the specific configuration steps?

microsoft-github-policy-service[bot] commented 2 weeks ago

Hi @hirokika! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

Nivedipa-MSFT commented 1 week ago

@hirokika - Thanks for reporting your issue. We will check and update you soon.