I am currently using Auth0 to manage users in my Angular application, but I want to switch to Azure Identity by utilizing @azure/msal-angular. To make this change, I removed the AuthModule from my app.module and replaced it with MsalModule. However, I encountered the following error:
main.ts:11 ERROR NullInjectorError: R3InjectorError(AppModule)[ApplicationInitStatus -> InjectionToken Application Initializer -> [object Object] -> AppConfigService -> OidcSecurityService -> CheckAuthService -> PeriodicallyTokenCheckService -> ConfigurationService -> StsConfigLoader -> StsConfigLoader -> StsConfigLoader]:
Error: No provider for StsConfigLoader!
This is how I updated my code:
MsalModule.forRoot(
new PublicClientApplication({
auth: {
clientId: "myclientId",
authority:
"myAuthority",
redirectUri: "https://localhost:*PORT*/",
},
cache: {
cacheLocation: "localStorage",
storeAuthStateInCookie: isIE,
},
}),
null,
null
),