I have implemented Azure AD with my web application. on clicking login window a pop up open with URL https://login.microsoftonline.com. it ask for Azure ad username and password, After successful login a code is return as parameter but pop up never route back to main page it just stays there.
Has anyone encountered this scenario?
This was working but stopped suddenly. Can there be a proxy issue or browser issue?
Advertisement
Answer
Many users have said that if you create a UserAgentApplication on the redirected page it will close the popup.
If you are using MSAL, you need to have the msal object instantiated in the page pointed to by the redirectUri, so that this object closes the popup.
You can also resolve this by using an SPFx extension on every page so the login popup is able to close. In the redirect URL (SPFx/AAD), you can specify the root site collection URL.
See related threads:
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/174
https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/611