@azure/msal-browser 4.0.0-alpha.0 → 4.0.1

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 (185) 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.d.ts +1 -1
  5. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  6. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +8 -8
  7. package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
  8. package/dist/broker/nativeBroker/NativeResponse.d.ts +1 -1
  9. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  10. package/dist/cache/AccountManager.mjs +1 -1
  11. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  12. package/dist/cache/BrowserCacheManager.d.ts +9 -9
  13. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  14. package/dist/cache/BrowserCacheManager.mjs +19 -19
  15. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  16. package/dist/cache/CacheHelpers.mjs +1 -1
  17. package/dist/cache/CookieStorage.mjs +1 -1
  18. package/dist/cache/CookieStorage.mjs.map +1 -1
  19. package/dist/cache/DatabaseStorage.mjs +1 -1
  20. package/dist/cache/IWindowStorage.d.ts +2 -2
  21. package/dist/cache/IWindowStorage.d.ts.map +1 -1
  22. package/dist/cache/LocalStorage.d.ts +7 -3
  23. package/dist/cache/LocalStorage.d.ts.map +1 -1
  24. package/dist/cache/LocalStorage.mjs +48 -34
  25. package/dist/cache/LocalStorage.mjs.map +1 -1
  26. package/dist/cache/MemoryStorage.mjs +1 -1
  27. package/dist/cache/SessionStorage.mjs +1 -1
  28. package/dist/cache/TokenCache.d.ts.map +1 -1
  29. package/dist/cache/TokenCache.mjs +15 -14
  30. package/dist/cache/TokenCache.mjs.map +1 -1
  31. package/dist/config/Configuration.d.ts +2 -2
  32. package/dist/config/Configuration.d.ts.map +1 -1
  33. package/dist/config/Configuration.mjs +5 -5
  34. package/dist/config/Configuration.mjs.map +1 -1
  35. package/dist/controllers/ControllerFactory.mjs +1 -1
  36. package/dist/controllers/NestedAppAuthController.d.ts +4 -3
  37. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
  38. package/dist/controllers/NestedAppAuthController.mjs +9 -7
  39. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  40. package/dist/controllers/StandardController.d.ts +2 -2
  41. package/dist/controllers/StandardController.d.ts.map +1 -1
  42. package/dist/controllers/StandardController.mjs +27 -23
  43. package/dist/controllers/StandardController.mjs.map +1 -1
  44. package/dist/controllers/UnknownOperatingContextController.d.ts +2 -2
  45. package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  46. package/dist/controllers/UnknownOperatingContextController.mjs +3 -3
  47. package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
  48. package/dist/crypto/BrowserCrypto.d.ts +1 -1
  49. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  50. package/dist/crypto/BrowserCrypto.mjs +3 -3
  51. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  52. package/dist/crypto/CryptoOps.d.ts +1 -1
  53. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  54. package/dist/crypto/CryptoOps.mjs +3 -3
  55. package/dist/crypto/CryptoOps.mjs.map +1 -1
  56. package/dist/crypto/PkceGenerator.mjs +1 -1
  57. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  58. package/dist/encode/Base64Decode.mjs +1 -1
  59. package/dist/encode/Base64Encode.mjs +1 -1
  60. package/dist/error/BrowserAuthError.mjs +1 -1
  61. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  62. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  63. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  64. package/dist/error/NativeAuthError.mjs +1 -1
  65. package/dist/error/NativeAuthError.mjs.map +1 -1
  66. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  67. package/dist/error/NestedAppAuthError.mjs +1 -1
  68. package/dist/event/EventHandler.mjs +1 -1
  69. package/dist/event/EventMessage.mjs +1 -1
  70. package/dist/event/EventType.mjs +1 -1
  71. package/dist/index.mjs +1 -1
  72. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  73. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  74. package/dist/interaction_client/NativeInteractionClient.d.ts +1 -1
  75. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  76. package/dist/interaction_client/NativeInteractionClient.mjs +4 -4
  77. package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
  78. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  79. package/dist/interaction_client/PopupClient.mjs +4 -4
  80. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  81. package/dist/interaction_client/RedirectClient.mjs +2 -2
  82. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  83. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  84. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  85. package/dist/interaction_client/SilentIframeClient.mjs +2 -2
  86. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  87. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  88. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  89. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  90. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  91. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  92. package/dist/naa/BridgeError.mjs +1 -1
  93. package/dist/naa/BridgeProxy.mjs +1 -1
  94. package/dist/naa/BridgeStatusCode.mjs +1 -1
  95. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  96. package/dist/navigation/NavigationClient.mjs +1 -1
  97. package/dist/network/FetchClient.mjs +1 -1
  98. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  99. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  100. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  101. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  102. package/dist/packageMetadata.d.ts +1 -1
  103. package/dist/packageMetadata.d.ts.map +1 -1
  104. package/dist/packageMetadata.mjs +2 -2
  105. package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
  106. package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
  107. package/dist/request/PopupRequest.d.ts +1 -1
  108. package/dist/request/PopupRequest.d.ts.map +1 -1
  109. package/dist/request/RedirectRequest.d.ts +1 -1
  110. package/dist/request/RedirectRequest.d.ts.map +1 -1
  111. package/dist/request/RequestHelpers.mjs +1 -1
  112. package/dist/request/SsoSilentRequest.d.ts +1 -1
  113. package/dist/request/SsoSilentRequest.d.ts.map +1 -1
  114. package/dist/response/ResponseHandler.mjs +1 -1
  115. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  116. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  117. package/dist/utils/BrowserConstants.mjs +1 -1
  118. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  119. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  120. package/dist/utils/BrowserUtils.mjs +4 -2
  121. package/dist/utils/BrowserUtils.mjs.map +1 -1
  122. package/lib/msal-browser.cjs +238 -197
  123. package/lib/msal-browser.cjs.map +1 -1
  124. package/lib/msal-browser.js +238 -197
  125. package/lib/msal-browser.js.map +1 -1
  126. package/lib/msal-browser.min.js +63 -63
  127. package/lib/types/broker/nativeBroker/NativeMessageHandler.d.ts +1 -1
  128. package/lib/types/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  129. package/lib/types/broker/nativeBroker/NativeResponse.d.ts +1 -1
  130. package/lib/types/cache/BrowserCacheManager.d.ts +9 -9
  131. package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
  132. package/lib/types/cache/IWindowStorage.d.ts +2 -2
  133. package/lib/types/cache/IWindowStorage.d.ts.map +1 -1
  134. package/lib/types/cache/LocalStorage.d.ts +7 -3
  135. package/lib/types/cache/LocalStorage.d.ts.map +1 -1
  136. package/lib/types/cache/TokenCache.d.ts.map +1 -1
  137. package/lib/types/config/Configuration.d.ts +2 -2
  138. package/lib/types/config/Configuration.d.ts.map +1 -1
  139. package/lib/types/controllers/NestedAppAuthController.d.ts +4 -3
  140. package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  141. package/lib/types/controllers/StandardController.d.ts +2 -2
  142. package/lib/types/controllers/StandardController.d.ts.map +1 -1
  143. package/lib/types/controllers/UnknownOperatingContextController.d.ts +2 -2
  144. package/lib/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  145. package/lib/types/crypto/BrowserCrypto.d.ts +1 -1
  146. package/lib/types/crypto/BrowserCrypto.d.ts.map +1 -1
  147. package/lib/types/crypto/CryptoOps.d.ts +1 -1
  148. package/lib/types/crypto/CryptoOps.d.ts.map +1 -1
  149. package/lib/types/interaction_client/NativeInteractionClient.d.ts +1 -1
  150. package/lib/types/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  151. package/lib/types/interaction_client/PopupClient.d.ts.map +1 -1
  152. package/lib/types/packageMetadata.d.ts +1 -1
  153. package/lib/types/packageMetadata.d.ts.map +1 -1
  154. package/lib/types/request/AuthorizationUrlRequest.d.ts +1 -1
  155. package/lib/types/request/AuthorizationUrlRequest.d.ts.map +1 -1
  156. package/lib/types/request/PopupRequest.d.ts +1 -1
  157. package/lib/types/request/PopupRequest.d.ts.map +1 -1
  158. package/lib/types/request/RedirectRequest.d.ts +1 -1
  159. package/lib/types/request/RedirectRequest.d.ts.map +1 -1
  160. package/lib/types/request/SsoSilentRequest.d.ts +1 -1
  161. package/lib/types/request/SsoSilentRequest.d.ts.map +1 -1
  162. package/lib/types/utils/BrowserUtils.d.ts.map +1 -1
  163. package/package.json +2 -2
  164. package/src/broker/nativeBroker/NativeMessageHandler.ts +7 -7
  165. package/src/broker/nativeBroker/NativeResponse.ts +1 -1
  166. package/src/cache/BrowserCacheManager.ts +56 -30
  167. package/src/cache/IWindowStorage.ts +2 -2
  168. package/src/cache/LocalStorage.ts +142 -43
  169. package/src/cache/TokenCache.ts +28 -11
  170. package/src/config/Configuration.ts +6 -6
  171. package/src/controllers/NestedAppAuthController.ts +15 -7
  172. package/src/controllers/StandardController.ts +41 -24
  173. package/src/controllers/UnknownOperatingContextController.ts +6 -5
  174. package/src/crypto/BrowserCrypto.ts +4 -2
  175. package/src/crypto/CryptoOps.ts +8 -2
  176. package/src/interaction_client/NativeInteractionClient.ts +5 -4
  177. package/src/interaction_client/PopupClient.ts +9 -8
  178. package/src/interaction_client/RedirectClient.ts +1 -1
  179. package/src/interaction_client/SilentIframeClient.ts +1 -1
  180. package/src/packageMetadata.ts +1 -1
  181. package/src/request/AuthorizationUrlRequest.ts +1 -1
  182. package/src/request/PopupRequest.ts +1 -1
  183. package/src/request/RedirectRequest.ts +1 -1
  184. package/src/request/SsoSilentRequest.ts +1 -1
  185. package/src/utils/BrowserUtils.ts +3 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v4.0.0-alpha.0 2024-12-18 */
1
+ /*! @azure/msal-browser v4.0.1 2025-01-15 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
5
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -306,7 +306,7 @@ const JsonWebTokenTypes = {
306
306
  // Token renewal offset default in seconds
307
307
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
308
308
 
309
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
309
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
310
310
  /*
311
311
  * Copyright (c) Microsoft Corporation. All rights reserved.
312
312
  * Licensed under the MIT License.
@@ -323,7 +323,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
323
323
  unexpectedError: unexpectedError
324
324
  });
325
325
 
326
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
326
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
327
327
 
328
328
  /*
329
329
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -372,7 +372,7 @@ function createAuthError(code, additionalMessage) {
372
372
  : AuthErrorMessages[code]);
373
373
  }
374
374
 
375
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
375
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
376
376
  /*
377
377
  * Copyright (c) Microsoft Corporation. All rights reserved.
378
378
  * Licensed under the MIT License.
@@ -470,7 +470,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
470
470
  userTimeoutReached: userTimeoutReached
471
471
  });
472
472
 
473
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
473
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
474
474
 
475
475
  /*
476
476
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -722,7 +722,7 @@ function createClientAuthError(errorCode, additionalMessage) {
722
722
  return new ClientAuthError(errorCode, additionalMessage);
723
723
  }
724
724
 
725
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
725
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
726
726
 
727
727
  /*
728
728
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -761,7 +761,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
761
761
  },
762
762
  };
763
763
 
764
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
764
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
765
765
 
766
766
  /*
767
767
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -952,12 +952,12 @@ class Logger {
952
952
  }
953
953
  }
954
954
 
955
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
955
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
956
956
  /* eslint-disable header/header */
957
957
  const name$1 = "@azure/msal-common";
958
- const version$1 = "15.0.0-alpha.0";
958
+ const version$1 = "15.0.1";
959
959
 
960
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
960
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
961
961
  /*
962
962
  * Copyright (c) Microsoft Corporation. All rights reserved.
963
963
  * Licensed under the MIT License.
@@ -977,7 +977,7 @@ const AzureCloudInstance = {
977
977
  AzureUsGovernment: "https://login.microsoftonline.us",
978
978
  };
979
979
 
980
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
980
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
981
981
 
982
982
  /*
983
983
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1038,7 +1038,7 @@ function checkMaxAge(authTime, maxAge) {
1038
1038
  }
1039
1039
  }
1040
1040
 
1041
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1041
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1042
1042
  /*
1043
1043
  * Copyright (c) Microsoft Corporation. All rights reserved.
1044
1044
  * Licensed under the MIT License.
@@ -1075,7 +1075,7 @@ function wasClockTurnedBack(cachedAt) {
1075
1075
  return cachedAtSec > nowSeconds();
1076
1076
  }
1077
1077
 
1078
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1078
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1079
1079
 
1080
1080
  /*
1081
1081
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1402,7 +1402,7 @@ function isAuthorityMetadataExpired(metadata) {
1402
1402
  return metadata.expiresAt <= nowSeconds();
1403
1403
  }
1404
1404
 
1405
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1405
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1406
1406
  /*
1407
1407
  * Copyright (c) Microsoft Corporation. All rights reserved.
1408
1408
  * Licensed under the MIT License.
@@ -1427,14 +1427,14 @@ const missingSshKid = "missing_ssh_kid";
1427
1427
  const missingNonceAuthenticationHeader = "missing_nonce_authentication_header";
1428
1428
  const invalidAuthenticationHeader = "invalid_authentication_header";
1429
1429
  const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
1430
- const cannotAllowNativeBroker = "cannot_allow_native_broker";
1430
+ const cannotAllowPlatformBroker = "cannot_allow_platform_broker";
1431
1431
  const authorityMismatch = "authority_mismatch";
1432
1432
 
1433
1433
  var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1434
1434
  __proto__: null,
1435
1435
  authorityMismatch: authorityMismatch,
1436
1436
  authorityUriInsecure: authorityUriInsecure,
1437
- cannotAllowNativeBroker: cannotAllowNativeBroker,
1437
+ cannotAllowPlatformBroker: cannotAllowPlatformBroker,
1438
1438
  cannotSetOIDCOptions: cannotSetOIDCOptions,
1439
1439
  claimsRequestParsingError: claimsRequestParsingError,
1440
1440
  emptyInputScopesError: emptyInputScopesError,
@@ -1456,7 +1456,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1456
1456
  urlParseError: urlParseError
1457
1457
  });
1458
1458
 
1459
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1459
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1460
1460
 
1461
1461
  /*
1462
1462
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1483,7 +1483,7 @@ const ClientConfigurationErrorMessages = {
1483
1483
  [missingNonceAuthenticationHeader]: "Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",
1484
1484
  [invalidAuthenticationHeader]: "Invalid authentication header provided",
1485
1485
  [cannotSetOIDCOptions]: "Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",
1486
- [cannotAllowNativeBroker]: "Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",
1486
+ [cannotAllowPlatformBroker]: "Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",
1487
1487
  [authorityMismatch]: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",
1488
1488
  };
1489
1489
  /**
@@ -1571,9 +1571,9 @@ const ClientConfigurationErrorMessage = {
1571
1571
  code: cannotSetOIDCOptions,
1572
1572
  desc: ClientConfigurationErrorMessages[cannotSetOIDCOptions],
1573
1573
  },
1574
- cannotAllowNativeBroker: {
1575
- code: cannotAllowNativeBroker,
1576
- desc: ClientConfigurationErrorMessages[cannotAllowNativeBroker],
1574
+ cannotAllowPlatformBroker: {
1575
+ code: cannotAllowPlatformBroker,
1576
+ desc: ClientConfigurationErrorMessages[cannotAllowPlatformBroker],
1577
1577
  },
1578
1578
  authorityMismatch: {
1579
1579
  code: authorityMismatch,
@@ -1594,7 +1594,7 @@ function createClientConfigurationError(errorCode) {
1594
1594
  return new ClientConfigurationError(errorCode);
1595
1595
  }
1596
1596
 
1597
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1597
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1598
1598
  /*
1599
1599
  * Copyright (c) Microsoft Corporation. All rights reserved.
1600
1600
  * Licensed under the MIT License.
@@ -1691,7 +1691,7 @@ class StringUtils {
1691
1691
  }
1692
1692
  }
1693
1693
 
1694
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1694
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1695
1695
 
1696
1696
  /*
1697
1697
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1891,7 +1891,7 @@ class ScopeSet {
1891
1891
  }
1892
1892
  }
1893
1893
 
1894
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1894
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1895
1895
 
1896
1896
  /*
1897
1897
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1931,7 +1931,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
1931
1931
  };
1932
1932
  }
1933
1933
 
1934
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
1934
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
1935
1935
  /*
1936
1936
  * Copyright (c) Microsoft Corporation. All rights reserved.
1937
1937
  * Licensed under the MIT License.
@@ -2010,7 +2010,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
2010
2010
  return updatedAccountInfo;
2011
2011
  }
2012
2012
 
2013
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2013
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2014
2014
  /*
2015
2015
  * Copyright (c) Microsoft Corporation. All rights reserved.
2016
2016
  * Licensed under the MIT License.
@@ -2025,7 +2025,7 @@ const AuthorityType = {
2025
2025
  Ciam: 3,
2026
2026
  };
2027
2027
 
2028
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2028
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2029
2029
  /*
2030
2030
  * Copyright (c) Microsoft Corporation. All rights reserved.
2031
2031
  * Licensed under the MIT License.
@@ -2047,7 +2047,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2047
2047
  return null;
2048
2048
  }
2049
2049
 
2050
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2050
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2051
2051
  /*
2052
2052
  * Copyright (c) Microsoft Corporation. All rights reserved.
2053
2053
  * Licensed under the MIT License.
@@ -2060,7 +2060,7 @@ const ProtocolMode = {
2060
2060
  OIDC: "OIDC",
2061
2061
  };
2062
2062
 
2063
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2063
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2064
2064
 
2065
2065
  /*
2066
2066
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2303,7 +2303,7 @@ class AccountEntity {
2303
2303
  }
2304
2304
  }
2305
2305
 
2306
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2306
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2307
2307
 
2308
2308
  /*
2309
2309
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2350,7 +2350,7 @@ function getDeserializedResponse(responseString) {
2350
2350
  return null;
2351
2351
  }
2352
2352
 
2353
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2353
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2354
2354
 
2355
2355
  /*
2356
2356
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2514,7 +2514,7 @@ class UrlString {
2514
2514
  }
2515
2515
  }
2516
2516
 
2517
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2517
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2518
2518
 
2519
2519
  /*
2520
2520
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2654,7 +2654,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2654
2654
  return null;
2655
2655
  }
2656
2656
 
2657
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2657
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2658
2658
  /*
2659
2659
  * Copyright (c) Microsoft Corporation. All rights reserved.
2660
2660
  * Licensed under the MIT License.
@@ -2662,7 +2662,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2662
2662
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2663
2663
  const cacheUnknownErrorCode = "cache_error_unknown";
2664
2664
 
2665
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2665
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2666
2666
 
2667
2667
  /*
2668
2668
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2689,7 +2689,7 @@ class CacheError extends Error {
2689
2689
  }
2690
2690
  }
2691
2691
 
2692
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
2692
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
2693
2693
 
2694
2694
  /*
2695
2695
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2854,24 +2854,24 @@ class CacheManager {
2854
2854
  * @param storeInCache {?StoreInCache}
2855
2855
  * @param correlationId {?string} correlation id
2856
2856
  */
2857
- async saveCacheRecord(cacheRecord, storeInCache, correlationId) {
2857
+ async saveCacheRecord(cacheRecord, correlationId, storeInCache) {
2858
2858
  if (!cacheRecord) {
2859
2859
  throw createClientAuthError(invalidCacheRecord);
2860
2860
  }
2861
2861
  try {
2862
2862
  if (!!cacheRecord.account) {
2863
- await this.setAccount(cacheRecord.account);
2863
+ await this.setAccount(cacheRecord.account, correlationId);
2864
2864
  }
2865
2865
  if (!!cacheRecord.idToken && storeInCache?.idToken !== false) {
2866
- await this.setIdTokenCredential(cacheRecord.idToken);
2866
+ await this.setIdTokenCredential(cacheRecord.idToken, correlationId);
2867
2867
  }
2868
2868
  if (!!cacheRecord.accessToken &&
2869
2869
  storeInCache?.accessToken !== false) {
2870
- await this.saveAccessToken(cacheRecord.accessToken);
2870
+ await this.saveAccessToken(cacheRecord.accessToken, correlationId);
2871
2871
  }
2872
2872
  if (!!cacheRecord.refreshToken &&
2873
2873
  storeInCache?.refreshToken !== false) {
2874
- await this.setRefreshTokenCredential(cacheRecord.refreshToken);
2874
+ await this.setRefreshTokenCredential(cacheRecord.refreshToken, correlationId);
2875
2875
  }
2876
2876
  if (!!cacheRecord.appMetadata) {
2877
2877
  this.setAppMetadata(cacheRecord.appMetadata);
@@ -2901,7 +2901,7 @@ class CacheManager {
2901
2901
  * saves access token credential
2902
2902
  * @param credential
2903
2903
  */
2904
- async saveAccessToken(credential) {
2904
+ async saveAccessToken(credential, correlationId) {
2905
2905
  const accessTokenFilter = {
2906
2906
  clientId: credential.clientId,
2907
2907
  credentialType: credential.credentialType,
@@ -2928,7 +2928,7 @@ class CacheManager {
2928
2928
  }
2929
2929
  });
2930
2930
  await Promise.all(removedAccessTokens);
2931
- await this.setAccessTokenCredential(credential);
2931
+ await this.setAccessTokenCredential(credential, correlationId);
2932
2932
  }
2933
2933
  /**
2934
2934
  * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
@@ -3874,7 +3874,7 @@ class DefaultStorageClass extends CacheManager {
3874
3874
  }
3875
3875
  }
3876
3876
 
3877
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
3877
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
3878
3878
 
3879
3879
  /*
3880
3880
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3973,7 +3973,7 @@ function isOidcProtocolMode(config) {
3973
3973
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
3974
3974
  }
3975
3975
 
3976
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
3976
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
3977
3977
  /*
3978
3978
  * Copyright (c) Microsoft Corporation. All rights reserved.
3979
3979
  * Licensed under the MIT License.
@@ -3983,7 +3983,7 @@ const CcsCredentialType = {
3983
3983
  UPN: "UPN",
3984
3984
  };
3985
3985
 
3986
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
3986
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
3987
3987
  /*
3988
3988
  * Copyright (c) Microsoft Corporation. All rights reserved.
3989
3989
  * Licensed under the MIT License.
@@ -4033,7 +4033,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
4033
4033
  const BROKER_CLIENT_ID = "brk_client_id";
4034
4034
  const BROKER_REDIRECT_URI = "brk_redirect_uri";
4035
4035
 
4036
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
4036
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
4037
4037
 
4038
4038
  /*
4039
4039
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4100,7 +4100,7 @@ class RequestValidator {
4100
4100
  }
4101
4101
  }
4102
4102
 
4103
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
4103
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
4104
4104
 
4105
4105
  /*
4106
4106
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4508,7 +4508,7 @@ class RequestParameterBuilder {
4508
4508
  }
4509
4509
  }
4510
4510
 
4511
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
4511
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
4512
4512
  /*
4513
4513
  * Copyright (c) Microsoft Corporation. All rights reserved.
4514
4514
  * Licensed under the MIT License.
@@ -4520,7 +4520,7 @@ function isOpenIdConfigResponse(response) {
4520
4520
  response.hasOwnProperty("jwks_uri"));
4521
4521
  }
4522
4522
 
4523
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
4523
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
4524
4524
  /*
4525
4525
  * Copyright (c) Microsoft Corporation. All rights reserved.
4526
4526
  * Licensed under the MIT License.
@@ -4530,7 +4530,7 @@ function isCloudInstanceDiscoveryResponse(response) {
4530
4530
  response.hasOwnProperty("metadata"));
4531
4531
  }
4532
4532
 
4533
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
4533
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
4534
4534
  /*
4535
4535
  * Copyright (c) Microsoft Corporation. All rights reserved.
4536
4536
  * Licensed under the MIT License.
@@ -4540,7 +4540,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
4540
4540
  response.hasOwnProperty("error_description"));
4541
4541
  }
4542
4542
 
4543
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
4543
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
4544
4544
  /*
4545
4545
  * Copyright (c) Microsoft Corporation. All rights reserved.
4546
4546
  * Licensed under the MIT License.
@@ -4698,6 +4698,7 @@ const PerformanceEvents = {
4698
4698
  */
4699
4699
  InitializeSilentRequest: "initializeSilentRequest",
4700
4700
  InitializeClientApplication: "initializeClientApplication",
4701
+ InitializeCache: "initializeCache",
4701
4702
  /**
4702
4703
  * Helper function in SilentIframeClient class (msal-browser).
4703
4704
  */
@@ -4775,6 +4776,8 @@ const PerformanceEvents = {
4775
4776
  */
4776
4777
  ClearTokensAndKeysWithClaims: "clearTokensAndKeysWithClaims",
4777
4778
  CacheManagerGetRefreshToken: "cacheManagerGetRefreshToken",
4779
+ ImportExistingCache: "importExistingCache",
4780
+ SetUserData: "setUserData",
4778
4781
  /**
4779
4782
  * Crypto Operations
4780
4783
  */
@@ -4783,6 +4786,12 @@ const PerformanceEvents = {
4783
4786
  GenerateCodeChallengeFromVerifier: "generateCodeChallengeFromVerifier",
4784
4787
  Sha256Digest: "sha256Digest",
4785
4788
  GetRandomValues: "getRandomValues",
4789
+ GenerateHKDF: "generateHKDF",
4790
+ GenerateBaseKey: "generateBaseKey",
4791
+ Base64Decode: "base64Decode",
4792
+ UrlEncodeArr: "urlEncodeArr",
4793
+ Encrypt: "encrypt",
4794
+ Decrypt: "decrypt",
4786
4795
  };
4787
4796
  const PerformanceEventAbbreviations = new Map([
4788
4797
  [PerformanceEvents.AcquireTokenByCode, "ATByCode"],
@@ -4867,6 +4876,9 @@ const PerformanceEventAbbreviations = new Map([
4867
4876
  PerformanceEvents.InitializeClientApplication,
4868
4877
  "InitClientApplication",
4869
4878
  ],
4879
+ [PerformanceEvents.InitializeCache, "InitCache"],
4880
+ [PerformanceEvents.ImportExistingCache, "importCache"],
4881
+ [PerformanceEvents.SetUserData, "setUserData"],
4870
4882
  [PerformanceEvents.SilentIframeClientTokenHelper, "SIClientTHelper"],
4871
4883
  [
4872
4884
  PerformanceEvents.SilentHandlerInitiateAuthRequest,
@@ -5000,6 +5012,12 @@ const PerformanceEventAbbreviations = new Map([
5000
5012
  ],
5001
5013
  [PerformanceEvents.Sha256Digest, "Sha256Digest"],
5002
5014
  [PerformanceEvents.GetRandomValues, "GetRandomValues"],
5015
+ [PerformanceEvents.GenerateHKDF, "genHKDF"],
5016
+ [PerformanceEvents.GenerateBaseKey, "genBaseKey"],
5017
+ [PerformanceEvents.Base64Decode, "b64Decode"],
5018
+ [PerformanceEvents.UrlEncodeArr, "urlEncArr"],
5019
+ [PerformanceEvents.Encrypt, "encrypt"],
5020
+ [PerformanceEvents.Decrypt, "decrypt"],
5003
5021
  ]);
5004
5022
  /**
5005
5023
  * State of the performance event.
@@ -5025,9 +5043,11 @@ const IntFields = new Set([
5025
5043
  "multiMatchedAT",
5026
5044
  "multiMatchedID",
5027
5045
  "multiMatchedRT",
5046
+ "unencryptedCacheCount",
5047
+ "encryptedCacheExpiredCount",
5028
5048
  ]);
5029
5049
 
5030
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
5050
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
5031
5051
  /*
5032
5052
  * Copyright (c) Microsoft Corporation. All rights reserved.
5033
5053
  * Licensed under the MIT License.
@@ -5123,7 +5143,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
5123
5143
  };
5124
5144
  };
5125
5145
 
5126
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
5146
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
5127
5147
 
5128
5148
  /*
5129
5149
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5232,7 +5252,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5232
5252
  },
5233
5253
  };
5234
5254
 
5235
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
5255
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
5236
5256
 
5237
5257
  /*
5238
5258
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6071,7 +6091,7 @@ function buildStaticAuthorityOptions(authOptions) {
6071
6091
  };
6072
6092
  }
6073
6093
 
6074
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6094
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6075
6095
 
6076
6096
  /*
6077
6097
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6102,7 +6122,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6102
6122
  }
6103
6123
  }
6104
6124
 
6105
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6125
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6106
6126
 
6107
6127
  /*
6108
6128
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6121,7 +6141,7 @@ class ServerError extends AuthError {
6121
6141
  }
6122
6142
  }
6123
6143
 
6124
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6144
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6125
6145
 
6126
6146
  /*
6127
6147
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6219,7 +6239,7 @@ class ThrottlingUtils {
6219
6239
  }
6220
6240
  }
6221
6241
 
6222
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6242
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6223
6243
 
6224
6244
  /*
6225
6245
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6249,7 +6269,7 @@ function createNetworkError(error, httpStatus, responseHeaders) {
6249
6269
  return new NetworkError(error, httpStatus, responseHeaders);
6250
6270
  }
6251
6271
 
6252
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6272
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6253
6273
 
6254
6274
  /*
6255
6275
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6399,7 +6419,7 @@ class BaseClient {
6399
6419
  }
6400
6420
  }
6401
6421
 
6402
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6422
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6403
6423
  /*
6404
6424
  * Copyright (c) Microsoft Corporation. All rights reserved.
6405
6425
  * Licensed under the MIT License.
@@ -6425,7 +6445,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6425
6445
  refreshTokenExpired: refreshTokenExpired
6426
6446
  });
6427
6447
 
6428
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6448
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6429
6449
 
6430
6450
  /*
6431
6451
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6513,7 +6533,7 @@ function createInteractionRequiredAuthError(errorCode) {
6513
6533
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6514
6534
  }
6515
6535
 
6516
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6536
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6517
6537
 
6518
6538
  /*
6519
6539
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6585,7 +6605,7 @@ class ProtocolUtils {
6585
6605
  }
6586
6606
  }
6587
6607
 
6588
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6608
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6589
6609
 
6590
6610
  /*
6591
6611
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6669,7 +6689,7 @@ class PopTokenGenerator {
6669
6689
  }
6670
6690
  }
6671
6691
 
6672
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6692
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6673
6693
  /*
6674
6694
  * Copyright (c) Microsoft Corporation. All rights reserved.
6675
6695
  * Licensed under the MIT License.
@@ -6696,7 +6716,7 @@ class PopTokenGenerator {
6696
6716
  }
6697
6717
  }
6698
6718
 
6699
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
6719
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
6700
6720
 
6701
6721
  /*
6702
6722
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6862,7 +6882,7 @@ class ResponseHandler {
6862
6882
  return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
6863
6883
  }
6864
6884
  }
6865
- await this.cacheStorage.saveCacheRecord(cacheRecord, request.storeInCache, request.correlationId);
6885
+ await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, request.storeInCache);
6866
6886
  }
6867
6887
  finally {
6868
6888
  if (this.persistencePlugin &&
@@ -7073,7 +7093,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
7073
7093
  return baseAccount;
7074
7094
  }
7075
7095
 
7076
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7096
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7077
7097
  /*
7078
7098
  * Copyright (c) Microsoft Corporation. All rights reserved.
7079
7099
  * Licensed under the MIT License.
@@ -7091,7 +7111,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
7091
7111
  }
7092
7112
  }
7093
7113
 
7094
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7114
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7095
7115
 
7096
7116
  /*
7097
7117
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7465,7 +7485,7 @@ class AuthorizationCodeClient extends BaseClient {
7465
7485
  });
7466
7486
  }
7467
7487
  this.addExtraQueryParams(request, parameterBuilder);
7468
- if (request.nativeBroker) {
7488
+ if (request.platformBroker) {
7469
7489
  // signal ests that this is a WAM call
7470
7490
  parameterBuilder.addNativeBroker();
7471
7491
  // pass the req_cnf for POP
@@ -7533,7 +7553,7 @@ class AuthorizationCodeClient extends BaseClient {
7533
7553
  }
7534
7554
  }
7535
7555
 
7536
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7556
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7537
7557
 
7538
7558
  /*
7539
7559
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7753,7 +7773,7 @@ class RefreshTokenClient extends BaseClient {
7753
7773
  }
7754
7774
  }
7755
7775
 
7756
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7776
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7757
7777
 
7758
7778
  /*
7759
7779
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7889,7 +7909,7 @@ class SilentFlowClient extends BaseClient {
7889
7909
  }
7890
7910
  }
7891
7911
 
7892
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7912
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7893
7913
 
7894
7914
  /*
7895
7915
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7904,7 +7924,7 @@ const StubbedNetworkModule = {
7904
7924
  },
7905
7925
  };
7906
7926
 
7907
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7927
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7908
7928
 
7909
7929
  /*
7910
7930
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7962,7 +7982,7 @@ class AuthenticationHeaderParser {
7962
7982
  }
7963
7983
  }
7964
7984
 
7965
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
7985
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
7966
7986
 
7967
7987
  /*
7968
7988
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8225,7 +8245,7 @@ class ServerTelemetryManager {
8225
8245
  }
8226
8246
  }
8227
8247
 
8228
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
8248
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
8229
8249
  /*
8230
8250
  * Copyright (c) Microsoft Corporation. All rights reserved.
8231
8251
  * Licensed under the MIT License.
@@ -8233,7 +8253,7 @@ class ServerTelemetryManager {
8233
8253
  const missingKidError = "missing_kid_error";
8234
8254
  const missingAlgError = "missing_alg_error";
8235
8255
 
8236
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
8256
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
8237
8257
 
8238
8258
  /*
8239
8259
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8258,7 +8278,7 @@ function createJoseHeaderError(code) {
8258
8278
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
8259
8279
  }
8260
8280
 
8261
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
8281
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
8262
8282
 
8263
8283
  /*
8264
8284
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8298,7 +8318,7 @@ class JoseHeader {
8298
8318
  }
8299
8319
  }
8300
8320
 
8301
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
8321
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
8302
8322
 
8303
8323
  /*
8304
8324
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8377,7 +8397,7 @@ class StubPerformanceClient {
8377
8397
  }
8378
8398
  }
8379
8399
 
8380
- /*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
8400
+ /*! @azure/msal-common v15.0.1 2025-01-15 */
8381
8401
 
8382
8402
  /*
8383
8403
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9693,14 +9713,14 @@ const keygenAlgorithmOptions = {
9693
9713
  /**
9694
9714
  * Check whether browser crypto is available.
9695
9715
  */
9696
- function validateCryptoAvailable() {
9716
+ function validateCryptoAvailable(skipValidateSubtleCrypto) {
9697
9717
  if (!window) {
9698
9718
  throw createBrowserAuthError(nonBrowserEnvironment);
9699
9719
  }
9700
9720
  if (!window.crypto) {
9701
9721
  throw createBrowserAuthError(cryptoNonExistent);
9702
9722
  }
9703
- if (!window.crypto.subtle) {
9723
+ if (!skipValidateSubtleCrypto && !window.crypto.subtle) {
9704
9724
  throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
9705
9725
  }
9706
9726
  }
@@ -9985,7 +10005,9 @@ function isInPopup() {
9985
10005
  * Returns current window URL as redirect uri
9986
10006
  */
9987
10007
  function getCurrentUri() {
9988
- return window.location.href.split("?")[0].split("#")[0];
10008
+ return typeof window !== "undefined" && window.location
10009
+ ? window.location.href.split("?")[0].split("#")[0]
10010
+ : "";
9989
10011
  }
9990
10012
  /**
9991
10013
  * Gets the homepage url for the current window location.
@@ -10365,7 +10387,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10365
10387
  redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,
10366
10388
  asyncPopups: false,
10367
10389
  allowRedirectInIframe: false,
10368
- allowNativeBroker: false,
10390
+ allowPlatformBroker: false,
10369
10391
  nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||
10370
10392
  DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
10371
10393
  pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,
@@ -10388,11 +10410,11 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10388
10410
  const logger = new Logger(providedSystemOptions.loggerOptions);
10389
10411
  logger.warning(JSON.stringify(createClientConfigurationError(cannotSetOIDCOptions)));
10390
10412
  }
10391
- // Throw an error if user has set allowNativeBroker to true without being in AAD protocol mode
10413
+ // Throw an error if user has set allowPlatformBroker to true without being in AAD protocol mode
10392
10414
  if (userInputAuth?.protocolMode &&
10393
10415
  userInputAuth.protocolMode !== ProtocolMode.AAD &&
10394
- providedSystemOptions?.allowNativeBroker) {
10395
- throw createClientConfigurationError(cannotAllowNativeBroker);
10416
+ providedSystemOptions?.allowPlatformBroker) {
10417
+ throw createClientConfigurationError(cannotAllowPlatformBroker);
10396
10418
  }
10397
10419
  const overlayedConfig = {
10398
10420
  auth: {
@@ -10412,7 +10434,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10412
10434
 
10413
10435
  /* eslint-disable header/header */
10414
10436
  const name = "@azure/msal-browser";
10415
- const version = "4.0.0-alpha.0";
10437
+ const version = "4.0.1";
10416
10438
 
10417
10439
  /*
10418
10440
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11171,10 +11193,10 @@ class AsyncMemoryStorage {
11171
11193
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
11172
11194
  */
11173
11195
  class CryptoOps {
11174
- constructor(logger, performanceClient) {
11196
+ constructor(logger, performanceClient, skipValidateSubtleCrypto) {
11175
11197
  this.logger = logger;
11176
11198
  // Browser crypto needs to be validated first before any other classes can be set.
11177
- validateCryptoAvailable();
11199
+ validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
11178
11200
  this.cache = new AsyncMemoryStorage(this.logger);
11179
11201
  this.performanceClient = performanceClient;
11180
11202
  }
@@ -11452,15 +11474,17 @@ function getTokenKeys(clientId, storage) {
11452
11474
  */
11453
11475
  const ENCRYPTION_KEY = "msal.cache.encryption";
11454
11476
  class LocalStorage {
11455
- constructor(clientId) {
11477
+ constructor(clientId, logger, performanceClient) {
11456
11478
  if (!window.localStorage) {
11457
11479
  throw createBrowserConfigurationAuthError(storageNotSupported);
11458
11480
  }
11459
11481
  this.memoryStorage = new MemoryStorage();
11460
11482
  this.initialized = false;
11461
11483
  this.clientId = clientId;
11484
+ this.logger = logger;
11485
+ this.performanceClient = performanceClient;
11462
11486
  }
11463
- async initialize() {
11487
+ async initialize(correlationId) {
11464
11488
  this.initialized = true;
11465
11489
  const cookies = new CookieStorage();
11466
11490
  const cookieString = cookies.getItem(ENCRYPTION_KEY);
@@ -11469,27 +11493,26 @@ class LocalStorage {
11469
11493
  try {
11470
11494
  parsedCookie = JSON.parse(cookieString);
11471
11495
  }
11472
- catch (e) {
11473
- // TODO: Log telemetry but don't throw
11474
- }
11496
+ catch (e) { }
11475
11497
  }
11476
11498
  if (parsedCookie.key && parsedCookie.id) {
11477
11499
  // Encryption key already exists, import
11500
+ const baseKey = invoke(base64DecToArr, PerformanceEvents.Base64Decode, this.logger, this.performanceClient, correlationId)(parsedCookie.key);
11478
11501
  this.encryptionCookie = {
11479
11502
  id: parsedCookie.id,
11480
- key: await generateHKDF(base64DecToArr(parsedCookie.key)),
11503
+ key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),
11481
11504
  };
11482
- await this.importExistingCache();
11505
+ await invokeAsync(this.importExistingCache.bind(this), PerformanceEvents.ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
11483
11506
  }
11484
11507
  else {
11485
11508
  // Encryption key doesn't exist or is invalid, generate a new one and clear existing cache
11486
11509
  this.clear();
11487
11510
  const id = createNewGuid();
11488
- const baseKey = await generateBaseKey();
11489
- const keyStr = urlEncodeArr(new Uint8Array(baseKey));
11511
+ const baseKey = await invokeAsync(generateBaseKey, PerformanceEvents.GenerateBaseKey, this.logger, this.performanceClient, correlationId)();
11512
+ const keyStr = invoke(urlEncodeArr, PerformanceEvents.UrlEncodeArr, this.logger, this.performanceClient, correlationId)(new Uint8Array(baseKey));
11490
11513
  this.encryptionCookie = {
11491
11514
  id: id,
11492
- key: await generateHKDF(baseKey),
11515
+ key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),
11493
11516
  };
11494
11517
  const cookieData = {
11495
11518
  id: id,
@@ -11510,11 +11533,11 @@ class LocalStorage {
11510
11533
  setItem(key, value) {
11511
11534
  window.localStorage.setItem(key, value);
11512
11535
  }
11513
- async setUserData(key, value) {
11536
+ async setUserData(key, value, correlationId) {
11514
11537
  if (!this.initialized || !this.encryptionCookie) {
11515
11538
  throw createBrowserAuthError(uninitializedPublicClientApplication);
11516
11539
  }
11517
- const { data, nonce } = await encrypt(this.encryptionCookie.key, value, this.getContext(key));
11540
+ const { data, nonce } = await invokeAsync(encrypt, PerformanceEvents.Encrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, value, this.getContext(key));
11518
11541
  const encryptedData = {
11519
11542
  id: this.encryptionCookie.id,
11520
11543
  nonce: nonce,
@@ -11557,25 +11580,27 @@ class LocalStorage {
11557
11580
  * Helper to decrypt all known MSAL keys in localStorage and save them to inMemory storage
11558
11581
  * @returns
11559
11582
  */
11560
- async importExistingCache() {
11583
+ async importExistingCache(correlationId) {
11561
11584
  if (!this.encryptionCookie) {
11562
11585
  return;
11563
11586
  }
11564
- const accountKeys = getAccountKeys(this);
11565
- await this.importArray(accountKeys);
11587
+ let accountKeys = getAccountKeys(this);
11588
+ accountKeys = await this.importArray(accountKeys, correlationId);
11589
+ // Write valid account keys back to map
11590
+ this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
11566
11591
  const tokenKeys = getTokenKeys(this.clientId, this);
11567
- await Promise.all([
11568
- this.importArray(tokenKeys.idToken),
11569
- this.importArray(tokenKeys.accessToken),
11570
- this.importArray(tokenKeys.refreshToken),
11571
- ]);
11592
+ tokenKeys.idToken = await this.importArray(tokenKeys.idToken, correlationId);
11593
+ tokenKeys.accessToken = await this.importArray(tokenKeys.accessToken, correlationId);
11594
+ tokenKeys.refreshToken = await this.importArray(tokenKeys.refreshToken, correlationId);
11595
+ // Write valid token keys back to map
11596
+ this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
11572
11597
  }
11573
11598
  /**
11574
11599
  * Helper to decrypt and save cache entries
11575
11600
  * @param key
11576
11601
  * @returns
11577
11602
  */
11578
- async getItemFromEncryptedCache(key) {
11603
+ async getItemFromEncryptedCache(key, correlationId) {
11579
11604
  if (!this.encryptionCookie) {
11580
11605
  return null;
11581
11606
  }
@@ -11586,36 +11611,46 @@ class LocalStorage {
11586
11611
  let encObj;
11587
11612
  try {
11588
11613
  encObj = JSON.parse(rawCache);
11589
- if (!encObj.id || !encObj.nonce || !encObj.data) {
11590
- throw "Not encrypted!"; // TODO: Typed error
11591
- }
11592
- if (encObj.id !== this.encryptionCookie.id) {
11593
- throw "Old item!"; // TODO: Typed error
11594
- }
11595
11614
  }
11596
11615
  catch (e) {
11597
11616
  // Not a valid encrypted object, remove
11598
- this.removeItem(key);
11599
- // TODO: Log to telemetry
11600
11617
  return null;
11601
11618
  }
11602
- return decrypt(this.encryptionCookie.key, encObj.nonce, this.getContext(key), encObj.data);
11619
+ if (!encObj.id || !encObj.nonce || !encObj.data) {
11620
+ // Data is not encrypted, likely from old version of MSAL. It must be removed because we don't know how old it is.
11621
+ this.performanceClient.incrementFields({ unencryptedCacheCount: 1 }, correlationId);
11622
+ return null;
11623
+ }
11624
+ if (encObj.id !== this.encryptionCookie.id) {
11625
+ // Data was encrypted with a different key. It must be removed because it is from a previous session.
11626
+ this.performanceClient.incrementFields({ encryptedCacheExpiredCount: 1 }, correlationId);
11627
+ return null;
11628
+ }
11629
+ return invokeAsync(decrypt, PerformanceEvents.Decrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, encObj.nonce, this.getContext(key), encObj.data);
11603
11630
  }
11604
11631
  /**
11605
11632
  * Helper to decrypt and save an array of cache keys
11606
11633
  * @param arr
11634
+ * @returns Array of keys successfully imported
11607
11635
  */
11608
- async importArray(arr) {
11636
+ async importArray(arr, correlationId) {
11637
+ const importedArr = [];
11609
11638
  const promiseArr = [];
11610
11639
  arr.forEach((key) => {
11611
- const promise = this.getItemFromEncryptedCache(key).then((value) => {
11640
+ const promise = this.getItemFromEncryptedCache(key, correlationId).then((value) => {
11612
11641
  if (value) {
11613
11642
  this.memoryStorage.setItem(key, value);
11643
+ importedArr.push(key);
11644
+ }
11645
+ else {
11646
+ // If value is empty, unencrypted or expired remove
11647
+ this.removeItem(key);
11614
11648
  }
11615
11649
  });
11616
11650
  promiseArr.push(promise);
11617
11651
  });
11618
11652
  await Promise.all(promiseArr);
11653
+ return importedArr;
11619
11654
  }
11620
11655
  /**
11621
11656
  * Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries
@@ -11699,7 +11734,7 @@ function extractBrowserRequestState(browserCrypto, state) {
11699
11734
  * parameters such as state and nonce, generally.
11700
11735
  */
11701
11736
  class BrowserCacheManager extends CacheManager {
11702
- constructor(clientId, cacheConfig, cryptoImpl, logger, staticAuthorityOptions, performanceClient) {
11737
+ constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, staticAuthorityOptions) {
11703
11738
  super(clientId, cryptoImpl, logger, staticAuthorityOptions);
11704
11739
  this.cacheConfig = cacheConfig;
11705
11740
  this.logger = logger;
@@ -11709,8 +11744,8 @@ class BrowserCacheManager extends CacheManager {
11709
11744
  this.cookieStorage = new CookieStorage();
11710
11745
  this.performanceClient = performanceClient;
11711
11746
  }
11712
- async initialize() {
11713
- await this.browserStorage.initialize();
11747
+ async initialize(correlationId) {
11748
+ await this.browserStorage.initialize(correlationId);
11714
11749
  }
11715
11750
  /**
11716
11751
  * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
@@ -11720,7 +11755,7 @@ class BrowserCacheManager extends CacheManager {
11720
11755
  try {
11721
11756
  switch (cacheLocation) {
11722
11757
  case BrowserCacheLocation.LocalStorage:
11723
- return new LocalStorage(this.clientId);
11758
+ return new LocalStorage(this.clientId, this.logger, this.performanceClient);
11724
11759
  case BrowserCacheLocation.SessionStorage:
11725
11760
  return new SessionStorage();
11726
11761
  case BrowserCacheLocation.MemoryStorage:
@@ -11779,10 +11814,10 @@ class BrowserCacheManager extends CacheManager {
11779
11814
  * set account entity in the platform cache
11780
11815
  * @param account
11781
11816
  */
11782
- async setAccount(account) {
11817
+ async setAccount(account, correlationId) {
11783
11818
  this.logger.trace("BrowserCacheManager.setAccount called");
11784
11819
  const key = account.generateAccountKey();
11785
- await this.browserStorage.setUserData(key, JSON.stringify(account));
11820
+ await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(key, JSON.stringify(account), correlationId);
11786
11821
  this.addAccountKeyToMap(key);
11787
11822
  }
11788
11823
  /**
@@ -11972,10 +12007,10 @@ class BrowserCacheManager extends CacheManager {
11972
12007
  * set IdToken credential to the platform cache
11973
12008
  * @param idToken
11974
12009
  */
11975
- async setIdTokenCredential(idToken) {
12010
+ async setIdTokenCredential(idToken, correlationId) {
11976
12011
  this.logger.trace("BrowserCacheManager.setIdTokenCredential called");
11977
12012
  const idTokenKey = generateCredentialKey(idToken);
11978
- await this.browserStorage.setUserData(idTokenKey, JSON.stringify(idToken));
12013
+ await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(idTokenKey, JSON.stringify(idToken), correlationId);
11979
12014
  this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);
11980
12015
  }
11981
12016
  /**
@@ -12003,10 +12038,10 @@ class BrowserCacheManager extends CacheManager {
12003
12038
  * set accessToken credential to the platform cache
12004
12039
  * @param accessToken
12005
12040
  */
12006
- async setAccessTokenCredential(accessToken) {
12041
+ async setAccessTokenCredential(accessToken, correlationId) {
12007
12042
  this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");
12008
12043
  const accessTokenKey = generateCredentialKey(accessToken);
12009
- await this.browserStorage.setUserData(accessTokenKey, JSON.stringify(accessToken));
12044
+ await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(accessTokenKey, JSON.stringify(accessToken), correlationId);
12010
12045
  this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
12011
12046
  }
12012
12047
  /**
@@ -12034,10 +12069,10 @@ class BrowserCacheManager extends CacheManager {
12034
12069
  * set refreshToken credential to the platform cache
12035
12070
  * @param refreshToken
12036
12071
  */
12037
- async setRefreshTokenCredential(refreshToken) {
12072
+ async setRefreshTokenCredential(refreshToken, correlationId) {
12038
12073
  this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");
12039
12074
  const refreshTokenKey = generateCredentialKey(refreshToken);
12040
- await this.browserStorage.setUserData(refreshTokenKey, JSON.stringify(refreshToken));
12075
+ await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(refreshTokenKey, JSON.stringify(refreshToken), correlationId);
12041
12076
  this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
12042
12077
  }
12043
12078
  /**
@@ -12596,7 +12631,7 @@ class BrowserCacheManager extends CacheManager {
12596
12631
  idToken: idTokenEntity,
12597
12632
  accessToken: accessTokenEntity,
12598
12633
  };
12599
- return this.saveCacheRecord(cacheRecord);
12634
+ return this.saveCacheRecord(cacheRecord, result.correlationId);
12600
12635
  }
12601
12636
  /**
12602
12637
  * saves a cache record
@@ -12604,9 +12639,9 @@ class BrowserCacheManager extends CacheManager {
12604
12639
  * @param storeInCache {?StoreInCache}
12605
12640
  * @param correlationId {?string} correlation id
12606
12641
  */
12607
- async saveCacheRecord(cacheRecord, storeInCache, correlationId) {
12642
+ async saveCacheRecord(cacheRecord, correlationId, storeInCache) {
12608
12643
  try {
12609
- await super.saveCacheRecord(cacheRecord, storeInCache, correlationId);
12644
+ await super.saveCacheRecord(cacheRecord, correlationId, storeInCache);
12610
12645
  }
12611
12646
  catch (e) {
12612
12647
  if (e instanceof CacheError &&
@@ -12626,7 +12661,7 @@ class BrowserCacheManager extends CacheManager {
12626
12661
  }
12627
12662
  }
12628
12663
  }
12629
- const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {
12664
+ const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient) => {
12630
12665
  const cacheOptions = {
12631
12666
  cacheLocation: BrowserCacheLocation.MemoryStorage,
12632
12667
  temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
@@ -12635,7 +12670,7 @@ const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {
12635
12670
  cacheMigrationEnabled: false,
12636
12671
  claimsBasedCachingEnabled: false,
12637
12672
  };
12638
- return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
12673
+ return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient);
12639
12674
  };
12640
12675
 
12641
12676
  /*
@@ -13701,7 +13736,7 @@ class NativeInteractionClient extends BaseInteractionClient {
13701
13736
  const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
13702
13737
  // cache accounts and tokens in the appropriate storage
13703
13738
  await this.cacheAccount(baseAccount);
13704
- this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, response.access_token, result.tenantId, reqTimestamp);
13739
+ await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, response.access_token, result.tenantId, reqTimestamp);
13705
13740
  return result;
13706
13741
  }
13707
13742
  /**
@@ -13827,7 +13862,7 @@ class NativeInteractionClient extends BaseInteractionClient {
13827
13862
  */
13828
13863
  async cacheAccount(accountEntity) {
13829
13864
  // Store the account info and hence `nativeAccountId` in browser cache
13830
- await this.browserStorage.setAccount(accountEntity);
13865
+ await this.browserStorage.setAccount(accountEntity, this.correlationId);
13831
13866
  // Remove any existing cached tokens for this account in browser storage
13832
13867
  this.browserStorage.removeAccountContext(accountEntity).catch((e) => {
13833
13868
  this.logger.error(`Error occurred while removing account context from browser storage. ${e}`);
@@ -13858,7 +13893,7 @@ class NativeInteractionClient extends BaseInteractionClient {
13858
13893
  idToken: cachedIdToken,
13859
13894
  accessToken: cachedAccessToken,
13860
13895
  };
13861
- void this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, request.storeInCache);
13896
+ return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, request.storeInCache);
13862
13897
  }
13863
13898
  addTelemetryFromNativeResponse(response) {
13864
13899
  const mats = this.getMATSFromResponse(response);
@@ -14293,15 +14328,15 @@ class NativeMessageHandler {
14293
14328
  * @param nativeExtensionProvider
14294
14329
  * @param authenticationScheme
14295
14330
  */
14296
- static isNativeAvailable(config, logger, nativeExtensionProvider, authenticationScheme) {
14297
- logger.trace("isNativeAvailable called");
14298
- if (!config.system.allowNativeBroker) {
14299
- logger.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false");
14331
+ static isPlatformBrokerAvailable(config, logger, nativeExtensionProvider, authenticationScheme) {
14332
+ logger.trace("isPlatformBrokerAvailable called");
14333
+ if (!config.system.allowPlatformBroker) {
14334
+ logger.trace("isPlatformBrokerAvailable: allowPlatformBroker is not enabled, returning false");
14300
14335
  // Developer disabled WAM
14301
14336
  return false;
14302
14337
  }
14303
14338
  if (!nativeExtensionProvider) {
14304
- logger.trace("isNativeAvailable: WAM extension provider is not initialized, returning false");
14339
+ logger.trace("isPlatformBrokerAvailable: Platform extension provider is not initialized, returning false");
14305
14340
  // Extension is not available
14306
14341
  return false;
14307
14342
  }
@@ -14309,10 +14344,10 @@ class NativeMessageHandler {
14309
14344
  switch (authenticationScheme) {
14310
14345
  case AuthenticationScheme.BEARER:
14311
14346
  case AuthenticationScheme.POP:
14312
- logger.trace("isNativeAvailable: authenticationScheme is supported, returning true");
14347
+ logger.trace("isPlatformBrokerAvailable: authenticationScheme is supported, returning true");
14313
14348
  return true;
14314
14349
  default:
14315
- logger.trace("isNativeAvailable: authenticationScheme is not supported, returning false");
14350
+ logger.trace("isPlatformBrokerAvailable: authenticationScheme is not supported, returning false");
14316
14351
  return false;
14317
14352
  }
14318
14353
  }
@@ -14549,17 +14584,17 @@ class PopupClient extends StandardInteractionClient {
14549
14584
  requestExtraQueryParameters: validRequest.extraQueryParameters,
14550
14585
  account: validRequest.account,
14551
14586
  });
14552
- const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
14587
+ const isPlatformBroker = NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
14553
14588
  // Start measurement for server calls with native brokering enabled
14554
14589
  let fetchNativeAccountIdMeasurement;
14555
- if (isNativeBroker) {
14590
+ if (isPlatformBroker) {
14556
14591
  fetchNativeAccountIdMeasurement =
14557
14592
  this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
14558
14593
  }
14559
14594
  // Create acquire token url.
14560
14595
  const navigateUrl = await authClient.getAuthCodeUrl({
14561
14596
  ...validRequest,
14562
- nativeBroker: isNativeBroker,
14597
+ platformBroker: isPlatformBroker,
14563
14598
  });
14564
14599
  // Create popup interaction handler.
14565
14600
  const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
@@ -15076,7 +15111,7 @@ class RedirectClient extends StandardInteractionClient {
15076
15111
  // Create acquire token url.
15077
15112
  const navigateUrl = await authClient.getAuthCodeUrl({
15078
15113
  ...validRequest,
15079
- nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme),
15114
+ platformBroker: NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme),
15080
15115
  });
15081
15116
  const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);
15082
15117
  this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);
@@ -15590,7 +15625,7 @@ class SilentIframeClient extends StandardInteractionClient {
15590
15625
  // Create authorize request url
15591
15626
  const navigateUrl = await invokeAsync(authClient.getAuthCodeUrl.bind(authClient), PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)({
15592
15627
  ...silentRequest,
15593
- nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
15628
+ platformBroker: NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
15594
15629
  });
15595
15630
  // Create silent handler
15596
15631
  const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
@@ -15709,6 +15744,7 @@ class TokenCache {
15709
15744
  if (!this.isBrowserEnvironment) {
15710
15745
  throw createBrowserAuthError(nonBrowserEnvironment);
15711
15746
  }
15747
+ const correlationId = request.correlationId || createNewGuid();
15712
15748
  const idTokenClaims = response.id_token
15713
15749
  ? extractTokenClaims(response.id_token, base64Decode)
15714
15750
  : undefined;
@@ -15722,10 +15758,10 @@ class TokenCache {
15722
15758
  const authority = request.authority
15723
15759
  ? new Authority(Authority.generateAuthority(request.authority, request.azureCloudOptions), this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid())
15724
15760
  : undefined;
15725
- const cacheRecordAccount = await this.loadAccount(request, options.clientInfo || response.client_info || "", idTokenClaims, authority);
15726
- const idToken = await this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm);
15727
- const accessToken = await this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options);
15728
- const refreshToken = await this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment);
15761
+ const cacheRecordAccount = await this.loadAccount(request, options.clientInfo || response.client_info || "", correlationId, idTokenClaims, authority);
15762
+ const idToken = await this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, correlationId);
15763
+ const accessToken = await this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options, correlationId);
15764
+ const refreshToken = await this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, correlationId);
15729
15765
  return this.generateAuthenticationResult(request, {
15730
15766
  account: cacheRecordAccount,
15731
15767
  idToken,
@@ -15742,11 +15778,11 @@ class TokenCache {
15742
15778
  * @param requestHomeAccountId
15743
15779
  * @returns `AccountEntity`
15744
15780
  */
15745
- async loadAccount(request, clientInfo, idTokenClaims, authority) {
15781
+ async loadAccount(request, clientInfo, correlationId, idTokenClaims, authority) {
15746
15782
  this.logger.verbose("TokenCache - loading account");
15747
15783
  if (request.account) {
15748
15784
  const accountEntity = AccountEntity.createFromAccountInfo(request.account);
15749
- await this.storage.setAccount(accountEntity);
15785
+ await this.storage.setAccount(accountEntity, correlationId);
15750
15786
  return accountEntity;
15751
15787
  }
15752
15788
  else if (!authority || (!clientInfo && !idTokenClaims)) {
@@ -15758,7 +15794,7 @@ class TokenCache {
15758
15794
  const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
15759
15795
  undefined, // nativeAccountId
15760
15796
  this.logger);
15761
- await this.storage.setAccount(cachedAccount);
15797
+ await this.storage.setAccount(cachedAccount, correlationId);
15762
15798
  return cachedAccount;
15763
15799
  }
15764
15800
  /**
@@ -15769,14 +15805,14 @@ class TokenCache {
15769
15805
  * @param tenantId
15770
15806
  * @returns `IdTokenEntity`
15771
15807
  */
15772
- async loadIdToken(response, homeAccountId, environment, tenantId) {
15808
+ async loadIdToken(response, homeAccountId, environment, tenantId, correlationId) {
15773
15809
  if (!response.id_token) {
15774
15810
  this.logger.verbose("TokenCache - no id token found in response");
15775
15811
  return null;
15776
15812
  }
15777
15813
  this.logger.verbose("TokenCache - loading id token");
15778
15814
  const idTokenEntity = createIdTokenEntity(homeAccountId, environment, response.id_token, this.config.auth.clientId, tenantId);
15779
- await this.storage.setIdTokenCredential(idTokenEntity);
15815
+ await this.storage.setIdTokenCredential(idTokenEntity, correlationId);
15780
15816
  return idTokenEntity;
15781
15817
  }
15782
15818
  /**
@@ -15788,7 +15824,7 @@ class TokenCache {
15788
15824
  * @param tenantId
15789
15825
  * @returns `AccessTokenEntity`
15790
15826
  */
15791
- async loadAccessToken(request, response, homeAccountId, environment, tenantId, options) {
15827
+ async loadAccessToken(request, response, homeAccountId, environment, tenantId, options, correlationId) {
15792
15828
  if (!response.access_token) {
15793
15829
  this.logger.verbose("TokenCache - no access token found in response");
15794
15830
  return null;
@@ -15812,7 +15848,7 @@ class TokenCache {
15812
15848
  (response.ext_expires_in || response.expires_in) +
15813
15849
  new Date().getTime() / 1000;
15814
15850
  const accessTokenEntity = createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);
15815
- await this.storage.setAccessTokenCredential(accessTokenEntity);
15851
+ await this.storage.setAccessTokenCredential(accessTokenEntity, correlationId);
15816
15852
  return accessTokenEntity;
15817
15853
  }
15818
15854
  /**
@@ -15823,7 +15859,7 @@ class TokenCache {
15823
15859
  * @param environment
15824
15860
  * @returns `RefreshTokenEntity`
15825
15861
  */
15826
- async loadRefreshToken(response, homeAccountId, environment) {
15862
+ async loadRefreshToken(response, homeAccountId, environment, correlationId) {
15827
15863
  if (!response.refresh_token) {
15828
15864
  this.logger.verbose("TokenCache - no refresh token found in response");
15829
15865
  return null;
@@ -15831,7 +15867,7 @@ class TokenCache {
15831
15867
  this.logger.verbose("TokenCache - loading refresh token");
15832
15868
  const refreshTokenEntity = createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId, response.foci, undefined, // userAssertionHash
15833
15869
  response.refresh_token_expires_in);
15834
- await this.storage.setRefreshTokenCredential(refreshTokenEntity);
15870
+ await this.storage.setRefreshTokenCredential(refreshTokenEntity, correlationId);
15835
15871
  return refreshTokenEntity;
15836
15872
  }
15837
15873
  /**
@@ -16027,8 +16063,8 @@ class StandardController {
16027
16063
  this.eventHandler = new EventHandler(this.logger);
16028
16064
  // Initialize the browser storage class.
16029
16065
  this.browserStorage = this.isBrowserEnvironment
16030
- ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth), this.performanceClient)
16031
- : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
16066
+ ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, buildStaticAuthorityOptions(this.config.auth))
16067
+ : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
16032
16068
  // initialize in memory storage for native flows
16033
16069
  const nativeCacheOptions = {
16034
16070
  cacheLocation: BrowserCacheLocation.MemoryStorage,
@@ -16038,7 +16074,7 @@ class StandardController {
16038
16074
  cacheMigrationEnabled: false,
16039
16075
  claimsBasedCachingEnabled: false,
16040
16076
  };
16041
- this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, undefined, this.performanceClient);
16077
+ this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient);
16042
16078
  // Initialize the token cache
16043
16079
  this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);
16044
16080
  this.activeSilentTokenRequests = new Map();
@@ -16080,12 +16116,12 @@ class StandardController {
16080
16116
  this.eventHandler.emitEvent(EventType.INITIALIZE_END);
16081
16117
  return;
16082
16118
  }
16083
- await this.browserStorage.initialize();
16084
16119
  const initCorrelationId = request?.correlationId || this.getRequestCorrelationId();
16085
- const allowNativeBroker = this.config.system.allowNativeBroker;
16120
+ const allowPlatformBroker = this.config.system.allowPlatformBroker;
16086
16121
  const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication, initCorrelationId);
16087
16122
  this.eventHandler.emitEvent(EventType.INITIALIZE_START);
16088
- if (allowNativeBroker) {
16123
+ await invokeAsync(this.browserStorage.initialize.bind(this.browserStorage), PerformanceEvents.InitializeCache, this.logger, this.performanceClient, initCorrelationId)(initCorrelationId);
16124
+ if (allowPlatformBroker) {
16089
16125
  try {
16090
16126
  this.nativeExtensionProvider =
16091
16127
  await NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient);
@@ -16100,7 +16136,10 @@ class StandardController {
16100
16136
  }
16101
16137
  this.initialized = true;
16102
16138
  this.eventHandler.emitEvent(EventType.INITIALIZE_END);
16103
- initMeasurement.end({ allowNativeBroker, success: true });
16139
+ initMeasurement.end({
16140
+ allowPlatformBroker: allowPlatformBroker,
16141
+ success: true,
16142
+ });
16104
16143
  }
16105
16144
  // #region Redirect Flow
16106
16145
  /**
@@ -16144,7 +16183,7 @@ class StandardController {
16144
16183
  const loggedInAccounts = this.getAllAccounts();
16145
16184
  const request = this.browserStorage.getCachedNativeRequest();
16146
16185
  const useNative = request &&
16147
- NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider) &&
16186
+ NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider) &&
16148
16187
  this.nativeExtensionProvider &&
16149
16188
  !hash;
16150
16189
  const correlationId = useNative
@@ -16273,7 +16312,8 @@ class StandardController {
16273
16312
  this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Redirect, request);
16274
16313
  }
16275
16314
  let result;
16276
- if (this.nativeExtensionProvider && this.canUseNative(request)) {
16315
+ if (this.nativeExtensionProvider &&
16316
+ this.canUsePlatformBroker(request)) {
16277
16317
  const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
16278
16318
  result = nativeClient
16279
16319
  .acquireTokenRedirect(request, atrMeasurement)
@@ -16344,7 +16384,7 @@ class StandardController {
16344
16384
  this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Popup, request);
16345
16385
  }
16346
16386
  let result;
16347
- if (this.canUseNative(request)) {
16387
+ if (this.canUsePlatformBroker(request)) {
16348
16388
  result = this.acquireTokenNative({
16349
16389
  ...request,
16350
16390
  correlationId,
@@ -16461,7 +16501,7 @@ class StandardController {
16461
16501
  this.logger.verbose("ssoSilent called", correlationId);
16462
16502
  this.eventHandler.emitEvent(EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
16463
16503
  let result;
16464
- if (this.canUseNative(validRequest)) {
16504
+ if (this.canUsePlatformBroker(validRequest)) {
16465
16505
  result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
16466
16506
  // If native token acquisition fails for availability reasons fallback to standard flow
16467
16507
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
@@ -16559,7 +16599,7 @@ class StandardController {
16559
16599
  return await response;
16560
16600
  }
16561
16601
  else if (request.nativeAccountId) {
16562
- if (this.canUseNative(request, request.nativeAccountId)) {
16602
+ if (this.canUsePlatformBroker(request, request.nativeAccountId)) {
16563
16603
  const result = await this.acquireTokenNative({
16564
16604
  ...request,
16565
16605
  correlationId,
@@ -16806,7 +16846,7 @@ class StandardController {
16806
16846
  this.logger.verbose("hydrateCache called");
16807
16847
  // Account gets saved to browser storage regardless of native or not
16808
16848
  const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
16809
- await this.browserStorage.setAccount(accountEntity);
16849
+ await this.browserStorage.setAccount(accountEntity, result.correlationId);
16810
16850
  if (result.fromNativeBroker) {
16811
16851
  this.logger.verbose("Response was from native broker, storing in-memory");
16812
16852
  // Tokens from native broker are stored in-memory
@@ -16830,13 +16870,13 @@ class StandardController {
16830
16870
  return nativeClient.acquireToken(request);
16831
16871
  }
16832
16872
  /**
16833
- * Returns boolean indicating if this request can use the native broker
16873
+ * Returns boolean indicating if this request can use the platform broker
16834
16874
  * @param request
16835
16875
  */
16836
- canUseNative(request, accountId) {
16837
- this.logger.trace("canUseNative called");
16838
- if (!NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {
16839
- this.logger.trace("canUseNative: isNativeAvailable returned false, returning false");
16876
+ canUsePlatformBroker(request, accountId) {
16877
+ this.logger.trace("canUsePlatformBroker called");
16878
+ if (!NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {
16879
+ this.logger.trace("canUsePlatformBroker: isPlatformBrokerAvailable returned false, returning false");
16840
16880
  return false;
16841
16881
  }
16842
16882
  if (request.prompt) {
@@ -16844,15 +16884,15 @@ class StandardController {
16844
16884
  case PromptValue.NONE:
16845
16885
  case PromptValue.CONSENT:
16846
16886
  case PromptValue.LOGIN:
16847
- this.logger.trace("canUseNative: prompt is compatible with native flow");
16887
+ this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");
16848
16888
  break;
16849
16889
  default:
16850
- this.logger.trace(`canUseNative: prompt = ${request.prompt} is not compatible with native flow, returning false`);
16890
+ this.logger.trace(`canUsePlatformBroker: prompt = ${request.prompt} is not compatible with platform broker flow, returning false`);
16851
16891
  return false;
16852
16892
  }
16853
16893
  }
16854
16894
  if (!accountId && !this.getNativeAccountId(request)) {
16855
- this.logger.trace("canUseNative: nativeAccountId is not available, returning false");
16895
+ this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false");
16856
16896
  return false;
16857
16897
  }
16858
16898
  return true;
@@ -17293,7 +17333,7 @@ class StandardController {
17293
17333
  * @returns
17294
17334
  */
17295
17335
  async acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy) {
17296
- if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, silentRequest.authenticationScheme) &&
17336
+ if (NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider, silentRequest.authenticationScheme) &&
17297
17337
  silentRequest.account.nativeAccountId) {
17298
17338
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");
17299
17339
  return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {
@@ -17579,12 +17619,12 @@ class NestedAppAuthController {
17579
17619
  this.performanceClient = this.config.telemetry.client;
17580
17620
  // Initialize the crypto class.
17581
17621
  this.browserCrypto = operatingContext.isBrowserEnvironment()
17582
- ? new CryptoOps(this.logger, this.performanceClient)
17622
+ ? new CryptoOps(this.logger, this.performanceClient, true)
17583
17623
  : DEFAULT_CRYPTO_IMPLEMENTATION;
17584
17624
  // Initialize the browser storage class.
17585
17625
  this.browserStorage = this.operatingContext.isBrowserEnvironment()
17586
- ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth))
17587
- : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
17626
+ ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, buildStaticAuthorityOptions(this.config.auth))
17627
+ : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
17588
17628
  this.eventHandler = new EventHandler(this.logger);
17589
17629
  this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
17590
17630
  // Set the active account if available
@@ -17607,8 +17647,9 @@ class NestedAppAuthController {
17607
17647
  * Specific implementation of initialize function for NestedAppAuthController
17608
17648
  * @returns
17609
17649
  */
17610
- async initialize() {
17611
- await this.browserStorage.initialize();
17650
+ async initialize(request) {
17651
+ const initCorrelationId = request?.correlationId || createNewGuid();
17652
+ await this.browserStorage.initialize(initCorrelationId);
17612
17653
  return Promise.resolve();
17613
17654
  }
17614
17655
  /**
@@ -18034,7 +18075,7 @@ class NestedAppAuthController {
18034
18075
  async hydrateCache(result, request) {
18035
18076
  this.logger.verbose("hydrateCache called");
18036
18077
  const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
18037
- await this.browserStorage.setAccount(accountEntity);
18078
+ await this.browserStorage.setAccount(accountEntity, result.correlationId);
18038
18079
  return this.browserStorage.hydrateCache(result, request);
18039
18080
  }
18040
18081
  }
@@ -18466,8 +18507,8 @@ class UnknownOperatingContextController {
18466
18507
  : DEFAULT_CRYPTO_IMPLEMENTATION;
18467
18508
  // Initialize the browser storage class.
18468
18509
  this.browserStorage = this.isBrowserEnvironment
18469
- ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, undefined, this.performanceClient)
18470
- : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
18510
+ ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, undefined)
18511
+ : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
18471
18512
  }
18472
18513
  getBrowserStorage() {
18473
18514
  return this.browserStorage;