Forum Discussion
Use Teams-js for authentication in web
JensK2023- Thanks for reporting your issue.
Are you developing teams app?
- Sayali-MSFTAug 04, 2023
Microsoft
@JensK2023- Yes, you can utilize the teams-js library and teamsfx (Teams Toolkit) to enable your app to run in a browser without the need for Teams, Outlook, or Office hosts. Both teams-js and teamsfx provide functionalities for authenticating and obtaining tokens.
The teams-js library offers a method called authentication.authenticate that can be used to obtain tokens for a specified list of resources. You can call this method in your web app's frontend to trigger the authentication process and obtain the necessary access tokens.
TeamsFx helps to reduce your tasks by using Microsoft Teams single sign-on (SSO) and accessing cloud resources down to single line statements with zero configuration. You can use TeamsFx SDK in the browser and Node.js environments. TeamsFx core functionalities can be accessed in client and server environments.
Reference doc-1. https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teamsfx-sdk
2.https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-tab-aad?tabs=teamsjs-v2