May 10 2022 11:33 AM - edited May 10 2022 11:35 AM
Hi, I'm trying to get the Teams Token in the in-meeting side-panel. Currently, I can get the Teams token in static tabs, but when I add the App in a meeting and I try to get the Teams Token I have the following error:
“App resource defined in manifest and iframe origin do not match”. Currently, this only happens on localhost environment, but it is a recent error because a week ago we could retrieve the token as expected.
The way that I have to retrieve the Teams token in the code is:
microsoftTeams.authentication.getAuthToken(authTokenRequest)
This information could be relevant:
In my package.json I have the following in validDomains:
"validDomains": ["{{HOST_NAME}}"]
Where HOST_NAME is a variable that has the value:
HOST_NAME=demo.localhost.localdomain:3021
And webApplicationInfo have the following
"webApplicationInfo": {
"id": "{{AZURE_APP_ID}}",
"resource": "{{AZURE_APP_URI}}",
"applicationPermissions": ["OnlineMeeting.ReadBasic.Chat"]
}
Where AZURE_APP_ID is the same one that is in the App Registration of the Azure Portal.
And AZURE_APP_URI is like api://demo.localhost.localdomain/{{AZURE_APP_ID}}
ConfigurableTabs have the following:
"configurableTabs": [
{
"configurationUrl": "https://{{HOST_NAME}}/side-panel-config",
"canUpdateConfiguration": false,
"scopes": ["groupchat"],
"context": ["meetingSidePanel"]
}
],
It works as expected in static tabs but it doesn't work in config tabs.
Thanks in advance,
best regards.
May 16 2022 11:04 PM
May 17 2022 02:49 AM - edited May 20 2022 04:27 AM
@rodrigolicata - Please verify the contents of webApplicationInfo section:
"webApplicationInfo": {
"id": "{AAD App client id}",
"resource": "api://{Your tab app domain}/{AAD App client id}"
}
Please make sure the domain in webApplicationInfo is same as your tab app's domain, otherwise Teams will return error.
May 17 2022 06:14 AM - edited May 17 2022 06:14 AM
The content of webApplicationInfo section is the following:
"webApplicationInfo": {
"id": "{{AZURE_APP_ID}}",
"resource": "api://demo.localhost.localdomain/{{AZURE_APP_ID}}",
"applicationPermissions": ["OnlineMeeting.ReadBasic.Chat"]
}
The tab app's domain is: demo.localhost.localdomain:3021
The port is not included in the resource URL, but it's needed?
May 18 2022 02:11 AM
May 18 2022 10:25 AM
@Sayali-MSFT Sorry, but this is not very helpful, you only pasted the same information from here .
May 19 2022 12:59 AM
May 19 2022 12:52 PM
@Sayali-MSFT I tested the App with the following conditions:
Put the port only in the manifest: it brakes the App because I can't sign in.
Put the port only in Azure portal: the App works but I can't get the token from static tab (if I don't put the port in both sides I can get the token from static tab). There is an error.
And If I have it in both places I have the same error of having the port only in the manifest.
May 20 2022 04:25 AM - edited May 20 2022 04:27 AM
Could you please check the below thread hope it's helpful-
https://github.com/OfficeDev/TeamsFx/issues/2039?msclkid=fa862349cf8811ecb87368b5ecf8d19e
May 23 2022 04:39 AM
May 23 2022 10:26 AM
@Sayali-MSFT Thanks for the thread, I read it, but I didn't find a solution yet. The problem is that I can retrieve the Teams token from any static tab. But, the problem is only with the configurable tab and in localhost (in other environments works as expected), because in the configurable tab I cannot retrieve the Teams token because I have the mentioned error.
Jun 03 2022 05:10 AM - edited Jun 03 2022 05:11 AM
You can try out this Sample Code-Trinetra-MSFT/teams-tab-SSO-CSharp (github.com)
Jun 09 2022 06:46 AM
Jun 17 2022 08:14 AM