Dec 03 2021 12:56 AM
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-lates... 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?
Dec 05 2021 10:28 PM
Dec 07 2021 06:23 AM
@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
Dec 15 2021 02:18 AM
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.
Dec 17 2021 06:44 AM
@zhy_qian - Could you please go through the following code sample and verify your code - Code sample
Dec 19 2021 06:56 PM
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?
Dec 21 2021 07:03 AM
@zhy_qian - Please check the below code sample where we are getting hostClientType.
Dec 22 2021 01:32 AM
Dec 26 2021 07:07 PM
Dec 27 2021 09:31 PM
@zhy_qian - Teams internal browser is a part of Microsoft Teams product. We do not have control over the internal browser to call/handle the events.