22// Azure AD B2C Configuration
33// ----------------------------------------------------------------------
44const POLICY = "b2c_1a_arm_accounts.susi" ;
5- const CLIENT_ID = "20ede7b2-aeb1-43d4-81f9-fc1b7fbfca5e" ;
5+ const ENV = "prod" ; // Change to "test" for testing environment
6+
7+ const CLIENT_ID_TEST = "20ede7b2-aeb1-43d4-81f9-fc1b7fbfca5e" ;
8+ const CLIENT_ID_PROD = "8234ed8a-6728-4a0b-bb7d-b2e5933e581d" ;
9+ const CLIENT_ID = ENV === "prod" ? CLIENT_ID_PROD : CLIENT_ID_TEST ;
10+
11+ const TENANT_DOMAIN_TEST = "armb2ctest.onmicrosoft.com" ;
12+ const TENANT_DOMAIN_PROD = "armb2c.onmicrosoft.com" ;
13+ const TENANT_DOMAIN = ENV === "prod" ? TENANT_DOMAIN_PROD : TENANT_DOMAIN_TEST ;
14+
15+ const TENANT_ID_TEST = "f15a8617-9b4e-41dd-8614-adea42784599" ;
16+ const TENANT_ID_PROD = "1eb62d43-db15-492b-beab-8a32f6d90351" ;
17+ const TENANT_ID = ENV === "prod" ? TENANT_ID_PROD : TENANT_ID_TEST ;
618
7- // Change these in CI/CD pipeline depending on target environment
8- const TENANT_DOMAIN = "armb2ctest.onmicrosoft.com" ;
9- const TENANT_ID = "f15a8617-9b4e-41dd-8614-adea42784599" ;
1019const B2C_DOMAIN = "account.arm.com" ;
1120
1221const REDIRECT_URI = window . location . origin + "/" ;
@@ -22,22 +31,21 @@ window.msalConfig = {
2231 authority : AUTHORITY ,
2332 knownAuthorities : [ B2C_DOMAIN ] ,
2433 redirectUri : REDIRECT_URI ,
25- postLogoutRedirectUri : REDIRECT_URI ,
26- navigateToLoginRequestUrl : true
34+ postLogoutRedirectUri : REDIRECT_URI
2735 } ,
2836 cache : {
2937 cacheLocation : "sessionStorage" , // Switch to localStorage for better persistence across tabs after testing
3038 storeAuthStateInCookie : false
39+ } ,
40+ system : {
41+ allowRedirectInIframe : false ,
3142 }
3243} ;
3344
3445window . loginRequest = {
3546 authority : AUTHORITY ,
3647 scopes : [
3748 "openid" ,
38- "profile" ,
39- "offline_access" ,
40- `https://${ TENANT_DOMAIN } /${ CLIENT_ID } /User.Read`
4149 ]
4250} ;
4351
@@ -47,9 +55,6 @@ if (!window.msalInstance) {
4755const msalInstance = window . msalInstance ;
4856
4957
50-
51-
52-
5358// ----------------------------------------------------------------------
5459// Authentication Functions
5560// ----------------------------------------------------------------------
@@ -304,4 +309,4 @@ document.addEventListener("arm-top-navigation-ready", function (e) {
304309( async ( ) => {
305310 await initAuth ( ) ; // IMPORTANT: await this before user clicks anything
306311
307- } ) ( ) ;
312+ } ) ( ) ;
0 commit comments