Forum Discussion
Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag in ms team
Rajesh Lohar - Could you explain you scenario in more detail? Also could you please share which document you are referring and Repro steps?
- Rajesh LoharAug 10, 2020Copper Contributor
Nikitha-MSFT I am developing a MS teams app where I am getting logged in user information using Graph API. just implementing SSO in MS teams Tab.
I have created an aspx page where I used adal.js to implement SSO. Below is the code I used.
<script type="text/javascript">
microsoftTeams.initialize();
window.config = {
instance: "https://login.microsoftonline.com/",
tenant: "common",
clientId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
postLogoutRedirectUri: window.location.origin,
cacheLocation: "localStorage",
endpoints: {
"https://graph.microsoft.com": "https://graph.microsoft.com"
}
};var authContext = new AuthenticationContext(window.config);
if (authContext.isCallback(window.location.hash))
authContext.handleWindowCallback(window.location.hash);
else {
var user = authContext.getCachedUser();
if (!user)
authContext.login(); // No cached user...force login
else {
authContext.acquireToken("https://graph.microsoft.com", function (error, token) {
if (error || !token) {
authContext.login();
}
else
microsoftTeams.authentication.notifySuccess(token);
$.ajax({
url: 'https://graph.microsoft.com/v1.0/me/',
headers: { 'authorization': 'Bearer ' + token },
type: 'GET',
dataType: 'json'
}).done(function (res) {
document.write(res['userPrincipalName']);
console.log(res['userPrincipalName']);
});
});
}
}
</script>The above is working good in Web View of MS Teams and getting user information, but it is not working in MS Teams Desktop View. When I debugged in Desktop View, I am getting error as "Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag in ms" in console.
Thanks,
Rajesh
- Nikitha-MSFTAug 10, 2020Former Employee
Rajesh Lohar - Could you please check this sample? Try if that helps.
- Rajesh LoharAug 10, 2020Copper Contributor
Nikitha-MSFT . Thanks for sharing the details.
The sample you provides uses Node.js/typescript while I am developing app in asp.net MVC. is there any sample available in .net?
Thanks