I'm having trouble with MSAL in Angular. I'm making use of the @azure/msal-angular package (version 1.1.1).
I'm working on an Angular app that will be embedded in an ERP system (Business Central). I'm currently having authentication issues.
The components are summarized below.

Business central is embedding the Angular app by referencing the Angular dist. files from Azure blob storage.
When logging in, there is no way the login provider can redirect back to the Angular app, since it's embedded in Business Central, and there is no public URL to call a route in Angular itself when embedded.
So, what I did was hosting the Angular application on a public endpoint and in the embedded app, use the external application to redirect back after authentication. I have used another library to support authentication this way, and when using a popup for authentication I redirected to a plain HTML page with a couple lines of JavaScript to retrieve the access_token / id_token from the url segments. After retrieval, I called (window.opener || window.parent).postMessage(message, "*"); to notify the parent window of the authentication result.
But now I'm having issues with MSAL. When running the Angular application just local, with redirectURL https://localhost:4200/ the authentication process works just fine. But when changing this to that external hosted Angular application (Same version) it shows a popup with the application (after redirect) with JWT's in the URL segments. And MSAL is not reacting on this result. I think because the domain of the popup is different than the parent window.
Is there a way to fix this (complicated) way of authentication with MSAL?
Here's a link that may help you.
Tutorial: Create an Angular app that uses the Microsoft identity platform for authentication using auth code flow - Microsoft Entra | Microsoft Learn