Forum Discussion
call Graph API from Teams Tab
Hi vovanb,
You cannot use the token returned by getAuthToken directly to interact with Microsoft Graph. As mentioned in this documentation
The token contains some claims about the user's identity. You have to convert the token to an access token with your backend (similar to "on behalf of" OAuth flow).
- vovanbJul 05, 2023Copper Contributor
Hi Alexis,
so I need to do something similar to below examples:
https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/app-complete-auth/csharp/AppCompleteAuth/helper/AuthHelper.cs
or
https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/tab-sso/csharp/TeamsTabSSO/Helper/SSOAuthHelper.cs
Thanks- alexisconiaJul 05, 2023MVP
Hi vovanb,
Yes, if your backend is implemented with ASP .net core, you have middleware to simplify all the process https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-web-api-call-api-call-api?tabs=aspnetcore&WT.mc_id=M365-MVP-4039677