Forum Discussion
Get refresh token of Teams Desktop of the current user
Hi David_Elsner,
Do you want to add a new tab for all your teams or add an option on a specific location?
- Nivedipa-MSFTOct 11, 2024
Microsoft
@David_Elsner - We got a reply from engineering team saying that the refresh token is handled by MSAL and it’s not a good practice for an app to try and extract it out of LocalStorage and even a worse practice to expose it in such a way that it can be extracted/copied out of our domain.
The way you want to implement has security concerns.
Teams network traffic can definitely be viewed using Fiddler or the browser DevTools. We have documentation on that here:
https://learn.microsoft.com/en-us/azure/azure-web-pubsub/howto-troubleshoot-network-trace
When using Fiddler, you might need to restart Teams after launching Fiddler so that it gets correctly set as the proxy. But opening Teams on the browser and using the network tab of the DevTools is even easier.Thanks,
Nivedipa
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- Nivedipa-MSFTOct 14, 2024
Microsoft
David_Elsner - Could you please share your valuable feedback via Microsoft Teams Developer Feedback link.
- David_ElsnerOct 16, 2024Brass Contributor
Nivedipa-MSFT Thanks for your feedback.
I am and was always aware that its not a good practice to use a refresh token for my use case.
However, what I need to do is not available in the Graph.
I want to add a cloud storage (or add document library) to a teams channel (no tab!), that users can navigate to it easily from within the channel.
That's currently not supported with the Graph, only via the unofficial teams API.To call this API, I need always a user context (no client credential flow possible)
So I am forced to a bad practice if I want to do what I need.
So yes: Its a bad practice
But no: A "good practice" seems not to exist here.