I am working on a Microsoft Teams tab app using the VS code toolkit. I have a already working website and I embedded it inside an iframe. My site is able to authenticate the user by using a Microsoft SSO key. I managed to get the SSO key of the current Microsoft user and I would like to pass down the token to the iframe so I can authenticate him/her. Is it possible to do this? If yes, how?
Thank you in advance for your help!
Here are a few snippets of my code:
useEffect(() => {
microsoftTeams.initialize();
microsoftTeams.authentication.getAuthToken({
successCallback: (result) => {
console.log("result", result);
setToken(result);
},
failureCallback: (reason) => {
console.log("reason", reason);
},
});
}, []);
return (
<div>
<h1 className="mainTitle">{token}</h1>
<iframe
src="mysiteurl"
title="XYZ out page"
allowFullScreen
className="iframe"
></iframe>
</div>
);