Cannot retrieve Teams token from Side Panel

%3CLINGO-SUB%20id%3D%22lingo-sub-3352997%22%20slang%3D%22en-US%22%3ECannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3352997%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I'm%20trying%20to%20get%20the%20Teams%20Token%20in%20the%20in-meeting%20side-panel.%20Currently%2C%20I%20can%20get%20the%20Teams%20token%20in%20static%20tabs%2C%20but%20when%20I%20add%20the%20App%20in%20a%20meeting%20and%20I%20try%20to%20get%20the%20Teams%20Token%20I%20have%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%3CSPAN%3E%E2%80%9C%3CSTRONG%3EApp%20resource%20defined%20in%20manifest%20and%20iframe%20origin%20do%20not%20match%3CSPAN%3E%E2%80%9D.%20%3C%2FSPAN%3E%3C%2FSTRONG%3ECurrently%2C%20this%20only%20happens%20on%20localhost%20environment%2C%20but%20it%20is%20a%20recent%20error%20because%20a%20week%20ago%20we%20could%20retrieve%20the%20token%20as%20expected.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20way%20that%20I%20have%20to%20retrieve%20the%20Teams%20token%20in%20the%20code%20is%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3EmicrosoftTeams.authentication.getAuthToken(authTokenRequest)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThis%20information%20could%20be%20relevant%3A%3CBR%20%2F%3EIn%20my%20package.json%20I%20have%20the%20following%20in%20validDomains%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%22validDomains%22%3A%20%5B%22%7B%7BHOST_NAME%7D%7D%22%5D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhere%20%3CSTRONG%3EHOST_NAME%3C%2FSTRONG%3E%20is%20a%20variable%20that%20has%20the%20value%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EHOST_NAME%3Ddemo.localhost.localdomain%3A3021%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAnd%20webApplicationInfo%20have%20the%20following%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%20%20%22webApplicationInfo%22%3A%20%7B%0A%20%20%20%20%22id%22%3A%20%22%7B%7BAZURE_APP_ID%7D%7D%22%2C%0A%20%20%20%20%22resource%22%3A%20%22%7B%7BAZURE_APP_URI%7D%7D%22%2C%0A%20%20%20%20%22applicationPermissions%22%3A%20%5B%22OnlineMeeting.ReadBasic.Chat%22%5D%0A%20%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhere%20%3CSTRONG%3EAZURE_APP_ID%3C%2FSTRONG%3E%20is%20the%20same%20one%20that%20is%20in%20the%20App%20Registration%20of%20the%20Azure%20Portal.%3CBR%20%2F%3EAnd%20%3CSTRONG%3EAZURE_APP_URI%3C%2FSTRONG%3E%20is%20like%20api%3A%2F%2Fdemo.localhost.localdomain%2F%7B%7BAZURE_APP_ID%7D%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EConfigurableTabs%20have%20the%20following%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%20%20%22configurableTabs%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22configurationUrl%22%3A%20%22https%3A%2F%2F%7B%7BHOST_NAME%7D%7D%2Fside-panel-config%22%2C%0A%20%20%20%20%20%20%22canUpdateConfiguration%22%3A%20false%2C%0A%20%20%20%20%20%20%22scopes%22%3A%20%5B%22groupchat%22%5D%2C%0A%20%20%20%20%20%20%22context%22%3A%20%5B%22meetingSidePanel%22%5D%0A%20%20%20%20%7D%0A%20%20%5D%2C%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIt%20works%20as%20expected%20in%20static%20tabs%20but%20it%20doesn't%20work%20in%20config%20tabs.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20in%20advance%2C%3CBR%20%2F%3Ebest%20regards.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3352997%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMeetings%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3383558%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3383558%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20are%20any%20updates%20please%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3384665%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3384665%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1385910%22%20target%3D%22_blank%22%3E%40rodrigolicata%3C%2FA%3E-%20We%20are%20looking%20into%20this%20I%20will%20get%20back%20to%20you%20soon.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3386747%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3386747%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1202096%22%20target%3D%22_blank%22%3E%40Sayali-MSFT%3C%2FA%3E%3C%2FP%3E%3CP%3EThe%20content%20of%20webApplicationInfo%20section%20is%20the%20following%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%20%20%22webApplicationInfo%22%3A%20%7B%0A%20%20%20%20%22id%22%3A%20%22%7B%7BAZURE_APP_ID%7D%7D%22%2C%0A%20%20%20%20%22resource%22%3A%20%22api%3A%2F%2Fdemo.localhost.localdomain%2F%7B%7BAZURE_APP_ID%7D%7D%22%2C%0A%20%20%20%20%22applicationPermissions%22%3A%20%5B%22OnlineMeeting.ReadBasic.Chat%22%5D%0A%20%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CBR%20%2F%3E%3CP%3EThe%20tab%20app's%20domain%20is%3A%26nbsp%3Bdemo.localhost.localdomain%3A3021%3CBR%20%2F%3EThe%20port%20is%20not%20included%20in%20the%20resource%20URL%2C%20but%20it's%20needed%3F%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3391945%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3391945%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1385910%22%20target%3D%22_blank%22%3E%40rodrigolicata%3C%2FA%3E%20-%20Provide%20your%20Azure%20Active%20Directory%20App%20ID%20and%20Microsoft%20Graph%20information%20to%20help%20users%20seamlessly%20sign%20into%20your%20app.%20If%20your%20app%20is%20registered%20in%20Microsoft%20Azure%20Active%20Directory%20(Azure%20AD)%2C%20you%20must%20provide%20the%20App%20ID.%20Administrators%20can%20easily%20review%20permissions%20and%20grant%20consent%20in%20Teams%20admin%20center.%3CBR%20%2F%3EResource%20URL%20of%20app%20for%20acquiring%20auth%20token%20for%20SSO.%3CBR%20%2F%3EIf%20you%20are%20not%20using%20SSO%2C%20ensure%20that%20you%20enter%20a%20dummy%20string%20value%20in%20this%20field%20to%20your%20app%20manifest%2C%20for%20example%2C%20%3CA%20href%3D%22https%3A%2F%2Fnotapplicable%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fnotapplicable%3C%2FA%3E%20to%20avoid%20an%20error%20response.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3395045%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3395045%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1202096%22%20target%3D%22_blank%22%3E%40Sayali-MSFT%3C%2FA%3E%26nbsp%3BSorry%2C%20but%20this%20is%20not%20very%20helpful%2C%20you%20only%20pasted%20the%20same%20information%20from%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fresources%2Fschema%2Fmanifest-schema%23webapplicationinfo%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E%26nbsp%3B.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3398050%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3398050%22%20slang%3D%22en-US%22%3EYes.%20you%20need%20to%20add%20port%20in%20the%20resource%20URL.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3402388%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3402388%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1202096%22%20target%3D%22_blank%22%3E%40Sayali-MSFT%3C%2FA%3E%26nbsp%3B%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EI%20tested%20the%20App%20with%20the%20following%20conditions%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EPut%20the%20port%20only%20in%20the%20manifest%3A%20it%20brakes%20the%20App%20because%20I%20can't%20sign%20in.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPut%20the%20port%20only%20in%20Azure%20portal%3A%20the%20App%20works%20but%20I%20can't%20get%20the%20token%20from%20static%20tab%20(if%20I%20don't%20put%20the%20port%20in%20both%20sides%20I%20can%20get%20the%20token%20from%20static%20tab).%20There%20is%20an%20error.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E%3CSPAN%3EAnd%20If%20I%20have%20it%20in%20both%20places%20I%20have%20the%20same%20error%20of%20having%20the%20port%20only%20in%20the%20manifest.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3385544%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3385544%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1385910%22%20target%3D%22_blank%22%3E%40rodrigolicata%3C%2FA%3E%26nbsp%3B-%26nbsp%3BPlease%20verify%20the%20contents%20of%20webApplicationInfo%20section%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%22webApplicationInfo%22%3A%20%7B%0A%20%20%20%20%22id%22%3A%20%22%7BAAD%20App%20client%20id%7D%22%2C%0A%20%20%20%20%22resource%22%3A%20%22api%3A%2F%2F%7BYour%20tab%20app%20domain%7D%2F%7BAAD%20App%20client%20id%7D%22%0A%20%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EPlease%20make%20sure%20the%20domain%20in%20webApplicationInfo%20is%20same%20as%20your%20tab%20app's%20domain%2C%20otherwise%20Teams%20will%20return%20error.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3405023%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3405023%22%20slang%3D%22en-US%22%3E%3CP%3ECould%20you%20please%20check%20the%20below%20thread%20hope%20it's%20helpful-%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FTeamsFx%2Fissues%2F2039%3Fmsclkid%3Dfa862349cf8811ecb87368b5ecf8d19e%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FOfficeDev%2FTeamsFx%2Fissues%2F2039%3Fmsclkid%3Dfa862349cf8811ecb87368b5ecf8d19e%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3414097%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3414097%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1385910%22%20target%3D%22_blank%22%3E%40rodrigolicata%3C%2FA%3E%20-Did%20you%20get%20the%20chance%20to%20check%20the%20above%20thread%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3416702%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20retrieve%20Teams%20token%20from%20Side%20Panel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3416702%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1202096%22%20target%3D%22_blank%22%3E%40Sayali-MSFT%3C%2FA%3E%26nbsp%3BThanks%20for%20the%20thread%2C%20I%20read%20it%2C%20but%20I%20didn't%20find%20a%20solution%20yet.%20The%20problem%20is%20that%20I%20can%20retrieve%20the%20Teams%20token%20from%20any%20static%20tab.%20But%2C%20the%20problem%20is%20only%20with%20the%20configurable%20tab%20and%20in%20localhost%20(in%20other%20environments%20works%20as%20expected)%2C%20because%20in%20the%20configurable%20tab%20I%20cannot%20retrieve%20the%20Teams%20token%20because%20I%20have%20the%20mentioned%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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.

11 Replies

There are any updates please?

@rodrigolicata- We are looking into this I will get back to you soon.

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

@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?

@rodrigolicata - Provide your Azure Active Directory App ID and Microsoft Graph information to help users seamlessly sign into your app. If your app is registered in Microsoft Azure Active Directory (Azure AD), you must provide the App ID. Administrators can easily review permissions and grant consent in Teams admin center.
Resource URL of app for acquiring auth token for SSO.
If you are not using SSO, ensure that you enter a dummy string value in this field to your app manifest, for example, https://notapplicable to avoid an error response.

@Sayali-MSFT Sorry, but this is not very helpful, you only pasted the same information from here . 

Yes. you need to add port in the resource URL.

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

Could you please check the below thread hope it's helpful-
https://github.com/OfficeDev/TeamsFx/issues/2039?msclkid=fa862349cf8811ecb87368b5ecf8d19e

@rodrigolicata -Did you get the chance to check the above thread?

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