@azure/msal-browser 3.27.0 → 3.28.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 (135) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/cache/AccountManager.mjs +1 -1
  7. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  8. package/dist/cache/BrowserCacheManager.d.ts +2 -38
  9. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +21 -115
  11. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  12. package/dist/cache/BrowserStorage.d.ts +3 -1
  13. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  14. package/dist/cache/BrowserStorage.mjs +13 -8
  15. package/dist/cache/BrowserStorage.mjs.map +1 -1
  16. package/dist/cache/CookieStorage.d.ts +14 -0
  17. package/dist/cache/CookieStorage.d.ts.map +1 -0
  18. package/dist/cache/CookieStorage.mjs +62 -0
  19. package/dist/cache/CookieStorage.mjs.map +1 -0
  20. package/dist/cache/DatabaseStorage.mjs +1 -1
  21. package/dist/cache/LocalStorage.d.ts +10 -0
  22. package/dist/cache/LocalStorage.d.ts.map +1 -0
  23. package/dist/cache/LocalStorage.mjs +34 -0
  24. package/dist/cache/LocalStorage.mjs.map +1 -0
  25. package/dist/cache/MemoryStorage.mjs +1 -1
  26. package/dist/cache/SessionStorage.d.ts +10 -0
  27. package/dist/cache/SessionStorage.d.ts.map +1 -0
  28. package/dist/cache/SessionStorage.mjs +34 -0
  29. package/dist/cache/SessionStorage.mjs.map +1 -0
  30. package/dist/cache/TokenCache.mjs +1 -1
  31. package/dist/config/Configuration.mjs +1 -1
  32. package/dist/controllers/ControllerFactory.mjs +1 -1
  33. package/dist/controllers/NestedAppAuthController.mjs +2 -2
  34. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  35. package/dist/controllers/StandardController.mjs +1 -1
  36. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  37. package/dist/crypto/BrowserCrypto.d.ts +1 -1
  38. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  39. package/dist/crypto/BrowserCrypto.mjs +3 -3
  40. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  41. package/dist/crypto/CryptoOps.d.ts +1 -1
  42. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  43. package/dist/crypto/CryptoOps.mjs +3 -3
  44. package/dist/crypto/CryptoOps.mjs.map +1 -1
  45. package/dist/crypto/PkceGenerator.mjs +1 -1
  46. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  47. package/dist/encode/Base64Decode.mjs +1 -1
  48. package/dist/encode/Base64Encode.mjs +1 -1
  49. package/dist/error/BrowserAuthError.mjs +1 -1
  50. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  51. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  52. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  53. package/dist/error/NativeAuthError.mjs +1 -1
  54. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  55. package/dist/error/NestedAppAuthError.mjs +1 -1
  56. package/dist/event/EventHandler.mjs +1 -1
  57. package/dist/event/EventMessage.mjs +1 -1
  58. package/dist/event/EventType.mjs +1 -1
  59. package/dist/index.d.ts +3 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.mjs +3 -1
  62. package/dist/index.mjs.map +1 -1
  63. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  64. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  65. package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
  66. package/dist/interaction_client/PopupClient.mjs +1 -1
  67. package/dist/interaction_client/RedirectClient.mjs +1 -1
  68. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  69. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  70. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  71. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  72. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  73. package/dist/interaction_client/StandardInteractionClient.mjs +5 -1
  74. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  75. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  76. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  77. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  78. package/dist/naa/BridgeError.mjs +1 -1
  79. package/dist/naa/BridgeProxy.mjs +1 -1
  80. package/dist/naa/BridgeStatusCode.mjs +1 -1
  81. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  82. package/dist/navigation/NavigationClient.mjs +1 -1
  83. package/dist/network/FetchClient.mjs +1 -1
  84. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  85. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  86. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  87. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  88. package/dist/packageMetadata.d.ts +1 -1
  89. package/dist/packageMetadata.mjs +2 -2
  90. package/dist/request/RequestHelpers.mjs +1 -1
  91. package/dist/response/ResponseHandler.mjs +1 -1
  92. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  93. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  94. package/dist/utils/BrowserConstants.mjs +1 -1
  95. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  96. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  97. package/dist/utils/BrowserUtils.mjs +4 -2
  98. package/dist/utils/BrowserUtils.mjs.map +1 -1
  99. package/lib/msal-browser.cjs +224 -198
  100. package/lib/msal-browser.cjs.map +1 -1
  101. package/lib/msal-browser.js +224 -198
  102. package/lib/msal-browser.js.map +1 -1
  103. package/lib/msal-browser.min.js +64 -64
  104. package/lib/types/cache/BrowserCacheManager.d.ts +2 -38
  105. package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
  106. package/lib/types/cache/BrowserStorage.d.ts +3 -1
  107. package/lib/types/cache/BrowserStorage.d.ts.map +1 -1
  108. package/lib/types/cache/CookieStorage.d.ts +14 -0
  109. package/lib/types/cache/CookieStorage.d.ts.map +1 -0
  110. package/lib/types/cache/LocalStorage.d.ts +10 -0
  111. package/lib/types/cache/LocalStorage.d.ts.map +1 -0
  112. package/lib/types/cache/SessionStorage.d.ts +10 -0
  113. package/lib/types/cache/SessionStorage.d.ts.map +1 -0
  114. package/lib/types/crypto/BrowserCrypto.d.ts +1 -1
  115. package/lib/types/crypto/BrowserCrypto.d.ts.map +1 -1
  116. package/lib/types/crypto/CryptoOps.d.ts +1 -1
  117. package/lib/types/crypto/CryptoOps.d.ts.map +1 -1
  118. package/lib/types/index.d.ts +3 -0
  119. package/lib/types/index.d.ts.map +1 -1
  120. package/lib/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  121. package/lib/types/packageMetadata.d.ts +1 -1
  122. package/lib/types/utils/BrowserUtils.d.ts.map +1 -1
  123. package/package.json +1 -1
  124. package/src/cache/BrowserCacheManager.ts +27 -141
  125. package/src/cache/BrowserStorage.ts +11 -11
  126. package/src/cache/CookieStorage.ts +80 -0
  127. package/src/cache/LocalStorage.ts +40 -0
  128. package/src/cache/SessionStorage.ts +40 -0
  129. package/src/controllers/NestedAppAuthController.ts +1 -1
  130. package/src/crypto/BrowserCrypto.ts +4 -2
  131. package/src/crypto/CryptoOps.ts +8 -2
  132. package/src/index.ts +3 -0
  133. package/src/interaction_client/StandardInteractionClient.ts +5 -0
  134. package/src/packageMetadata.ts +1 -1
  135. package/src/utils/BrowserUtils.ts +3 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v3.27.0 2024-11-05 */
1
+ /*! @azure/msal-browser v3.28.1 2025-01-14 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v14.16.0 2024-11-05 */
5
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -312,7 +312,7 @@ const JsonWebTokenTypes = {
312
312
  // Token renewal offset default in seconds
313
313
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
314
314
 
315
- /*! @azure/msal-common v14.16.0 2024-11-05 */
315
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
316
316
  /*
317
317
  * Copyright (c) Microsoft Corporation. All rights reserved.
318
318
  * Licensed under the MIT License.
@@ -329,7 +329,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
329
329
  unexpectedError: unexpectedError
330
330
  });
331
331
 
332
- /*! @azure/msal-common v14.16.0 2024-11-05 */
332
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
333
333
 
334
334
  /*
335
335
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -378,7 +378,7 @@ function createAuthError(code, additionalMessage) {
378
378
  : AuthErrorMessages[code]);
379
379
  }
380
380
 
381
- /*! @azure/msal-common v14.16.0 2024-11-05 */
381
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
382
382
  /*
383
383
  * Copyright (c) Microsoft Corporation. All rights reserved.
384
384
  * Licensed under the MIT License.
@@ -476,7 +476,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
476
476
  userTimeoutReached: userTimeoutReached
477
477
  });
478
478
 
479
- /*! @azure/msal-common v14.16.0 2024-11-05 */
479
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
480
480
 
481
481
  /*
482
482
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -728,7 +728,7 @@ function createClientAuthError(errorCode, additionalMessage) {
728
728
  return new ClientAuthError(errorCode, additionalMessage);
729
729
  }
730
730
 
731
- /*! @azure/msal-common v14.16.0 2024-11-05 */
731
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
732
732
 
733
733
  /*
734
734
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -767,7 +767,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
767
767
  },
768
768
  };
769
769
 
770
- /*! @azure/msal-common v14.16.0 2024-11-05 */
770
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
771
771
 
772
772
  /*
773
773
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -958,12 +958,12 @@ class Logger {
958
958
  }
959
959
  }
960
960
 
961
- /*! @azure/msal-common v14.16.0 2024-11-05 */
961
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
962
962
  /* eslint-disable header/header */
963
963
  const name$1 = "@azure/msal-common";
964
964
  const version$1 = "14.16.0";
965
965
 
966
- /*! @azure/msal-common v14.16.0 2024-11-05 */
966
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
967
967
  /*
968
968
  * Copyright (c) Microsoft Corporation. All rights reserved.
969
969
  * Licensed under the MIT License.
@@ -983,7 +983,7 @@ const AzureCloudInstance = {
983
983
  AzureUsGovernment: "https://login.microsoftonline.us",
984
984
  };
985
985
 
986
- /*! @azure/msal-common v14.16.0 2024-11-05 */
986
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
987
987
 
988
988
  /*
989
989
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1044,7 +1044,7 @@ function checkMaxAge(authTime, maxAge) {
1044
1044
  }
1045
1045
  }
1046
1046
 
1047
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1047
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1048
1048
  /*
1049
1049
  * Copyright (c) Microsoft Corporation. All rights reserved.
1050
1050
  * Licensed under the MIT License.
@@ -1081,7 +1081,7 @@ function wasClockTurnedBack(cachedAt) {
1081
1081
  return cachedAtSec > nowSeconds();
1082
1082
  }
1083
1083
 
1084
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1084
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1085
1085
 
1086
1086
  /*
1087
1087
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1408,7 +1408,7 @@ function isAuthorityMetadataExpired(metadata) {
1408
1408
  return metadata.expiresAt <= nowSeconds();
1409
1409
  }
1410
1410
 
1411
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1411
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1412
1412
  /*
1413
1413
  * Copyright (c) Microsoft Corporation. All rights reserved.
1414
1414
  * Licensed under the MIT License.
@@ -1462,7 +1462,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1462
1462
  urlParseError: urlParseError
1463
1463
  });
1464
1464
 
1465
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1465
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1466
1466
 
1467
1467
  /*
1468
1468
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1600,7 +1600,7 @@ function createClientConfigurationError(errorCode) {
1600
1600
  return new ClientConfigurationError(errorCode);
1601
1601
  }
1602
1602
 
1603
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1603
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1604
1604
  /*
1605
1605
  * Copyright (c) Microsoft Corporation. All rights reserved.
1606
1606
  * Licensed under the MIT License.
@@ -1697,7 +1697,7 @@ class StringUtils {
1697
1697
  }
1698
1698
  }
1699
1699
 
1700
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1700
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1701
1701
 
1702
1702
  /*
1703
1703
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1897,7 +1897,7 @@ class ScopeSet {
1897
1897
  }
1898
1898
  }
1899
1899
 
1900
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1900
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1901
1901
 
1902
1902
  /*
1903
1903
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1937,7 +1937,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
1937
1937
  };
1938
1938
  }
1939
1939
 
1940
- /*! @azure/msal-common v14.16.0 2024-11-05 */
1940
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
1941
1941
  /*
1942
1942
  * Copyright (c) Microsoft Corporation. All rights reserved.
1943
1943
  * Licensed under the MIT License.
@@ -2016,7 +2016,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
2016
2016
  return updatedAccountInfo;
2017
2017
  }
2018
2018
 
2019
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2019
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2020
2020
  /*
2021
2021
  * Copyright (c) Microsoft Corporation. All rights reserved.
2022
2022
  * Licensed under the MIT License.
@@ -2031,7 +2031,7 @@ const AuthorityType = {
2031
2031
  Ciam: 3,
2032
2032
  };
2033
2033
 
2034
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2034
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2035
2035
  /*
2036
2036
  * Copyright (c) Microsoft Corporation. All rights reserved.
2037
2037
  * Licensed under the MIT License.
@@ -2053,7 +2053,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2053
2053
  return null;
2054
2054
  }
2055
2055
 
2056
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2056
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2057
2057
  /*
2058
2058
  * Copyright (c) Microsoft Corporation. All rights reserved.
2059
2059
  * Licensed under the MIT License.
@@ -2066,7 +2066,7 @@ const ProtocolMode = {
2066
2066
  OIDC: "OIDC",
2067
2067
  };
2068
2068
 
2069
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2069
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2070
2070
 
2071
2071
  /*
2072
2072
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2309,7 +2309,7 @@ class AccountEntity {
2309
2309
  }
2310
2310
  }
2311
2311
 
2312
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2312
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2313
2313
 
2314
2314
  /*
2315
2315
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2356,7 +2356,7 @@ function getDeserializedResponse(responseString) {
2356
2356
  return null;
2357
2357
  }
2358
2358
 
2359
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2359
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2360
2360
 
2361
2361
  /*
2362
2362
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2520,7 +2520,7 @@ class UrlString {
2520
2520
  }
2521
2521
  }
2522
2522
 
2523
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2523
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2524
2524
 
2525
2525
  /*
2526
2526
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2660,7 +2660,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2660
2660
  return null;
2661
2661
  }
2662
2662
 
2663
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2663
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2664
2664
  /*
2665
2665
  * Copyright (c) Microsoft Corporation. All rights reserved.
2666
2666
  * Licensed under the MIT License.
@@ -2668,7 +2668,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2668
2668
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2669
2669
  const cacheUnknownErrorCode = "cache_error_unknown";
2670
2670
 
2671
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2671
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2672
2672
 
2673
2673
  /*
2674
2674
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2695,7 +2695,7 @@ class CacheError extends Error {
2695
2695
  }
2696
2696
  }
2697
2697
 
2698
- /*! @azure/msal-common v14.16.0 2024-11-05 */
2698
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
2699
2699
 
2700
2700
  /*
2701
2701
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3944,7 +3944,7 @@ class DefaultStorageClass extends CacheManager {
3944
3944
  }
3945
3945
  }
3946
3946
 
3947
- /*! @azure/msal-common v14.16.0 2024-11-05 */
3947
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
3948
3948
 
3949
3949
  /*
3950
3950
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4043,7 +4043,7 @@ function isOidcProtocolMode(config) {
4043
4043
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4044
4044
  }
4045
4045
 
4046
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4046
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4047
4047
  /*
4048
4048
  * Copyright (c) Microsoft Corporation. All rights reserved.
4049
4049
  * Licensed under the MIT License.
@@ -4053,7 +4053,7 @@ const CcsCredentialType = {
4053
4053
  UPN: "UPN",
4054
4054
  };
4055
4055
 
4056
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4056
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4057
4057
  /*
4058
4058
  * Copyright (c) Microsoft Corporation. All rights reserved.
4059
4059
  * Licensed under the MIT License.
@@ -4103,7 +4103,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
4103
4103
  const BROKER_CLIENT_ID = "brk_client_id";
4104
4104
  const BROKER_REDIRECT_URI = "brk_redirect_uri";
4105
4105
 
4106
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4106
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4107
4107
 
4108
4108
  /*
4109
4109
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4170,7 +4170,7 @@ class RequestValidator {
4170
4170
  }
4171
4171
  }
4172
4172
 
4173
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4173
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4174
4174
 
4175
4175
  /*
4176
4176
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4578,7 +4578,7 @@ class RequestParameterBuilder {
4578
4578
  }
4579
4579
  }
4580
4580
 
4581
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4581
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4582
4582
  /*
4583
4583
  * Copyright (c) Microsoft Corporation. All rights reserved.
4584
4584
  * Licensed under the MIT License.
@@ -4590,7 +4590,7 @@ function isOpenIdConfigResponse(response) {
4590
4590
  response.hasOwnProperty("jwks_uri"));
4591
4591
  }
4592
4592
 
4593
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4593
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4594
4594
  /*
4595
4595
  * Copyright (c) Microsoft Corporation. All rights reserved.
4596
4596
  * Licensed under the MIT License.
@@ -4600,7 +4600,7 @@ function isCloudInstanceDiscoveryResponse(response) {
4600
4600
  response.hasOwnProperty("metadata"));
4601
4601
  }
4602
4602
 
4603
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4603
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4604
4604
  /*
4605
4605
  * Copyright (c) Microsoft Corporation. All rights reserved.
4606
4606
  * Licensed under the MIT License.
@@ -4610,7 +4610,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
4610
4610
  response.hasOwnProperty("error_description"));
4611
4611
  }
4612
4612
 
4613
- /*! @azure/msal-common v14.16.0 2024-11-05 */
4613
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
4614
4614
  /*
4615
4615
  * Copyright (c) Microsoft Corporation. All rights reserved.
4616
4616
  * Licensed under the MIT License.
@@ -5097,7 +5097,7 @@ const IntFields = new Set([
5097
5097
  "multiMatchedRT",
5098
5098
  ]);
5099
5099
 
5100
- /*! @azure/msal-common v14.16.0 2024-11-05 */
5100
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
5101
5101
  /*
5102
5102
  * Copyright (c) Microsoft Corporation. All rights reserved.
5103
5103
  * Licensed under the MIT License.
@@ -5193,7 +5193,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
5193
5193
  };
5194
5194
  };
5195
5195
 
5196
- /*! @azure/msal-common v14.16.0 2024-11-05 */
5196
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
5197
5197
 
5198
5198
  /*
5199
5199
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5302,7 +5302,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5302
5302
  },
5303
5303
  };
5304
5304
 
5305
- /*! @azure/msal-common v14.16.0 2024-11-05 */
5305
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
5306
5306
 
5307
5307
  /*
5308
5308
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6141,7 +6141,7 @@ function buildStaticAuthorityOptions(authOptions) {
6141
6141
  };
6142
6142
  }
6143
6143
 
6144
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6144
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6145
6145
 
6146
6146
  /*
6147
6147
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6172,7 +6172,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6172
6172
  }
6173
6173
  }
6174
6174
 
6175
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6175
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6176
6176
 
6177
6177
  /*
6178
6178
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6191,7 +6191,7 @@ class ServerError extends AuthError {
6191
6191
  }
6192
6192
  }
6193
6193
 
6194
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6194
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6195
6195
 
6196
6196
  /*
6197
6197
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6289,7 +6289,7 @@ class ThrottlingUtils {
6289
6289
  }
6290
6290
  }
6291
6291
 
6292
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6292
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6293
6293
 
6294
6294
  /*
6295
6295
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6319,7 +6319,7 @@ function createNetworkError(error, httpStatus, responseHeaders) {
6319
6319
  return new NetworkError(error, httpStatus, responseHeaders);
6320
6320
  }
6321
6321
 
6322
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6322
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6323
6323
 
6324
6324
  /*
6325
6325
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6469,7 +6469,7 @@ class BaseClient {
6469
6469
  }
6470
6470
  }
6471
6471
 
6472
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6472
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6473
6473
  /*
6474
6474
  * Copyright (c) Microsoft Corporation. All rights reserved.
6475
6475
  * Licensed under the MIT License.
@@ -6495,7 +6495,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6495
6495
  refreshTokenExpired: refreshTokenExpired
6496
6496
  });
6497
6497
 
6498
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6498
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6499
6499
 
6500
6500
  /*
6501
6501
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6583,7 +6583,7 @@ function createInteractionRequiredAuthError(errorCode) {
6583
6583
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6584
6584
  }
6585
6585
 
6586
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6586
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6587
6587
 
6588
6588
  /*
6589
6589
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6655,7 +6655,7 @@ class ProtocolUtils {
6655
6655
  }
6656
6656
  }
6657
6657
 
6658
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6658
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6659
6659
 
6660
6660
  /*
6661
6661
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6739,7 +6739,7 @@ class PopTokenGenerator {
6739
6739
  }
6740
6740
  }
6741
6741
 
6742
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6742
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6743
6743
  /*
6744
6744
  * Copyright (c) Microsoft Corporation. All rights reserved.
6745
6745
  * Licensed under the MIT License.
@@ -6766,7 +6766,7 @@ class PopTokenGenerator {
6766
6766
  }
6767
6767
  }
6768
6768
 
6769
- /*! @azure/msal-common v14.16.0 2024-11-05 */
6769
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
6770
6770
 
6771
6771
  /*
6772
6772
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7143,7 +7143,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
7143
7143
  return baseAccount;
7144
7144
  }
7145
7145
 
7146
- /*! @azure/msal-common v14.16.0 2024-11-05 */
7146
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
7147
7147
  /*
7148
7148
  * Copyright (c) Microsoft Corporation. All rights reserved.
7149
7149
  * Licensed under the MIT License.
@@ -7161,7 +7161,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
7161
7161
  }
7162
7162
  }
7163
7163
 
7164
- /*! @azure/msal-common v14.16.0 2024-11-05 */
7164
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
7165
7165
 
7166
7166
  /*
7167
7167
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7603,7 +7603,7 @@ class AuthorizationCodeClient extends BaseClient {
7603
7603
  }
7604
7604
  }
7605
7605
 
7606
- /*! @azure/msal-common v14.16.0 2024-11-05 */
7606
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
7607
7607
 
7608
7608
  /*
7609
7609
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7823,7 +7823,7 @@ class RefreshTokenClient extends BaseClient {
7823
7823
  }
7824
7824
  }
7825
7825
 
7826
- /*! @azure/msal-common v14.16.0 2024-11-05 */
7826
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
7827
7827
 
7828
7828
  /*
7829
7829
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7959,7 +7959,7 @@ class SilentFlowClient extends BaseClient {
7959
7959
  }
7960
7960
  }
7961
7961
 
7962
- /*! @azure/msal-common v14.16.0 2024-11-05 */
7962
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
7963
7963
 
7964
7964
  /*
7965
7965
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7974,7 +7974,7 @@ const StubbedNetworkModule = {
7974
7974
  },
7975
7975
  };
7976
7976
 
7977
- /*! @azure/msal-common v14.16.0 2024-11-05 */
7977
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
7978
7978
 
7979
7979
  /*
7980
7980
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8032,7 +8032,7 @@ class AuthenticationHeaderParser {
8032
8032
  }
8033
8033
  }
8034
8034
 
8035
- /*! @azure/msal-common v14.16.0 2024-11-05 */
8035
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
8036
8036
 
8037
8037
  /*
8038
8038
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8295,7 +8295,7 @@ class ServerTelemetryManager {
8295
8295
  }
8296
8296
  }
8297
8297
 
8298
- /*! @azure/msal-common v14.16.0 2024-11-05 */
8298
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
8299
8299
  /*
8300
8300
  * Copyright (c) Microsoft Corporation. All rights reserved.
8301
8301
  * Licensed under the MIT License.
@@ -8303,7 +8303,7 @@ class ServerTelemetryManager {
8303
8303
  const missingKidError = "missing_kid_error";
8304
8304
  const missingAlgError = "missing_alg_error";
8305
8305
 
8306
- /*! @azure/msal-common v14.16.0 2024-11-05 */
8306
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
8307
8307
 
8308
8308
  /*
8309
8309
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8328,7 +8328,7 @@ function createJoseHeaderError(code) {
8328
8328
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
8329
8329
  }
8330
8330
 
8331
- /*! @azure/msal-common v14.16.0 2024-11-05 */
8331
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
8332
8332
 
8333
8333
  /*
8334
8334
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8368,7 +8368,7 @@ class JoseHeader {
8368
8368
  }
8369
8369
  }
8370
8370
 
8371
- /*! @azure/msal-common v14.16.0 2024-11-05 */
8371
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
8372
8372
 
8373
8373
  /*
8374
8374
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8447,7 +8447,7 @@ class StubPerformanceClient {
8447
8447
  }
8448
8448
  }
8449
8449
 
8450
- /*! @azure/msal-common v14.16.0 2024-11-05 */
8450
+ /*! @azure/msal-common v14.16.0 2025-01-14 */
8451
8451
 
8452
8452
  /*
8453
8453
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9717,14 +9717,14 @@ const keygenAlgorithmOptions = {
9717
9717
  /**
9718
9718
  * Check whether browser crypto is available.
9719
9719
  */
9720
- function validateCryptoAvailable() {
9720
+ function validateCryptoAvailable(skipValidateSubtleCrypto) {
9721
9721
  if (!window) {
9722
9722
  throw createBrowserAuthError(nonBrowserEnvironment);
9723
9723
  }
9724
9724
  if (!window.crypto) {
9725
9725
  throw createBrowserAuthError(cryptoNonExistent);
9726
9726
  }
9727
- if (!window.crypto.subtle) {
9727
+ if (!skipValidateSubtleCrypto && !window.crypto.subtle) {
9728
9728
  throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
9729
9729
  }
9730
9730
  }
@@ -9939,7 +9939,9 @@ function isInPopup() {
9939
9939
  * Returns current window URL as redirect uri
9940
9940
  */
9941
9941
  function getCurrentUri() {
9942
- return window.location.href.split("?")[0].split("#")[0];
9942
+ return typeof window !== "undefined" && window.location
9943
+ ? window.location.href.split("?")[0].split("#")[0]
9944
+ : "";
9943
9945
  }
9944
9946
  /**
9945
9947
  * Gets the homepage url for the current window location.
@@ -10366,7 +10368,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10366
10368
 
10367
10369
  /* eslint-disable header/header */
10368
10370
  const name = "@azure/msal-browser";
10369
- const version = "3.27.0";
10371
+ const version = "3.28.1";
10370
10372
 
10371
10373
  /*
10372
10374
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11153,10 +11155,10 @@ class AsyncMemoryStorage {
11153
11155
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
11154
11156
  */
11155
11157
  class CryptoOps {
11156
- constructor(logger, performanceClient) {
11158
+ constructor(logger, performanceClient, skipValidateSubtleCrypto) {
11157
11159
  this.logger = logger;
11158
11160
  // Browser crypto needs to be validated first before any other classes can be set.
11159
- validateCryptoAvailable();
11161
+ validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
11160
11162
  this.cache = new AsyncMemoryStorage(this.logger);
11161
11163
  this.performanceClient = performanceClient;
11162
11164
  }
@@ -11325,32 +11327,53 @@ function getSortedObjectString(obj) {
11325
11327
  * Copyright (c) Microsoft Corporation. All rights reserved.
11326
11328
  * Licensed under the MIT License.
11327
11329
  */
11328
- class BrowserStorage {
11329
- constructor(cacheLocation) {
11330
- this.validateWindowStorage(cacheLocation);
11331
- this.windowStorage = window[cacheLocation];
11330
+ class LocalStorage {
11331
+ constructor() {
11332
+ if (!window.localStorage) {
11333
+ throw createBrowserConfigurationAuthError(storageNotSupported);
11334
+ }
11335
+ }
11336
+ getItem(key) {
11337
+ return window.localStorage.getItem(key);
11338
+ }
11339
+ setItem(key, value) {
11340
+ window.localStorage.setItem(key, value);
11332
11341
  }
11333
- validateWindowStorage(cacheLocation) {
11334
- if ((cacheLocation !== BrowserCacheLocation.LocalStorage &&
11335
- cacheLocation !== BrowserCacheLocation.SessionStorage) ||
11336
- !window[cacheLocation]) {
11342
+ removeItem(key) {
11343
+ window.localStorage.removeItem(key);
11344
+ }
11345
+ getKeys() {
11346
+ return Object.keys(window.localStorage);
11347
+ }
11348
+ containsKey(key) {
11349
+ return window.localStorage.hasOwnProperty(key);
11350
+ }
11351
+ }
11352
+
11353
+ /*
11354
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11355
+ * Licensed under the MIT License.
11356
+ */
11357
+ class SessionStorage {
11358
+ constructor() {
11359
+ if (!window.sessionStorage) {
11337
11360
  throw createBrowserConfigurationAuthError(storageNotSupported);
11338
11361
  }
11339
11362
  }
11340
11363
  getItem(key) {
11341
- return this.windowStorage.getItem(key);
11364
+ return window.sessionStorage.getItem(key);
11342
11365
  }
11343
11366
  setItem(key, value) {
11344
- this.windowStorage.setItem(key, value);
11367
+ window.sessionStorage.setItem(key, value);
11345
11368
  }
11346
11369
  removeItem(key) {
11347
- this.windowStorage.removeItem(key);
11370
+ window.sessionStorage.removeItem(key);
11348
11371
  }
11349
11372
  getKeys() {
11350
- return Object.keys(this.windowStorage);
11373
+ return Object.keys(window.sessionStorage);
11351
11374
  }
11352
11375
  containsKey(key) {
11353
- return this.windowStorage.hasOwnProperty(key);
11376
+ return window.sessionStorage.hasOwnProperty(key);
11354
11377
  }
11355
11378
  }
11356
11379
 
@@ -11376,6 +11399,64 @@ function extractBrowserRequestState(browserCrypto, state) {
11376
11399
  }
11377
11400
  }
11378
11401
 
11402
+ /*
11403
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11404
+ * Licensed under the MIT License.
11405
+ */
11406
+ // Cookie life calculation (hours * minutes * seconds * ms)
11407
+ const COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
11408
+ class CookieStorage {
11409
+ getItem(key) {
11410
+ const name = `${encodeURIComponent(key)}`;
11411
+ const cookieList = document.cookie.split(";");
11412
+ for (let i = 0; i < cookieList.length; i++) {
11413
+ const cookie = cookieList[i];
11414
+ const [key, ...rest] = decodeURIComponent(cookie).trim().split("=");
11415
+ const value = rest.join("=");
11416
+ if (key === name) {
11417
+ return value;
11418
+ }
11419
+ }
11420
+ return "";
11421
+ }
11422
+ setItem(key, value, cookieLifeDays, secure = true) {
11423
+ let cookieStr = `${encodeURIComponent(key)}=${encodeURIComponent(value)};path=/;SameSite=Lax;`;
11424
+ if (cookieLifeDays) {
11425
+ const expireTime = getCookieExpirationTime(cookieLifeDays);
11426
+ cookieStr += `expires=${expireTime};`;
11427
+ }
11428
+ if (secure) {
11429
+ cookieStr += "Secure;";
11430
+ }
11431
+ document.cookie = cookieStr;
11432
+ }
11433
+ removeItem(key) {
11434
+ // Setting expiration to -1 removes it
11435
+ this.setItem(key, "", -1);
11436
+ }
11437
+ getKeys() {
11438
+ const cookieList = document.cookie.split(";");
11439
+ const keys = [];
11440
+ cookieList.forEach((cookie) => {
11441
+ const cookieParts = decodeURIComponent(cookie).trim().split("=");
11442
+ keys.push(cookieParts[0]);
11443
+ });
11444
+ return keys;
11445
+ }
11446
+ containsKey(key) {
11447
+ return this.getKeys().includes(key);
11448
+ }
11449
+ }
11450
+ /**
11451
+ * Get cookie expiration time
11452
+ * @param cookieLifeDays
11453
+ */
11454
+ function getCookieExpirationTime(cookieLifeDays) {
11455
+ const today = new Date();
11456
+ const expr = new Date(today.getTime() + cookieLifeDays * COOKIE_LIFE_MULTIPLIER);
11457
+ return expr.toUTCString();
11458
+ }
11459
+
11379
11460
  /*
11380
11461
  * Copyright (c) Microsoft Corporation. All rights reserved.
11381
11462
  * Licensed under the MIT License.
@@ -11388,13 +11469,12 @@ function extractBrowserRequestState(browserCrypto, state) {
11388
11469
  class BrowserCacheManager extends CacheManager {
11389
11470
  constructor(clientId, cacheConfig, cryptoImpl, logger, staticAuthorityOptions, performanceClient) {
11390
11471
  super(clientId, cryptoImpl, logger, staticAuthorityOptions);
11391
- // Cookie life calculation (hours * minutes * seconds * ms)
11392
- this.COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
11393
11472
  this.cacheConfig = cacheConfig;
11394
11473
  this.logger = logger;
11395
11474
  this.internalStorage = new MemoryStorage();
11396
11475
  this.browserStorage = this.setupBrowserStorage(this.cacheConfig.cacheLocation);
11397
- this.temporaryCacheStorage = this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation, this.cacheConfig.cacheLocation);
11476
+ this.temporaryCacheStorage = this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation);
11477
+ this.cookieStorage = new CookieStorage();
11398
11478
  // Migrate cache entries from older versions of MSAL.
11399
11479
  if (cacheConfig.cacheMigrationEnabled) {
11400
11480
  this.migrateCacheEntries();
@@ -11407,44 +11487,23 @@ class BrowserCacheManager extends CacheManager {
11407
11487
  * @param cacheLocation
11408
11488
  */
11409
11489
  setupBrowserStorage(cacheLocation) {
11410
- switch (cacheLocation) {
11411
- case BrowserCacheLocation.LocalStorage:
11412
- case BrowserCacheLocation.SessionStorage:
11413
- try {
11414
- return new BrowserStorage(cacheLocation);
11415
- }
11416
- catch (e) {
11417
- this.logger.verbose(e);
11490
+ try {
11491
+ switch (cacheLocation) {
11492
+ case BrowserCacheLocation.LocalStorage:
11493
+ return new LocalStorage();
11494
+ case BrowserCacheLocation.SessionStorage:
11495
+ return new SessionStorage();
11496
+ case BrowserCacheLocation.MemoryStorage:
11497
+ default:
11418
11498
  break;
11419
- }
11420
- case BrowserCacheLocation.MemoryStorage:
11499
+ }
11500
+ }
11501
+ catch (e) {
11502
+ this.logger.error(e);
11421
11503
  }
11422
11504
  this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;
11423
11505
  return new MemoryStorage();
11424
11506
  }
11425
- /**
11426
- * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.
11427
- * @param temporaryCacheLocation
11428
- * @param cacheLocation
11429
- */
11430
- setupTemporaryCacheStorage(temporaryCacheLocation, cacheLocation) {
11431
- switch (cacheLocation) {
11432
- case BrowserCacheLocation.LocalStorage:
11433
- case BrowserCacheLocation.SessionStorage:
11434
- try {
11435
- // Temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs
11436
- return new BrowserStorage(temporaryCacheLocation ||
11437
- BrowserCacheLocation.SessionStorage);
11438
- }
11439
- catch (e) {
11440
- this.logger.verbose(e);
11441
- return this.internalStorage;
11442
- }
11443
- case BrowserCacheLocation.MemoryStorage:
11444
- default:
11445
- return this.internalStorage;
11446
- }
11447
- }
11448
11507
  /**
11449
11508
  * Migrate all old cache entries to new schema. No rollback supported.
11450
11509
  * @param storeAuthStateInCookie
@@ -12132,7 +12191,7 @@ class BrowserCacheManager extends CacheManager {
12132
12191
  getTemporaryCache(cacheKey, generateKey) {
12133
12192
  const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
12134
12193
  if (this.cacheConfig.storeAuthStateInCookie) {
12135
- const itemCookie = this.getItemCookie(key);
12194
+ const itemCookie = this.cookieStorage.getItem(key);
12136
12195
  if (itemCookie) {
12137
12196
  this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies");
12138
12197
  return itemCookie;
@@ -12167,7 +12226,7 @@ class BrowserCacheManager extends CacheManager {
12167
12226
  this.temporaryCacheStorage.setItem(key, value);
12168
12227
  if (this.cacheConfig.storeAuthStateInCookie) {
12169
12228
  this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie");
12170
- this.setItemCookie(key, value);
12229
+ this.cookieStorage.setItem(key, value, undefined, this.cacheConfig.secureCookies);
12171
12230
  }
12172
12231
  }
12173
12232
  /**
@@ -12186,7 +12245,7 @@ class BrowserCacheManager extends CacheManager {
12186
12245
  this.temporaryCacheStorage.removeItem(key);
12187
12246
  if (this.cacheConfig.storeAuthStateInCookie) {
12188
12247
  this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie");
12189
- this.clearItemCookie(key);
12248
+ this.cookieStorage.removeItem(key);
12190
12249
  }
12191
12250
  }
12192
12251
  /**
@@ -12242,79 +12301,6 @@ class BrowserCacheManager extends CacheManager {
12242
12301
  this.logger.warning(`${removedAccessTokens.length} access tokens with claims in the cache keys have been removed from the cache.`);
12243
12302
  }
12244
12303
  }
12245
- /**
12246
- * Add value to cookies
12247
- * @param cookieName
12248
- * @param cookieValue
12249
- * @param expires
12250
- * @deprecated
12251
- */
12252
- setItemCookie(cookieName, cookieValue, expires) {
12253
- let cookieStr = `${encodeURIComponent(cookieName)}=${encodeURIComponent(cookieValue)};path=/;SameSite=Lax;`;
12254
- if (expires) {
12255
- const expireTime = this.getCookieExpirationTime(expires);
12256
- cookieStr += `expires=${expireTime};`;
12257
- }
12258
- if (this.cacheConfig.secureCookies) {
12259
- cookieStr += "Secure;";
12260
- }
12261
- document.cookie = cookieStr;
12262
- }
12263
- /**
12264
- * Get one item by key from cookies
12265
- * @param cookieName
12266
- * @deprecated
12267
- */
12268
- getItemCookie(cookieName) {
12269
- const name = `${encodeURIComponent(cookieName)}=`;
12270
- const cookieList = document.cookie.split(";");
12271
- for (let i = 0; i < cookieList.length; i++) {
12272
- let cookie = cookieList[i];
12273
- while (cookie.charAt(0) === " ") {
12274
- cookie = cookie.substring(1);
12275
- }
12276
- if (cookie.indexOf(name) === 0) {
12277
- return decodeURIComponent(cookie.substring(name.length, cookie.length));
12278
- }
12279
- }
12280
- return Constants.EMPTY_STRING;
12281
- }
12282
- /**
12283
- * Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.
12284
- * @deprecated
12285
- */
12286
- clearMsalCookies() {
12287
- const cookiePrefix = `${Constants.CACHE_PREFIX}.${this.clientId}`;
12288
- const cookieList = document.cookie.split(";");
12289
- cookieList.forEach((cookie) => {
12290
- while (cookie.charAt(0) === " ") {
12291
- // eslint-disable-next-line no-param-reassign
12292
- cookie = cookie.substring(1);
12293
- }
12294
- if (cookie.indexOf(cookiePrefix) === 0) {
12295
- const cookieKey = cookie.split("=")[0];
12296
- this.clearItemCookie(cookieKey);
12297
- }
12298
- });
12299
- }
12300
- /**
12301
- * Clear an item in the cookies by key
12302
- * @param cookieName
12303
- * @deprecated
12304
- */
12305
- clearItemCookie(cookieName) {
12306
- this.setItemCookie(cookieName, Constants.EMPTY_STRING, -1);
12307
- }
12308
- /**
12309
- * Get cookie expiration time
12310
- * @param cookieLifeDays
12311
- * @deprecated
12312
- */
12313
- getCookieExpirationTime(cookieLifeDays) {
12314
- const today = new Date();
12315
- const expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);
12316
- return expr.toUTCString();
12317
- }
12318
12304
  /**
12319
12305
  * 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)
12320
12306
  * @param key
@@ -12438,7 +12424,6 @@ class BrowserCacheManager extends CacheManager {
12438
12424
  this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${cachedState}`);
12439
12425
  this.resetRequestCache(cachedState || Constants.EMPTY_STRING);
12440
12426
  }
12441
- this.clearMsalCookies();
12442
12427
  }
12443
12428
  /**
12444
12429
  * Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
@@ -12466,7 +12451,6 @@ class BrowserCacheManager extends CacheManager {
12466
12451
  this.resetRequestCache(stateValue);
12467
12452
  }
12468
12453
  });
12469
- this.clearMsalCookies();
12470
12454
  this.setInteractionInProgress(false);
12471
12455
  }
12472
12456
  cacheCodeRequest(authCodeRequest) {
@@ -13321,6 +13305,10 @@ class StandardInteractionClient extends BaseInteractionClient {
13321
13305
  responseMode: this.config.auth.OIDCOptions
13322
13306
  .serverResponseType,
13323
13307
  };
13308
+ // Skip active account lookup if either login hint or session id is set
13309
+ if (request.loginHint || request.sid) {
13310
+ return validatedRequest;
13311
+ }
13324
13312
  const account = request.account || this.browserStorage.getActiveAccount();
13325
13313
  if (account) {
13326
13314
  this.logger.verbose("Setting validated request account", this.correlationId);
@@ -17615,7 +17603,7 @@ class NestedAppAuthController {
17615
17603
  this.performanceClient = this.config.telemetry.client;
17616
17604
  // Initialize the crypto class.
17617
17605
  this.browserCrypto = operatingContext.isBrowserEnvironment()
17618
- ? new CryptoOps(this.logger, this.performanceClient)
17606
+ ? new CryptoOps(this.logger, this.performanceClient, true)
17619
17607
  : DEFAULT_CRYPTO_IMPLEMENTATION;
17620
17608
  // Initialize the browser storage class.
17621
17609
  this.browserStorage = this.operatingContext.isBrowserEnvironment()
@@ -19228,6 +19216,42 @@ const stubbedPublicClientApplication = {
19228
19216
  },
19229
19217
  };
19230
19218
 
19219
+ /*
19220
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19221
+ * Licensed under the MIT License.
19222
+ */
19223
+ /**
19224
+ * @deprecated This class will be removed in a future major version
19225
+ */
19226
+ class BrowserStorage {
19227
+ constructor(cacheLocation) {
19228
+ if (cacheLocation === BrowserCacheLocation.LocalStorage) {
19229
+ this.windowStorage = new LocalStorage();
19230
+ }
19231
+ else if (cacheLocation === BrowserCacheLocation.SessionStorage) {
19232
+ this.windowStorage = new SessionStorage();
19233
+ }
19234
+ else {
19235
+ throw createBrowserConfigurationAuthError(storageNotSupported);
19236
+ }
19237
+ }
19238
+ getItem(key) {
19239
+ return this.windowStorage.getItem(key);
19240
+ }
19241
+ setItem(key, value) {
19242
+ this.windowStorage.setItem(key, value);
19243
+ }
19244
+ removeItem(key) {
19245
+ this.windowStorage.removeItem(key);
19246
+ }
19247
+ getKeys() {
19248
+ return Object.keys(this.windowStorage);
19249
+ }
19250
+ containsKey(key) {
19251
+ return this.windowStorage.hasOwnProperty(key);
19252
+ }
19253
+ }
19254
+
19231
19255
  /*
19232
19256
  * Copyright (c) Microsoft Corporation. All rights reserved.
19233
19257
  * Licensed under the MIT License.
@@ -19633,6 +19657,7 @@ exports.InteractionRequiredAuthErrorCodes = InteractionRequiredAuthErrorCodes;
19633
19657
  exports.InteractionRequiredAuthErrorMessage = InteractionRequiredAuthErrorMessage;
19634
19658
  exports.InteractionStatus = InteractionStatus;
19635
19659
  exports.JsonWebTokenTypes = JsonWebTokenTypes;
19660
+ exports.LocalStorage = LocalStorage;
19636
19661
  exports.Logger = Logger;
19637
19662
  exports.MemoryStorage = MemoryStorage;
19638
19663
  exports.NavigationClient = NavigationClient;
@@ -19644,6 +19669,7 @@ exports.PublicClientApplication = PublicClientApplication;
19644
19669
  exports.PublicClientNext = PublicClientNext;
19645
19670
  exports.ServerError = ServerError;
19646
19671
  exports.ServerResponseType = ServerResponseType;
19672
+ exports.SessionStorage = SessionStorage;
19647
19673
  exports.SignedHttpRequest = SignedHttpRequest;
19648
19674
  exports.StringUtils = StringUtils;
19649
19675
  exports.StubPerformanceClient = StubPerformanceClient;