I am using this microsoft adal wrapper to manage authentication in an angular single page app: https://github.com/manishrasrani/ms-adal-angular6
And based on the documentation there I configure all the various options at compile time like this, which works as expected.
@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
}),
---
---
],
---
---
})
But as I have and automated deployment pipeline with multiple environments (dev, test, prod, etc..) that requiring unique settings - I want to do this runtime instead. That is, I don't want to re-compile for each environment I deploy to.
I followed this guide on how to load settings from a json file at rutime: https://juristr.com/blog/2018/01/ng-app-runtime-config/ which works nicely, but how to get values loaded that way into the MsAdalAngular6Module at runtime?