Forum Discussion
Problems with teams desktop calling Microsoft Teams JavaScript client SDK
Please refer to the following URL for the SDK used:
https://docs.microsoft.com/en-us/javascript/api/overview/msteams-client?view=msteams-client-js-latest https://docs.microsoft.com/en-us/javascript/api/@microsoft/teams-js/?view=msteams-client-js-latest
I use the Microsoft Teams JavaScript client SDK to authenticate programs.
In the browser's teams, the pop-up window will pop up normally during identity authentication.
However, when performing identity authentication in the teams desktop, the pop window does not pop up in the teams, but calls the IE browser of windows. This caused a problem with my program.
Debug the code:
After executing [initialize()], the SDK does not recognize the desktop environment.(Unrecognized host Client Type)
Caused the default browser to be called when executing [authentication]
What is the reason for this?
Is my initialization incorrect?
9 Replies
- Meghana-MSFTFormer Employee
zhy_qian - Could you please let us know if you are trying bot authentication or tab authentication? Please go through the below mentioned links for bot/tab auth.
1) Microsoft Teams authentication flow for tabs2) Authentication flow for bots in Microsoft Teams
- zhy_qianCopper Contributor
I am trying the tab authentication
Please refer to the picture in the attachment for the code.In the desktop of teams, when executing the code shown in the attachment, the code does not recognize the current execution environment of the application.(During the observation of the source code, it is found that the value of "hostClientType" is undefined).
As a result, the internal browser of teams desktop is not opened, but the local IE browser is opened.
Opening the local IE browser will cause errors in my application.
Does the team desktop have a built-in browser? And please help check whether the code is correct.
Thank you.
- Meghana-MSFTFormer Employee
zhy_qian - Could you please go through the following code sample and verify your code - Code sample
- Meghana-MSFTFormer EmployeeWe are looking into this. we will update you