Login with AAD MSAL - Login is already in progress Login with AAD MSAL - Login is already in progress azure azure

Login with AAD MSAL - Login is already in progress


Check session/local storage and cookies for any dangling msal information. We had the same problem, and I stumbled into this link.

https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1069

It suggests clearing storage and cookies, but if you dig into using your browser tools, you'll see several entries like "msal...interactive...". Those will have values of "in progress", and that's what is causing the error.

Deleting those entries clears up the problem.


First, when using loginRedirect, you need to put the code you want to run when the user is redirected back to your app inside myMsalObj.handleRedirectCallback(callback) instead of inside the function where you initiate the redirect process. Also note, that handleRedirectCallback should be registered on initial page load.

Example:

const myMSALObj = new Msal.UserAgentApplication(msalConfig);$(document).ready(function(){    myMSALObj.handleRedirectCallback(function(error, response) {        var account = myMSALObj.getAcccount();        if (account) {            // user is logged in        }    });});

I am a little confused about your app though. Are you saying you have page in your app that just calls myMSALObj.logout()?