0
votes

I have a Web App that's supposed to be used only within a Teams Tab. It's a simple app with a bunch of html pages and since it uses SSO for authentication I don't have any explicit login screens. I don't want anyone to access the app from outside of Teams. If anyone tries to access any of the app's web pages outside of Teams, it should throw an error or a warning. Currently the whole world is able to load the every html page of the app from outside Teams. Is there an easy way to prevent this?

1

1 Answers

0
votes

Presumably you're referencing the Teams JS library in your tabs. Inside of this there's a "getContext" method which will only work inside of Teams, and it has a callback, so you could perform your final page rendering inside of that callback, something like:

microsoftTeams.getContext(function(context) { document.getElementById("MainPanel").style.display = ""; })

where you have display set by default to "none", as an example