@azure/msal-browser 3.19.0 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/cache/AccountManager.mjs +1 -1
  7. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  8. package/dist/cache/BrowserCacheManager.mjs +1 -1
  9. package/dist/cache/BrowserStorage.mjs +1 -1
  10. package/dist/cache/DatabaseStorage.mjs +1 -1
  11. package/dist/cache/MemoryStorage.mjs +1 -1
  12. package/dist/cache/TokenCache.mjs +1 -1
  13. package/dist/config/Configuration.mjs +1 -1
  14. package/dist/controllers/ControllerFactory.mjs +1 -1
  15. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  16. package/dist/controllers/StandardController.mjs +1 -1
  17. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  18. package/dist/crypto/BrowserCrypto.mjs +1 -1
  19. package/dist/crypto/CryptoOps.mjs +1 -1
  20. package/dist/crypto/PkceGenerator.mjs +1 -1
  21. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  22. package/dist/encode/Base64Decode.mjs +1 -1
  23. package/dist/encode/Base64Encode.mjs +1 -1
  24. package/dist/error/BrowserAuthError.mjs +1 -1
  25. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  26. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  27. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  28. package/dist/error/NativeAuthError.mjs +1 -1
  29. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  30. package/dist/error/NestedAppAuthError.mjs +1 -1
  31. package/dist/event/EventHandler.mjs +1 -1
  32. package/dist/event/EventMessage.mjs +1 -1
  33. package/dist/event/EventType.mjs +1 -1
  34. package/dist/index.mjs +1 -1
  35. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  36. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  37. package/dist/interaction_client/NativeInteractionClient.d.ts +9 -1
  38. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  39. package/dist/interaction_client/NativeInteractionClient.mjs +83 -43
  40. package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
  41. package/dist/interaction_client/PopupClient.mjs +1 -1
  42. package/dist/interaction_client/RedirectClient.mjs +1 -1
  43. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  44. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  45. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  46. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  47. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  48. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  49. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  50. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  51. package/dist/naa/BridgeError.mjs +1 -1
  52. package/dist/naa/BridgeProxy.mjs +1 -1
  53. package/dist/naa/BridgeStatusCode.mjs +1 -1
  54. package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  55. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +3 -3
  56. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  57. package/dist/navigation/NavigationClient.mjs +1 -1
  58. package/dist/network/FetchClient.mjs +1 -1
  59. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  60. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  61. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  62. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  63. package/dist/packageMetadata.d.ts +1 -1
  64. package/dist/packageMetadata.mjs +2 -2
  65. package/dist/request/RequestHelpers.mjs +1 -1
  66. package/dist/response/ResponseHandler.mjs +1 -1
  67. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  68. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  69. package/dist/utils/BrowserConstants.mjs +1 -1
  70. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  71. package/dist/utils/BrowserUtils.mjs +1 -1
  72. package/lib/msal-browser.cjs +247 -138
  73. package/lib/msal-browser.cjs.map +1 -1
  74. package/lib/msal-browser.js +247 -138
  75. package/lib/msal-browser.js.map +1 -1
  76. package/lib/msal-browser.min.js +64 -64
  77. package/package.json +2 -2
  78. package/src/interaction_client/NativeInteractionClient.ts +105 -54
  79. package/src/naa/mapping/NestedAppAuthAdapter.ts +4 -2
  80. package/src/packageMetadata.ts +1 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v3.19.0 2024-07-12 */
1
+ /*! @azure/msal-browser v3.20.0 2024-07-23 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -311,7 +311,7 @@ const JsonWebTokenTypes = {
311
311
  // Token renewal offset default in seconds
312
312
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
313
313
 
314
- /*! @azure/msal-common v14.13.0 2024-07-12 */
314
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
315
315
  /*
316
316
  * Copyright (c) Microsoft Corporation. All rights reserved.
317
317
  * Licensed under the MIT License.
@@ -328,7 +328,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
328
328
  unexpectedError: unexpectedError
329
329
  });
330
330
 
331
- /*! @azure/msal-common v14.13.0 2024-07-12 */
331
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
332
332
 
333
333
  /*
334
334
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -377,7 +377,7 @@ function createAuthError(code, additionalMessage) {
377
377
  : AuthErrorMessages[code]);
378
378
  }
379
379
 
380
- /*! @azure/msal-common v14.13.0 2024-07-12 */
380
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
381
381
  /*
382
382
  * Copyright (c) Microsoft Corporation. All rights reserved.
383
383
  * Licensed under the MIT License.
@@ -475,7 +475,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
475
475
  userTimeoutReached: userTimeoutReached
476
476
  });
477
477
 
478
- /*! @azure/msal-common v14.13.0 2024-07-12 */
478
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
479
479
 
480
480
  /*
481
481
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -727,7 +727,7 @@ function createClientAuthError(errorCode, additionalMessage) {
727
727
  return new ClientAuthError(errorCode, additionalMessage);
728
728
  }
729
729
 
730
- /*! @azure/msal-common v14.13.0 2024-07-12 */
730
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
731
731
 
732
732
  /*
733
733
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -788,7 +788,7 @@ function checkMaxAge(authTime, maxAge) {
788
788
  }
789
789
  }
790
790
 
791
- /*! @azure/msal-common v14.13.0 2024-07-12 */
791
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
792
792
  /*
793
793
  * Copyright (c) Microsoft Corporation. All rights reserved.
794
794
  * Licensed under the MIT License.
@@ -803,7 +803,7 @@ const AuthorityType = {
803
803
  Ciam: 3,
804
804
  };
805
805
 
806
- /*! @azure/msal-common v14.13.0 2024-07-12 */
806
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
807
807
  /*
808
808
  * Copyright (c) Microsoft Corporation. All rights reserved.
809
809
  * Licensed under the MIT License.
@@ -815,7 +815,7 @@ function isOpenIdConfigResponse(response) {
815
815
  response.hasOwnProperty("jwks_uri"));
816
816
  }
817
817
 
818
- /*! @azure/msal-common v14.13.0 2024-07-12 */
818
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
819
819
  /*
820
820
  * Copyright (c) Microsoft Corporation. All rights reserved.
821
821
  * Licensed under the MIT License.
@@ -869,7 +869,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
869
869
  urlParseError: urlParseError
870
870
  });
871
871
 
872
- /*! @azure/msal-common v14.13.0 2024-07-12 */
872
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
873
873
 
874
874
  /*
875
875
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1007,7 +1007,7 @@ function createClientConfigurationError(errorCode) {
1007
1007
  return new ClientConfigurationError(errorCode);
1008
1008
  }
1009
1009
 
1010
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1010
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1011
1011
  /*
1012
1012
  * Copyright (c) Microsoft Corporation. All rights reserved.
1013
1013
  * Licensed under the MIT License.
@@ -1104,7 +1104,7 @@ class StringUtils {
1104
1104
  }
1105
1105
  }
1106
1106
 
1107
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1107
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1108
1108
 
1109
1109
  /*
1110
1110
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1151,7 +1151,7 @@ function getDeserializedResponse(responseString) {
1151
1151
  return null;
1152
1152
  }
1153
1153
 
1154
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1154
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1155
1155
 
1156
1156
  /*
1157
1157
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1315,7 +1315,7 @@ class UrlString {
1315
1315
  }
1316
1316
  }
1317
1317
 
1318
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1318
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1319
1319
 
1320
1320
  /*
1321
1321
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1455,7 +1455,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1455
1455
  return null;
1456
1456
  }
1457
1457
 
1458
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1458
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1459
1459
  /*
1460
1460
  * Copyright (c) Microsoft Corporation. All rights reserved.
1461
1461
  * Licensed under the MIT License.
@@ -1468,7 +1468,7 @@ const ProtocolMode = {
1468
1468
  OIDC: "OIDC",
1469
1469
  };
1470
1470
 
1471
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1471
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1472
1472
  /*
1473
1473
  * Copyright (c) Microsoft Corporation. All rights reserved.
1474
1474
  * Licensed under the MIT License.
@@ -1488,7 +1488,7 @@ const AzureCloudInstance = {
1488
1488
  AzureUsGovernment: "https://login.microsoftonline.us",
1489
1489
  };
1490
1490
 
1491
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1491
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1492
1492
  /*
1493
1493
  * Copyright (c) Microsoft Corporation. All rights reserved.
1494
1494
  * Licensed under the MIT License.
@@ -1498,7 +1498,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1498
1498
  response.hasOwnProperty("metadata"));
1499
1499
  }
1500
1500
 
1501
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1501
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1502
1502
  /*
1503
1503
  * Copyright (c) Microsoft Corporation. All rights reserved.
1504
1504
  * Licensed under the MIT License.
@@ -1508,7 +1508,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1508
1508
  response.hasOwnProperty("error_description"));
1509
1509
  }
1510
1510
 
1511
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1511
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1512
1512
  /*
1513
1513
  * Copyright (c) Microsoft Corporation. All rights reserved.
1514
1514
  * Licensed under the MIT License.
@@ -1990,7 +1990,7 @@ const IntFields = new Set([
1990
1990
  "multiMatchedRT",
1991
1991
  ]);
1992
1992
 
1993
- /*! @azure/msal-common v14.13.0 2024-07-12 */
1993
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
1994
1994
  /*
1995
1995
  * Copyright (c) Microsoft Corporation. All rights reserved.
1996
1996
  * Licensed under the MIT License.
@@ -2086,7 +2086,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
2086
2086
  };
2087
2087
  };
2088
2088
 
2089
- /*! @azure/msal-common v14.13.0 2024-07-12 */
2089
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
2090
2090
 
2091
2091
  /*
2092
2092
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2195,7 +2195,7 @@ RegionDiscovery.IMDS_OPTIONS = {
2195
2195
  },
2196
2196
  };
2197
2197
 
2198
- /*! @azure/msal-common v14.13.0 2024-07-12 */
2198
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
2199
2199
  /*
2200
2200
  * Copyright (c) Microsoft Corporation. All rights reserved.
2201
2201
  * Licensed under the MIT License.
@@ -2232,7 +2232,7 @@ function wasClockTurnedBack(cachedAt) {
2232
2232
  return cachedAtSec > nowSeconds();
2233
2233
  }
2234
2234
 
2235
- /*! @azure/msal-common v14.13.0 2024-07-12 */
2235
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
2236
2236
 
2237
2237
  /*
2238
2238
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2559,7 +2559,7 @@ function isAuthorityMetadataExpired(metadata) {
2559
2559
  return metadata.expiresAt <= nowSeconds();
2560
2560
  }
2561
2561
 
2562
- /*! @azure/msal-common v14.13.0 2024-07-12 */
2562
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
2563
2563
 
2564
2564
  /*
2565
2565
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3398,7 +3398,7 @@ function buildStaticAuthorityOptions(authOptions) {
3398
3398
  };
3399
3399
  }
3400
3400
 
3401
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3401
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3402
3402
 
3403
3403
  /*
3404
3404
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3429,7 +3429,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3429
3429
  }
3430
3430
  }
3431
3431
 
3432
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3432
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3433
3433
  /*
3434
3434
  * Copyright (c) Microsoft Corporation. All rights reserved.
3435
3435
  * Licensed under the MIT License.
@@ -3447,7 +3447,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
3447
3447
  }
3448
3448
  }
3449
3449
 
3450
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3450
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3451
3451
  /*
3452
3452
  * Copyright (c) Microsoft Corporation. All rights reserved.
3453
3453
  * Licensed under the MIT License.
@@ -3493,8 +3493,9 @@ const LOGOUT_HINT = "logout_hint";
3493
3493
  const SID = "sid";
3494
3494
  const LOGIN_HINT = "login_hint";
3495
3495
  const DOMAIN_HINT = "domain_hint";
3496
+ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
3496
3497
 
3497
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3498
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3498
3499
 
3499
3500
  /*
3500
3501
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3533,7 +3534,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
3533
3534
  },
3534
3535
  };
3535
3536
 
3536
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3537
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3537
3538
 
3538
3539
  /*
3539
3540
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3724,12 +3725,12 @@ class Logger {
3724
3725
  }
3725
3726
  }
3726
3727
 
3727
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3728
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3728
3729
  /* eslint-disable header/header */
3729
3730
  const name$1 = "@azure/msal-common";
3730
- const version$1 = "14.13.0";
3731
+ const version$1 = "14.14.0";
3731
3732
 
3732
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3733
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3733
3734
 
3734
3735
  /*
3735
3736
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3929,7 +3930,7 @@ class ScopeSet {
3929
3930
  }
3930
3931
  }
3931
3932
 
3932
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3933
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3933
3934
 
3934
3935
  /*
3935
3936
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3969,7 +3970,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
3969
3970
  };
3970
3971
  }
3971
3972
 
3972
- /*! @azure/msal-common v14.13.0 2024-07-12 */
3973
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
3973
3974
  /*
3974
3975
  * Copyright (c) Microsoft Corporation. All rights reserved.
3975
3976
  * Licensed under the MIT License.
@@ -3985,21 +3986,38 @@ function tenantIdMatchesHomeTenant(tenantId, homeAccountId) {
3985
3986
  !!homeAccountId &&
3986
3987
  tenantId === homeAccountId.split(".")[1]);
3987
3988
  }
3988
- function buildTenantProfileFromIdTokenClaims(homeAccountId, idTokenClaims) {
3989
- const { oid, sub, tid, name, tfp, acr } = idTokenClaims;
3990
- /**
3991
- * Since there is no way to determine if the authority is AAD or B2C, we exhaust all the possible claims that can serve as tenant ID with the following precedence:
3992
- * tid - TenantID claim that identifies the tenant that issued the token in AAD. Expected in all AAD ID tokens, not present in B2C ID Tokens.
3993
- * tfp - Trust Framework Policy claim that identifies the policy that was used to authenticate the user. Functions as tenant for B2C scenarios.
3994
- * acr - Authentication Context Class Reference claim used only with older B2C policies. Fallback in case tfp is not present, but likely won't be present anyway.
3995
- */
3996
- const tenantId = tid || tfp || acr || "";
3997
- return {
3998
- tenantId: tenantId,
3999
- localAccountId: oid || sub || "",
4000
- name: name,
4001
- isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),
4002
- };
3989
+ /**
3990
+ * Build tenant profile
3991
+ * @param homeAccountId - Home account identifier for this account object
3992
+ * @param localAccountId - Local account identifer for this account object
3993
+ * @param tenantId - Full tenant or organizational id that this account belongs to
3994
+ * @param idTokenClaims - Claims from the ID token
3995
+ * @returns
3996
+ */
3997
+ function buildTenantProfile(homeAccountId, localAccountId, tenantId, idTokenClaims) {
3998
+ if (idTokenClaims) {
3999
+ const { oid, sub, tid, name, tfp, acr } = idTokenClaims;
4000
+ /**
4001
+ * Since there is no way to determine if the authority is AAD or B2C, we exhaust all the possible claims that can serve as tenant ID with the following precedence:
4002
+ * tid - TenantID claim that identifies the tenant that issued the token in AAD. Expected in all AAD ID tokens, not present in B2C ID Tokens.
4003
+ * tfp - Trust Framework Policy claim that identifies the policy that was used to authenticate the user. Functions as tenant for B2C scenarios.
4004
+ * acr - Authentication Context Class Reference claim used only with older B2C policies. Fallback in case tfp is not present, but likely won't be present anyway.
4005
+ */
4006
+ const tenantId = tid || tfp || acr || "";
4007
+ return {
4008
+ tenantId: tenantId,
4009
+ localAccountId: oid || sub || "",
4010
+ name: name,
4011
+ isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),
4012
+ };
4013
+ }
4014
+ else {
4015
+ return {
4016
+ tenantId,
4017
+ localAccountId,
4018
+ isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),
4019
+ };
4020
+ }
4003
4021
  }
4004
4022
  /**
4005
4023
  * Replaces account info that varies by tenant profile sourced from the ID token claims passed in with the tenant-specific account info
@@ -4019,7 +4037,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
4019
4037
  if (idTokenClaims) {
4020
4038
  // Ignore isHomeTenant, loginHint, and sid which are part of tenant profile but not base account info
4021
4039
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4022
- const { isHomeTenant, ...claimsSourcedTenantProfile } = buildTenantProfileFromIdTokenClaims(baseAccountInfo.homeAccountId, idTokenClaims);
4040
+ const { isHomeTenant, ...claimsSourcedTenantProfile } = buildTenantProfile(baseAccountInfo.homeAccountId, baseAccountInfo.localAccountId, baseAccountInfo.tenantId, idTokenClaims);
4023
4041
  updatedAccountInfo = {
4024
4042
  ...updatedAccountInfo,
4025
4043
  ...claimsSourcedTenantProfile,
@@ -4031,7 +4049,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
4031
4049
  return updatedAccountInfo;
4032
4050
  }
4033
4051
 
4034
- /*! @azure/msal-common v14.13.0 2024-07-12 */
4052
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
4035
4053
  /*
4036
4054
  * Copyright (c) Microsoft Corporation. All rights reserved.
4037
4055
  * Licensed under the MIT License.
@@ -4053,7 +4071,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
4053
4071
  return null;
4054
4072
  }
4055
4073
 
4056
- /*! @azure/msal-common v14.13.0 2024-07-12 */
4074
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
4057
4075
 
4058
4076
  /*
4059
4077
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4197,12 +4215,8 @@ class AccountEntity {
4197
4215
  account.tenantProfiles = accountDetails.tenantProfiles;
4198
4216
  }
4199
4217
  else {
4200
- const tenantProfiles = [];
4201
- if (accountDetails.idTokenClaims) {
4202
- const tenantProfile = buildTenantProfileFromIdTokenClaims(accountDetails.homeAccountId, accountDetails.idTokenClaims);
4203
- tenantProfiles.push(tenantProfile);
4204
- }
4205
- account.tenantProfiles = tenantProfiles;
4218
+ const tenantProfile = buildTenantProfile(accountDetails.homeAccountId, account.localAccountId, account.realm, accountDetails.idTokenClaims);
4219
+ account.tenantProfiles = [tenantProfile];
4206
4220
  }
4207
4221
  return account;
4208
4222
  }
@@ -4300,7 +4314,7 @@ class AccountEntity {
4300
4314
  }
4301
4315
  }
4302
4316
 
4303
- /*! @azure/msal-common v14.13.0 2024-07-12 */
4317
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
4304
4318
  /*
4305
4319
  * Copyright (c) Microsoft Corporation. All rights reserved.
4306
4320
  * Licensed under the MIT License.
@@ -4308,7 +4322,7 @@ class AccountEntity {
4308
4322
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
4309
4323
  const cacheUnknownErrorCode = "cache_error_unknown";
4310
4324
 
4311
- /*! @azure/msal-common v14.13.0 2024-07-12 */
4325
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
4312
4326
 
4313
4327
  /*
4314
4328
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4335,7 +4349,7 @@ class CacheError extends Error {
4335
4349
  }
4336
4350
  }
4337
4351
 
4338
- /*! @azure/msal-common v14.13.0 2024-07-12 */
4352
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
4339
4353
 
4340
4354
  /*
4341
4355
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4403,12 +4417,9 @@ class CacheManager {
4403
4417
  */
4404
4418
  buildTenantProfiles(cachedAccounts, accountFilter) {
4405
4419
  return cachedAccounts.flatMap((accountEntity) => {
4406
- return this.getAccountInfoForTenantProfiles(accountEntity, accountFilter);
4420
+ return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
4407
4421
  });
4408
4422
  }
4409
- getAccountInfoForTenantProfiles(accountEntity, accountFilter) {
4410
- return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
4411
- }
4412
4423
  getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter) {
4413
4424
  let tenantedAccountInfo = null;
4414
4425
  let idTokenClaims;
@@ -5590,7 +5601,7 @@ class DefaultStorageClass extends CacheManager {
5590
5601
  }
5591
5602
  }
5592
5603
 
5593
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5604
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5594
5605
 
5595
5606
  /*
5596
5607
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5688,7 +5699,7 @@ function isOidcProtocolMode(config) {
5688
5699
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5689
5700
  }
5690
5701
 
5691
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5702
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5692
5703
 
5693
5704
  /*
5694
5705
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5707,7 +5718,7 @@ class ServerError extends AuthError {
5707
5718
  }
5708
5719
  }
5709
5720
 
5710
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5721
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5711
5722
 
5712
5723
  /*
5713
5724
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5805,7 +5816,7 @@ class ThrottlingUtils {
5805
5816
  }
5806
5817
  }
5807
5818
 
5808
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5819
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5809
5820
 
5810
5821
  /*
5811
5822
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5842,7 +5853,7 @@ class NetworkManager {
5842
5853
  }
5843
5854
  }
5844
5855
 
5845
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5856
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5846
5857
  /*
5847
5858
  * Copyright (c) Microsoft Corporation. All rights reserved.
5848
5859
  * Licensed under the MIT License.
@@ -5852,7 +5863,7 @@ const CcsCredentialType = {
5852
5863
  UPN: "UPN",
5853
5864
  };
5854
5865
 
5855
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5866
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5856
5867
 
5857
5868
  /*
5858
5869
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5919,7 +5930,7 @@ class RequestValidator {
5919
5930
  }
5920
5931
  }
5921
5932
 
5922
- /*! @azure/msal-common v14.13.0 2024-07-12 */
5933
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
5923
5934
 
5924
5935
  /*
5925
5936
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6304,7 +6315,7 @@ class RequestParameterBuilder {
6304
6315
  }
6305
6316
  }
6306
6317
 
6307
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6318
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6308
6319
 
6309
6320
  /*
6310
6321
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6407,7 +6418,7 @@ class BaseClient {
6407
6418
  }
6408
6419
  }
6409
6420
 
6410
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6421
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6411
6422
  /*
6412
6423
  * Copyright (c) Microsoft Corporation. All rights reserved.
6413
6424
  * Licensed under the MIT License.
@@ -6433,7 +6444,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6433
6444
  refreshTokenExpired: refreshTokenExpired
6434
6445
  });
6435
6446
 
6436
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6447
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6437
6448
 
6438
6449
  /*
6439
6450
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6521,7 +6532,7 @@ function createInteractionRequiredAuthError(errorCode) {
6521
6532
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6522
6533
  }
6523
6534
 
6524
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6535
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6525
6536
 
6526
6537
  /*
6527
6538
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6593,7 +6604,7 @@ class ProtocolUtils {
6593
6604
  }
6594
6605
  }
6595
6606
 
6596
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6607
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6597
6608
 
6598
6609
  /*
6599
6610
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6677,7 +6688,7 @@ class PopTokenGenerator {
6677
6688
  }
6678
6689
  }
6679
6690
 
6680
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6691
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6681
6692
  /*
6682
6693
  * Copyright (c) Microsoft Corporation. All rights reserved.
6683
6694
  * Licensed under the MIT License.
@@ -6704,7 +6715,7 @@ class PopTokenGenerator {
6704
6715
  }
6705
6716
  }
6706
6717
 
6707
- /*! @azure/msal-common v14.13.0 2024-07-12 */
6718
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
6708
6719
 
6709
6720
  /*
6710
6721
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7069,19 +7080,19 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
7069
7080
  nativeAccountId: nativeAccountId,
7070
7081
  }, authority, base64Decode);
7071
7082
  const tenantProfiles = baseAccount.tenantProfiles || [];
7072
- if (claimsTenantId &&
7073
- idTokenClaims &&
7083
+ const tenantId = claimsTenantId || baseAccount.realm;
7084
+ if (tenantId &&
7074
7085
  !tenantProfiles.find((tenantProfile) => {
7075
- return tenantProfile.tenantId === claimsTenantId;
7086
+ return tenantProfile.tenantId === tenantId;
7076
7087
  })) {
7077
- const newTenantProfile = buildTenantProfileFromIdTokenClaims(homeAccountId, idTokenClaims);
7088
+ const newTenantProfile = buildTenantProfile(homeAccountId, baseAccount.localAccountId, tenantId, idTokenClaims);
7078
7089
  tenantProfiles.push(newTenantProfile);
7079
7090
  }
7080
7091
  baseAccount.tenantProfiles = tenantProfiles;
7081
7092
  return baseAccount;
7082
7093
  }
7083
7094
 
7084
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7095
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7085
7096
 
7086
7097
  /*
7087
7098
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7504,7 +7515,7 @@ class AuthorizationCodeClient extends BaseClient {
7504
7515
  }
7505
7516
  }
7506
7517
 
7507
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7518
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7508
7519
 
7509
7520
  /*
7510
7521
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7718,7 +7729,7 @@ class RefreshTokenClient extends BaseClient {
7718
7729
  }
7719
7730
  }
7720
7731
 
7721
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7732
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7722
7733
 
7723
7734
  /*
7724
7735
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7854,7 +7865,7 @@ class SilentFlowClient extends BaseClient {
7854
7865
  }
7855
7866
  }
7856
7867
 
7857
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7868
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7858
7869
 
7859
7870
  /*
7860
7871
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7869,7 +7880,7 @@ const StubbedNetworkModule = {
7869
7880
  },
7870
7881
  };
7871
7882
 
7872
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7883
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7873
7884
  /*
7874
7885
  * Copyright (c) Microsoft Corporation. All rights reserved.
7875
7886
  * Licensed under the MIT License.
@@ -7877,7 +7888,7 @@ const StubbedNetworkModule = {
7877
7888
  const missingKidError = "missing_kid_error";
7878
7889
  const missingAlgError = "missing_alg_error";
7879
7890
 
7880
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7891
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7881
7892
 
7882
7893
  /*
7883
7894
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7902,7 +7913,7 @@ function createJoseHeaderError(code) {
7902
7913
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
7903
7914
  }
7904
7915
 
7905
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7916
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7906
7917
 
7907
7918
  /*
7908
7919
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7942,7 +7953,7 @@ class JoseHeader {
7942
7953
  }
7943
7954
  }
7944
7955
 
7945
- /*! @azure/msal-common v14.13.0 2024-07-12 */
7956
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
7946
7957
 
7947
7958
  /*
7948
7959
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8000,12 +8011,50 @@ class AuthenticationHeaderParser {
8000
8011
  }
8001
8012
  }
8002
8013
 
8003
- /*! @azure/msal-common v14.13.0 2024-07-12 */
8014
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
8004
8015
 
8005
8016
  /*
8006
8017
  * Copyright (c) Microsoft Corporation. All rights reserved.
8007
8018
  * Licensed under the MIT License.
8008
8019
  */
8020
+ const skuGroupSeparator = ",";
8021
+ const skuValueSeparator = "|";
8022
+ function makeExtraSkuString(params) {
8023
+ const { skus, libraryName, libraryVersion, extensionName, extensionVersion, } = params;
8024
+ const skuMap = new Map([
8025
+ [0, [libraryName, libraryVersion]],
8026
+ [2, [extensionName, extensionVersion]],
8027
+ ]);
8028
+ let skuArr = [];
8029
+ if (skus?.length) {
8030
+ skuArr = skus.split(skuGroupSeparator);
8031
+ // Ignore invalid input sku param
8032
+ if (skuArr.length < 4) {
8033
+ return skus;
8034
+ }
8035
+ }
8036
+ else {
8037
+ skuArr = Array.from({ length: 4 }, () => skuValueSeparator);
8038
+ }
8039
+ skuMap.forEach((value, key) => {
8040
+ if (value.length === 2 && value[0]?.length && value[1]?.length) {
8041
+ setSku({
8042
+ skuArr,
8043
+ index: key,
8044
+ skuName: value[0],
8045
+ skuVersion: value[1],
8046
+ });
8047
+ }
8048
+ });
8049
+ return skuArr.join(skuGroupSeparator);
8050
+ }
8051
+ function setSku(params) {
8052
+ const { skuArr, index, skuName, skuVersion } = params;
8053
+ if (index >= skuArr.length) {
8054
+ return;
8055
+ }
8056
+ skuArr[index] = [skuName, skuVersion].join(skuValueSeparator);
8057
+ }
8009
8058
  /** @internal */
8010
8059
  class ServerTelemetryManager {
8011
8060
  constructor(telemetryRequest, cacheManager) {
@@ -8025,7 +8074,12 @@ class ServerTelemetryManager {
8025
8074
  */
8026
8075
  generateCurrentRequestHeaderValue() {
8027
8076
  const request = `${this.apiId}${SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR}${this.cacheOutcome}`;
8028
- const platformFields = [this.wrapperSKU, this.wrapperVer].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8077
+ const platformFieldsArr = [this.wrapperSKU, this.wrapperVer];
8078
+ const nativeBrokerErrorCode = this.getNativeBrokerErrorCode();
8079
+ if (nativeBrokerErrorCode?.length) {
8080
+ platformFieldsArr.push(`broker_error=${nativeBrokerErrorCode}`);
8081
+ }
8082
+ const platformFields = platformFieldsArr.join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8029
8083
  const regionDiscoveryFields = this.getRegionDiscoveryFields();
8030
8084
  const requestWithRegionDiscoveryFields = [
8031
8085
  request,
@@ -8202,9 +8256,25 @@ class ServerTelemetryManager {
8202
8256
  setCacheOutcome(cacheOutcome) {
8203
8257
  this.cacheOutcome = cacheOutcome;
8204
8258
  }
8259
+ setNativeBrokerErrorCode(errorCode) {
8260
+ const lastRequests = this.getLastRequests();
8261
+ lastRequests.nativeBrokerErrorCode = errorCode;
8262
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
8263
+ }
8264
+ getNativeBrokerErrorCode() {
8265
+ return this.getLastRequests().nativeBrokerErrorCode;
8266
+ }
8267
+ clearNativeBrokerErrorCode() {
8268
+ const lastRequests = this.getLastRequests();
8269
+ delete lastRequests.nativeBrokerErrorCode;
8270
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
8271
+ }
8272
+ static makeExtraSkuString(params) {
8273
+ return makeExtraSkuString(params);
8274
+ }
8205
8275
  }
8206
8276
 
8207
- /*! @azure/msal-common v14.13.0 2024-07-12 */
8277
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
8208
8278
 
8209
8279
  /*
8210
8280
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8283,7 +8353,7 @@ class StubPerformanceClient {
8283
8353
  }
8284
8354
  }
8285
8355
 
8286
- /*! @azure/msal-common v14.13.0 2024-07-12 */
8356
+ /*! @azure/msal-common v14.14.0 2024-07-23 */
8287
8357
 
8288
8358
  /*
8289
8359
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10154,7 +10224,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10154
10224
 
10155
10225
  /* eslint-disable header/header */
10156
10226
  const name = "@azure/msal-browser";
10157
- const version = "3.19.0";
10227
+ const version = "3.20.0";
10158
10228
 
10159
10229
  /*
10160
10230
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -13302,6 +13372,30 @@ class NativeInteractionClient extends BaseInteractionClient {
13302
13372
  this.nativeMessageHandler = provider;
13303
13373
  this.nativeStorageManager = nativeStorageImpl;
13304
13374
  this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
13375
+ this.serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
13376
+ const extensionName = this.nativeMessageHandler.getExtensionId() ===
13377
+ NativeConstants.PREFERRED_EXTENSION_ID
13378
+ ? "chrome"
13379
+ : this.nativeMessageHandler.getExtensionId()?.length
13380
+ ? "unknown"
13381
+ : undefined;
13382
+ this.skus = ServerTelemetryManager.makeExtraSkuString({
13383
+ libraryName: BrowserConstants.MSAL_SKU,
13384
+ libraryVersion: version,
13385
+ extensionName: extensionName,
13386
+ extensionVersion: this.nativeMessageHandler.getExtensionVersion(),
13387
+ });
13388
+ }
13389
+ /**
13390
+ * Adds SKUs to request extra query parameters
13391
+ * @param request {NativeTokenRequest}
13392
+ * @private
13393
+ */
13394
+ addRequestSKUs(request) {
13395
+ request.extraParameters = {
13396
+ ...request.extraParameters,
13397
+ [X_CLIENT_EXTRA_SKU]: this.skus,
13398
+ };
13305
13399
  }
13306
13400
  /**
13307
13401
  * Acquire token from native platform via browser extension
@@ -13313,48 +13407,57 @@ class NativeInteractionClient extends BaseInteractionClient {
13313
13407
  // start the perf measurement
13314
13408
  const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
13315
13409
  const reqTimestamp = nowSeconds();
13316
- // initialize native request
13317
- const nativeRequest = await this.initializeNativeRequest(request);
13318
- // check if the tokens can be retrieved from internal cache
13319
13410
  try {
13320
- const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
13321
- nativeATMeasurement.end({
13322
- success: true,
13323
- isNativeBroker: false,
13324
- fromCache: true,
13411
+ // initialize native request
13412
+ const nativeRequest = await this.initializeNativeRequest(request);
13413
+ // check if the tokens can be retrieved from internal cache
13414
+ try {
13415
+ const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
13416
+ nativeATMeasurement.end({
13417
+ success: true,
13418
+ isNativeBroker: false,
13419
+ fromCache: true,
13420
+ });
13421
+ return result;
13422
+ }
13423
+ catch (e) {
13424
+ // continue with a native call for any and all errors
13425
+ this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
13426
+ }
13427
+ const { ...nativeTokenRequest } = nativeRequest;
13428
+ // fall back to native calls
13429
+ const messageBody = {
13430
+ method: NativeExtensionMethod.GetToken,
13431
+ request: nativeTokenRequest,
13432
+ };
13433
+ const response = await this.nativeMessageHandler.sendMessage(messageBody);
13434
+ const validatedResponse = this.validateNativeResponse(response);
13435
+ return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
13436
+ .then((result) => {
13437
+ nativeATMeasurement.end({
13438
+ success: true,
13439
+ isNativeBroker: true,
13440
+ requestId: result.requestId,
13441
+ });
13442
+ this.serverTelemetryManager.clearNativeBrokerErrorCode();
13443
+ return result;
13444
+ })
13445
+ .catch((error) => {
13446
+ nativeATMeasurement.end({
13447
+ success: false,
13448
+ errorCode: error.errorCode,
13449
+ subErrorCode: error.subError,
13450
+ isNativeBroker: true,
13451
+ });
13452
+ throw error;
13325
13453
  });
13326
- return result;
13327
13454
  }
13328
13455
  catch (e) {
13329
- // continue with a native call for any and all errors
13330
- this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
13456
+ if (e instanceof NativeAuthError) {
13457
+ this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
13458
+ }
13459
+ throw e;
13331
13460
  }
13332
- const { ...nativeTokenRequest } = nativeRequest;
13333
- // fall back to native calls
13334
- const messageBody = {
13335
- method: NativeExtensionMethod.GetToken,
13336
- request: nativeTokenRequest,
13337
- };
13338
- const response = await this.nativeMessageHandler.sendMessage(messageBody);
13339
- const validatedResponse = this.validateNativeResponse(response);
13340
- return this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
13341
- .then((result) => {
13342
- nativeATMeasurement.end({
13343
- success: true,
13344
- isNativeBroker: true,
13345
- requestId: result.requestId,
13346
- });
13347
- return result;
13348
- })
13349
- .catch((error) => {
13350
- nativeATMeasurement.end({
13351
- success: false,
13352
- errorCode: error.errorCode,
13353
- subErrorCode: error.subError,
13354
- isNativeBroker: true,
13355
- });
13356
- throw error;
13357
- });
13358
13461
  }
13359
13462
  /**
13360
13463
  * Creates silent flow request
@@ -13427,8 +13530,11 @@ class NativeInteractionClient extends BaseInteractionClient {
13427
13530
  }
13428
13531
  catch (e) {
13429
13532
  // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
13430
- if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
13431
- throw e;
13533
+ if (e instanceof NativeAuthError) {
13534
+ this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
13535
+ if (isFatalNativeAuthError(e)) {
13536
+ throw e;
13537
+ }
13432
13538
  }
13433
13539
  }
13434
13540
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
@@ -13479,7 +13585,9 @@ class NativeInteractionClient extends BaseInteractionClient {
13479
13585
  this.validateNativeResponse(response);
13480
13586
  const result = this.handleNativeResponse(response, request, reqTimestamp);
13481
13587
  this.browserStorage.setInteractionInProgress(false);
13482
- return await result;
13588
+ const res = await result;
13589
+ this.serverTelemetryManager.clearNativeBrokerErrorCode();
13590
+ return res;
13483
13591
  }
13484
13592
  catch (e) {
13485
13593
  this.browserStorage.setInteractionInProgress(false);
@@ -13843,6 +13951,7 @@ class NativeInteractionClient extends BaseInteractionClient {
13843
13951
  // SPAs require whole string to be passed to broker
13844
13952
  validatedRequest.reqCnf = reqCnfData;
13845
13953
  }
13954
+ this.addRequestSKUs(validatedRequest);
13846
13955
  return validatedRequest;
13847
13956
  }
13848
13957
  /**
@@ -17110,7 +17219,7 @@ class NestedAppAuthAdapter {
17110
17219
  "";
17111
17220
  const name = fromAccount.name || effectiveIdTokenClaims?.name;
17112
17221
  const tenantProfiles = new Map();
17113
- const tenantProfile = buildTenantProfileFromIdTokenClaims(homeAccountId, effectiveIdTokenClaims);
17222
+ const tenantProfile = buildTenantProfile(homeAccountId, localAccountId, tenantId, effectiveIdTokenClaims);
17114
17223
  tenantProfiles.set(tenantId, tenantProfile);
17115
17224
  const account = {
17116
17225
  homeAccountId,