MS Teams open dialog with Window.open, without valid domain

  angular, c#, javascript, microsoft-teams

We are working on MS Teams Application in which we need to do authentication with third party identity server. Currently, when we enter the third-party domain in "Valid Domain" list it works as expected in both MS Teams Desktop and MS Teams Web application. Please find our sample code as follow,

microsoftTeams.initialize(() => {
    microsoftTeams.authentication.authenticate({
        url: ds['Url'],
        width: 600,
        height: 400,
        failureCallback: function (reason) {
          window.location.reload();
        }
    });
});

Our issue is we do have 1000+ third-party services with which we need to authorize as per the end user’s preference, and it is not possible to list all the domains in a "Valid Domain" list. So, as an alternative we have tried with,

window.open(ds['Url']);

windows.open() works well for both MS Teams Desktop and MS Teams Web application but we are working with SPA so, after redirection we would like to close that window which we are not able to do so from our SPA.

Source: Ask Javascript Questions

LEAVE A COMMENT