In order to manage authentication in an Angular single page app, I am utilizing the microsoft adal wrapper available at https://github.com/manishrasrani/ms-adal-angular6.
Following the documentation, I configure all necessary options during compile time using the provided guidelines, which functions as intended.
@NgModule({
imports: [
MsAdalAngular6Module.forRoot({
tenant: '<YOUR TENANT>',<-------------------------------- ADD
clientId: '<YOUR CLIENT / APP ID>',<--------------------- ADD
redirectUri: window.location.origin,
endpoints: { <------------------------------------------- ADD
"https://localhost/Api/": "xxx-bae6-4760-b434-xxx",
---
---
},
navigateToLoginRequestUrl: false,
cacheLocation: '<localStorage / sessionStorage>', <------ ADD
}),
---
---
],
---
---
})
However, due to having an automated deployment pipeline with multiple environments (dev, test, prod, etc.) that require unique settings, I aim to apply these configurations at runtime. In other words, I prefer not to recompile for each environment I deploy to.
I have followed a helpful guide on loading settings from a json file at runtime: , which has been effective. The challenge now is how to incorporate values loaded this way into the MsAdalAngular6Module dynamically?