Estoy tratando de averiguar cómo cerrar programáticamente la ventana emergente del navegador MSAL en su versión 2.0. https://github.com/AzureAD/microsoft-authentication-library-for-js
Actualmente activé esta ventana emergente a través de un clic en una página web.
El window.close no cierra la ventana emergente, ¿hay alguna forma alternativa de lograr esto?
function msalAuth(){ const config = { auth: { clientId: 'xxx', } } const loginRequest = { scopes: ["User.ReadWrite"] } let accountId = ""; const myMsal = new msal.PublicClientApplication(config); myMsal.loginPopup(loginRequest) .then(function (loginResponse) { accountId = loginResponse.account.homeAccountId; // Display signed-in user content, call API, etc. }).catch(function (error) { //login failure console.log(error); }); const callbackId = myMsal.addEventCallback((message) => { // This will be run every time an event is emitted after registering this callback if (message.eventType === msal.EventType.LOGIN_FAILURE) { const result = message.payload; console.log("Failed auth !!") // Some actions window.close(); // Want to close the popup window exactly here } }); }