Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag in ms team

Copper Contributor

Hi,

 

I have developed an application for MS teams where I am using silent sign in using Azure Graph API. It is working fine in MS Teams Web View but it not working in MS Teams Desktop View. When I debugged, I am getting error as "Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag.". 

 

Thanks,

 

 

6 Replies

Hello @Rajesh Lohar   I'm going to move this thread over to our Microsoft Teams developer community conversation to increase your chances of a proper response.

@Rajesh Lohar - Could you explain you scenario in more detail? Also could you please share which document you are referring and Repro steps?

@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-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