Please refer to this sample here https://github.com/Azure-Samples/active-directory-javascript-singlepageapp-angular/tree/master/
In step 2 number at https://github.com/Azure-Samples/active-directory-javascript-singlepageapp-angular/tree/master/#setup
you can see that the configuration values are defined. You can edit them to your needs, for example
MsalModule.forRoot({
auth: {
clientId: 'Enter_the_Application_Id_Here',
authority: 'Enter_the_Cloud_Instance_Id_HereEnter_the_Tenant_Info_Here',
redirectUri: 'https://test-test.azurewebsites.net',
},
cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: isIE, // set to true for IE 11
},
},
{
popUp: !isIE,
consentScopes: [
'user.read',
'openid',
'profile',
],
unprotectedResources: [],
protectedResourceMap: [
['Enter_the_Graph_Endpoint_Herev1.0/me', ['user.read']]
],
extraQueryParameters: {}
})
I don't see the need to set the values programmatically when you can easily configure it from this ts file. If this helps, please mark the answer as verified.