Forum Discussion

rodrigolicata's avatar
rodrigolicata
Copper Contributor
May 10, 2022

Cannot retrieve Teams token from Side Panel

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.

14 Replies

  • 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.

    • rodrigolicata's avatar
      rodrigolicata
      Copper Contributor

      Sayali-MSFT

      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?

Resources