Can't save custom connector configuration - microsoft-teams

I am following the tutorials on https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/tabs/tabs-configuration with the configuration code provided. When I hit save after some seconds I get the error that it was not successful.
As far as I am concerned all needed valid domains are added.
Manifest.json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
"manifestVersion": "1.3",
"id": "ec3e802c-506d-4301-9ae4-868b93461ca0",
"version": "1.0.0",
"packageName": "com.Package",
"developer": {
"name": "Developer",
"websiteUrl": "https://privateDomain.de",
"privacyUrl": "https://privateDomain.de",
"termsOfUseUrl": "https://privateDomain.de"
},
"description": {
"full": "Text",
"short": "More Text"
},
"icons": {
"outline": "IncomingWebhook.jpg",
"color": "IncomingWebhook.jpg"
},
"connectors": [
{
"connectorId": "ec3e802c-506d-4301-9ae4-868b93461ca0",
"scopes": [
"team"
],
"configurationUrl": "*linkToConfigurationPage*"
}
],
"name": {
"full": "Package",
"short": "Package"
},
"accentColor": "#FFFFFF",
"validDomains": [
"bing.com",
"google.com",
"*.google.com",
"*.bing.com",
"teams-get-started-sample.azurewebsites.net",
"*.microsoft.com",
"*.skype.com",
"*.privateDomain.de",
"vater-gruppe.de",
"static2.sharepointonline.com",
"secure.aadcdn.microsoftonline-p.com",
"code.jquery.com",
"statics.teams.microsoft.com",
"*.microsoftonline.com",
"ajax.googleapis.com"
],
"needsIdentity": "false"
}
The code in the index on the SSL capable server(linkToConfigurationPage) is
`<body>
<form>
<input type="radio" name="maptype" value="bing" onclick="onClick()"> Bing Maps<br>
<input type="radio" name="maptype" value="google" onclick="onClick()"> Google Maps
</form>
<script src="https://statics.teams.microsoft.com/sdk/v1.2/js/MicrosoftTeams.min.js"></script>
<script type="text/javascript">
microsoftTeams.initialize();
microsoftTeams.settings.registerOnSaveHandler(function(saveEvent){
var radios = document.getElementsByName("maptype");
if (radios[0].checked) {
microsoftTeams.settings.setSettings({
entityId: "bing",
contentUrl: "https://www.bing.com/maps/embed",
suggestedDisplayName: "Bing Map",
websiteUrl: "https://www.bing.com/maps",
removeUrl: "https://teams-get-started-sample.azurewebsites.net/tabremove.html",
});
} else {
microsoftTeams.settings.setSettings({
entityId: "google",
contentUrl: "https://www.google.com/maps/embed",
suggestedDisplayName: "Google Map",
websiteUrl: "https://www.google.com/maps",
removeUrl: "https://teams-get-started-sample.azurewebsites.net/tabremove.html",
});
}
saveEvent.notifySuccess();
});
function onClick() {
microsoftTeams.settings.setValidityState(true);
}
</script>
</body>
</html>`
The error message I get is
angular.min.js:112 2018-09-04T09:26:24.007Z Received error from connectors {"seq":1536048346894,"timestamp":1536053183994,"flightSettings":{"Name":"ConnectorFrontEndSettings","AriaSDKToken":"d127f72a3abd41c9b9dd94faca947689-d58285e6-3a68-4cab-a458-37b9d9761d35-7033","SPAEnabled":true,"ClassificationFilterEnabled":true,"ClientRoutingEnabled":true,"EnableYammerGroupOption":true,"EnableFadeMessage":false,"EnableDomainBasedOwaConnectorList":false,"EnableDomainBasedTeamsConnectorList":false,"DevPortalSPAEnabled":true,"ShowHomeNavigationButtonOnConfigurationPage":false},"status":500,"clientType":"SkypeSpaces","connectorType":"ec3e802c-506d-4301-9ae4-868b93461ca0","name":"handleMessageError","nonPIIInfo":"{\"exception\":{}}"}
Can anyone help me what I am doing wrong?

The content URL in microsoftTeams.settings.setSettings() is used to handle edits. This URL also need to be under the same domain which is added in Connector Portal's valid domain section. You could try following as your linkToConfigurationPage is already part of valid domains.
microsoftTeams.settings.setSettings({
entityId: "bing",
contentUrl: "*linkToConfigurationPage*",
suggestedDisplayName: "Bing Map"
})

The solution is to remove the "validDomains" attribute from the generated mainfest.json.

Related

Manifest parsing error when trying to test app in Teams

From https://dev.teams.microsoft.com/, whenever I click "Preview in Teams", it shows an error in Teams with these details copied to the clipboard: "Error while reading manifest.json". If I download the app package and "upload a custom app" I get the same error. What can I do to resolve this? If I remove the messaging extension configuration, it works but I configured that part in their app and that's what I want to build.
This is my manifest file:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"version": "1.0.0",
"manifestVersion": "1.11",
"id": "3fXXXX",
"packageName": "com.package.name",
"name": {
"short": "Domo Integration",
"full": ""
},
"developer": {
"name": "Domo Inc.",
"mpnId": "",
"websiteUrl": "https://www.domo.com",
"privacyUrl": "https://www.domo.com/company/privacy-policy",
"termsOfUseUrl": "https://www.domo.com/company/service-terms"
},
"description": {
"short": "short",
"full": "full"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"composeExtensions": [
{
"botId": "deXXXXXXXX",
"commands": [],
"canUpdateConfiguration": true,
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"*.domo.com"
]
}
}
]
}
],
"validDomains": [
"*.domo.com"
]
}
#ccnokes In order to use messaging extension in your bot, you need to provide at least one command. commands is required property in composeExtension - see doc.
I was also getting the same error when tried with your manifest but after adding commands it worked totally fine.

Microsoft Teams Connector error "ngClickDecorator: value not found in enum type. value:"

I'm currently seeing this error when I try and save my connector configuration:
21T21:05:12.087Z ngClickDecorator: value not found in enum type. value:
and
21T21:05:12.155Z Received error from connectors {"seq":1611247472155,"timestamp":1611263112143,"flightSettings": {"Name":"ConnectorFrontEndSettings","AriaSDKToken":"d127f72a3abd41c9b9dd94faca947689-d58285e6-3a68-4cab-a458-37b9d9761d35-7033","SPAEnabled":true,"ClassificationFilterEnabled":true,
"ClientRoutingEnabled":true,"EnableYammerGroupOption":true,
"EnableFadeMessage":false,"EnableDomainBasedOwaConnectorList":false,
"EnableDomainBasedTeamsConnectorList":false,"DevPortalSPAEnabled":true,
"ShowHomeNavigationButtonOnConfigurationPage":false,"DisableConnectToO365InlineDeleteFeedbackPage":true},"status":500,"clientType":"SkypeSpaces",
"connectorType":"c6adb316-46b2-4e46-a511-8b4947b3d554","name":"handleMessageError"}
And the SO post: Can't save custom connector configuration is very close to my problem however I have added my configurationURL to my valid domains, and removed mine from the manifest but with still no luck. I'm all set up on my permissions as well unless there is something specific I am missing to configure?
Any suggestions, below is my manifest and code:
Manifest:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.3",
"showLoadingIndicator": true,
"isFullScreen": true,
"id": "c6adb316-46b2-4e46-a511-8b4947b3d554",
"packageName": "com.test",
"developer": {
"name": "Test, Inc",
"websiteUrl": "https://test.com",
"privacyUrl": "https://test.com/privacy",
"termsOfUseUrl": "https://test.com/toc"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"connectors": [
{
"connectorId": "c6adb316-46b2-4e46-a511-8b4947b3d554",
"scopes": [
"team"
],
"configurationUrl": "https://localdev-test.test.com/connector"
}
],
"name": {
"short": "Test Development",
"full": "Test for Microsoft Teams"
},
"description": {
"short": "Test Development",
"full": "Test for Microsoft Teams"
},
"accentColor": "#FFFFFF",
"staticTabs": [
{
"entityId": "22f101b6-f9a2-44d3-8eba-74309295f398",
"scopes": [
"personal"
],
"context":[
"personalTab",
"channelTab"
],
"name": "TestSite",
"contentUrl": "https://localdev-test.test.com",
"websiteUrl": "https://localdev-test.test.com",
"searchUrl": "https://localdev-test.test.com"
}
],
"devicePermissions": [
"notifications",
"openExternal"
],
"permissions": [
"identity",
"messageTeamMembers"
]
}
Code:
ngOnInit(): void {
microsoftTeams.initialize();
microsoftTeams.settings.registerOnSaveHandler((saveEvent) => {
microsoftTeams.settings.setSettings({
entityId: 'Create',
contentUrl: 'https://localdev-test.test.com/connector',
removeUrl: 'https://localdev-test.test.com/connector',
configName: 'Create'
});
microsoftTeams.settings.getSettings((settings) => {
this.webhookUrl = settings.webhookUrl;
localStorage.setItem('connectorWebHook', this.webhookUrl);
});
saveEvent.notifySuccess();
});
}
onClick(): void {
if (!this.webhookUrl) {
microsoftTeams.settings.setValidityState(true);
}
}
This is a Microsoft Bug, the "Configuration page for your Connector" on the Connector Portal is immutable (even though it is in an edit field). Meaning that the URL you set on the creation of the Connector can not change through development or you will get this error. So just making a new connector through the portal with my changed configuration URL fixed my problem.
A comment on their git points to this as well: https://github.com/MicrosoftDocs/msteams-docs/issues/1738#issuecomment-647675420

Cannot get subEntityId on MS Teams tab app from deep link

I cannot retrieve a subEntityId on a Teams tab app from a deep link. It's always empty in getContext. Could anyone please help me out?
I generated a deep link as following this page, https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links
The link looks like this,
https://teams.microsoft.com/l/entity/58061894-78f0-49c3-99d7-25830d1c84f0/anpi-personal&context=%7B%22subEntityId%22:%22task123%22%7D
The link works as it expected, it brings me to the tab app on Teams. But no subEntityId.
The manifest of the tab app looks like this,
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json",
"manifestVersion": "1.7",
"version": "1.0.0",
"id": "58061894-78f0-49c3-99d7-25830d1c84f0",
"packageName": "something.package.name",
"developer": {
"name": "dev",
"websiteUrl": "some url",
"privacyUrl": "some url",
"termsOfUseUrl": "some url"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "some name",
"full": "some text"
},
"description": {
"short": "some text",
"full": "some text"
},
"accentColor": "#FFFFFF",
"staticTabs": [
{
"entityId": "anpi-personal",
"name": "app name",
"contentUrl": "https://exmample.com/Default.aspx?entityId={entityId}&subEntityId={subEntityId}",
"scopes": [
"personal"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"foo.com"
],
"webApplicationInfo": {
"id": "13958568-6984-47d4-910f-7bb9c87078c2",
"resource": "api://exmample.com/13958568-6984-47d4-910f-7bb9c87078c2"
}
}
I think you need to change:
...anpi-personal&context=%7B%22subEntityId%22:%22task123%22%7D
to:
...anpi-personal?context=%7B%22subEntityId%22:%22task123%22%7D
the change is hard to see - I've changed "&context" to "?context" - "&" is required if you have -multiple- values you're passing (like "weburl=something" AND "context=something"), but in this case you only have "context", so it needs to start with "?"

Having Difficulty Displaying Web Frame with Task Module - Microsoft Bot Framework

I have followed the microsoft documentation.
From it, I understand that "I can run my own custom HTML/JavaScript code" and make it display on teams with Task Module.
I have done everything recommended my card is showing blank each time invoke the task module.
I'm using the BotBuilder-Sample Node JS SDK
teamsTaskModuleBot.js file contains
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const {
TeamsActivityHandler,
MessageFactory,
CardFactory,
} = require("botbuilder");
class TeamsTaskModuleBot extends TeamsActivityHandler
{
constructor ()
{
super();
// See https://aka.ms/about-bot-activity-message to learn more about the message and other activity types.
this.onMessage(async (context,next) =>
{
const card = this.getHeroCardMenu();
const message = MessageFactory.attachment(card);
await context.sendActivity(message);
// By calling next() you ensure that the next BotHandler is run.
await next();
});
this.onMembersAdded(async (context,next) =>
{
const card = this.getHeroCardMenu();
const message = MessageFactory.attachment(card);
await context.sendActivity(message);
// By calling next() you ensure that the next BotHandler is run.
await next();
});
}
getHeroCardMenu ()
{
return CardFactory.heroCard(
"Task Module Invocation from Hero Card",
null, // No images
[
{
type: "invoke",
title: "Open",
value: {type: "task/fetch"},
},
]
);
}
handleTeamsTaskModuleFetch (context,taskModuleRequest)
{
// taskModuleRequest.data can be checked to determine different paths.
return {
task: {
type: "continue",
value: {
url: "https://botiframe.netlify.app/index.html",
height: "medium",
width: "medium",
title: "Task Module Bot",
fallbackUrl: "https://botiframe.netlify.app/index.html"
},
},
};
}
}
module.exports.TeamsTaskModuleBot = TeamsTaskModuleBot;
My manifest.json file
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0.0",
"id": "208a91ef-baa9-460d-bf8d-7c7bc2f475e0",
"packageName": "com.dipolediamond.taskmodule",
"developer": {
"name": "dipoleDiamond Ltd",
"websiteUrl": "https://www.dipolediamond.com",
"privacyUrl": "https://www.dipolediamond.com/blog",
"termsOfUseUrl": "https://www.dipolediamond.com/contact"
},
"icons": {
"color": "icon-color.png",
"outline": "icon-outline.png"
},
"name": {
"short": "Task Module Bot",
"full": "Simple Task Module Bot"
},
"description": {
"short": "Test Task Module Sample Bot",
"full": "Simple Task Module Sample Bot"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "208a91ef-baa9-460d-xxxx-xxxxxxx",
"scopes": ["personal", "team", "groupchat"],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"permissions": ["identity", "messageTeamMembers"],
"composeExtensions": [
{
"botId": "208a91ef-baa9-460d-xxxx-xxxx",
"canUpdateConfiguration": true,
"commands": [],
"messageHandlers": [
{
"type": "link",
"value": {
"domains":"www.botiframe.netlify.app"
]
}
}
]
}
],
"validDomains": ["www.botiframe.netlify.app"]
}
Before showing your web content, Teams does some basic validation of the end address. This requires, as you've done, that the domain be registed with validDomains and domains sections. However, when I visit the site, I'm getting a certificate error, so it's likely that Teams is blocking your site for that reason. Are you able to get that resolved (custom domain, or cert matching domain (the cert is for *.netlify.com, but your site is running on netlify.app)? Try that first.

Use of aJax in extension default_popup?

Can I somehow use aJax in my Google Chrome Extension "default_popup".
I have tried the following...
manifest.json:
{
"name": "My extension",
"manifest_version": 2,
"version": "1.0",
"permissions": [
"tabs", "http://*/*"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["jquery-1.8.3.min.js", "content.js"],
"run_at": "document_end"
}
]
}
popup.html:
<html>
<body>
<script>
$.ajax({
type: "GET",
url: "http://www.mysite.com/api.php"
}).done(function(response) {
alert("work");
}).fail(function(response) {
alert("doesn't work");
});
</script>
</body>
</html>
Does anyone have any ideas how to do this?
It's possible, but you'll most likely have to use JSONP. You can use what you already have as a basis, so it shouldn't require much refactoring.

Resources