@azure/msal-browser 2.38.1 → 2.38.3

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.d.ts.map +1 -1
  4. package/dist/app/ClientApplication.js +11 -2
  5. package/dist/app/ClientApplication.js.map +1 -1
  6. package/dist/app/IPublicClientApplication.js +1 -1
  7. package/dist/app/PublicClientApplication.js +1 -1
  8. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  9. package/dist/cache/AsyncMemoryStorage.js +1 -1
  10. package/dist/cache/BrowserCacheManager.d.ts +6 -0
  11. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  12. package/dist/cache/BrowserCacheManager.js +35 -1
  13. package/dist/cache/BrowserCacheManager.js.map +1 -1
  14. package/dist/cache/BrowserStorage.js +1 -1
  15. package/dist/cache/CryptoKeyStore.js +1 -1
  16. package/dist/cache/DatabaseStorage.js +1 -1
  17. package/dist/cache/MemoryStorage.js +1 -1
  18. package/dist/cache/TokenCache.js +1 -1
  19. package/dist/config/Configuration.js +1 -1
  20. package/dist/crypto/BrowserCrypto.js +1 -1
  21. package/dist/crypto/CryptoOps.js +1 -1
  22. package/dist/crypto/GuidGenerator.js +1 -1
  23. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  24. package/dist/crypto/MsBrowserCrypto.js +1 -1
  25. package/dist/crypto/MsrBrowserCrypto.js +1 -1
  26. package/dist/crypto/PkceGenerator.js +1 -1
  27. package/dist/crypto/SignedHttpRequest.js +1 -1
  28. package/dist/encode/Base64Decode.js +1 -1
  29. package/dist/encode/Base64Encode.js +1 -1
  30. package/dist/error/BrowserAuthError.js +1 -1
  31. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  32. package/dist/error/NativeAuthError.js +1 -1
  33. package/dist/event/EventHandler.js +1 -1
  34. package/dist/event/EventMessage.js +1 -1
  35. package/dist/event/EventType.js +1 -1
  36. package/dist/index.cjs.js +121 -65
  37. package/dist/index.cjs.js.map +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/interaction_client/BaseInteractionClient.js +1 -1
  40. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  41. package/dist/interaction_client/NativeInteractionClient.js +1 -1
  42. package/dist/interaction_client/PopupClient.js +1 -1
  43. package/dist/interaction_client/RedirectClient.js +1 -1
  44. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  45. package/dist/interaction_client/SilentCacheClient.js +1 -1
  46. package/dist/interaction_client/SilentIframeClient.js +1 -1
  47. package/dist/interaction_client/SilentRefreshClient.js +1 -1
  48. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  49. package/dist/interaction_handler/InteractionHandler.js +1 -1
  50. package/dist/interaction_handler/RedirectHandler.js +1 -1
  51. package/dist/interaction_handler/SilentHandler.js +1 -1
  52. package/dist/internals.js +1 -1
  53. package/dist/navigation/NavigationClient.js +1 -1
  54. package/dist/network/FetchClient.js +1 -1
  55. package/dist/network/XhrClient.js +1 -1
  56. package/dist/packageMetadata.d.ts +1 -1
  57. package/dist/packageMetadata.js +2 -2
  58. package/dist/packageMetadata.js.map +1 -1
  59. package/dist/telemetry/BrowserPerformanceClient.js +1 -1
  60. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  61. package/dist/utils/BrowserConstants.js +1 -1
  62. package/dist/utils/BrowserProtocolUtils.js +1 -1
  63. package/dist/utils/BrowserStringUtils.js +1 -1
  64. package/dist/utils/BrowserUtils.js +1 -1
  65. package/dist/utils/MathUtils.js +1 -1
  66. package/lib/msal-browser.js +121 -65
  67. package/lib/msal-browser.js.map +1 -1
  68. package/lib/msal-browser.min.js +30 -30
  69. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, AuthError } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { InteractionRequiredAuthError, AuthError } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  import { AccountEntity, CacheManager } from '@azure/msal-common';
4
4
  import { EventType } from './EventType.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  import { EventType } from './EventType.js';
4
4
  import { InteractionType, InteractionStatus } from '../utils/BrowserConstants.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.38.1 2023-08-07 */
1
+ /*! @azure/msal-browser v2.38.3 2023-10-27 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -117,7 +117,7 @@ function __spread() {
117
117
  return ar;
118
118
  }
119
119
 
120
- /*! @azure/msal-common v13.2.1 2023-08-07 */
120
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
121
121
  /*! *****************************************************************************
122
122
  Copyright (c) Microsoft Corporation.
123
123
 
@@ -204,7 +204,7 @@ function __spreadArrays() {
204
204
  return r;
205
205
  }
206
206
 
207
- /*! @azure/msal-common v13.2.1 2023-08-07 */
207
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
208
208
 
209
209
  /*
210
210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -577,7 +577,7 @@ var JsonTypes;
577
577
  JsonTypes["Pop"] = "pop";
578
578
  })(JsonTypes || (JsonTypes = {}));
579
579
 
580
- /*! @azure/msal-common v13.2.1 2023-08-07 */
580
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
581
581
 
582
582
  /*
583
583
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -633,7 +633,7 @@ var AuthError = /** @class */ (function (_super) {
633
633
  return AuthError;
634
634
  }(Error));
635
635
 
636
- /*! @azure/msal-common v13.2.1 2023-08-07 */
636
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
637
637
 
638
638
  /*
639
639
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -708,7 +708,7 @@ var DEFAULT_CRYPTO_IMPLEMENTATION = {
708
708
  }
709
709
  };
710
710
 
711
- /*! @azure/msal-common v13.2.1 2023-08-07 */
711
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
712
712
 
713
713
  /*
714
714
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1223,7 +1223,7 @@ var ClientAuthError = /** @class */ (function (_super) {
1223
1223
  return ClientAuthError;
1224
1224
  }(AuthError));
1225
1225
 
1226
- /*! @azure/msal-common v13.2.1 2023-08-07 */
1226
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
1227
1227
 
1228
1228
  /*
1229
1229
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1348,7 +1348,7 @@ var StringUtils = /** @class */ (function () {
1348
1348
  return StringUtils;
1349
1349
  }());
1350
1350
 
1351
- /*! @azure/msal-common v13.2.1 2023-08-07 */
1351
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
1352
1352
 
1353
1353
  /*
1354
1354
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1538,12 +1538,12 @@ var Logger = /** @class */ (function () {
1538
1538
  return Logger;
1539
1539
  }());
1540
1540
 
1541
- /*! @azure/msal-common v13.2.1 2023-08-07 */
1541
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
1542
1542
  /* eslint-disable header/header */
1543
1543
  var name$1 = "@azure/msal-common";
1544
- var version$1 = "13.2.1";
1544
+ var version$1 = "13.3.1";
1545
1545
 
1546
- /*! @azure/msal-common v13.2.1 2023-08-07 */
1546
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
1547
1547
  /*
1548
1548
  * Copyright (c) Microsoft Corporation. All rights reserved.
1549
1549
  * Licensed under the MIT License.
@@ -1564,7 +1564,7 @@ exports.AzureCloudInstance = void 0;
1564
1564
  AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1565
1565
  })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1566
1566
 
1567
- /*! @azure/msal-common v13.2.1 2023-08-07 */
1567
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
1568
1568
 
1569
1569
  /*
1570
1570
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1829,7 +1829,7 @@ var ClientConfigurationError = /** @class */ (function (_super) {
1829
1829
  return ClientConfigurationError;
1830
1830
  }(ClientAuthError));
1831
1831
 
1832
- /*! @azure/msal-common v13.2.1 2023-08-07 */
1832
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
1833
1833
 
1834
1834
  /*
1835
1835
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2028,7 +2028,7 @@ var ScopeSet = /** @class */ (function () {
2028
2028
  return ScopeSet;
2029
2029
  }());
2030
2030
 
2031
- /*! @azure/msal-common v13.2.1 2023-08-07 */
2031
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
2032
2032
 
2033
2033
  /*
2034
2034
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2066,7 +2066,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2066
2066
  };
2067
2067
  }
2068
2068
 
2069
- /*! @azure/msal-common v13.2.1 2023-08-07 */
2069
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
2070
2070
  /*
2071
2071
  * Copyright (c) Microsoft Corporation. All rights reserved.
2072
2072
  * Licensed under the MIT License.
@@ -2082,7 +2082,7 @@ var AuthorityType;
2082
2082
  AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
2083
2083
  })(AuthorityType || (AuthorityType = {}));
2084
2084
 
2085
- /*! @azure/msal-common v13.2.1 2023-08-07 */
2085
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
2086
2086
 
2087
2087
  /*
2088
2088
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2321,7 +2321,7 @@ var AccountEntity = /** @class */ (function () {
2321
2321
  return AccountEntity;
2322
2322
  }());
2323
2323
 
2324
- /*! @azure/msal-common v13.2.1 2023-08-07 */
2324
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
2325
2325
 
2326
2326
  /*
2327
2327
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2373,7 +2373,7 @@ var AuthToken = /** @class */ (function () {
2373
2373
  return AuthToken;
2374
2374
  }());
2375
2375
 
2376
- /*! @azure/msal-common v13.2.1 2023-08-07 */
2376
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
2377
2377
 
2378
2378
  /*
2379
2379
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2901,6 +2901,7 @@ var CacheManager = /** @class */ (function () {
2901
2901
  * @param inputRealm
2902
2902
  */
2903
2903
  CacheManager.prototype.getIdToken = function (account, tokenKeys) {
2904
+ var _this = this;
2904
2905
  this.commonLogger.trace("CacheManager - getIdToken called");
2905
2906
  var idTokenFilter = {
2906
2907
  homeAccountId: account.homeAccountId,
@@ -2916,7 +2917,11 @@ var CacheManager = /** @class */ (function () {
2916
2917
  return null;
2917
2918
  }
2918
2919
  else if (numIdTokens > 1) {
2919
- throw ClientAuthError.createMultipleMatchingTokensInCacheError();
2920
+ this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them");
2921
+ idTokens.forEach(function (idToken) {
2922
+ _this.removeIdToken(idToken.generateCredentialKey());
2923
+ });
2924
+ return null;
2920
2925
  }
2921
2926
  this.commonLogger.info("CacheManager:getIdToken - Returning id token");
2922
2927
  return idTokens[0];
@@ -3017,7 +3022,11 @@ var CacheManager = /** @class */ (function () {
3017
3022
  return null;
3018
3023
  }
3019
3024
  else if (numAccessTokens > 1) {
3020
- throw ClientAuthError.createMultipleMatchingTokensInCacheError();
3025
+ this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them");
3026
+ accessTokens.forEach(function (accessToken) {
3027
+ _this.removeAccessToken(accessToken.generateCredentialKey());
3028
+ });
3029
+ return null;
3021
3030
  }
3022
3031
  this.commonLogger.info("CacheManager:getAccessToken - Returning access token");
3023
3032
  return accessTokens[0];
@@ -3421,7 +3430,7 @@ var DefaultStorageClass = /** @class */ (function (_super) {
3421
3430
  return DefaultStorageClass;
3422
3431
  }(CacheManager));
3423
3432
 
3424
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3433
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3425
3434
 
3426
3435
  /*
3427
3436
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3518,7 +3527,7 @@ function buildAuthOptions(authOptions) {
3518
3527
  return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
3519
3528
  }
3520
3529
 
3521
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3530
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3522
3531
 
3523
3532
  /*
3524
3533
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3538,7 +3547,7 @@ var ServerError = /** @class */ (function (_super) {
3538
3547
  return ServerError;
3539
3548
  }(AuthError));
3540
3549
 
3541
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3550
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3542
3551
 
3543
3552
  /*
3544
3553
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3634,7 +3643,7 @@ var ThrottlingUtils = /** @class */ (function () {
3634
3643
  return ThrottlingUtils;
3635
3644
  }());
3636
3645
 
3637
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3646
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3638
3647
 
3639
3648
  /*
3640
3649
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3683,7 +3692,7 @@ var NetworkManager = /** @class */ (function () {
3683
3692
  return NetworkManager;
3684
3693
  }());
3685
3694
 
3686
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3695
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3687
3696
  /*
3688
3697
  * Copyright (c) Microsoft Corporation. All rights reserved.
3689
3698
  * Licensed under the MIT License.
@@ -3694,7 +3703,7 @@ var CcsCredentialType;
3694
3703
  CcsCredentialType["UPN"] = "UPN";
3695
3704
  })(CcsCredentialType || (CcsCredentialType = {}));
3696
3705
 
3697
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3706
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3698
3707
 
3699
3708
  /*
3700
3709
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3785,7 +3794,7 @@ var RequestValidator = /** @class */ (function () {
3785
3794
  return RequestValidator;
3786
3795
  }());
3787
3796
 
3788
- /*! @azure/msal-common v13.2.1 2023-08-07 */
3797
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
3789
3798
 
3790
3799
  /*
3791
3800
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4163,7 +4172,7 @@ var RequestParameterBuilder = /** @class */ (function () {
4163
4172
  return RequestParameterBuilder;
4164
4173
  }());
4165
4174
 
4166
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4175
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4167
4176
 
4168
4177
  /*
4169
4178
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4265,7 +4274,7 @@ var BaseClient = /** @class */ (function () {
4265
4274
  return BaseClient;
4266
4275
  }());
4267
4276
 
4268
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4277
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4269
4278
 
4270
4279
  /*
4271
4280
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4403,7 +4412,7 @@ var CredentialEntity = /** @class */ (function () {
4403
4412
  return CredentialEntity;
4404
4413
  }());
4405
4414
 
4406
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4415
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4407
4416
 
4408
4417
  /*
4409
4418
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4467,7 +4476,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
4467
4476
  return IdTokenEntity;
4468
4477
  }(CredentialEntity));
4469
4478
 
4470
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4479
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4471
4480
  /*
4472
4481
  * Copyright (c) Microsoft Corporation. All rights reserved.
4473
4482
  * Licensed under the MIT License.
@@ -4517,7 +4526,7 @@ var TimeUtils = /** @class */ (function () {
4517
4526
  return TimeUtils;
4518
4527
  }());
4519
4528
 
4520
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4529
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4521
4530
 
4522
4531
  /*
4523
4532
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4631,7 +4640,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
4631
4640
  return AccessTokenEntity;
4632
4641
  }(CredentialEntity));
4633
4642
 
4634
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4643
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4635
4644
 
4636
4645
  /*
4637
4646
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4698,7 +4707,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
4698
4707
  return RefreshTokenEntity;
4699
4708
  }(CredentialEntity));
4700
4709
 
4701
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4710
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4702
4711
 
4703
4712
  /*
4704
4713
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4777,7 +4786,7 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
4777
4786
  return InteractionRequiredAuthError;
4778
4787
  }(AuthError));
4779
4788
 
4780
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4789
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4781
4790
  /*
4782
4791
  * Copyright (c) Microsoft Corporation. All rights reserved.
4783
4792
  * Licensed under the MIT License.
@@ -4793,7 +4802,7 @@ var CacheRecord = /** @class */ (function () {
4793
4802
  return CacheRecord;
4794
4803
  }());
4795
4804
 
4796
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4805
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4797
4806
 
4798
4807
  /*
4799
4808
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4864,7 +4873,7 @@ var ProtocolUtils = /** @class */ (function () {
4864
4873
  return ProtocolUtils;
4865
4874
  }());
4866
4875
 
4867
- /*! @azure/msal-common v13.2.1 2023-08-07 */
4876
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
4868
4877
 
4869
4878
  /*
4870
4879
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5098,7 +5107,7 @@ var UrlString = /** @class */ (function () {
5098
5107
  return UrlString;
5099
5108
  }());
5100
5109
 
5101
- /*! @azure/msal-common v13.2.1 2023-08-07 */
5110
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
5102
5111
  /*
5103
5112
  * Copyright (c) Microsoft Corporation. All rights reserved.
5104
5113
  * Licensed under the MIT License.
@@ -5302,6 +5311,10 @@ exports.PerformanceEvents = void 0;
5302
5311
  PerformanceEvents["UpdateCloudDiscoveryMetadataMeasurement"] = "updateCloudDiscoveryMetadataMeasurement";
5303
5312
  PerformanceEvents["UsernamePasswordClientAcquireToken"] = "usernamePasswordClientAcquireToken";
5304
5313
  PerformanceEvents["NativeMessageHandlerHandshake"] = "nativeMessageHandlerHandshake";
5314
+ /**
5315
+ * Cache operations
5316
+ */
5317
+ PerformanceEvents["ClearTokensAndKeysWithClaims"] = "clearTokensAndKeysWithClaims";
5305
5318
  })(exports.PerformanceEvents || (exports.PerformanceEvents = {}));
5306
5319
  /**
5307
5320
  * State of the performance event.
@@ -5327,7 +5340,7 @@ var IntFields = new Set([
5327
5340
  "status",
5328
5341
  ]);
5329
5342
 
5330
- /*! @azure/msal-common v13.2.1 2023-08-07 */
5343
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
5331
5344
 
5332
5345
  /*
5333
5346
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5436,7 +5449,7 @@ var PopTokenGenerator = /** @class */ (function () {
5436
5449
  return PopTokenGenerator;
5437
5450
  }());
5438
5451
 
5439
- /*! @azure/msal-common v13.2.1 2023-08-07 */
5452
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
5440
5453
 
5441
5454
  /*
5442
5455
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5506,7 +5519,7 @@ var AppMetadataEntity = /** @class */ (function () {
5506
5519
  return AppMetadataEntity;
5507
5520
  }());
5508
5521
 
5509
- /*! @azure/msal-common v13.2.1 2023-08-07 */
5522
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
5510
5523
  /*
5511
5524
  * Copyright (c) Microsoft Corporation. All rights reserved.
5512
5525
  * Licensed under the MIT License.
@@ -5542,7 +5555,7 @@ var AppMetadataEntity = /** @class */ (function () {
5542
5555
  return TokenCacheContext;
5543
5556
  }());
5544
5557
 
5545
- /*! @azure/msal-common v13.2.1 2023-08-07 */
5558
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
5546
5559
 
5547
5560
  /*
5548
5561
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5829,7 +5842,7 @@ var ResponseHandler = /** @class */ (function () {
5829
5842
  return ResponseHandler;
5830
5843
  }());
5831
5844
 
5832
- /*! @azure/msal-common v13.2.1 2023-08-07 */
5845
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
5833
5846
 
5834
5847
  /*
5835
5848
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6307,7 +6320,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
6307
6320
  return AuthorizationCodeClient;
6308
6321
  }(BaseClient));
6309
6322
 
6310
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6323
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6311
6324
 
6312
6325
  /*
6313
6326
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6581,7 +6594,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
6581
6594
  return RefreshTokenClient;
6582
6595
  }(BaseClient));
6583
6596
 
6584
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6597
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6585
6598
 
6586
6599
  /*
6587
6600
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6711,7 +6724,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
6711
6724
  return SilentFlowClient;
6712
6725
  }(BaseClient));
6713
6726
 
6714
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6727
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6715
6728
  /*
6716
6729
  * Copyright (c) Microsoft Corporation. All rights reserved.
6717
6730
  * Licensed under the MIT License.
@@ -6723,7 +6736,7 @@ function isOpenIdConfigResponse(response) {
6723
6736
  response.hasOwnProperty("jwks_uri"));
6724
6737
  }
6725
6738
 
6726
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6739
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6727
6740
  /*
6728
6741
  * Copyright (c) Microsoft Corporation. All rights reserved.
6729
6742
  * Licensed under the MIT License.
@@ -6732,7 +6745,7 @@ var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/
6732
6745
  var EndpointMetadata = rawMetdataJSON.endpointMetadata;
6733
6746
  var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
6734
6747
 
6735
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6748
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6736
6749
  /*
6737
6750
  * Copyright (c) Microsoft Corporation. All rights reserved.
6738
6751
  * Licensed under the MIT License.
@@ -6746,7 +6759,7 @@ exports.ProtocolMode = void 0;
6746
6759
  ProtocolMode["OIDC"] = "OIDC";
6747
6760
  })(exports.ProtocolMode || (exports.ProtocolMode = {}));
6748
6761
 
6749
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6762
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6750
6763
 
6751
6764
  /*
6752
6765
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6823,7 +6836,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
6823
6836
  return AuthorityMetadataEntity;
6824
6837
  }());
6825
6838
 
6826
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6839
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6827
6840
  /*
6828
6841
  * Copyright (c) Microsoft Corporation. All rights reserved.
6829
6842
  * Licensed under the MIT License.
@@ -6833,7 +6846,7 @@ function isCloudInstanceDiscoveryResponse(response) {
6833
6846
  response.hasOwnProperty("metadata"));
6834
6847
  }
6835
6848
 
6836
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6849
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6837
6850
  /*
6838
6851
  * Copyright (c) Microsoft Corporation. All rights reserved.
6839
6852
  * Licensed under the MIT License.
@@ -6843,7 +6856,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
6843
6856
  response.hasOwnProperty("error_description"));
6844
6857
  }
6845
6858
 
6846
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6859
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6847
6860
 
6848
6861
  /*
6849
6862
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6975,7 +6988,7 @@ var RegionDiscovery = /** @class */ (function () {
6975
6988
  return RegionDiscovery;
6976
6989
  }());
6977
6990
 
6978
- /*! @azure/msal-common v13.2.1 2023-08-07 */
6991
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
6979
6992
 
6980
6993
  /*
6981
6994
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7768,7 +7781,7 @@ var Authority = /** @class */ (function () {
7768
7781
  return Authority;
7769
7782
  }());
7770
7783
 
7771
- /*! @azure/msal-common v13.2.1 2023-08-07 */
7784
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7772
7785
 
7773
7786
  /*
7774
7787
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7832,7 +7845,7 @@ var AuthorityFactory = /** @class */ (function () {
7832
7845
  return AuthorityFactory;
7833
7846
  }());
7834
7847
 
7835
- /*! @azure/msal-common v13.2.1 2023-08-07 */
7848
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7836
7849
 
7837
7850
  /*
7838
7851
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7863,7 +7876,7 @@ var ServerTelemetryEntity = /** @class */ (function () {
7863
7876
  return ServerTelemetryEntity;
7864
7877
  }());
7865
7878
 
7866
- /*! @azure/msal-common v13.2.1 2023-08-07 */
7879
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7867
7880
 
7868
7881
  /*
7869
7882
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7891,7 +7904,7 @@ var ThrottlingEntity = /** @class */ (function () {
7891
7904
  return ThrottlingEntity;
7892
7905
  }());
7893
7906
 
7894
- /*! @azure/msal-common v13.2.1 2023-08-07 */
7907
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7895
7908
 
7896
7909
  /*
7897
7910
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7908,7 +7921,7 @@ var StubbedNetworkModule = {
7908
7921
  }
7909
7922
  };
7910
7923
 
7911
- /*! @azure/msal-common v13.2.1 2023-08-07 */
7924
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7912
7925
 
7913
7926
  /*
7914
7927
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7953,7 +7966,7 @@ var JoseHeaderError = /** @class */ (function (_super) {
7953
7966
  return JoseHeaderError;
7954
7967
  }(AuthError));
7955
7968
 
7956
- /*! @azure/msal-common v13.2.1 2023-08-07 */
7969
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7957
7970
 
7958
7971
  /*
7959
7972
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7993,7 +8006,7 @@ var JoseHeader = /** @class */ (function () {
7993
8006
  return JoseHeader;
7994
8007
  }());
7995
8008
 
7996
- /*! @azure/msal-common v13.2.1 2023-08-07 */
8009
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
7997
8010
 
7998
8011
  /*
7999
8012
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8052,7 +8065,7 @@ var AuthenticationHeaderParser = /** @class */ (function () {
8052
8065
  return AuthenticationHeaderParser;
8053
8066
  }());
8054
8067
 
8055
- /*! @azure/msal-common v13.2.1 2023-08-07 */
8068
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
8056
8069
 
8057
8070
  /*
8058
8071
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8214,7 +8227,7 @@ var ServerTelemetryManager = /** @class */ (function () {
8214
8227
  return ServerTelemetryManager;
8215
8228
  }());
8216
8229
 
8217
- /*! @azure/msal-common v13.2.1 2023-08-07 */
8230
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
8218
8231
 
8219
8232
  /*
8220
8233
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8617,7 +8630,7 @@ var PerformanceClient = /** @class */ (function () {
8617
8630
  return PerformanceClient;
8618
8631
  }());
8619
8632
 
8620
- /*! @azure/msal-common v13.2.1 2023-08-07 */
8633
+ /*! @azure/msal-common v13.3.1 2023-10-27 */
8621
8634
 
8622
8635
  /*
8623
8636
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10448,6 +10461,40 @@ var BrowserCacheManager = /** @class */ (function (_super) {
10448
10461
  });
10449
10462
  });
10450
10463
  };
10464
+ /**
10465
+ * Clears all access tokes that have claims prior to saving the current one
10466
+ * @param credential
10467
+ * @returns
10468
+ */
10469
+ BrowserCacheManager.prototype.clearTokensAndKeysWithClaims = function () {
10470
+ return __awaiter$1(this, void 0, void 0, function () {
10471
+ var tokenKeys, removedAccessTokens;
10472
+ var _this = this;
10473
+ return __generator$1(this, function (_a) {
10474
+ switch (_a.label) {
10475
+ case 0:
10476
+ this.logger.trace("BrowserCacheManager.clearTokensAndKeysWithClaims called");
10477
+ tokenKeys = this.getTokenKeys();
10478
+ removedAccessTokens = [];
10479
+ tokenKeys.accessToken.forEach(function (key) {
10480
+ // if the access token has claims in its key, remove the token key and the token
10481
+ var credential = _this.getAccessTokenCredential(key);
10482
+ if ((credential === null || credential === void 0 ? void 0 : credential.requestedClaimsHash) && key.includes(credential.requestedClaimsHash.toLowerCase())) {
10483
+ removedAccessTokens.push(_this.removeAccessToken(key));
10484
+ }
10485
+ });
10486
+ return [4 /*yield*/, Promise.all(removedAccessTokens)];
10487
+ case 1:
10488
+ _a.sent();
10489
+ // warn if any access tokens are removed
10490
+ if (removedAccessTokens.length > 0) {
10491
+ this.logger.warning(removedAccessTokens.length + " access tokens with claims in the cache keys have been removed from the cache.");
10492
+ }
10493
+ return [2 /*return*/];
10494
+ }
10495
+ });
10496
+ });
10497
+ };
10451
10498
  /**
10452
10499
  * Add value to cookies
10453
10500
  * @param cookieName
@@ -10843,7 +10890,7 @@ var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
10843
10890
 
10844
10891
  /* eslint-disable header/header */
10845
10892
  var name = "@azure/msal-browser";
10846
- var version = "2.38.1";
10893
+ var version = "2.38.3";
10847
10894
 
10848
10895
  /*
10849
10896
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -16709,7 +16756,7 @@ var ClientApplication = /** @class */ (function () {
16709
16756
  */
16710
16757
  ClientApplication.prototype.initialize = function () {
16711
16758
  return __awaiter$1(this, void 0, void 0, function () {
16712
- var allowNativeBroker, initMeasurement, _a, e_1;
16759
+ var allowNativeBroker, initMeasurement, _a, e_1, claimsTokensRemovalMeasurement;
16713
16760
  return __generator$1(this, function (_b) {
16714
16761
  switch (_b.label) {
16715
16762
  case 0:
@@ -16735,6 +16782,15 @@ var ClientApplication = /** @class */ (function () {
16735
16782
  this.logger.verbose(e_1);
16736
16783
  return [3 /*break*/, 4];
16737
16784
  case 4:
16785
+ if (!!this.config.cache.claimsBasedCachingEnabled) return [3 /*break*/, 6];
16786
+ this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims");
16787
+ claimsTokensRemovalMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.ClearTokensAndKeysWithClaims);
16788
+ return [4 /*yield*/, this.browserStorage.clearTokensAndKeysWithClaims()];
16789
+ case 5:
16790
+ _b.sent();
16791
+ claimsTokensRemovalMeasurement.endMeasurement({ success: true });
16792
+ _b.label = 6;
16793
+ case 6:
16738
16794
  this.initialized = true;
16739
16795
  this.eventHandler.emitEvent(exports.EventType.INITIALIZE_END);
16740
16796
  initMeasurement.endMeasurement({ allowNativeBroker: allowNativeBroker, success: true });