Forum Discussion
Problems with teams desktop calling Microsoft Teams JavaScript client SDK
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 tabs
2) Authentication flow for bots in Microsoft Teams
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-MSFTDec 17, 2021Former Employee
zhy_qian - Could you please go through the following code sample and verify your code - Code sample
- zhy_qianDec 20, 2021Copper Contributor
Hello, thank you very much for your reply. I refer to the sample code.
The authentication code is roughly the same.
Execute "microsoftTeams.initialize()" code first, and then execute "microsoftTeams.authentication.authenticate()" for authentication.
However, in my code, after the "microsoftTeams.initialize()" code is executed, debug the source code of "microsoftTeams.authentication.authenticate()". It is found that the value of "hostClientType" in the code does not exist.
If I can't call the internal browser of Teams desktop, it will affect my application.
Is there a solution?
- Meghana-MSFTDec 21, 2021Former Employee
zhy_qian - Please check the below code sample where we are getting hostClientType.