For my Angular (v12) application, I use MSAL for Authentication and I’m facing an issue on configuration.
In configuration, I have tenantId and app Id to initialize MSAL.
I cannot use the standard Angular configuration switching with
environment.ts since it cannot be changed in a post build step.
Instead, I try to load a json file and call at app startup using APP_INITIALIZER callback as it is explained in this post : How to initialize msal configurations using APP_INITIALIZER
I’ve modified it a bit since
MsalAngularConfiguration doesn’t exist anymore in MSAL v2.
But it’s not working, a call to
MSALInstanceFactory is done before ConfigService.init is called (by AppComponent since it depends from
I’ve tried also to pass
msalConfigFactory function, but the parameter is undefined.
I’ve also tried to import in code as json, but it doesn’t work since I got the values when it was built.
Source: Angular Questions