I have created a single-page using .net core web application with the Angular Template. This application requires AAD authentication. Hence I have integrated MSAL and Microsoft Graph API. The auth setting requires AppId, Redirection Url, and Scopes. When I try to set these values programmatically, it always considers the initial value, and the updated values are not taken. If anyone has suggestions, please let me know.
Code Snipet:
export const OAuthSettings = {
appId: '---*',
redirectUri: 'https://test-test.azurewebsites.net',
scopes: [
"user.read"
]
};
The SignIn call is not considering the update values.
To update these values, AppConfigService is created and called in the AppModule APP_INITIALIZER section.
{ provide : APP_INITIALIZER,
useFactory: (appConfigProvider: AppConfigService)=>{
return()=>appConfigProvider.loadConfig();
},
multi:true,
deps:[AppConfigService]}],