How to load Component in App interface of teams apps

Copper Contributor

I have developed one task module  in Teams Apps which help me to log-in the user. After Successful logged-in, submitTask method is being called for closing task module. in mean while I am also fetching   data from Back-end  to display App interface after successful logged-in. but data is updating in task module not in App interface. Please help me what snap code is required for this issue in ReactJS and typescript.

8 Replies

@ManikantSingh - Are you trying to display the result using bot or tab on submit Could you please explain your scenario in more detail?

@Nikitha-MSFT  Thank you for replying. Below is exactly requirement


 Requirement:- Show one tab along with login button  in App interface. When click on log-in button,show one task module for user log-in and when  click on submit on user log-in task module,close the pop-up and update data in App interface.


When log-in API is responding session-id, I am calling another API to get data using session-id which is used to show in App interface. Now this data is updating in user log-in task module 

@ManikantSingh - Are you trying to authenticate user? If so could you please check this sample?



 Thank you for replying. I did  SSO login type of authentication. Now please tell me how to generate sessionId for calling API

@ManikantSingh - To call Graph APIs you need access token. You can get the access token by calling following method:

Get an authentication token from your client-side code

var authTokenRequest = { successCallback: function(result) { console.log("Success: " + result); }, failureCallback: function(error) { console.log("Failure: " + error); }, }; microsoftTeams.authentication.getAuthToken(authTokenRequest);

 Also, please take a look at Asking for additional consent using the Auth API.

@Wajeed-MSFT  Thank you for replying


I pass session Id parameter in API called to identify user`s session in web application project
For Teams Apps, how to generate this  sessionId  to integrate with web application project when I am using SSO login

@ManikantSingh - In Token-based Authentication no session is persisted server-side (stateless). You can pass your access token which then can be used to call Graph APIs.

My AAD Application is multi-tenant but the getAuthToken takes to /{tenantID} endpoint. How can I make the call to /common?