@azure/msal-browser 3.10.0 → 3.11.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 (148) 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/AsyncMemoryStorage.d.ts +2 -3
  7. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
  8. package/dist/cache/AsyncMemoryStorage.mjs +4 -5
  9. package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
  10. package/dist/cache/BrowserCacheManager.d.ts +8 -27
  11. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  12. package/dist/cache/BrowserCacheManager.mjs +48 -75
  13. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  14. package/dist/cache/BrowserStorage.mjs +1 -1
  15. package/dist/cache/DatabaseStorage.d.ts +1 -1
  16. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  17. package/dist/cache/DatabaseStorage.mjs +14 -4
  18. package/dist/cache/DatabaseStorage.mjs.map +1 -1
  19. package/dist/cache/{IAsyncMemoryStorage.d.ts → IAsyncStorage.d.ts} +1 -1
  20. package/dist/cache/IAsyncStorage.d.ts.map +1 -0
  21. package/dist/cache/MemoryStorage.mjs +1 -1
  22. package/dist/cache/TokenCache.mjs +1 -1
  23. package/dist/config/Configuration.mjs +1 -1
  24. package/dist/controllers/ControllerFactory.mjs +1 -1
  25. package/dist/controllers/IController.d.ts +1 -3
  26. package/dist/controllers/IController.d.ts.map +1 -1
  27. package/dist/controllers/NestedAppAuthController.d.ts +2 -3
  28. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
  29. package/dist/controllers/NestedAppAuthController.mjs +21 -19
  30. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  31. package/dist/controllers/StandardController.d.ts +5 -23
  32. package/dist/controllers/StandardController.d.ts.map +1 -1
  33. package/dist/controllers/StandardController.mjs +47 -127
  34. package/dist/controllers/StandardController.mjs.map +1 -1
  35. package/dist/controllers/UnknownOperatingContextController.d.ts +1 -2
  36. package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  37. package/dist/controllers/UnknownOperatingContextController.mjs +28 -36
  38. package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
  39. package/dist/crypto/BrowserCrypto.d.ts +5 -0
  40. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  41. package/dist/crypto/BrowserCrypto.mjs +12 -2
  42. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  43. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  44. package/dist/crypto/CryptoOps.mjs +28 -12
  45. package/dist/crypto/CryptoOps.mjs.map +1 -1
  46. package/dist/crypto/PkceGenerator.mjs +1 -1
  47. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  48. package/dist/encode/Base64Decode.mjs +1 -1
  49. package/dist/encode/Base64Encode.mjs +1 -1
  50. package/dist/error/BrowserAuthError.mjs +1 -1
  51. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  52. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  53. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  54. package/dist/error/NativeAuthError.mjs +1 -1
  55. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  56. package/dist/error/NestedAppAuthError.mjs +1 -1
  57. package/dist/event/EventHandler.mjs +1 -1
  58. package/dist/event/EventMessage.mjs +1 -1
  59. package/dist/event/EventType.mjs +1 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.mjs +2 -2
  63. package/dist/interaction_client/BaseInteractionClient.d.ts +1 -6
  64. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  65. package/dist/interaction_client/BaseInteractionClient.mjs +2 -43
  66. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  67. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  68. package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
  69. package/dist/interaction_client/PopupClient.mjs +1 -1
  70. package/dist/interaction_client/RedirectClient.mjs +1 -1
  71. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  72. package/dist/interaction_client/SilentCacheClient.d.ts +1 -9
  73. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  74. package/dist/interaction_client/SilentCacheClient.mjs +3 -22
  75. package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
  76. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  77. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  78. package/dist/interaction_client/SilentRefreshClient.mjs +3 -2
  79. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  80. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  81. package/dist/interaction_client/StandardInteractionClient.mjs +3 -2
  82. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  83. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  84. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  85. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  86. package/dist/naa/BridgeError.mjs +1 -1
  87. package/dist/naa/BridgeProxy.mjs +1 -1
  88. package/dist/naa/BridgeStatusCode.mjs +1 -1
  89. package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +3 -1
  90. package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  91. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +4 -3
  92. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  93. package/dist/navigation/NavigationClient.mjs +1 -1
  94. package/dist/network/FetchClient.mjs +1 -1
  95. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  96. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  97. package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
  98. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  99. package/dist/packageMetadata.d.ts +1 -1
  100. package/dist/packageMetadata.mjs +2 -2
  101. package/dist/request/RequestHelpers.d.ts +14 -0
  102. package/dist/request/RequestHelpers.d.ts.map +1 -0
  103. package/dist/request/RequestHelpers.mjs +61 -0
  104. package/dist/request/RequestHelpers.mjs.map +1 -0
  105. package/dist/response/ResponseHandler.mjs +1 -1
  106. package/dist/telemetry/BrowserPerformanceClient.d.ts +1 -1
  107. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  108. package/dist/telemetry/BrowserPerformanceClient.mjs +5 -5
  109. package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
  110. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  111. package/dist/utils/BrowserConstants.mjs +1 -1
  112. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  113. package/dist/utils/BrowserUtils.d.ts +14 -3
  114. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  115. package/dist/utils/BrowserUtils.mjs +37 -10
  116. package/dist/utils/BrowserUtils.mjs.map +1 -1
  117. package/lib/msal-browser.cjs +866 -584
  118. package/lib/msal-browser.cjs.map +1 -1
  119. package/lib/msal-browser.js +866 -584
  120. package/lib/msal-browser.js.map +1 -1
  121. package/lib/msal-browser.min.js +66 -66
  122. package/package.json +2 -2
  123. package/src/cache/AsyncMemoryStorage.ts +4 -6
  124. package/src/cache/BrowserCacheManager.ts +54 -90
  125. package/src/cache/DatabaseStorage.ts +14 -4
  126. package/src/controllers/IController.ts +1 -7
  127. package/src/controllers/NestedAppAuthController.ts +38 -23
  128. package/src/controllers/StandardController.ts +107 -179
  129. package/src/controllers/UnknownOperatingContextController.ts +28 -37
  130. package/src/crypto/BrowserCrypto.ts +11 -0
  131. package/src/crypto/CryptoOps.ts +31 -13
  132. package/src/index.ts +2 -0
  133. package/src/interaction_client/BaseInteractionClient.ts +0 -66
  134. package/src/interaction_client/SilentCacheClient.ts +11 -51
  135. package/src/interaction_client/SilentRefreshClient.ts +3 -2
  136. package/src/interaction_client/StandardInteractionClient.ts +8 -2
  137. package/src/naa/mapping/NestedAppAuthAdapter.ts +10 -2
  138. package/src/packageMetadata.ts +1 -1
  139. package/src/request/RequestHelpers.ts +112 -0
  140. package/src/telemetry/BrowserPerformanceClient.ts +18 -9
  141. package/src/utils/BrowserUtils.ts +50 -15
  142. package/dist/cache/CryptoKeyStore.d.ts +0 -19
  143. package/dist/cache/CryptoKeyStore.d.ts.map +0 -1
  144. package/dist/cache/CryptoKeyStore.mjs +0 -47
  145. package/dist/cache/CryptoKeyStore.mjs.map +0 -1
  146. package/dist/cache/IAsyncMemoryStorage.d.ts.map +0 -1
  147. package/src/cache/CryptoKeyStore.ts +0 -63
  148. /package/src/cache/{IAsyncMemoryStorage.ts → IAsyncStorage.ts} +0 -0
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.10.0 2024-02-17 */
1
+ /*! @azure/msal-browser v3.11.1 2024-03-27 */
2
2
  'use strict';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -6,7 +6,7 @@
6
6
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
7
7
  })(this, (function (exports) { 'use strict';
8
8
 
9
- /*! @azure/msal-common v14.7.1 2024-02-17 */
9
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
12
12
  * Licensed under the MIT License.
@@ -301,7 +301,7 @@
301
301
  Pop: "pop",
302
302
  };
303
303
 
304
- /*! @azure/msal-common v14.7.1 2024-02-17 */
304
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
305
305
  /*
306
306
  * Copyright (c) Microsoft Corporation. All rights reserved.
307
307
  * Licensed under the MIT License.
@@ -318,7 +318,7 @@
318
318
  unexpectedError: unexpectedError
319
319
  });
320
320
 
321
- /*! @azure/msal-common v14.7.1 2024-02-17 */
321
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
322
322
 
323
323
  /*
324
324
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -367,7 +367,7 @@
367
367
  : AuthErrorMessages[code]);
368
368
  }
369
369
 
370
- /*! @azure/msal-common v14.7.1 2024-02-17 */
370
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
371
371
  /*
372
372
  * Copyright (c) Microsoft Corporation. All rights reserved.
373
373
  * Licensed under the MIT License.
@@ -465,7 +465,7 @@
465
465
  userTimeoutReached: userTimeoutReached
466
466
  });
467
467
 
468
- /*! @azure/msal-common v14.7.1 2024-02-17 */
468
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
469
469
 
470
470
  /*
471
471
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -717,7 +717,7 @@
717
717
  return new ClientAuthError(errorCode, additionalMessage);
718
718
  }
719
719
 
720
- /*! @azure/msal-common v14.7.1 2024-02-17 */
720
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
721
721
 
722
722
  /*
723
723
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -750,7 +750,7 @@
750
750
  },
751
751
  };
752
752
 
753
- /*! @azure/msal-common v14.7.1 2024-02-17 */
753
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
754
754
 
755
755
  /*
756
756
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -941,12 +941,12 @@
941
941
  }
942
942
  }
943
943
 
944
- /*! @azure/msal-common v14.7.1 2024-02-17 */
944
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
945
945
  /* eslint-disable header/header */
946
946
  const name$1 = "@azure/msal-common";
947
- const version$1 = "14.7.1";
947
+ const version$1 = "14.8.1";
948
948
 
949
- /*! @azure/msal-common v14.7.1 2024-02-17 */
949
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
950
950
  /*
951
951
  * Copyright (c) Microsoft Corporation. All rights reserved.
952
952
  * Licensed under the MIT License.
@@ -966,7 +966,7 @@
966
966
  AzureUsGovernment: "https://login.microsoftonline.us",
967
967
  };
968
968
 
969
- /*! @azure/msal-common v14.7.1 2024-02-17 */
969
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
970
970
 
971
971
  /*
972
972
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1027,7 +1027,7 @@
1027
1027
  }
1028
1028
  }
1029
1029
 
1030
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1030
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1031
1031
  /*
1032
1032
  * Copyright (c) Microsoft Corporation. All rights reserved.
1033
1033
  * Licensed under the MIT License.
@@ -1064,7 +1064,7 @@
1064
1064
  return cachedAtSec > nowSeconds();
1065
1065
  }
1066
1066
 
1067
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1067
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1068
1068
 
1069
1069
  /*
1070
1070
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1391,7 +1391,7 @@
1391
1391
  return metadata.expiresAt <= nowSeconds();
1392
1392
  }
1393
1393
 
1394
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1394
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1395
1395
  /*
1396
1396
  * Copyright (c) Microsoft Corporation. All rights reserved.
1397
1397
  * Licensed under the MIT License.
@@ -1445,7 +1445,7 @@
1445
1445
  urlParseError: urlParseError
1446
1446
  });
1447
1447
 
1448
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1448
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1449
1449
 
1450
1450
  /*
1451
1451
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1583,7 +1583,7 @@
1583
1583
  return new ClientConfigurationError(errorCode);
1584
1584
  }
1585
1585
 
1586
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1586
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1587
1587
  /*
1588
1588
  * Copyright (c) Microsoft Corporation. All rights reserved.
1589
1589
  * Licensed under the MIT License.
@@ -1680,7 +1680,7 @@
1680
1680
  }
1681
1681
  }
1682
1682
 
1683
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1683
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1684
1684
 
1685
1685
  /*
1686
1686
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1880,7 +1880,7 @@
1880
1880
  }
1881
1881
  }
1882
1882
 
1883
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1883
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1884
1884
 
1885
1885
  /*
1886
1886
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1920,7 +1920,7 @@
1920
1920
  };
1921
1921
  }
1922
1922
 
1923
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1923
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1924
1924
  /*
1925
1925
  * Copyright (c) Microsoft Corporation. All rights reserved.
1926
1926
  * Licensed under the MIT License.
@@ -1982,7 +1982,7 @@
1982
1982
  return updatedAccountInfo;
1983
1983
  }
1984
1984
 
1985
- /*! @azure/msal-common v14.7.1 2024-02-17 */
1985
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
1986
1986
  /*
1987
1987
  * Copyright (c) Microsoft Corporation. All rights reserved.
1988
1988
  * Licensed under the MIT License.
@@ -1997,7 +1997,7 @@
1997
1997
  Ciam: 3,
1998
1998
  };
1999
1999
 
2000
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2000
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2001
2001
  /*
2002
2002
  * Copyright (c) Microsoft Corporation. All rights reserved.
2003
2003
  * Licensed under the MIT License.
@@ -2019,7 +2019,7 @@
2019
2019
  return null;
2020
2020
  }
2021
2021
 
2022
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2022
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2023
2023
  /*
2024
2024
  * Copyright (c) Microsoft Corporation. All rights reserved.
2025
2025
  * Licensed under the MIT License.
@@ -2032,7 +2032,7 @@
2032
2032
  OIDC: "OIDC",
2033
2033
  };
2034
2034
 
2035
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2035
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2036
2036
 
2037
2037
  /*
2038
2038
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2279,7 +2279,7 @@
2279
2279
  }
2280
2280
  }
2281
2281
 
2282
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2282
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2283
2283
 
2284
2284
  /*
2285
2285
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2326,7 +2326,7 @@
2326
2326
  return null;
2327
2327
  }
2328
2328
 
2329
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2329
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2330
2330
 
2331
2331
  /*
2332
2332
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2490,7 +2490,7 @@
2490
2490
  }
2491
2491
  }
2492
2492
 
2493
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2493
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2494
2494
 
2495
2495
  /*
2496
2496
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2630,7 +2630,7 @@
2630
2630
  return null;
2631
2631
  }
2632
2632
 
2633
- /*! @azure/msal-common v14.7.1 2024-02-17 */
2633
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
2634
2634
 
2635
2635
  /*
2636
2636
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3037,14 +3037,6 @@
3037
3037
  * @param filter
3038
3038
  */
3039
3039
  getAppMetadataFilteredBy(filter) {
3040
- return this.getAppMetadataFilteredByInternal(filter.environment, filter.clientId);
3041
- }
3042
- /**
3043
- * Support function to help match appMetadata
3044
- * @param environment
3045
- * @param clientId
3046
- */
3047
- getAppMetadataFilteredByInternal(environment, clientId) {
3048
3040
  const allCacheKeys = this.getKeys();
3049
3041
  const matchingAppMetadata = {};
3050
3042
  allCacheKeys.forEach((cacheKey) => {
@@ -3057,10 +3049,12 @@
3057
3049
  if (!entity) {
3058
3050
  return;
3059
3051
  }
3060
- if (!!environment && !this.matchEnvironment(entity, environment)) {
3052
+ if (!!filter.environment &&
3053
+ !this.matchEnvironment(entity, filter.environment)) {
3061
3054
  return;
3062
3055
  }
3063
- if (!!clientId && !this.matchClientId(entity, clientId)) {
3056
+ if (!!filter.clientId &&
3057
+ !this.matchClientId(entity, filter.clientId)) {
3064
3058
  return;
3065
3059
  }
3066
3060
  matchingAppMetadata[cacheKey] = entity;
@@ -3847,9 +3841,6 @@
3847
3841
  removeItem() {
3848
3842
  throw createClientAuthError(methodNotImplemented);
3849
3843
  }
3850
- containsKey() {
3851
- throw createClientAuthError(methodNotImplemented);
3852
- }
3853
3844
  getKeys() {
3854
3845
  throw createClientAuthError(methodNotImplemented);
3855
3846
  }
@@ -3870,7 +3861,7 @@
3870
3861
  }
3871
3862
  }
3872
3863
 
3873
- /*! @azure/msal-common v14.7.1 2024-02-17 */
3864
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
3874
3865
 
3875
3866
  /*
3876
3867
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3970,7 +3961,7 @@
3970
3961
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
3971
3962
  }
3972
3963
 
3973
- /*! @azure/msal-common v14.7.1 2024-02-17 */
3964
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
3974
3965
 
3975
3966
  /*
3976
3967
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3987,7 +3978,7 @@
3987
3978
  }
3988
3979
  }
3989
3980
 
3990
- /*! @azure/msal-common v14.7.1 2024-02-17 */
3981
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
3991
3982
 
3992
3983
  /*
3993
3984
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4085,7 +4076,7 @@
4085
4076
  }
4086
4077
  }
4087
4078
 
4088
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4079
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4089
4080
 
4090
4081
  /*
4091
4082
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4122,7 +4113,7 @@
4122
4113
  }
4123
4114
  }
4124
4115
 
4125
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4116
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4126
4117
  /*
4127
4118
  * Copyright (c) Microsoft Corporation. All rights reserved.
4128
4119
  * Licensed under the MIT License.
@@ -4132,7 +4123,7 @@
4132
4123
  UPN: "UPN",
4133
4124
  };
4134
4125
 
4135
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4126
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4136
4127
  /*
4137
4128
  * Copyright (c) Microsoft Corporation. All rights reserved.
4138
4129
  * Licensed under the MIT License.
@@ -4179,7 +4170,7 @@
4179
4170
  const LOGIN_HINT = "login_hint";
4180
4171
  const DOMAIN_HINT = "domain_hint";
4181
4172
 
4182
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4173
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4183
4174
 
4184
4175
  /*
4185
4176
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4263,7 +4254,7 @@
4263
4254
  }
4264
4255
  }
4265
4256
 
4266
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4257
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4267
4258
 
4268
4259
  /*
4269
4260
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4647,7 +4638,7 @@
4647
4638
  }
4648
4639
  }
4649
4640
 
4650
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4641
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4651
4642
  /*
4652
4643
  * Copyright (c) Microsoft Corporation. All rights reserved.
4653
4644
  * Licensed under the MIT License.
@@ -4659,7 +4650,7 @@
4659
4650
  response.hasOwnProperty("jwks_uri"));
4660
4651
  }
4661
4652
 
4662
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4653
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4663
4654
  /*
4664
4655
  * Copyright (c) Microsoft Corporation. All rights reserved.
4665
4656
  * Licensed under the MIT License.
@@ -4669,7 +4660,7 @@
4669
4660
  response.hasOwnProperty("metadata"));
4670
4661
  }
4671
4662
 
4672
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4663
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4673
4664
  /*
4674
4665
  * Copyright (c) Microsoft Corporation. All rights reserved.
4675
4666
  * Licensed under the MIT License.
@@ -4679,7 +4670,7 @@
4679
4670
  response.hasOwnProperty("error_description"));
4680
4671
  }
4681
4672
 
4682
- /*! @azure/msal-common v14.7.1 2024-02-17 */
4673
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4683
4674
  /*
4684
4675
  * Copyright (c) Microsoft Corporation. All rights reserved.
4685
4676
  * Licensed under the MIT License.
@@ -4914,6 +4905,219 @@
4914
4905
  Sha256Digest: "sha256Digest",
4915
4906
  GetRandomValues: "getRandomValues",
4916
4907
  };
4908
+ const PerformanceEventAbbreviations = new Map([
4909
+ [PerformanceEvents.AcquireTokenByCode, "ATByCode"],
4910
+ [PerformanceEvents.AcquireTokenByRefreshToken, "ATByRT"],
4911
+ [PerformanceEvents.AcquireTokenSilent, "ATS"],
4912
+ [PerformanceEvents.AcquireTokenSilentAsync, "ATSAsync"],
4913
+ [PerformanceEvents.AcquireTokenPopup, "ATPopup"],
4914
+ [PerformanceEvents.AcquireTokenRedirect, "ATRedirect"],
4915
+ [
4916
+ PerformanceEvents.CryptoOptsGetPublicKeyThumbprint,
4917
+ "CryptoGetPKThumb",
4918
+ ],
4919
+ [PerformanceEvents.CryptoOptsSignJwt, "CryptoSignJwt"],
4920
+ [PerformanceEvents.SilentCacheClientAcquireToken, "SltCacheClientAT"],
4921
+ [PerformanceEvents.SilentIframeClientAcquireToken, "SltIframeClientAT"],
4922
+ [PerformanceEvents.SilentRefreshClientAcquireToken, "SltRClientAT"],
4923
+ [PerformanceEvents.SsoSilent, "SsoSlt"],
4924
+ [
4925
+ PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority,
4926
+ "StdIntClientGetDiscAuth",
4927
+ ],
4928
+ [
4929
+ PerformanceEvents.FetchAccountIdWithNativeBroker,
4930
+ "FetchAccIdWithNtvBroker",
4931
+ ],
4932
+ [
4933
+ PerformanceEvents.NativeInteractionClientAcquireToken,
4934
+ "NtvIntClientAT",
4935
+ ],
4936
+ [
4937
+ PerformanceEvents.BaseClientCreateTokenRequestHeaders,
4938
+ "BaseClientCreateTReqHead",
4939
+ ],
4940
+ [
4941
+ PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint,
4942
+ "RTClientExecPost",
4943
+ ],
4944
+ [
4945
+ PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint,
4946
+ "AuthCodeClientExecPost",
4947
+ ],
4948
+ [PerformanceEvents.BrokerHandhshake, "BrokerHandshake"],
4949
+ [
4950
+ PerformanceEvents.AcquireTokenByRefreshTokenInBroker,
4951
+ "ATByRTInBroker",
4952
+ ],
4953
+ [PerformanceEvents.AcquireTokenByBroker, "ATByBroker"],
4954
+ [
4955
+ PerformanceEvents.RefreshTokenClientExecuteTokenRequest,
4956
+ "RTClientExecTReq",
4957
+ ],
4958
+ [PerformanceEvents.RefreshTokenClientAcquireToken, "RTClientAT"],
4959
+ [
4960
+ PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken,
4961
+ "RTClientATWithCachedRT",
4962
+ ],
4963
+ [
4964
+ PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken,
4965
+ "RTClientATByRT",
4966
+ ],
4967
+ [
4968
+ PerformanceEvents.RefreshTokenClientCreateTokenRequestBody,
4969
+ "RTClientCreateTReqBody",
4970
+ ],
4971
+ [PerformanceEvents.AcquireTokenFromCache, "ATFromCache"],
4972
+ [
4973
+ PerformanceEvents.SilentFlowClientAcquireCachedToken,
4974
+ "SltFlowClientATCached",
4975
+ ],
4976
+ [
4977
+ PerformanceEvents.SilentFlowClientGenerateResultFromCacheRecord,
4978
+ "SltFlowClientGenResFromCache",
4979
+ ],
4980
+ [PerformanceEvents.AcquireTokenBySilentIframe, "ATBySltIframe"],
4981
+ [PerformanceEvents.InitializeBaseRequest, "InitBaseReq"],
4982
+ [PerformanceEvents.InitializeSilentRequest, "InitSltReq"],
4983
+ [
4984
+ PerformanceEvents.InitializeClientApplication,
4985
+ "InitClientApplication",
4986
+ ],
4987
+ [PerformanceEvents.SilentIframeClientTokenHelper, "SIClientTHelper"],
4988
+ [
4989
+ PerformanceEvents.SilentHandlerInitiateAuthRequest,
4990
+ "SHandlerInitAuthReq",
4991
+ ],
4992
+ [
4993
+ PerformanceEvents.SilentHandlerMonitorIframeForHash,
4994
+ "SltHandlerMonitorIframeForHash",
4995
+ ],
4996
+ [PerformanceEvents.SilentHandlerLoadFrame, "SHandlerLoadFrame"],
4997
+ [PerformanceEvents.SilentHandlerLoadFrameSync, "SHandlerLoadFrameSync"],
4998
+ [
4999
+ PerformanceEvents.StandardInteractionClientCreateAuthCodeClient,
5000
+ "StdIntClientCreateAuthCodeClient",
5001
+ ],
5002
+ [
5003
+ PerformanceEvents.StandardInteractionClientGetClientConfiguration,
5004
+ "StdIntClientGetClientConf",
5005
+ ],
5006
+ [
5007
+ PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest,
5008
+ "StdIntClientInitAuthReq",
5009
+ ],
5010
+ [
5011
+ PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest,
5012
+ "StdIntClientInitAuthCodeReq",
5013
+ ],
5014
+ [PerformanceEvents.GetAuthCodeUrl, "GetAuthCodeUrl"],
5015
+ [
5016
+ PerformanceEvents.HandleCodeResponseFromServer,
5017
+ "HandleCodeResFromServer",
5018
+ ],
5019
+ [PerformanceEvents.HandleCodeResponse, "HandleCodeResp"],
5020
+ [PerformanceEvents.UpdateTokenEndpointAuthority, "UpdTEndpointAuth"],
5021
+ [PerformanceEvents.AuthClientAcquireToken, "AuthClientAT"],
5022
+ [PerformanceEvents.AuthClientExecuteTokenRequest, "AuthClientExecTReq"],
5023
+ [
5024
+ PerformanceEvents.AuthClientCreateTokenRequestBody,
5025
+ "AuthClientCreateTReqBody",
5026
+ ],
5027
+ [
5028
+ PerformanceEvents.AuthClientCreateQueryString,
5029
+ "AuthClientCreateQueryStr",
5030
+ ],
5031
+ [PerformanceEvents.PopTokenGenerateCnf, "PopTGenCnf"],
5032
+ [PerformanceEvents.PopTokenGenerateKid, "PopTGenKid"],
5033
+ [PerformanceEvents.HandleServerTokenResponse, "HandleServerTRes"],
5034
+ [PerformanceEvents.DeserializeResponse, "DeserializeRes"],
5035
+ [
5036
+ PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
5037
+ "AuthFactCreateDiscInst",
5038
+ ],
5039
+ [
5040
+ PerformanceEvents.AuthorityResolveEndpointsAsync,
5041
+ "AuthResolveEndpointsAsync",
5042
+ ],
5043
+ [
5044
+ PerformanceEvents.AuthorityResolveEndpointsFromLocalSources,
5045
+ "AuthResolveEndpointsFromLocal",
5046
+ ],
5047
+ [
5048
+ PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork,
5049
+ "AuthGetCDMetaFromNet",
5050
+ ],
5051
+ [
5052
+ PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata,
5053
+ "AuthUpdCDMeta",
5054
+ ],
5055
+ [
5056
+ PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork,
5057
+ "AuthUpdCDMetaFromNet",
5058
+ ],
5059
+ [
5060
+ PerformanceEvents.AuthorityUpdateEndpointMetadata,
5061
+ "AuthUpdEndpointMeta",
5062
+ ],
5063
+ [
5064
+ PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
5065
+ "AuthUpdMetaWithRegInfo",
5066
+ ],
5067
+ [PerformanceEvents.RegionDiscoveryDetectRegion, "RegDiscDetectReg"],
5068
+ [
5069
+ PerformanceEvents.RegionDiscoveryGetRegionFromIMDS,
5070
+ "RegDiscGetRegFromIMDS",
5071
+ ],
5072
+ [
5073
+ PerformanceEvents.RegionDiscoveryGetCurrentVersion,
5074
+ "RegDiscGetCurrentVer",
5075
+ ],
5076
+ [PerformanceEvents.AcquireTokenByCodeAsync, "ATByCodeAsync"],
5077
+ [
5078
+ PerformanceEvents.GetEndpointMetadataFromNetwork,
5079
+ "GetEndpointMetaFromNet",
5080
+ ],
5081
+ [
5082
+ PerformanceEvents.GetCloudDiscoveryMetadataFromNetworkMeasurement,
5083
+ "GetCDMetaFromNet",
5084
+ ],
5085
+ [
5086
+ PerformanceEvents.HandleRedirectPromiseMeasurement,
5087
+ "HandleRedirectPromise",
5088
+ ],
5089
+ [
5090
+ PerformanceEvents.HandleNativeRedirectPromiseMeasurement,
5091
+ "HandleNtvRedirectPromise",
5092
+ ],
5093
+ [
5094
+ PerformanceEvents.UpdateCloudDiscoveryMetadataMeasurement,
5095
+ "UpdateCDMeta",
5096
+ ],
5097
+ [
5098
+ PerformanceEvents.UsernamePasswordClientAcquireToken,
5099
+ "UserPassClientAT",
5100
+ ],
5101
+ [
5102
+ PerformanceEvents.NativeMessageHandlerHandshake,
5103
+ "NtvMsgHandlerHandshake",
5104
+ ],
5105
+ [PerformanceEvents.NativeGenerateAuthResult, "NtvGenAuthRes"],
5106
+ [PerformanceEvents.RemoveHiddenIframe, "RemoveHiddenIframe"],
5107
+ [
5108
+ PerformanceEvents.ClearTokensAndKeysWithClaims,
5109
+ "ClearTAndKeysWithClaims",
5110
+ ],
5111
+ [PerformanceEvents.CacheManagerGetRefreshToken, "CacheManagerGetRT"],
5112
+ [PerformanceEvents.GeneratePkceCodes, "GenPkceCodes"],
5113
+ [PerformanceEvents.GenerateCodeVerifier, "GenCodeVerifier"],
5114
+ [
5115
+ PerformanceEvents.GenerateCodeChallengeFromVerifier,
5116
+ "GenCodeChallengeFromVerifier",
5117
+ ],
5118
+ [PerformanceEvents.Sha256Digest, "Sha256Digest"],
5119
+ [PerformanceEvents.GetRandomValues, "GetRandomValues"],
5120
+ ]);
4917
5121
  /**
4918
5122
  * State of the performance event.
4919
5123
  *
@@ -4940,7 +5144,7 @@
4940
5144
  "multiMatchedRT",
4941
5145
  ]);
4942
5146
 
4943
- /*! @azure/msal-common v14.7.1 2024-02-17 */
5147
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
4944
5148
  /*
4945
5149
  * Copyright (c) Microsoft Corporation. All rights reserved.
4946
5150
  * Licensed under the MIT License.
@@ -4984,7 +5188,7 @@
4984
5188
  }
4985
5189
  inProgressEvent?.end({
4986
5190
  success: false,
4987
- });
5191
+ }, e);
4988
5192
  throw e;
4989
5193
  }
4990
5194
  };
@@ -5030,13 +5234,13 @@
5030
5234
  }
5031
5235
  inProgressEvent?.end({
5032
5236
  success: false,
5033
- });
5237
+ }, e);
5034
5238
  throw e;
5035
5239
  });
5036
5240
  };
5037
5241
  };
5038
5242
 
5039
- /*! @azure/msal-common v14.7.1 2024-02-17 */
5243
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
5040
5244
 
5041
5245
  /*
5042
5246
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5145,7 +5349,7 @@
5145
5349
  },
5146
5350
  };
5147
5351
 
5148
- /*! @azure/msal-common v14.7.1 2024-02-17 */
5352
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
5149
5353
 
5150
5354
  /*
5151
5355
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5980,7 +6184,7 @@
5980
6184
  };
5981
6185
  }
5982
6186
 
5983
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6187
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
5984
6188
 
5985
6189
  /*
5986
6190
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6011,7 +6215,7 @@
6011
6215
  }
6012
6216
  }
6013
6217
 
6014
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6218
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6015
6219
 
6016
6220
  /*
6017
6221
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6114,7 +6318,7 @@
6114
6318
  }
6115
6319
  }
6116
6320
 
6117
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6321
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6118
6322
  /*
6119
6323
  * Copyright (c) Microsoft Corporation. All rights reserved.
6120
6324
  * Licensed under the MIT License.
@@ -6140,7 +6344,7 @@
6140
6344
  refreshTokenExpired: refreshTokenExpired
6141
6345
  });
6142
6346
 
6143
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6347
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6144
6348
 
6145
6349
  /*
6146
6350
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6227,7 +6431,7 @@
6227
6431
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6228
6432
  }
6229
6433
 
6230
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6434
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6231
6435
  /*
6232
6436
  * Copyright (c) Microsoft Corporation. All rights reserved.
6233
6437
  * Licensed under the MIT License.
@@ -6243,7 +6447,7 @@
6243
6447
  }
6244
6448
  }
6245
6449
 
6246
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6450
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6247
6451
 
6248
6452
  /*
6249
6453
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6315,7 +6519,7 @@
6315
6519
  }
6316
6520
  }
6317
6521
 
6318
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6522
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6319
6523
 
6320
6524
  /*
6321
6525
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6400,7 +6604,7 @@
6400
6604
  }
6401
6605
  }
6402
6606
 
6403
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6607
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6404
6608
  /*
6405
6609
  * Copyright (c) Microsoft Corporation. All rights reserved.
6406
6610
  * Licensed under the MIT License.
@@ -6427,7 +6631,7 @@
6427
6631
  }
6428
6632
  }
6429
6633
 
6430
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6634
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6431
6635
 
6432
6636
  /*
6433
6637
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6780,7 +6984,7 @@
6780
6984
  return baseAccount;
6781
6985
  }
6782
6986
 
6783
- /*! @azure/msal-common v14.7.1 2024-02-17 */
6987
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
6784
6988
 
6785
6989
  /*
6786
6990
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7185,7 +7389,7 @@
7185
7389
  }
7186
7390
  }
7187
7391
 
7188
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7392
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7189
7393
 
7190
7394
  /*
7191
7395
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7392,7 +7596,7 @@
7392
7596
  }
7393
7597
  }
7394
7598
 
7395
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7599
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7396
7600
 
7397
7601
  /*
7398
7602
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7410,7 +7614,12 @@
7410
7614
  */
7411
7615
  async acquireToken(request) {
7412
7616
  try {
7413
- const [authResponse, cacheOutcome] = await this.acquireCachedToken(request);
7617
+ const [authResponse, cacheOutcome] = await this.acquireCachedToken({
7618
+ ...request,
7619
+ scopes: request.scopes?.length
7620
+ ? request.scopes
7621
+ : [...OIDC_DEFAULT_SCOPES],
7622
+ });
7414
7623
  // if the token is not expired but must be refreshed; get a new one in the background
7415
7624
  if (cacheOutcome === CacheOutcome.PROACTIVELY_REFRESHED) {
7416
7625
  this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");
@@ -7523,7 +7732,7 @@
7523
7732
  }
7524
7733
  }
7525
7734
 
7526
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7735
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7527
7736
 
7528
7737
  /*
7529
7738
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7538,7 +7747,7 @@
7538
7747
  },
7539
7748
  };
7540
7749
 
7541
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7750
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7542
7751
  /*
7543
7752
  * Copyright (c) Microsoft Corporation. All rights reserved.
7544
7753
  * Licensed under the MIT License.
@@ -7546,7 +7755,7 @@
7546
7755
  const missingKidError = "missing_kid_error";
7547
7756
  const missingAlgError = "missing_alg_error";
7548
7757
 
7549
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7758
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7550
7759
 
7551
7760
  /*
7552
7761
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7571,7 +7780,7 @@
7571
7780
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
7572
7781
  }
7573
7782
 
7574
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7783
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7575
7784
 
7576
7785
  /*
7577
7786
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7611,7 +7820,7 @@
7611
7820
  }
7612
7821
  }
7613
7822
 
7614
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7823
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7615
7824
 
7616
7825
  /*
7617
7826
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7669,7 +7878,7 @@
7669
7878
  }
7670
7879
  }
7671
7880
 
7672
- /*! @azure/msal-common v14.7.1 2024-02-17 */
7881
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7673
7882
 
7674
7883
  /*
7675
7884
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7873,7 +8082,7 @@
7873
8082
  }
7874
8083
  }
7875
8084
 
7876
- /*! @azure/msal-common v14.7.1 2024-02-17 */
8085
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7877
8086
 
7878
8087
  /*
7879
8088
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7952,12 +8161,168 @@
7952
8161
  }
7953
8162
  }
7954
8163
 
7955
- /*! @azure/msal-common v14.7.1 2024-02-17 */
8164
+ /*! @azure/msal-common v14.8.1 2024-03-27 */
7956
8165
 
7957
8166
  /*
7958
8167
  * Copyright (c) Microsoft Corporation. All rights reserved.
7959
8168
  * Licensed under the MIT License.
7960
8169
  */
8170
+ /**
8171
+ * Starts context by adding payload to the stack
8172
+ * @param event {PerformanceEvent}
8173
+ * @param abbreviations {Map<string, string>} event name abbreviations
8174
+ * @param stack {?PerformanceEventStackedContext[]} stack
8175
+ */
8176
+ function startContext(event, abbreviations, stack) {
8177
+ if (!stack) {
8178
+ return;
8179
+ }
8180
+ stack.push({
8181
+ name: abbreviations.get(event.name) || event.name,
8182
+ });
8183
+ }
8184
+ /**
8185
+ * Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
8186
+ *
8187
+ * @param event {PerformanceEvent}
8188
+ * @param abbreviations {Map<string, string>} event name abbreviations
8189
+ * @param stack {?PerformanceEventStackedContext[]} stack
8190
+ * @param error {?unknown} error
8191
+ */
8192
+ function endContext(event, abbreviations, stack, error) {
8193
+ if (!stack?.length) {
8194
+ return;
8195
+ }
8196
+ const peek = (stack) => {
8197
+ return stack.length ? stack[stack.length - 1] : undefined;
8198
+ };
8199
+ const abbrEventName = abbreviations.get(event.name) || event.name;
8200
+ const top = peek(stack);
8201
+ if (top?.name !== abbrEventName) {
8202
+ return;
8203
+ }
8204
+ const current = stack?.pop();
8205
+ if (!current) {
8206
+ return;
8207
+ }
8208
+ const errorCode = error instanceof AuthError
8209
+ ? error.errorCode
8210
+ : error instanceof Error
8211
+ ? error.name
8212
+ : undefined;
8213
+ const subErr = error instanceof AuthError ? error.subError : undefined;
8214
+ if (errorCode && current.childErr !== errorCode) {
8215
+ current.err = errorCode;
8216
+ if (subErr) {
8217
+ current.subErr = subErr;
8218
+ }
8219
+ }
8220
+ delete current.name;
8221
+ delete current.childErr;
8222
+ const context = {
8223
+ ...current,
8224
+ dur: event.durationMs,
8225
+ };
8226
+ if (!event.success) {
8227
+ context.fail = 1;
8228
+ }
8229
+ const parent = peek(stack);
8230
+ if (!parent) {
8231
+ return { [abbrEventName]: context };
8232
+ }
8233
+ if (errorCode) {
8234
+ parent.childErr = errorCode;
8235
+ }
8236
+ let childName;
8237
+ if (!parent[abbrEventName]) {
8238
+ childName = abbrEventName;
8239
+ }
8240
+ else {
8241
+ const siblings = Object.keys(parent).filter((key) => key.startsWith(abbrEventName)).length;
8242
+ childName = `${abbrEventName}_${siblings + 1}`;
8243
+ }
8244
+ parent[childName] = context;
8245
+ return parent;
8246
+ }
8247
+ /**
8248
+ * Adds error name and stack trace to the telemetry event
8249
+ * @param error {Error}
8250
+ * @param logger {Logger}
8251
+ * @param event {PerformanceEvent}
8252
+ * @param stackMaxSize {number} max error stack size to capture
8253
+ */
8254
+ function addError(error, logger, event, stackMaxSize = 5) {
8255
+ if (!(error instanceof Error)) {
8256
+ logger.trace("PerformanceClient.addErrorStack: Input error is not instance of Error", event.correlationId);
8257
+ return;
8258
+ }
8259
+ else if (error instanceof AuthError) {
8260
+ event.errorCode = error.errorCode;
8261
+ event.subErrorCode = error.subError;
8262
+ return;
8263
+ }
8264
+ else if (event.errorStack?.length) {
8265
+ logger.trace("PerformanceClient.addErrorStack: Stack already exist", event.correlationId);
8266
+ return;
8267
+ }
8268
+ else if (!error.stack?.length) {
8269
+ logger.trace("PerformanceClient.addErrorStack: Input stack is empty", event.correlationId);
8270
+ return;
8271
+ }
8272
+ if (error.stack) {
8273
+ event.errorStack = compactStack(error.stack, stackMaxSize);
8274
+ }
8275
+ event.errorName = error.name;
8276
+ }
8277
+ /**
8278
+ * Compacts error stack into array by fetching N first entries
8279
+ * @param stack {string} error stack
8280
+ * @param stackMaxSize {number} max error stack size to capture
8281
+ * @returns {string[]}
8282
+ */
8283
+ function compactStack(stack, stackMaxSize) {
8284
+ if (stackMaxSize < 0) {
8285
+ return [];
8286
+ }
8287
+ const stackArr = stack.split("\n") || [];
8288
+ if (stackArr.length < 2) {
8289
+ return [];
8290
+ }
8291
+ const res = [];
8292
+ // Get top N stack lines
8293
+ for (
8294
+ // Skip first line as it may contain PII data
8295
+ let ix = Math.max(stackArr.length - stackMaxSize - 1, 1); ix < stackArr.length; ix++) {
8296
+ const line = stackArr[ix];
8297
+ if (res.length >= stackMaxSize) {
8298
+ break;
8299
+ }
8300
+ res.push(compactStackLine(line));
8301
+ }
8302
+ return res;
8303
+ }
8304
+ /**
8305
+ * Compacts error stack line by shortening file path
8306
+ * Example: https://localhost/msal-common/src/authority/Authority.js:100:1 -> Authority.js:100:1
8307
+ * @param line {string} stack line
8308
+ * @returns {string}
8309
+ */
8310
+ function compactStackLine(line) {
8311
+ const filePathIx = line.lastIndexOf(" ") + 1;
8312
+ if (filePathIx < 1) {
8313
+ return line;
8314
+ }
8315
+ const filePath = line.substring(filePathIx);
8316
+ let fileNameIx = filePath.lastIndexOf("/");
8317
+ fileNameIx = fileNameIx < 0 ? filePath.lastIndexOf("\\") : fileNameIx;
8318
+ if (fileNameIx >= 0) {
8319
+ return (line.substring(0, filePathIx) +
8320
+ "(" +
8321
+ filePath.substring(fileNameIx + 1) +
8322
+ (filePath.charAt(filePath.length - 1) === ")" ? "" : ")")).trimStart();
8323
+ }
8324
+ return line.trimStart();
8325
+ }
7961
8326
  class PerformanceClient {
7962
8327
  /**
7963
8328
  * Creates an instance of PerformanceClient,
@@ -7971,8 +8336,9 @@
7971
8336
  * @param {string} libraryVersion Version of the library
7972
8337
  * @param {ApplicationTelemetry} applicationTelemetry application name and version
7973
8338
  * @param {Set<String>} intFields integer fields to be truncated
8339
+ * @param {Map<string, string>} abbreviations event name abbreviations
7974
8340
  */
7975
- constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, intFields) {
8341
+ constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, intFields, abbreviations) {
7976
8342
  this.authority = authority;
7977
8343
  this.libraryName = libraryName;
7978
8344
  this.libraryVersion = libraryVersion;
@@ -7981,12 +8347,17 @@
7981
8347
  this.logger = logger;
7982
8348
  this.callbacks = new Map();
7983
8349
  this.eventsByCorrelationId = new Map();
8350
+ this.eventStack = new Map();
7984
8351
  this.queueMeasurements = new Map();
7985
8352
  this.preQueueTimeByCorrelationId = new Map();
7986
8353
  this.intFields = intFields || new Set();
7987
8354
  for (const item of IntFields) {
7988
8355
  this.intFields.add(item);
7989
8356
  }
8357
+ this.abbreviations = abbreviations || new Map();
8358
+ for (const [key, value] of PerformanceEventAbbreviations) {
8359
+ this.abbreviations.set(key, value);
8360
+ }
7990
8361
  }
7991
8362
  /**
7992
8363
  * Starts and returns an platform-specific implementation of IPerformanceMeasurement.
@@ -8116,15 +8487,16 @@
8116
8487
  };
8117
8488
  // Store in progress events so they can be discarded if not ended properly
8118
8489
  this.cacheEventByCorrelationId(inProgressEvent);
8490
+ startContext(inProgressEvent, this.abbreviations, this.eventStack.get(eventCorrelationId));
8119
8491
  // Return the event and functions the caller can use to properly end/flush the measurement
8120
8492
  return {
8121
- end: (event) => {
8493
+ end: (event, error) => {
8122
8494
  return this.endMeasurement({
8123
8495
  // Initial set of event properties
8124
8496
  ...inProgressEvent,
8125
8497
  // Properties set when event ends
8126
8498
  ...event,
8127
- });
8499
+ }, error);
8128
8500
  },
8129
8501
  discard: () => {
8130
8502
  return this.discardMeasurements(inProgressEvent.correlationId);
@@ -8146,10 +8518,10 @@
8146
8518
  * otherwise.
8147
8519
  *
8148
8520
  * @param {PerformanceEvent} event
8149
- * @param {IPerformanceMeasurement} measurement
8521
+ * @param {unknown} error
8150
8522
  * @returns {(PerformanceEvent | null)}
8151
8523
  */
8152
- endMeasurement(event) {
8524
+ endMeasurement(event, error) {
8153
8525
  const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
8154
8526
  if (!rootEvent) {
8155
8527
  this.logger.trace(`PerformanceClient: Measurement not found for ${event.eventId}`, event.correlationId);
@@ -8161,6 +8533,8 @@
8161
8533
  totalQueueCount: 0,
8162
8534
  manuallyCompletedCount: 0,
8163
8535
  };
8536
+ event.durationMs = Math.round(event.durationMs || this.getDurationMs(event.startTimeMs));
8537
+ const context = JSON.stringify(endContext(event, this.abbreviations, this.eventStack.get(rootEvent.correlationId), error));
8164
8538
  if (isRoot) {
8165
8539
  queueInfo = this.getQueueInfo(event.correlationId);
8166
8540
  this.discardCache(rootEvent.correlationId);
@@ -8168,13 +8542,15 @@
8168
8542
  else {
8169
8543
  rootEvent.incompleteSubMeasurements?.delete(event.eventId);
8170
8544
  }
8171
- const durationMs = event.durationMs || this.getDurationMs(event.startTimeMs);
8172
- this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${durationMs} ms`, event.correlationId);
8545
+ this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`, event.correlationId);
8173
8546
  // Add sub-measurement attribute to root event.
8174
8547
  if (!isRoot) {
8175
- rootEvent[event.name + "DurationMs"] = Math.floor(durationMs);
8548
+ rootEvent[event.name + "DurationMs"] = Math.floor(event.durationMs);
8176
8549
  return { ...rootEvent };
8177
8550
  }
8551
+ if (error) {
8552
+ addError(error, this.logger, rootEvent);
8553
+ }
8178
8554
  let finalEvent = { ...rootEvent, ...event };
8179
8555
  let incompleteSubsCount = 0;
8180
8556
  // Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.
@@ -8185,12 +8561,12 @@
8185
8561
  finalEvent.incompleteSubMeasurements = undefined;
8186
8562
  finalEvent = {
8187
8563
  ...finalEvent,
8188
- durationMs: Math.round(durationMs),
8189
8564
  queuedTimeMs: queueInfo.totalQueueTime,
8190
8565
  queuedCount: queueInfo.totalQueueCount,
8191
8566
  queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount,
8192
8567
  status: PerformanceEventStatus.Completed,
8193
8568
  incompleteSubsCount,
8569
+ context,
8194
8570
  };
8195
8571
  this.truncateIntegralFields(finalEvent);
8196
8572
  this.emitEvents([finalEvent], event.correlationId);
@@ -8260,6 +8636,7 @@
8260
8636
  else {
8261
8637
  this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} started`, event.correlationId);
8262
8638
  this.eventsByCorrelationId.set(event.correlationId, { ...event });
8639
+ this.eventStack.set(event.correlationId, []);
8263
8640
  }
8264
8641
  }
8265
8642
  getQueueInfo(correlationId) {
@@ -8301,6 +8678,8 @@
8301
8678
  this.queueMeasurements.delete(correlationId);
8302
8679
  this.logger.trace("PerformanceClient: Pre-queue times discarded", correlationId);
8303
8680
  this.preQueueTimeByCorrelationId.delete(correlationId);
8681
+ this.logger.trace("PerformanceClient: Event stack discarded", correlationId);
8682
+ this.eventStack.delete(correlationId);
8304
8683
  }
8305
8684
  /**
8306
8685
  * Registers a callback function to receive performance events.
@@ -8346,7 +8725,6 @@
8346
8725
  /**
8347
8726
  * Enforce truncation of integral fields in performance event.
8348
8727
  * @param {PerformanceEvent} event performance event to update.
8349
- * @param {Set<string>} intFields integral fields.
8350
8728
  */
8351
8729
  truncateIntegralFields(event) {
8352
8730
  this.intFields.forEach((key) => {
@@ -8938,6 +9316,50 @@
8938
9316
  const LOG_PII_CACHE_KEY = "msal.browser.log.pii";
8939
9317
  const BROWSER_PERF_ENABLED_KEY = "msal.browser.performance.enabled";
8940
9318
 
9319
+ /*
9320
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9321
+ * Licensed under the MIT License.
9322
+ */
9323
+ /**
9324
+ * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
9325
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
9326
+ */
9327
+ /**
9328
+ * Returns URL Safe b64 encoded string from a plaintext string.
9329
+ * @param input
9330
+ */
9331
+ function urlEncode(input) {
9332
+ return encodeURIComponent(base64Encode(input)
9333
+ .replace(/=/g, "")
9334
+ .replace(/\+/g, "-")
9335
+ .replace(/\//g, "_"));
9336
+ }
9337
+ /**
9338
+ * Returns URL Safe b64 encoded string from an int8Array.
9339
+ * @param inputArr
9340
+ */
9341
+ function urlEncodeArr(inputArr) {
9342
+ return base64EncArr(inputArr)
9343
+ .replace(/=/g, "")
9344
+ .replace(/\+/g, "-")
9345
+ .replace(/\//g, "_");
9346
+ }
9347
+ /**
9348
+ * Returns b64 encoded string from plaintext string.
9349
+ * @param input
9350
+ */
9351
+ function base64Encode(input) {
9352
+ return base64EncArr(new TextEncoder().encode(input));
9353
+ }
9354
+ /**
9355
+ * Base64 encode byte array
9356
+ * @param aBytes
9357
+ */
9358
+ function base64EncArr(aBytes) {
9359
+ const binString = Array.from(aBytes, (x) => String.fromCodePoint(x)).join("");
9360
+ return btoa(binString);
9361
+ }
9362
+
8941
9363
  /*
8942
9364
  * Copyright (c) Microsoft Corporation. All rights reserved.
8943
9365
  * Licensed under the MIT License.
@@ -9080,6 +9502,71 @@
9080
9502
  async function sign(key, data) {
9081
9503
  return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
9082
9504
  }
9505
+ /**
9506
+ * Returns the SHA-256 hash of an input string
9507
+ * @param plainText
9508
+ */
9509
+ async function hashString(plainText) {
9510
+ const hashBuffer = await sha256Digest(plainText);
9511
+ const hashBytes = new Uint8Array(hashBuffer);
9512
+ return urlEncodeArr(hashBytes);
9513
+ }
9514
+
9515
+ /*
9516
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9517
+ * Licensed under the MIT License.
9518
+ */
9519
+ const storageNotSupported = "storage_not_supported";
9520
+ const stubbedPublicClientApplicationCalled = "stubbed_public_client_application_called";
9521
+ const inMemRedirectUnavailable = "in_mem_redirect_unavailable";
9522
+
9523
+ var BrowserConfigurationAuthErrorCodes = /*#__PURE__*/Object.freeze({
9524
+ __proto__: null,
9525
+ inMemRedirectUnavailable: inMemRedirectUnavailable,
9526
+ storageNotSupported: storageNotSupported,
9527
+ stubbedPublicClientApplicationCalled: stubbedPublicClientApplicationCalled
9528
+ });
9529
+
9530
+ /*
9531
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9532
+ * Licensed under the MIT License.
9533
+ */
9534
+ const BrowserConfigurationAuthErrorMessages = {
9535
+ [storageNotSupported]: "Given storage configuration option was not supported.",
9536
+ [stubbedPublicClientApplicationCalled]: "Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",
9537
+ [inMemRedirectUnavailable]: "Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true.",
9538
+ };
9539
+ /**
9540
+ * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
9541
+ * @deprecated Use BrowserAuthErrorCodes instead
9542
+ */
9543
+ const BrowserConfigurationAuthErrorMessage = {
9544
+ storageNotSupportedError: {
9545
+ code: storageNotSupported,
9546
+ desc: BrowserConfigurationAuthErrorMessages[storageNotSupported],
9547
+ },
9548
+ stubPcaInstanceCalled: {
9549
+ code: stubbedPublicClientApplicationCalled,
9550
+ desc: BrowserConfigurationAuthErrorMessages[stubbedPublicClientApplicationCalled],
9551
+ },
9552
+ inMemRedirectUnavailable: {
9553
+ code: inMemRedirectUnavailable,
9554
+ desc: BrowserConfigurationAuthErrorMessages[inMemRedirectUnavailable],
9555
+ },
9556
+ };
9557
+ /**
9558
+ * Browser library error class thrown by the MSAL.js library for SPAs
9559
+ */
9560
+ class BrowserConfigurationAuthError extends AuthError {
9561
+ constructor(errorCode, errorMessage) {
9562
+ super(errorCode, errorMessage);
9563
+ this.name = "BrowserConfigurationAuthError";
9564
+ Object.setPrototypeOf(this, BrowserConfigurationAuthError.prototype);
9565
+ }
9566
+ }
9567
+ function createBrowserConfigurationAuthError(errorCode) {
9568
+ return new BrowserConfigurationAuthError(errorCode, BrowserConfigurationAuthErrorMessages[errorCode]);
9569
+ }
9083
9570
 
9084
9571
  /*
9085
9572
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9151,11 +9638,8 @@
9151
9638
  * @param interactionType Interaction type for the request
9152
9639
  * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe
9153
9640
  */
9154
- function blockRedirectInIframe(interactionType, allowRedirectInIframe) {
9155
- const isIframedApp = isInIframe();
9156
- if (interactionType === exports.InteractionType.Redirect &&
9157
- isIframedApp &&
9158
- !allowRedirectInIframe) {
9641
+ function blockRedirectInIframe(allowRedirectInIframe) {
9642
+ if (isInIframe() && !allowRedirectInIframe) {
9159
9643
  // If we are not in top frame, we shouldn't redirect. This is also handled by the service.
9160
9644
  throw createBrowserAuthError(redirectInIframe);
9161
9645
  }
@@ -9173,8 +9657,8 @@
9173
9657
  * Throws error if token requests are made in non-browser environment
9174
9658
  * @param isBrowserEnvironment Flag indicating if environment is a browser.
9175
9659
  */
9176
- function blockNonBrowserEnvironment(isBrowserEnvironment) {
9177
- if (!isBrowserEnvironment) {
9660
+ function blockNonBrowserEnvironment() {
9661
+ if (typeof window === "undefined") {
9178
9662
  throw createBrowserAuthError(nonBrowserEnvironment);
9179
9663
  }
9180
9664
  }
@@ -9187,6 +9671,34 @@
9187
9671
  throw createBrowserAuthError(uninitializedPublicClientApplication);
9188
9672
  }
9189
9673
  }
9674
+ /**
9675
+ * Helper to validate app environment before making an auth request
9676
+ * @param initialized
9677
+ */
9678
+ function preflightCheck(initialized) {
9679
+ // Block request if not in browser environment
9680
+ blockNonBrowserEnvironment();
9681
+ // Block auth requests inside a hidden iframe
9682
+ blockReloadInHiddenIframes();
9683
+ // Block redirectUri opened in a popup from calling MSAL APIs
9684
+ blockAcquireTokenInPopups();
9685
+ // Block token acquisition before initialize has been called
9686
+ blockAPICallsBeforeInitialize(initialized);
9687
+ }
9688
+ /**
9689
+ * Helper to validate app enviornment before making redirect request
9690
+ * @param initialized
9691
+ * @param config
9692
+ */
9693
+ function redirectPreflightCheck(initialized, config) {
9694
+ preflightCheck(initialized);
9695
+ blockRedirectInIframe(config.system.allowRedirectInIframe);
9696
+ // Block redirects if memory storage is enabled but storeAuthStateInCookie is not
9697
+ if (config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&
9698
+ !config.cache.storeAuthStateInCookie) {
9699
+ throw createBrowserConfigurationAuthError(inMemRedirectUnavailable);
9700
+ }
9701
+ }
9190
9702
  /**
9191
9703
  * Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request
9192
9704
  * @param loginDomain Authority domain, including https protocol e.g. https://login.microsoftonline.com
@@ -9228,6 +9740,8 @@
9228
9740
  isInIframe: isInIframe,
9229
9741
  isInPopup: isInPopup,
9230
9742
  preconnect: preconnect,
9743
+ preflightCheck: preflightCheck,
9744
+ redirectPreflightCheck: redirectPreflightCheck,
9231
9745
  replaceHash: replaceHash
9232
9746
  });
9233
9747
 
@@ -9503,7 +10017,7 @@
9503
10017
 
9504
10018
  /* eslint-disable header/header */
9505
10019
  const name = "@azure/msal-browser";
9506
- const version = "3.10.0";
10020
+ const version = "3.11.1";
9507
10021
 
9508
10022
  /*
9509
10023
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9929,50 +10443,6 @@
9929
10443
  }
9930
10444
  }
9931
10445
 
9932
- /*
9933
- * Copyright (c) Microsoft Corporation. All rights reserved.
9934
- * Licensed under the MIT License.
9935
- */
9936
- /**
9937
- * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
9938
- * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
9939
- */
9940
- /**
9941
- * Returns URL Safe b64 encoded string from a plaintext string.
9942
- * @param input
9943
- */
9944
- function urlEncode(input) {
9945
- return encodeURIComponent(base64Encode(input)
9946
- .replace(/=/g, "")
9947
- .replace(/\+/g, "-")
9948
- .replace(/\//g, "_"));
9949
- }
9950
- /**
9951
- * Returns URL Safe b64 encoded string from an int8Array.
9952
- * @param inputArr
9953
- */
9954
- function urlEncodeArr(inputArr) {
9955
- return base64EncArr(inputArr)
9956
- .replace(/=/g, "")
9957
- .replace(/\+/g, "-")
9958
- .replace(/\//g, "_");
9959
- }
9960
- /**
9961
- * Returns b64 encoded string from plaintext string.
9962
- * @param input
9963
- */
9964
- function base64Encode(input) {
9965
- return base64EncArr(new TextEncoder().encode(input));
9966
- }
9967
- /**
9968
- * Base64 encode byte array
9969
- * @param aBytes
9970
- */
9971
- function base64EncArr(aBytes) {
9972
- const binString = Array.from(aBytes, (x) => String.fromCodePoint(x)).join("");
9973
- return btoa(binString);
9974
- }
9975
-
9976
10446
  /*
9977
10447
  * Copyright (c) Microsoft Corporation. All rights reserved.
9978
10448
  * Licensed under the MIT License.
@@ -10194,9 +10664,19 @@
10194
10664
  }
10195
10665
  return new Promise((resolve, reject) => {
10196
10666
  const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
10197
- deleteDbRequest.addEventListener("success", () => resolve(true));
10198
- deleteDbRequest.addEventListener("blocked", () => resolve(true));
10199
- deleteDbRequest.addEventListener("error", () => reject(false));
10667
+ const id = setTimeout(() => reject(false), 200); // Reject if events aren't raised within 200ms
10668
+ deleteDbRequest.addEventListener("success", () => {
10669
+ clearTimeout(id);
10670
+ return resolve(true);
10671
+ });
10672
+ deleteDbRequest.addEventListener("blocked", () => {
10673
+ clearTimeout(id);
10674
+ return resolve(true);
10675
+ });
10676
+ deleteDbRequest.addEventListener("error", () => {
10677
+ clearTimeout(id);
10678
+ return reject(false);
10679
+ });
10200
10680
  });
10201
10681
  }
10202
10682
  }
@@ -10242,11 +10722,10 @@
10242
10722
  * backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.
10243
10723
  */
10244
10724
  class AsyncMemoryStorage {
10245
- constructor(logger, storeName) {
10725
+ constructor(logger) {
10246
10726
  this.inMemoryCache = new MemoryStorage();
10247
10727
  this.indexedDBCache = new DatabaseStorage();
10248
10728
  this.logger = logger;
10249
- this.storeName = storeName;
10250
10729
  }
10251
10730
  handleDatabaseAccessError(error) {
10252
10731
  if (error instanceof BrowserAuthError &&
@@ -10342,66 +10821,25 @@
10342
10821
  */
10343
10822
  clearInMemory() {
10344
10823
  // InMemory cache is a Map instance, clear is straightforward
10345
- this.logger.verbose(`Deleting in-memory keystore ${this.storeName}`);
10824
+ this.logger.verbose(`Deleting in-memory keystore`);
10346
10825
  this.inMemoryCache.clear();
10347
- this.logger.verbose(`In-memory keystore ${this.storeName} deleted`);
10348
- }
10349
- /**
10350
- * Tries to delete the IndexedDB database
10351
- * @returns
10352
- */
10353
- async clearPersistent() {
10354
- try {
10355
- this.logger.verbose("Deleting persistent keystore");
10356
- const dbDeleted = await this.indexedDBCache.deleteDatabase();
10357
- if (dbDeleted) {
10358
- this.logger.verbose("Persistent keystore deleted");
10359
- }
10360
- return dbDeleted;
10361
- }
10362
- catch (e) {
10363
- this.handleDatabaseAccessError(e);
10364
- return false;
10365
- }
10366
- }
10367
- }
10368
-
10369
- /*
10370
- * Copyright (c) Microsoft Corporation. All rights reserved.
10371
- * Licensed under the MIT License.
10372
- */
10373
- const CryptoKeyStoreNames = {
10374
- asymmetricKeys: "asymmetricKeys",
10375
- symmetricKeys: "symmetricKeys",
10376
- };
10377
- /**
10378
- * MSAL CryptoKeyStore DB Version 2
10379
- */
10380
- class CryptoKeyStore {
10381
- constructor(logger) {
10382
- this.logger = logger;
10383
- this.asymmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.asymmetricKeys);
10384
- this.symmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.symmetricKeys);
10385
- }
10386
- async clear() {
10387
- // Delete in-memory keystores
10388
- this.asymmetricKeys.clearInMemory();
10389
- this.symmetricKeys.clearInMemory();
10390
- /**
10391
- * There is only one database, so calling clearPersistent on asymmetric keystore takes care of
10392
- * every persistent keystore
10393
- */
10826
+ this.logger.verbose(`In-memory keystore deleted`);
10827
+ }
10828
+ /**
10829
+ * Tries to delete the IndexedDB database
10830
+ * @returns
10831
+ */
10832
+ async clearPersistent() {
10394
10833
  try {
10395
- await this.asymmetricKeys.clearPersistent();
10396
- return true;
10834
+ this.logger.verbose("Deleting persistent keystore");
10835
+ const dbDeleted = await this.indexedDBCache.deleteDatabase();
10836
+ if (dbDeleted) {
10837
+ this.logger.verbose("Persistent keystore deleted");
10838
+ }
10839
+ return dbDeleted;
10397
10840
  }
10398
10841
  catch (e) {
10399
- if (e instanceof Error) {
10400
- this.logger.error(`Clearing keystore failed with error: ${e.message}`);
10401
- }
10402
- else {
10403
- this.logger.error("Clearing keystore failed with unknown error");
10404
- }
10842
+ this.handleDatabaseAccessError(e);
10405
10843
  return false;
10406
10844
  }
10407
10845
  }
@@ -10420,7 +10858,7 @@
10420
10858
  this.logger = logger;
10421
10859
  // Browser crypto needs to be validated first before any other classes can be set.
10422
10860
  validateCryptoAvailable(logger);
10423
- this.cache = new CryptoKeyStore(this.logger);
10861
+ this.cache = new AsyncMemoryStorage(this.logger);
10424
10862
  this.performanceClient = performanceClient;
10425
10863
  }
10426
10864
  /**
@@ -10466,7 +10904,7 @@
10466
10904
  // Re-import private key to make it unextractable
10467
10905
  const unextractablePrivateKey = await importJwk(privateKeyJwk, false, ["sign"]);
10468
10906
  // Store Keypair data in keystore
10469
- await this.cache.asymmetricKeys.setItem(publicJwkHash, {
10907
+ await this.cache.setItem(publicJwkHash, {
10470
10908
  privateKey: unextractablePrivateKey,
10471
10909
  publicKey: keyPair.publicKey,
10472
10910
  requestMethod: request.resourceRequestMethod,
@@ -10484,15 +10922,33 @@
10484
10922
  * @param kid
10485
10923
  */
10486
10924
  async removeTokenBindingKey(kid) {
10487
- await this.cache.asymmetricKeys.removeItem(kid);
10488
- const keyFound = await this.cache.asymmetricKeys.containsKey(kid);
10925
+ await this.cache.removeItem(kid);
10926
+ const keyFound = await this.cache.containsKey(kid);
10489
10927
  return !keyFound;
10490
10928
  }
10491
10929
  /**
10492
10930
  * Removes all cryptographic keys from IndexedDB storage
10493
10931
  */
10494
10932
  async clearKeystore() {
10495
- return this.cache.clear();
10933
+ // Delete in-memory keystores
10934
+ this.cache.clearInMemory();
10935
+ /**
10936
+ * There is only one database, so calling clearPersistent on asymmetric keystore takes care of
10937
+ * every persistent keystore
10938
+ */
10939
+ try {
10940
+ await this.cache.clearPersistent();
10941
+ return true;
10942
+ }
10943
+ catch (e) {
10944
+ if (e instanceof Error) {
10945
+ this.logger.error(`Clearing keystore failed with error: ${e.message}`);
10946
+ }
10947
+ else {
10948
+ this.logger.error("Clearing keystore failed with unknown error");
10949
+ }
10950
+ return false;
10951
+ }
10496
10952
  }
10497
10953
  /**
10498
10954
  * Signs the given object as a jwt payload with private key retrieved by given kid.
@@ -10501,7 +10957,7 @@
10501
10957
  */
10502
10958
  async signJwt(payload, kid, shrOptions, correlationId) {
10503
10959
  const signJwtMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);
10504
- const cachedKeyPair = await this.cache.asymmetricKeys.getItem(kid);
10960
+ const cachedKeyPair = await this.cache.getItem(kid);
10505
10961
  if (!cachedKeyPair) {
10506
10962
  throw createBrowserAuthError(cryptoKeyNotFound);
10507
10963
  }
@@ -10542,9 +10998,7 @@
10542
10998
  * @param plainText
10543
10999
  */
10544
11000
  async hashString(plainText) {
10545
- const hashBuffer = await sha256Digest(plainText);
10546
- const hashBytes = new Uint8Array(hashBuffer);
10547
- return urlEncodeArr(hashBytes);
11001
+ return hashString(plainText);
10548
11002
  }
10549
11003
  }
10550
11004
  CryptoOps.POP_KEY_USAGES = ["sign", "verify"];
@@ -10553,62 +11007,6 @@
10553
11007
  return JSON.stringify(obj, Object.keys(obj).sort());
10554
11008
  }
10555
11009
 
10556
- /*
10557
- * Copyright (c) Microsoft Corporation. All rights reserved.
10558
- * Licensed under the MIT License.
10559
- */
10560
- const storageNotSupported = "storage_not_supported";
10561
- const stubbedPublicClientApplicationCalled = "stubbed_public_client_application_called";
10562
- const inMemRedirectUnavailable = "in_mem_redirect_unavailable";
10563
-
10564
- var BrowserConfigurationAuthErrorCodes = /*#__PURE__*/Object.freeze({
10565
- __proto__: null,
10566
- inMemRedirectUnavailable: inMemRedirectUnavailable,
10567
- storageNotSupported: storageNotSupported,
10568
- stubbedPublicClientApplicationCalled: stubbedPublicClientApplicationCalled
10569
- });
10570
-
10571
- /*
10572
- * Copyright (c) Microsoft Corporation. All rights reserved.
10573
- * Licensed under the MIT License.
10574
- */
10575
- const BrowserConfigurationAuthErrorMessages = {
10576
- [storageNotSupported]: "Given storage configuration option was not supported.",
10577
- [stubbedPublicClientApplicationCalled]: "Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",
10578
- [inMemRedirectUnavailable]: "Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true.",
10579
- };
10580
- /**
10581
- * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
10582
- * @deprecated Use BrowserAuthErrorCodes instead
10583
- */
10584
- const BrowserConfigurationAuthErrorMessage = {
10585
- storageNotSupportedError: {
10586
- code: storageNotSupported,
10587
- desc: BrowserConfigurationAuthErrorMessages[storageNotSupported],
10588
- },
10589
- stubPcaInstanceCalled: {
10590
- code: stubbedPublicClientApplicationCalled,
10591
- desc: BrowserConfigurationAuthErrorMessages[stubbedPublicClientApplicationCalled],
10592
- },
10593
- inMemRedirectUnavailable: {
10594
- code: inMemRedirectUnavailable,
10595
- desc: BrowserConfigurationAuthErrorMessages[inMemRedirectUnavailable],
10596
- },
10597
- };
10598
- /**
10599
- * Browser library error class thrown by the MSAL.js library for SPAs
10600
- */
10601
- class BrowserConfigurationAuthError extends AuthError {
10602
- constructor(errorCode, errorMessage) {
10603
- super(errorCode, errorMessage);
10604
- this.name = "BrowserConfigurationAuthError";
10605
- Object.setPrototypeOf(this, BrowserConfigurationAuthError.prototype);
10606
- }
10607
- }
10608
- function createBrowserConfigurationAuthError(errorCode) {
10609
- return new BrowserConfigurationAuthError(errorCode, BrowserConfigurationAuthErrorMessages[errorCode]);
10610
- }
10611
-
10612
11010
  /*
10613
11011
  * Copyright (c) Microsoft Corporation. All rights reserved.
10614
11012
  * Licensed under the MIT License.
@@ -10757,18 +11155,12 @@
10757
11155
  PersistentCacheKeys.ERROR,
10758
11156
  PersistentCacheKeys.ERROR_DESC,
10759
11157
  ];
10760
- keysToMigrate.forEach((cacheKey, index) => this.migrateCacheEntry(cacheKey, values[index]));
10761
- }
10762
- /**
10763
- * Utility function to help with migration.
10764
- * @param newKey
10765
- * @param value
10766
- * @param storeAuthStateInCookie
10767
- */
10768
- migrateCacheEntry(newKey, value) {
10769
- if (value) {
10770
- this.setTemporaryCache(newKey, value, true);
10771
- }
11158
+ keysToMigrate.forEach((cacheKey, index) => {
11159
+ const value = values[index];
11160
+ if (value) {
11161
+ this.setTemporaryCache(cacheKey, value, true);
11162
+ }
11163
+ });
10772
11164
  }
10773
11165
  /**
10774
11166
  * Searches all cache entries for MSAL accounts and creates the account key map
@@ -11465,33 +11857,28 @@
11465
11857
  }
11466
11858
  /**
11467
11859
  * Removes the cache item with the given key.
11468
- * Will also clear the cookie item if storeAuthStateInCookie is set to true.
11469
11860
  * @param key
11470
11861
  */
11471
11862
  removeItem(key) {
11472
11863
  this.browserStorage.removeItem(key);
11864
+ }
11865
+ /**
11866
+ * Removes the temporary cache item with the given key.
11867
+ * Will also clear the cookie item if storeAuthStateInCookie is set to true.
11868
+ * @param key
11869
+ */
11870
+ removeTemporaryItem(key) {
11473
11871
  this.temporaryCacheStorage.removeItem(key);
11474
11872
  if (this.cacheConfig.storeAuthStateInCookie) {
11475
11873
  this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie");
11476
11874
  this.clearItemCookie(key);
11477
11875
  }
11478
11876
  }
11479
- /**
11480
- * Checks whether key is in cache.
11481
- * @param key
11482
- */
11483
- containsKey(key) {
11484
- return (this.browserStorage.containsKey(key) ||
11485
- this.temporaryCacheStorage.containsKey(key));
11486
- }
11487
11877
  /**
11488
11878
  * Gets all keys in window.
11489
11879
  */
11490
11880
  getKeys() {
11491
- return [
11492
- ...this.browserStorage.getKeys(),
11493
- ...this.temporaryCacheStorage.getKeys(),
11494
- ];
11881
+ return this.browserStorage.getKeys();
11495
11882
  }
11496
11883
  /**
11497
11884
  * Clears all cache entries created by MSAL.
@@ -11500,14 +11887,18 @@
11500
11887
  // Removes all accounts and their credentials
11501
11888
  await this.removeAllAccounts();
11502
11889
  this.removeAppMetadata();
11890
+ // Remove temp storage first to make sure any cookies are cleared
11891
+ this.temporaryCacheStorage.getKeys().forEach((cacheKey) => {
11892
+ if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
11893
+ cacheKey.indexOf(this.clientId) !== -1) {
11894
+ this.removeTemporaryItem(cacheKey);
11895
+ }
11896
+ });
11503
11897
  // Removes all remaining MSAL cache items
11504
- this.getKeys().forEach((cacheKey) => {
11505
- // Check if key contains msal prefix; For now, we are clearing all the cache items created by MSAL.js
11506
- if ((this.browserStorage.containsKey(cacheKey) ||
11507
- this.temporaryCacheStorage.containsKey(cacheKey)) &&
11508
- (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
11509
- cacheKey.indexOf(this.clientId) !== -1)) {
11510
- this.removeItem(cacheKey);
11898
+ this.browserStorage.getKeys().forEach((cacheKey) => {
11899
+ if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
11900
+ cacheKey.indexOf(this.clientId) !== -1) {
11901
+ this.browserStorage.removeItem(cacheKey);
11511
11902
  }
11512
11903
  });
11513
11904
  this.internalStorage.clear();
@@ -11540,6 +11931,7 @@
11540
11931
  * @param cookieName
11541
11932
  * @param cookieValue
11542
11933
  * @param expires
11934
+ * @deprecated
11543
11935
  */
11544
11936
  setItemCookie(cookieName, cookieValue, expires) {
11545
11937
  let cookieStr = `${encodeURIComponent(cookieName)}=${encodeURIComponent(cookieValue)};path=/;SameSite=Lax;`;
@@ -11555,6 +11947,7 @@
11555
11947
  /**
11556
11948
  * Get one item by key from cookies
11557
11949
  * @param cookieName
11950
+ * @deprecated
11558
11951
  */
11559
11952
  getItemCookie(cookieName) {
11560
11953
  const name = `${encodeURIComponent(cookieName)}=`;
@@ -11572,6 +11965,7 @@
11572
11965
  }
11573
11966
  /**
11574
11967
  * Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.
11968
+ * @deprecated
11575
11969
  */
11576
11970
  clearMsalCookies() {
11577
11971
  const cookiePrefix = `${Constants.CACHE_PREFIX}.${this.clientId}`;
@@ -11590,6 +11984,7 @@
11590
11984
  /**
11591
11985
  * Clear an item in the cookies by key
11592
11986
  * @param cookieName
11987
+ * @deprecated
11593
11988
  */
11594
11989
  clearItemCookie(cookieName) {
11595
11990
  this.setItemCookie(cookieName, Constants.EMPTY_STRING, -1);
@@ -11597,24 +11992,13 @@
11597
11992
  /**
11598
11993
  * Get cookie expiration time
11599
11994
  * @param cookieLifeDays
11995
+ * @deprecated
11600
11996
  */
11601
11997
  getCookieExpirationTime(cookieLifeDays) {
11602
11998
  const today = new Date();
11603
11999
  const expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);
11604
12000
  return expr.toUTCString();
11605
12001
  }
11606
- /**
11607
- * Gets the cache object referenced by the browser
11608
- */
11609
- getCache() {
11610
- return this.browserStorage;
11611
- }
11612
- /**
11613
- * interface compat, we cannot overwrite browser cache; Functionality is supported by individual entities in browser
11614
- */
11615
- setCache() {
11616
- // sets nothing
11617
- }
11618
12002
  /**
11619
12003
  * Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
11620
12004
  * @param key
@@ -11707,22 +12091,22 @@
11707
12091
  this.logger.trace("BrowserCacheManager.resetRequestCache called");
11708
12092
  // check state and remove associated cache items
11709
12093
  if (state) {
11710
- this.getKeys().forEach((key) => {
12094
+ this.temporaryCacheStorage.getKeys().forEach((key) => {
11711
12095
  if (key.indexOf(state) !== -1) {
11712
- this.removeItem(key);
12096
+ this.removeTemporaryItem(key);
11713
12097
  }
11714
12098
  });
11715
12099
  // delete generic interactive request parameters
11716
- this.removeItem(this.generateStateKey(state));
11717
- this.removeItem(this.generateNonceKey(state));
11718
- this.removeItem(this.generateAuthorityKey(state));
11719
- }
11720
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
11721
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));
11722
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));
11723
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));
11724
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
11725
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
12100
+ this.removeTemporaryItem(this.generateStateKey(state));
12101
+ this.removeTemporaryItem(this.generateNonceKey(state));
12102
+ this.removeTemporaryItem(this.generateAuthorityKey(state));
12103
+ }
12104
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
12105
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));
12106
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));
12107
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));
12108
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
12109
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
11726
12110
  this.setInteractionInProgress(false);
11727
12111
  }
11728
12112
  /**
@@ -11748,7 +12132,7 @@
11748
12132
  cleanRequestByInteractionType(interactionType) {
11749
12133
  this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called");
11750
12134
  // Loop through all keys to find state key
11751
- this.getKeys().forEach((key) => {
12135
+ this.temporaryCacheStorage.getKeys().forEach((key) => {
11752
12136
  // If this key is not the state key, move on
11753
12137
  if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {
11754
12138
  return;
@@ -11793,7 +12177,7 @@
11793
12177
  this.logger.error(`Parsing cached token request threw with error: ${e}`);
11794
12178
  throw createBrowserAuthError(unableToParseTokenRequestCacheError);
11795
12179
  }
11796
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
12180
+ this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
11797
12181
  // Get cached authority and use if no authority is cached with request.
11798
12182
  if (!parsedRequest.authority) {
11799
12183
  const authorityCacheKey = this.generateAuthorityKey(state);
@@ -11849,7 +12233,7 @@
11849
12233
  }
11850
12234
  else if (!inProgress &&
11851
12235
  this.getInteractionInProgress() === this.clientId) {
11852
- this.removeItem(key);
12236
+ this.removeTemporaryItem(key);
11853
12237
  }
11854
12238
  }
11855
12239
  /**
@@ -11866,7 +12250,7 @@
11866
12250
  // Check for cached MSAL v1 id token
11867
12251
  const msalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ID_TOKEN, true);
11868
12252
  if (msalIdTokenString) {
11869
- this.removeItem(this.generateCacheKey(PersistentCacheKeys.ID_TOKEN));
12253
+ this.browserStorage.removeItem(this.generateCacheKey(PersistentCacheKeys.ID_TOKEN));
11870
12254
  this.logger.verbose("Cached MSAL.js v1 id token retrieved");
11871
12255
  }
11872
12256
  const cachedIdTokenString = msalIdTokenString || adalIdTokenString;
@@ -11894,7 +12278,7 @@
11894
12278
  if (currentCacheKey !== updatedCacheKey) {
11895
12279
  const cacheItem = this.getItem(currentCacheKey);
11896
12280
  if (cacheItem) {
11897
- this.removeItem(currentCacheKey);
12281
+ this.browserStorage.removeItem(currentCacheKey);
11898
12282
  this.setItem(updatedCacheKey, cacheItem);
11899
12283
  this.logger.verbose(`Updated an outdated ${credential.credentialType} cache key`);
11900
12284
  return updatedCacheKey;
@@ -11905,19 +12289,6 @@
11905
12289
  }
11906
12290
  return currentCacheKey;
11907
12291
  }
11908
- /**
11909
- * Returns application id as redirect context during AcquireTokenRedirect flow.
11910
- */
11911
- getRedirectRequestContext() {
11912
- return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);
11913
- }
11914
- /**
11915
- * Sets application id as the redirect context during AcquireTokenRedirect flow.
11916
- * @param value
11917
- */
11918
- setRedirectRequestContext(value) {
11919
- this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);
11920
- }
11921
12292
  /**
11922
12293
  * Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache
11923
12294
  * @param result
@@ -12152,47 +12523,6 @@
12152
12523
  }
12153
12524
  }
12154
12525
  }
12155
- /**
12156
- * Initializer function for all request APIs
12157
- * @param request
12158
- */
12159
- async initializeBaseRequest(request) {
12160
- this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, this.correlationId);
12161
- const authority = request.authority || this.config.auth.authority;
12162
- const scopes = [...((request && request.scopes) || [])];
12163
- const validatedRequest = {
12164
- ...request,
12165
- correlationId: this.correlationId,
12166
- authority,
12167
- scopes,
12168
- };
12169
- // Set authenticationScheme to BEARER if not explicitly set in the request
12170
- if (!validatedRequest.authenticationScheme) {
12171
- validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;
12172
- this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');
12173
- }
12174
- else {
12175
- if (validatedRequest.authenticationScheme ===
12176
- AuthenticationScheme.SSH) {
12177
- if (!request.sshJwk) {
12178
- throw createClientConfigurationError(missingSshJwk);
12179
- }
12180
- if (!request.sshKid) {
12181
- throw createClientConfigurationError(missingSshKid);
12182
- }
12183
- }
12184
- this.logger.verbose(`Authentication Scheme set to "${validatedRequest.authenticationScheme}" as configured in Auth request`);
12185
- }
12186
- // Set requested claims hash if claims-based caching is enabled and claims were requested
12187
- if (this.config.cache.claimsBasedCachingEnabled &&
12188
- request.claims &&
12189
- // Checks for empty stringified object "{}" which doesn't qualify as requested claims
12190
- !StringUtils.isEmptyObj(request.claims)) {
12191
- validatedRequest.requestedClaimsHash =
12192
- await this.browserCrypto.hashString(request.claims);
12193
- }
12194
- return validatedRequest;
12195
- }
12196
12526
  /**
12197
12527
  *
12198
12528
  * Use to get the redirect uri configured in MSAL or null.
@@ -12310,6 +12640,60 @@
12310
12640
  }
12311
12641
  }
12312
12642
 
12643
+ /*
12644
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12645
+ * Licensed under the MIT License.
12646
+ */
12647
+ /**
12648
+ * Initializer function for all request APIs
12649
+ * @param request
12650
+ */
12651
+ async function initializeBaseRequest(request, config, performanceClient, logger) {
12652
+ performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, request.correlationId);
12653
+ const authority = request.authority || config.auth.authority;
12654
+ const scopes = [...((request && request.scopes) || [])];
12655
+ const validatedRequest = {
12656
+ ...request,
12657
+ correlationId: request.correlationId,
12658
+ authority,
12659
+ scopes,
12660
+ };
12661
+ // Set authenticationScheme to BEARER if not explicitly set in the request
12662
+ if (!validatedRequest.authenticationScheme) {
12663
+ validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;
12664
+ logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');
12665
+ }
12666
+ else {
12667
+ if (validatedRequest.authenticationScheme === AuthenticationScheme.SSH) {
12668
+ if (!request.sshJwk) {
12669
+ throw createClientConfigurationError(missingSshJwk);
12670
+ }
12671
+ if (!request.sshKid) {
12672
+ throw createClientConfigurationError(missingSshKid);
12673
+ }
12674
+ }
12675
+ logger.verbose(`Authentication Scheme set to "${validatedRequest.authenticationScheme}" as configured in Auth request`);
12676
+ }
12677
+ // Set requested claims hash if claims-based caching is enabled and claims were requested
12678
+ if (config.cache.claimsBasedCachingEnabled &&
12679
+ request.claims &&
12680
+ // Checks for empty stringified object "{}" which doesn't qualify as requested claims
12681
+ !StringUtils.isEmptyObj(request.claims)) {
12682
+ validatedRequest.requestedClaimsHash = await hashString(request.claims);
12683
+ }
12684
+ return validatedRequest;
12685
+ }
12686
+ async function initializeSilentRequest(request, account, config, performanceClient, logger) {
12687
+ performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, request.correlationId);
12688
+ const baseRequest = await invokeAsync(initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, logger, performanceClient, request.correlationId)(request, config, performanceClient, logger);
12689
+ return {
12690
+ ...request,
12691
+ ...baseRequest,
12692
+ account: account,
12693
+ forceRefresh: request.forceRefresh || false,
12694
+ };
12695
+ }
12696
+
12313
12697
  /*
12314
12698
  * Copyright (c) Microsoft Corporation. All rights reserved.
12315
12699
  * Licensed under the MIT License.
@@ -12484,7 +12868,7 @@
12484
12868
  interactionType: interactionType,
12485
12869
  };
12486
12870
  const state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
12487
- const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)(request);
12871
+ const baseRequest = await invokeAsync(initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)({ ...request, correlationId: this.correlationId }, this.config, this.performanceClient, this.logger);
12488
12872
  const validatedRequest = {
12489
12873
  ...baseRequest,
12490
12874
  redirectUri: redirectUri,
@@ -12603,7 +12987,8 @@
12603
12987
  this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
12604
12988
  // Telemetry manager only used to increment cacheHits here
12605
12989
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
12606
- const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);
12990
+ const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);
12991
+ const silentAuthClient = new SilentFlowClient(clientConfig, this.performanceClient);
12607
12992
  this.logger.verbose("Silent auth client created");
12608
12993
  try {
12609
12994
  const response = await invokeAsync(silentAuthClient.acquireCachedToken.bind(silentAuthClient), PerformanceEvents.SilentFlowClientAcquireCachedToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);
@@ -12630,26 +13015,6 @@
12630
13015
  const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);
12631
13016
  return this.clearCacheOnLogout(validLogoutRequest?.account);
12632
13017
  }
12633
- /**
12634
- * Creates an Silent Flow Client with the given authority, or the default authority.
12635
- * @param serverTelemetryManager
12636
- * @param authorityUrl
12637
- */
12638
- async createSilentFlowClient(serverTelemetryManager, authorityUrl, azureCloudOptions, account) {
12639
- // Create auth module.
12640
- const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions, account);
12641
- return new SilentFlowClient(clientConfig, this.performanceClient);
12642
- }
12643
- async initializeSilentRequest(request, account) {
12644
- this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);
12645
- const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)(request);
12646
- return {
12647
- ...request,
12648
- ...baseRequest,
12649
- account: account,
12650
- forceRefresh: request.forceRefresh || false,
12651
- };
12652
- }
12653
13018
  }
12654
13019
 
12655
13020
  /*
@@ -14729,7 +15094,7 @@
14729
15094
  */
14730
15095
  async acquireToken(request) {
14731
15096
  this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14732
- const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request);
15097
+ const baseRequest = await invokeAsync(initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request, this.config, this.performanceClient, this.logger);
14733
15098
  const silentRequest = {
14734
15099
  ...request,
14735
15100
  ...baseRequest,
@@ -15085,7 +15450,6 @@
15085
15450
  * @param configuration Object for the MSAL PublicClientApplication instance
15086
15451
  */
15087
15452
  constructor(operatingContext) {
15088
- this.atsAsyncMeasurement = undefined;
15089
15453
  this.operatingContext = operatingContext;
15090
15454
  this.isBrowserEnvironment =
15091
15455
  this.operatingContext.isBrowserEnvironment();
@@ -15137,14 +15501,12 @@
15137
15501
  await controller.initialize();
15138
15502
  return controller;
15139
15503
  }
15140
- trackPageVisibility() {
15141
- if (!this.atsAsyncMeasurement) {
15504
+ trackPageVisibility(correlationId) {
15505
+ if (!correlationId) {
15142
15506
  return;
15143
15507
  }
15144
15508
  this.logger.info("Perf: Visibility change detected");
15145
- this.atsAsyncMeasurement.increment({
15146
- visibilityChangeCount: 1,
15147
- });
15509
+ this.performanceClient.incrementFields({ visibilityChangeCount: 1 }, correlationId);
15148
15510
  }
15149
15511
  /**
15150
15512
  * Initializer function to perform async startup tasks such as connecting to WAM extension
@@ -15249,18 +15611,9 @@
15249
15611
  this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, eventError);
15250
15612
  }
15251
15613
  this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
15252
- if (eventError instanceof AuthError) {
15253
- rootMeasurement.end({
15254
- success: false,
15255
- errorCode: eventError.errorCode,
15256
- subErrorCode: eventError.subError,
15257
- });
15258
- }
15259
- else {
15260
- rootMeasurement.end({
15261
- success: false,
15262
- });
15263
- }
15614
+ rootMeasurement.end({
15615
+ success: false,
15616
+ }, eventError);
15264
15617
  throw e;
15265
15618
  });
15266
15619
  this.redirectResponse.set(redirectResponseKey, response);
@@ -15286,7 +15639,8 @@
15286
15639
  // Preflight request
15287
15640
  const correlationId = this.getRequestCorrelationId(request);
15288
15641
  this.logger.verbose("acquireTokenRedirect called", correlationId);
15289
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Redirect);
15642
+ redirectPreflightCheck(this.initialized, this.config);
15643
+ this.browserStorage.setInteractionInProgress(true);
15290
15644
  // If logged in, emit acquire token events
15291
15645
  const isLoggedIn = this.getAllAccounts().length > 0;
15292
15646
  if (isLoggedIn) {
@@ -15312,7 +15666,7 @@
15312
15666
  const redirectClient = this.createRedirectClient(correlationId);
15313
15667
  return redirectClient.acquireToken(request);
15314
15668
  }
15315
- this.getBrowserStorage().setInteractionInProgress(false);
15669
+ this.browserStorage.setInteractionInProgress(false);
15316
15670
  throw e;
15317
15671
  });
15318
15672
  }
@@ -15345,7 +15699,8 @@
15345
15699
  const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);
15346
15700
  try {
15347
15701
  this.logger.verbose("acquireTokenPopup called", correlationId);
15348
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
15702
+ preflightCheck(this.initialized);
15703
+ this.browserStorage.setInteractionInProgress(true);
15349
15704
  }
15350
15705
  catch (e) {
15351
15706
  // Since this function is syncronous we need to reject
@@ -15366,7 +15721,7 @@
15366
15721
  correlationId,
15367
15722
  }, ApiId.acquireTokenPopup)
15368
15723
  .then((response) => {
15369
- this.getBrowserStorage().setInteractionInProgress(false);
15724
+ this.browserStorage.setInteractionInProgress(false);
15370
15725
  atPopupMeasurement.end({
15371
15726
  success: true,
15372
15727
  isNativeBroker: true,
@@ -15386,7 +15741,7 @@
15386
15741
  const popupClient = this.createPopupClient(correlationId);
15387
15742
  return popupClient.acquireToken(request);
15388
15743
  }
15389
- this.getBrowserStorage().setInteractionInProgress(false);
15744
+ this.browserStorage.setInteractionInProgress(false);
15390
15745
  throw e;
15391
15746
  });
15392
15747
  }
@@ -15424,10 +15779,8 @@
15424
15779
  this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
15425
15780
  }
15426
15781
  atPopupMeasurement.end({
15427
- errorCode: e.errorCode,
15428
- subErrorCode: e.subError,
15429
15782
  success: false,
15430
- });
15783
+ }, e);
15431
15784
  // Since this function is syncronous we need to reject
15432
15785
  return Promise.reject(e);
15433
15786
  });
@@ -15468,7 +15821,7 @@
15468
15821
  prompt: request.prompt,
15469
15822
  correlationId: correlationId,
15470
15823
  };
15471
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
15824
+ preflightCheck(this.initialized);
15472
15825
  this.ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);
15473
15826
  this.ssoSilentMeasurement?.increment({
15474
15827
  visibilityChangeCount: 0,
@@ -15509,10 +15862,8 @@
15509
15862
  .catch((e) => {
15510
15863
  this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
15511
15864
  this.ssoSilentMeasurement?.end({
15512
- errorCode: e.errorCode,
15513
- subErrorCode: e.subError,
15514
15865
  success: false,
15515
- });
15866
+ }, e);
15516
15867
  throw e;
15517
15868
  })
15518
15869
  .finally(() => {
@@ -15531,8 +15882,8 @@
15531
15882
  */
15532
15883
  async acquireTokenByCode(request) {
15533
15884
  const correlationId = this.getRequestCorrelationId(request);
15534
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
15535
15885
  this.logger.trace("acquireTokenByCode called", correlationId);
15886
+ preflightCheck(this.initialized);
15536
15887
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
15537
15888
  const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, correlationId);
15538
15889
  try {
@@ -15567,10 +15918,8 @@
15567
15918
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
15568
15919
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
15569
15920
  atbcMeasurement.end({
15570
- errorCode: error.errorCode,
15571
- subErrorCode: error.subError,
15572
15921
  success: false,
15573
- });
15922
+ }, error);
15574
15923
  throw error;
15575
15924
  });
15576
15925
  this.hybridAuthCodeResponses.set(hybridAuthCode, response);
@@ -15606,10 +15955,8 @@
15606
15955
  catch (e) {
15607
15956
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
15608
15957
  atbcMeasurement.end({
15609
- errorCode: (e instanceof AuthError && e.errorCode) || undefined,
15610
- subErrorCode: (e instanceof AuthError && e.subError) || undefined,
15611
15958
  success: false,
15612
- });
15959
+ }, e);
15613
15960
  throw e;
15614
15961
  }
15615
15962
  }
@@ -15640,10 +15987,8 @@
15640
15987
  })
15641
15988
  .catch((tokenRenewalError) => {
15642
15989
  this.acquireTokenByCodeAsyncMeasurement?.end({
15643
- errorCode: tokenRenewalError.errorCode,
15644
- subErrorCode: tokenRenewalError.subError,
15645
15990
  success: false,
15646
- });
15991
+ }, tokenRenewalError);
15647
15992
  throw tokenRenewalError;
15648
15993
  })
15649
15994
  .finally(() => {
@@ -15658,12 +16003,13 @@
15658
16003
  * @param silentRequest SilentRequest
15659
16004
  * @returns A promise that, when resolved, returns the access token
15660
16005
  */
15661
- async acquireTokenFromCache(silentCacheClient, commonRequest, cacheLookupPolicy) {
16006
+ async acquireTokenFromCache(commonRequest, cacheLookupPolicy) {
15662
16007
  this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);
15663
16008
  switch (cacheLookupPolicy) {
15664
16009
  case CacheLookupPolicy.Default:
15665
16010
  case CacheLookupPolicy.AccessToken:
15666
16011
  case CacheLookupPolicy.AccessTokenAndRefreshToken:
16012
+ const silentCacheClient = this.createSilentCacheClient(commonRequest.correlationId);
15667
16013
  return invokeAsync(silentCacheClient.acquireToken.bind(silentCacheClient), PerformanceEvents.SilentCacheClientAcquireToken, this.logger, this.performanceClient, commonRequest.correlationId)(commonRequest);
15668
16014
  default:
15669
16015
  throw createClientAuthError(tokenRefreshRequired);
@@ -15720,7 +16066,8 @@
15720
16066
  */
15721
16067
  async logoutRedirect(logoutRequest) {
15722
16068
  const correlationId = this.getRequestCorrelationId(logoutRequest);
15723
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Redirect);
16069
+ redirectPreflightCheck(this.initialized, this.config);
16070
+ this.browserStorage.setInteractionInProgress(true);
15724
16071
  const redirectClient = this.createRedirectClient(correlationId);
15725
16072
  return redirectClient.logout(logoutRequest);
15726
16073
  }
@@ -15731,7 +16078,8 @@
15731
16078
  logoutPopup(logoutRequest) {
15732
16079
  try {
15733
16080
  const correlationId = this.getRequestCorrelationId(logoutRequest);
15734
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
16081
+ preflightCheck(this.initialized);
16082
+ this.browserStorage.setInteractionInProgress(true);
15735
16083
  const popupClient = this.createPopupClient(correlationId);
15736
16084
  return popupClient.logout(logoutRequest);
15737
16085
  }
@@ -15897,52 +16245,6 @@
15897
16245
  }
15898
16246
  }
15899
16247
  // #region Helpers
15900
- /**
15901
- * Helper to validate app environment before making an auth request
15902
- *
15903
- * @protected
15904
- * @param {InteractionType} interactionType What kind of interaction is being used
15905
- * @param {boolean} [isAppEmbedded=false] Whether to set interaction in progress temp cache flag
15906
- */
15907
- preflightBrowserEnvironmentCheck(interactionType, isAppEmbedded = false) {
15908
- this.logger.verbose("preflightBrowserEnvironmentCheck started");
15909
- // Block request if not in browser environment
15910
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
15911
- // Block redirects if in an iframe
15912
- blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);
15913
- // Block auth requests inside a hidden iframe
15914
- blockReloadInHiddenIframes();
15915
- // Block redirectUri opened in a popup from calling MSAL APIs
15916
- blockAcquireTokenInPopups();
15917
- // Block token acquisition before initialize has been called
15918
- blockAPICallsBeforeInitialize(this.initialized);
15919
- // Block redirects if memory storage is enabled but storeAuthStateInCookie is not
15920
- if (interactionType === exports.InteractionType.Redirect &&
15921
- this.config.cache.cacheLocation ===
15922
- BrowserCacheLocation.MemoryStorage &&
15923
- !this.config.cache.storeAuthStateInCookie) {
15924
- throw createBrowserConfigurationAuthError(inMemRedirectUnavailable);
15925
- }
15926
- if (interactionType === exports.InteractionType.Redirect ||
15927
- interactionType === exports.InteractionType.Popup) {
15928
- this.preflightInteractiveRequest(!isAppEmbedded);
15929
- }
15930
- }
15931
- /**
15932
- * Preflight check for interactive requests
15933
- *
15934
- * @protected
15935
- * @param {boolean} setInteractionInProgress Whether to set interaction in progress temp cache flag
15936
- */
15937
- preflightInteractiveRequest(setInteractionInProgress) {
15938
- this.logger.verbose("preflightInteractiveRequest called, validating app environment");
15939
- // block the reload if it occurred inside a hidden iframe
15940
- blockReloadInHiddenIframes();
15941
- // Set interaction in progress temporary cache or throw if alread set.
15942
- if (setInteractionInProgress) {
15943
- this.getBrowserStorage().setInteractionInProgress(true);
15944
- }
15945
- }
15946
16248
  /**
15947
16249
  * Acquire a token from native device (e.g. WAM)
15948
16250
  * @param request
@@ -16127,12 +16429,6 @@
16127
16429
  getPerformanceClient() {
16128
16430
  return this.performanceClient;
16129
16431
  }
16130
- /**
16131
- * Returns the browser storage
16132
- */
16133
- getBrowserStorage() {
16134
- return this.browserStorage;
16135
- }
16136
16432
  /**
16137
16433
  * Returns the browser env indicator
16138
16434
  */
@@ -16210,7 +16506,7 @@
16210
16506
  atsMeasurement.add({
16211
16507
  cacheLookupPolicy: request.cacheLookupPolicy,
16212
16508
  });
16213
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
16509
+ preflightCheck(this.initialized);
16214
16510
  this.logger.verbose("acquireTokenSilent called", correlationId);
16215
16511
  const account = request.account || this.getActiveAccount();
16216
16512
  if (!account) {
@@ -16255,10 +16551,8 @@
16255
16551
  .catch((error) => {
16256
16552
  this.activeSilentTokenRequests.delete(silentRequestKey);
16257
16553
  atsMeasurement.end({
16258
- errorCode: error.errorCode,
16259
- subErrorCode: error.subError,
16260
16554
  success: false,
16261
- });
16555
+ }, error);
16262
16556
  throw error;
16263
16557
  });
16264
16558
  this.activeSilentTokenRequests.set(silentRequestKey, response);
@@ -16286,11 +16580,10 @@
16286
16580
  async acquireTokenSilentAsync(request, account) {
16287
16581
  this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
16288
16582
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
16289
- this.atsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
16290
- this.atsAsyncMeasurement?.increment({
16291
- visibilityChangeCount: 0,
16292
- });
16293
- document.addEventListener("visibilitychange", this.trackPageVisibility);
16583
+ if (request.correlationId) {
16584
+ this.performanceClient.incrementFields({ visibilityChangeCount: 0 }, request.correlationId);
16585
+ }
16586
+ document.addEventListener("visibilitychange", () => this.trackPageVisibility(request.correlationId));
16294
16587
  let result;
16295
16588
  if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) &&
16296
16589
  account.nativeAccountId) {
@@ -16313,16 +16606,13 @@
16313
16606
  }
16314
16607
  else {
16315
16608
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");
16316
- const silentCacheClient = this.createSilentCacheClient(request.correlationId);
16317
- const silentRequest = await invokeAsync(silentCacheClient.initializeSilentRequest.bind(silentCacheClient), PerformanceEvents.InitializeSilentRequest, this.logger, this.performanceClient, request.correlationId)(request, account);
16609
+ const silentRequest = await invokeAsync(initializeSilentRequest, PerformanceEvents.InitializeSilentRequest, this.logger, this.performanceClient, request.correlationId)(request, account, this.config, this.performanceClient, this.logger);
16318
16610
  const cacheLookupPolicy = request.cacheLookupPolicy || CacheLookupPolicy.Default;
16319
- result = invokeAsync(this.acquireTokenFromCache.bind(this), PerformanceEvents.AcquireTokenFromCache, this.logger, this.performanceClient, silentRequest.correlationId)(silentCacheClient, silentRequest, cacheLookupPolicy).catch((cacheError) => {
16611
+ result = invokeAsync(this.acquireTokenFromCache.bind(this), PerformanceEvents.AcquireTokenFromCache, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest, cacheLookupPolicy).catch((cacheError) => {
16320
16612
  if (request.cacheLookupPolicy ===
16321
16613
  CacheLookupPolicy.AccessToken) {
16322
16614
  throw cacheError;
16323
16615
  }
16324
- // block the reload if it occurred inside a hidden iframe
16325
- blockReloadInHiddenIframes();
16326
16616
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, exports.InteractionType.Silent, silentRequest);
16327
16617
  return invokeAsync(this.acquireTokenByRefreshToken.bind(this), PerformanceEvents.AcquireTokenByRefreshToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest, cacheLookupPolicy).catch((refreshTokenError) => {
16328
16618
  const shouldTryToResolveSilently = checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, silentRequest, cacheLookupPolicy);
@@ -16340,25 +16630,21 @@
16340
16630
  return result
16341
16631
  .then((response) => {
16342
16632
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
16343
- this.atsAsyncMeasurement?.end({
16344
- success: true,
16345
- fromCache: response.fromCache,
16346
- isNativeBroker: response.fromNativeBroker,
16347
- requestId: response.requestId,
16348
- });
16633
+ if (request.correlationId) {
16634
+ this.performanceClient.addFields({
16635
+ fromCache: response.fromCache,
16636
+ isNativeBroker: response.fromNativeBroker,
16637
+ requestId: response.requestId,
16638
+ }, request.correlationId);
16639
+ }
16349
16640
  return response;
16350
16641
  })
16351
16642
  .catch((tokenRenewalError) => {
16352
16643
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
16353
- this.atsAsyncMeasurement?.end({
16354
- errorCode: tokenRenewalError.errorCode,
16355
- subErrorCode: tokenRenewalError.subError,
16356
- success: false,
16357
- });
16358
16644
  throw tokenRenewalError;
16359
16645
  })
16360
16646
  .finally(() => {
16361
- document.removeEventListener("visibilitychange", this.trackPageVisibility);
16647
+ document.removeEventListener("visibilitychange", () => this.trackPageVisibility(request.correlationId));
16362
16648
  });
16363
16649
  }
16364
16650
  }
@@ -16799,27 +17085,27 @@
16799
17085
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16800
17086
  acquireTokenPopup(request) {
16801
17087
  blockAPICallsBeforeInitialize(this.initialized);
16802
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17088
+ blockNonBrowserEnvironment();
16803
17089
  return {};
16804
17090
  }
16805
17091
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16806
17092
  acquireTokenRedirect(request) {
16807
17093
  blockAPICallsBeforeInitialize(this.initialized);
16808
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17094
+ blockNonBrowserEnvironment();
16809
17095
  return Promise.resolve();
16810
17096
  }
16811
17097
  acquireTokenSilent(
16812
17098
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16813
17099
  silentRequest) {
16814
17100
  blockAPICallsBeforeInitialize(this.initialized);
16815
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17101
+ blockNonBrowserEnvironment();
16816
17102
  return {};
16817
17103
  }
16818
17104
  acquireTokenByCode(
16819
17105
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16820
17106
  request) {
16821
17107
  blockAPICallsBeforeInitialize(this.initialized);
16822
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17108
+ blockNonBrowserEnvironment();
16823
17109
  return {};
16824
17110
  }
16825
17111
  acquireTokenNative(
@@ -16830,7 +17116,7 @@
16830
17116
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16831
17117
  accountId) {
16832
17118
  blockAPICallsBeforeInitialize(this.initialized);
16833
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17119
+ blockNonBrowserEnvironment();
16834
17120
  return {};
16835
17121
  }
16836
17122
  acquireTokenByRefreshToken(
@@ -16839,7 +17125,7 @@
16839
17125
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16840
17126
  silentRequest) {
16841
17127
  blockAPICallsBeforeInitialize(this.initialized);
16842
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17128
+ blockNonBrowserEnvironment();
16843
17129
  return {};
16844
17130
  }
16845
17131
  addEventCallback(callback) {
@@ -16851,22 +17137,22 @@
16851
17137
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16852
17138
  addPerformanceCallback(callback) {
16853
17139
  blockAPICallsBeforeInitialize(this.initialized);
16854
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17140
+ blockNonBrowserEnvironment();
16855
17141
  return "";
16856
17142
  }
16857
17143
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16858
17144
  removePerformanceCallback(callbackId) {
16859
17145
  blockAPICallsBeforeInitialize(this.initialized);
16860
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17146
+ blockNonBrowserEnvironment();
16861
17147
  return true;
16862
17148
  }
16863
17149
  enableAccountStorageEvents() {
16864
17150
  blockAPICallsBeforeInitialize(this.initialized);
16865
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17151
+ blockNonBrowserEnvironment();
16866
17152
  }
16867
17153
  disableAccountStorageEvents() {
16868
17154
  blockAPICallsBeforeInitialize(this.initialized);
16869
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17155
+ blockNonBrowserEnvironment();
16870
17156
  }
16871
17157
  handleRedirectPromise(
16872
17158
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -16878,45 +17164,45 @@
16878
17164
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16879
17165
  request) {
16880
17166
  blockAPICallsBeforeInitialize(this.initialized);
16881
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17167
+ blockNonBrowserEnvironment();
16882
17168
  return {};
16883
17169
  }
16884
17170
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16885
17171
  loginRedirect(request) {
16886
17172
  blockAPICallsBeforeInitialize(this.initialized);
16887
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17173
+ blockNonBrowserEnvironment();
16888
17174
  return {};
16889
17175
  }
16890
17176
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16891
17177
  logout(logoutRequest) {
16892
17178
  blockAPICallsBeforeInitialize(this.initialized);
16893
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17179
+ blockNonBrowserEnvironment();
16894
17180
  return {};
16895
17181
  }
16896
17182
  logoutRedirect(
16897
17183
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16898
17184
  logoutRequest) {
16899
17185
  blockAPICallsBeforeInitialize(this.initialized);
16900
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17186
+ blockNonBrowserEnvironment();
16901
17187
  return {};
16902
17188
  }
16903
17189
  logoutPopup(
16904
17190
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16905
17191
  logoutRequest) {
16906
17192
  blockAPICallsBeforeInitialize(this.initialized);
16907
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17193
+ blockNonBrowserEnvironment();
16908
17194
  return {};
16909
17195
  }
16910
17196
  ssoSilent(
16911
17197
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16912
17198
  request) {
16913
17199
  blockAPICallsBeforeInitialize(this.initialized);
16914
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17200
+ blockNonBrowserEnvironment();
16915
17201
  return {};
16916
17202
  }
16917
17203
  getTokenCache() {
16918
17204
  blockAPICallsBeforeInitialize(this.initialized);
16919
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17205
+ blockNonBrowserEnvironment();
16920
17206
  return {};
16921
17207
  }
16922
17208
  getLogger() {
@@ -16925,16 +17211,16 @@
16925
17211
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16926
17212
  setLogger(logger) {
16927
17213
  blockAPICallsBeforeInitialize(this.initialized);
16928
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17214
+ blockNonBrowserEnvironment();
16929
17215
  }
16930
17216
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16931
17217
  setActiveAccount(account) {
16932
17218
  blockAPICallsBeforeInitialize(this.initialized);
16933
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17219
+ blockNonBrowserEnvironment();
16934
17220
  }
16935
17221
  getActiveAccount() {
16936
17222
  blockAPICallsBeforeInitialize(this.initialized);
16937
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17223
+ blockNonBrowserEnvironment();
16938
17224
  return null;
16939
17225
  }
16940
17226
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -16944,43 +17230,35 @@
16944
17230
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16945
17231
  setNavigationClient(navigationClient) {
16946
17232
  blockAPICallsBeforeInitialize(this.initialized);
16947
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17233
+ blockNonBrowserEnvironment();
16948
17234
  }
16949
17235
  getConfiguration() {
16950
17236
  return this.config;
16951
17237
  }
16952
17238
  isBrowserEnv() {
16953
17239
  blockAPICallsBeforeInitialize(this.initialized);
16954
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17240
+ blockNonBrowserEnvironment();
16955
17241
  return true;
16956
17242
  }
16957
17243
  getBrowserCrypto() {
16958
17244
  blockAPICallsBeforeInitialize(this.initialized);
16959
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17245
+ blockNonBrowserEnvironment();
16960
17246
  return {};
16961
17247
  }
16962
17248
  getPerformanceClient() {
16963
17249
  blockAPICallsBeforeInitialize(this.initialized);
16964
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17250
+ blockNonBrowserEnvironment();
16965
17251
  return {};
16966
17252
  }
16967
17253
  getRedirectResponse() {
16968
17254
  blockAPICallsBeforeInitialize(this.initialized);
16969
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17255
+ blockNonBrowserEnvironment();
16970
17256
  return {};
16971
17257
  }
16972
- preflightBrowserEnvironmentCheck(
16973
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16974
- interactionType,
16975
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16976
- isAppEmbedded) {
16977
- blockAPICallsBeforeInitialize(this.initialized);
16978
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
16979
- }
16980
17258
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16981
17259
  async clearCache(logoutRequest) {
16982
17260
  blockAPICallsBeforeInitialize(this.initialized);
16983
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17261
+ blockNonBrowserEnvironment();
16984
17262
  }
16985
17263
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16986
17264
  async hydrateCache(
@@ -16989,7 +17267,7 @@
16989
17267
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16990
17268
  request) {
16991
17269
  blockAPICallsBeforeInitialize(this.initialized);
16992
- blockNonBrowserEnvironment(this.isBrowserEnvironment);
17270
+ blockNonBrowserEnvironment();
16993
17271
  }
16994
17272
  }
16995
17273
 
@@ -17640,11 +17918,11 @@
17640
17918
  return Math.round(window.performance.now() - startTime);
17641
17919
  }
17642
17920
  class BrowserPerformanceClient extends PerformanceClient {
17643
- constructor(configuration, intFields) {
17921
+ constructor(configuration, intFields, abbreviations) {
17644
17922
  super(configuration.auth.clientId, configuration.auth.authority || `${Constants.DEFAULT_AUTHORITY}`, new Logger(configuration.system?.loggerOptions || {}, name, version), name, version, configuration.telemetry?.application || {
17645
17923
  appName: "",
17646
17924
  appVersion: "",
17647
- }, intFields);
17925
+ }, intFields, abbreviations);
17648
17926
  }
17649
17927
  generateId() {
17650
17928
  return createNewGuid();
@@ -17688,13 +17966,13 @@
17688
17966
  void browserMeasurement?.then((measurement) => measurement.startMeasurement());
17689
17967
  return {
17690
17968
  ...inProgressEvent,
17691
- end: (event) => {
17969
+ end: (event, error) => {
17692
17970
  const res = inProgressEvent.end({
17693
17971
  ...event,
17694
17972
  startPageVisibility,
17695
17973
  endPageVisibility: this.getPageVisibility(),
17696
17974
  durationMs: getPerfDurationMs(startTime),
17697
- });
17975
+ }, error);
17698
17976
  void browserMeasurement?.then((measurement) => measurement.endMeasurement());
17699
17977
  this.deleteIncompleteSubMeasurements(inProgressEvent);
17700
17978
  return res;
@@ -17890,11 +18168,12 @@
17890
18168
  }
17891
18169
  const requestBuilder = new RequestParameterBuilder();
17892
18170
  const claims = requestBuilder.addClientCapabilitiesToClaims(request.claims, this.clientCapabilities);
18171
+ const scopes = request.scopes || OIDC_DEFAULT_SCOPES;
17893
18172
  const tokenRequest = {
17894
18173
  platformBrokerId: request.account?.homeAccountId,
17895
18174
  clientId: this.clientId,
17896
18175
  authority: request.authority,
17897
- scope: request.scopes.join(" "),
18176
+ scope: scopes.join(" "),
17898
18177
  correlationId: request.correlationId !== undefined
17899
18178
  ? request.correlationId
17900
18179
  : this.crypto.createNewGuid(),
@@ -18076,12 +18355,22 @@
18076
18355
  // do nothing not required by this controller
18077
18356
  return Promise.resolve();
18078
18357
  }
18358
+ ensureValidRequest(request) {
18359
+ if (request?.correlationId) {
18360
+ return request;
18361
+ }
18362
+ return {
18363
+ ...request,
18364
+ correlationId: this.browserCrypto.createNewGuid(),
18365
+ };
18366
+ }
18079
18367
  async acquireTokenInteractive(request) {
18080
- this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, request);
18081
- const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, request.correlationId);
18368
+ const validRequest = this.ensureValidRequest(request);
18369
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, validRequest);
18370
+ const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, validRequest.correlationId);
18082
18371
  atPopupMeasurement?.add({ nestedAppAuthRequest: true });
18083
18372
  try {
18084
- const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(request);
18373
+ const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
18085
18374
  const reqTimestamp = nowSeconds();
18086
18375
  const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
18087
18376
  const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
@@ -18101,16 +18390,15 @@
18101
18390
  const error = this.nestedAppAuthAdapter.fromBridgeError(e);
18102
18391
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Popup, null, e);
18103
18392
  atPopupMeasurement.end({
18104
- errorCode: error.errorCode,
18105
- subErrorCode: error.subError,
18106
18393
  success: false,
18107
- });
18394
+ }, e);
18108
18395
  throw error;
18109
18396
  }
18110
18397
  }
18111
18398
  async acquireTokenSilentInternal(request) {
18112
- this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
18113
- const ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, request.correlationId);
18399
+ const validRequest = this.ensureValidRequest(request);
18400
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, validRequest);
18401
+ const ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, validRequest.correlationId);
18114
18402
  ssoSilentMeasurement?.increment({
18115
18403
  visibilityChangeCount: 0,
18116
18404
  });
@@ -18118,7 +18406,7 @@
18118
18406
  nestedAppAuthRequest: true,
18119
18407
  });
18120
18408
  try {
18121
- const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(request);
18409
+ const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
18122
18410
  const reqTimestamp = nowSeconds();
18123
18411
  const response = await this.bridgeProxy.getTokenSilent(naaRequest);
18124
18412
  const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
@@ -18138,10 +18426,8 @@
18138
18426
  const error = this.nestedAppAuthAdapter.fromBridgeError(e);
18139
18427
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, e);
18140
18428
  ssoSilentMeasurement?.end({
18141
- errorCode: error.errorCode,
18142
- subErrorCode: error.subError,
18143
18429
  success: false,
18144
- });
18430
+ }, e);
18145
18431
  throw error;
18146
18432
  }
18147
18433
  }
@@ -18258,7 +18544,7 @@
18258
18544
  }
18259
18545
  handleRedirectPromise(hash // eslint-disable-line @typescript-eslint/no-unused-vars
18260
18546
  ) {
18261
- throw NestedAppAuthError.createUnsupportedError();
18547
+ return Promise.resolve(null);
18262
18548
  }
18263
18549
  loginPopup(request // eslint-disable-line @typescript-eslint/no-unused-vars
18264
18550
  ) {
@@ -18351,11 +18637,6 @@
18351
18637
  getRedirectResponse() {
18352
18638
  throw NestedAppAuthError.createUnsupportedError();
18353
18639
  }
18354
- preflightBrowserEnvironmentCheck(interactionType, // eslint-disable-line @typescript-eslint/no-unused-vars
18355
- setInteractionInProgress // eslint-disable-line @typescript-eslint/no-unused-vars
18356
- ) {
18357
- throw NestedAppAuthError.createUnsupportedError();
18358
- }
18359
18640
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18360
18641
  async clearCache(logoutRequest) {
18361
18642
  throw NestedAppAuthError.createUnsupportedError();
@@ -18422,6 +18703,7 @@
18422
18703
  exports.ServerResponseType = ServerResponseType;
18423
18704
  exports.SignedHttpRequest = SignedHttpRequest;
18424
18705
  exports.StringUtils = StringUtils;
18706
+ exports.StubPerformanceClient = StubPerformanceClient;
18425
18707
  exports.UrlString = UrlString;
18426
18708
  exports.WrapperSKU = WrapperSKU;
18427
18709
  exports.stubbedPublicClientApplication = stubbedPublicClientApplication;