Forum Discussion

Peaverin's avatar
Peaverin
Copper Contributor
Oct 04, 2022

Storing persistent data associated to Teams user

I am developing a Teams Tab App where the user needs to authenticate using an external API which sends back a token. As the tab is reloaded everytime it is exited and entered again, the user would need to authenticate again. I would like to store this token somewhere. localStorage is an option, but it would be even better if I could store this token in some kind of storage associated to the Teams user using the app, so, for example, it does not need to relogin when switching from Team in web to Team standalone app.

 

For this, and for other use cases, I would like to know whether it is possible to store data associated to the Teams account that is using the app, so it can be later retrieved (something like a localStorage but associated to the account).

 

I have already had a look at this thread https://techcommunity.microsoft.com/t5/teams-developer/is-there-a-way-to-store-retrieve-persistent-data-in-teams-tab/m-p/1544749#M1549 but I don't see how getContext (as the answer says) can help me with my task. An explanation on this if it's possible will also help.

 

Thank you

Resources