问题
I created the bot application and created the manifest file for it. I added it to the Microsoft teams and it is working fine. So if I use that manifest file with the other tenant account then also that app will be added and working. I don't want it to be like this. If the other tenant people tries to add the manifest it should not work or added. How to give tenant restriction in the manifest file? I am attaching my manifest file also.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0.0",
"id": "<id>",
"packageName": "com.example.myapp",
"developer": {
"name": "AzS",
"websiteUrl": "https://teams.com",
"privacyUrl": "https://teams.com/privacy",
"termsOfUseUrl": "https://teams.com/termsofuse"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "test Bot",
"full": "test App"
},
"description": {
"short": "This is a test bot",
"full": " bot"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "<botid>",
"scopes": [
"team",
"groupchat",
"personal"
],
"supportsFiles": true,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": []
}
回答1:
Aside from my question in the comments above, Microsoft provide a middleware as part of the bot framework itself, to filter for specific tenant id(s). Have a look at teamsTenantFilteringMiddleware
(The above is for Node). For interest, here is the C# version as well.
来源:https://stackoverflow.com/questions/61382080/ms-teams-app-manifest-file-tenant-restriction