@azure/msal-browser 2.37.0 → 2.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) 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 +3 -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.map +1 -1
  11. package/dist/cache/BrowserCacheManager.js +3 -2
  12. package/dist/cache/BrowserCacheManager.js.map +1 -1
  13. package/dist/cache/BrowserStorage.js +1 -1
  14. package/dist/cache/CryptoKeyStore.js +1 -1
  15. package/dist/cache/DatabaseStorage.js +1 -1
  16. package/dist/cache/MemoryStorage.js +1 -1
  17. package/dist/cache/TokenCache.js +1 -1
  18. package/dist/config/Configuration.d.ts +4 -0
  19. package/dist/config/Configuration.d.ts.map +1 -1
  20. package/dist/config/Configuration.js +3 -2
  21. package/dist/config/Configuration.js.map +1 -1
  22. package/dist/crypto/BrowserCrypto.js +1 -1
  23. package/dist/crypto/CryptoOps.js +1 -1
  24. package/dist/crypto/GuidGenerator.js +1 -1
  25. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  26. package/dist/crypto/MsBrowserCrypto.js +1 -1
  27. package/dist/crypto/MsrBrowserCrypto.js +1 -1
  28. package/dist/crypto/PkceGenerator.js +1 -1
  29. package/dist/crypto/SignedHttpRequest.js +1 -1
  30. package/dist/encode/Base64Decode.js +1 -1
  31. package/dist/encode/Base64Encode.js +1 -1
  32. package/dist/error/BrowserAuthError.js +1 -1
  33. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  34. package/dist/error/NativeAuthError.js +1 -1
  35. package/dist/event/EventHandler.js +1 -1
  36. package/dist/event/EventMessage.d.ts.map +1 -1
  37. package/dist/event/EventMessage.js +2 -1
  38. package/dist/event/EventMessage.js.map +1 -1
  39. package/dist/event/EventType.d.ts +2 -1
  40. package/dist/event/EventType.d.ts.map +1 -1
  41. package/dist/event/EventType.js +2 -1
  42. package/dist/event/EventType.js.map +1 -1
  43. package/dist/index.cjs.js +243 -152
  44. package/dist/index.cjs.js.map +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/interaction_client/BaseInteractionClient.d.ts +2 -1
  47. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  48. package/dist/interaction_client/BaseInteractionClient.js +33 -7
  49. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  50. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  51. package/dist/interaction_client/NativeInteractionClient.d.ts +1 -1
  52. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  53. package/dist/interaction_client/NativeInteractionClient.js +22 -15
  54. package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
  55. package/dist/interaction_client/PopupClient.js +1 -1
  56. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  57. package/dist/interaction_client/RedirectClient.js +3 -2
  58. package/dist/interaction_client/RedirectClient.js.map +1 -1
  59. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  60. package/dist/interaction_client/SilentCacheClient.js +2 -2
  61. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  62. package/dist/interaction_client/SilentIframeClient.js +1 -1
  63. package/dist/interaction_client/SilentRefreshClient.js +2 -2
  64. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  65. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  66. package/dist/interaction_client/StandardInteractionClient.js +4 -1
  67. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  68. package/dist/interaction_handler/InteractionHandler.js +1 -1
  69. package/dist/interaction_handler/RedirectHandler.js +1 -1
  70. package/dist/interaction_handler/SilentHandler.js +1 -1
  71. package/dist/internals.js +1 -1
  72. package/dist/navigation/NavigationClient.js +1 -1
  73. package/dist/network/FetchClient.js +1 -1
  74. package/dist/network/XhrClient.js +1 -1
  75. package/dist/packageMetadata.d.ts +1 -1
  76. package/dist/packageMetadata.js +2 -2
  77. package/dist/packageMetadata.js.map +1 -1
  78. package/dist/telemetry/BrowserPerformanceClient.js +1 -1
  79. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  80. package/dist/utils/BrowserConstants.js +1 -1
  81. package/dist/utils/BrowserProtocolUtils.js +1 -1
  82. package/dist/utils/BrowserStringUtils.js +1 -1
  83. package/dist/utils/BrowserUtils.js +1 -1
  84. package/dist/utils/MathUtils.js +1 -1
  85. package/lib/msal-browser.js +243 -152
  86. package/lib/msal-browser.js.map +1 -1
  87. package/lib/msal-browser.min.js +38 -38
  88. package/package.json +2 -2
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.37.0 2023-05-01 */
1
+ /*! @azure/msal-browser v2.38.0 2023-07-05 */
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.0.0 2023-05-01 */
120
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
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.0.0 2023-05-01 */
207
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
208
208
 
209
209
  /*
210
210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -568,6 +568,7 @@ var CacheOutcome;
568
568
  CacheOutcome["NO_CACHED_ACCESS_TOKEN"] = "2";
569
569
  CacheOutcome["CACHED_ACCESS_TOKEN_EXPIRED"] = "3";
570
570
  CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
571
+ CacheOutcome["CLAIMS_REQUESTED_CACHE_SKIPPED"] = "5";
571
572
  })(CacheOutcome || (CacheOutcome = {}));
572
573
  var JsonTypes;
573
574
  (function (JsonTypes) {
@@ -576,7 +577,7 @@ var JsonTypes;
576
577
  JsonTypes["Pop"] = "pop";
577
578
  })(JsonTypes || (JsonTypes = {}));
578
579
 
579
- /*! @azure/msal-common v13.0.0 2023-05-01 */
580
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
580
581
 
581
582
  /*
582
583
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -632,7 +633,7 @@ var AuthError = /** @class */ (function (_super) {
632
633
  return AuthError;
633
634
  }(Error));
634
635
 
635
- /*! @azure/msal-common v13.0.0 2023-05-01 */
636
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
636
637
 
637
638
  /*
638
639
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -707,7 +708,7 @@ var DEFAULT_CRYPTO_IMPLEMENTATION = {
707
708
  }
708
709
  };
709
710
 
710
- /*! @azure/msal-common v13.0.0 2023-05-01 */
711
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
711
712
 
712
713
  /*
713
714
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1222,7 +1223,7 @@ var ClientAuthError = /** @class */ (function (_super) {
1222
1223
  return ClientAuthError;
1223
1224
  }(AuthError));
1224
1225
 
1225
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1226
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
1226
1227
 
1227
1228
  /*
1228
1229
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1347,7 +1348,7 @@ var StringUtils = /** @class */ (function () {
1347
1348
  return StringUtils;
1348
1349
  }());
1349
1350
 
1350
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1351
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
1351
1352
 
1352
1353
  /*
1353
1354
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1537,12 +1538,12 @@ var Logger = /** @class */ (function () {
1537
1538
  return Logger;
1538
1539
  }());
1539
1540
 
1540
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1541
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
1541
1542
  /* eslint-disable header/header */
1542
1543
  var name$1 = "@azure/msal-common";
1543
- var version$1 = "13.0.0";
1544
+ var version$1 = "13.2.0";
1544
1545
 
1545
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1546
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
1546
1547
  /*
1547
1548
  * Copyright (c) Microsoft Corporation. All rights reserved.
1548
1549
  * Licensed under the MIT License.
@@ -1563,7 +1564,7 @@ exports.AzureCloudInstance = void 0;
1563
1564
  AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1564
1565
  })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1565
1566
 
1566
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1567
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
1567
1568
 
1568
1569
  /*
1569
1570
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1664,6 +1665,10 @@ var ClientConfigurationErrorMessage = {
1664
1665
  invalidAuthenticationHeader: {
1665
1666
  code: "invalid_authentication_header",
1666
1667
  desc: "Invalid authentication header provided"
1668
+ },
1669
+ authorityMismatch: {
1670
+ code: "authority_mismatch",
1671
+ desc: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."
1667
1672
  }
1668
1673
  };
1669
1674
  /**
@@ -1815,10 +1820,16 @@ var ClientConfigurationError = /** @class */ (function (_super) {
1815
1820
  ClientConfigurationError.createInvalidAuthenticationHeaderError = function (invalidHeaderName, details) {
1816
1821
  return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code, ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc + ". Invalid header: " + invalidHeaderName + ". Details: " + details);
1817
1822
  };
1823
+ /**
1824
+ * Create an error when the authority provided in request does not match authority provided in account or MSAL.js configuration.
1825
+ */
1826
+ ClientConfigurationError.createAuthorityMismatchError = function () {
1827
+ return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityMismatch.code, ClientConfigurationErrorMessage.authorityMismatch.desc);
1828
+ };
1818
1829
  return ClientConfigurationError;
1819
1830
  }(ClientAuthError));
1820
1831
 
1821
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1832
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
1822
1833
 
1823
1834
  /*
1824
1835
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2017,7 +2028,7 @@ var ScopeSet = /** @class */ (function () {
2017
2028
  return ScopeSet;
2018
2029
  }());
2019
2030
 
2020
- /*! @azure/msal-common v13.0.0 2023-05-01 */
2031
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
2021
2032
 
2022
2033
  /*
2023
2034
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2055,7 +2066,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2055
2066
  };
2056
2067
  }
2057
2068
 
2058
- /*! @azure/msal-common v13.0.0 2023-05-01 */
2069
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
2059
2070
  /*
2060
2071
  * Copyright (c) Microsoft Corporation. All rights reserved.
2061
2072
  * Licensed under the MIT License.
@@ -2071,7 +2082,7 @@ var AuthorityType;
2071
2082
  AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
2072
2083
  })(AuthorityType || (AuthorityType = {}));
2073
2084
 
2074
- /*! @azure/msal-common v13.0.0 2023-05-01 */
2085
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
2075
2086
 
2076
2087
  /*
2077
2088
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2310,7 +2321,7 @@ var AccountEntity = /** @class */ (function () {
2310
2321
  return AccountEntity;
2311
2322
  }());
2312
2323
 
2313
- /*! @azure/msal-common v13.0.0 2023-05-01 */
2324
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
2314
2325
 
2315
2326
  /*
2316
2327
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2362,7 +2373,7 @@ var AuthToken = /** @class */ (function () {
2362
2373
  return AuthToken;
2363
2374
  }());
2364
2375
 
2365
- /*! @azure/msal-common v13.0.0 2023-05-01 */
2376
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
2366
2377
 
2367
2378
  /*
2368
2379
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3410,7 +3421,7 @@ var DefaultStorageClass = /** @class */ (function (_super) {
3410
3421
  return DefaultStorageClass;
3411
3422
  }(CacheManager));
3412
3423
 
3413
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3424
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3414
3425
 
3415
3426
  /*
3416
3427
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3430,6 +3441,9 @@ var DEFAULT_LOGGER_IMPLEMENTATION = {
3430
3441
  logLevel: exports.LogLevel.Info,
3431
3442
  correlationId: Constants.EMPTY_STRING
3432
3443
  };
3444
+ var DEFAULT_CACHE_OPTIONS = {
3445
+ claimsBasedCachingEnabled: true
3446
+ };
3433
3447
  var DEFAULT_NETWORK_IMPLEMENTATION = {
3434
3448
  sendGetRequestAsync: function () {
3435
3449
  return __awaiter(this, void 0, void 0, function () {
@@ -3478,12 +3492,13 @@ var DEFAULT_TELEMETRY_OPTIONS = {
3478
3492
  * @returns Configuration
3479
3493
  */
3480
3494
  function buildClientConfiguration(_a) {
3481
- var userAuthOptions = _a.authOptions, userSystemOptions = _a.systemOptions, userLoggerOption = _a.loggerOptions, storageImplementation = _a.storageInterface, networkImplementation = _a.networkInterface, cryptoImplementation = _a.cryptoInterface, clientCredentials = _a.clientCredentials, libraryInfo = _a.libraryInfo, telemetry = _a.telemetry, serverTelemetryManager = _a.serverTelemetryManager, persistencePlugin = _a.persistencePlugin, serializableCache = _a.serializableCache;
3495
+ var userAuthOptions = _a.authOptions, userSystemOptions = _a.systemOptions, userLoggerOption = _a.loggerOptions, userCacheOptions = _a.cacheOptions, storageImplementation = _a.storageInterface, networkImplementation = _a.networkInterface, cryptoImplementation = _a.cryptoInterface, clientCredentials = _a.clientCredentials, libraryInfo = _a.libraryInfo, telemetry = _a.telemetry, serverTelemetryManager = _a.serverTelemetryManager, persistencePlugin = _a.persistencePlugin, serializableCache = _a.serializableCache;
3482
3496
  var loggerOptions = __assign(__assign({}, DEFAULT_LOGGER_IMPLEMENTATION), userLoggerOption);
3483
3497
  return {
3484
3498
  authOptions: buildAuthOptions(userAuthOptions),
3485
3499
  systemOptions: __assign(__assign({}, DEFAULT_SYSTEM_OPTIONS), userSystemOptions),
3486
3500
  loggerOptions: loggerOptions,
3501
+ cacheOptions: __assign(__assign({}, DEFAULT_CACHE_OPTIONS), userCacheOptions),
3487
3502
  storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions)),
3488
3503
  networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
3489
3504
  cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
@@ -3503,7 +3518,7 @@ function buildAuthOptions(authOptions) {
3503
3518
  return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
3504
3519
  }
3505
3520
 
3506
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3521
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3507
3522
 
3508
3523
  /*
3509
3524
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3523,7 +3538,7 @@ var ServerError = /** @class */ (function (_super) {
3523
3538
  return ServerError;
3524
3539
  }(AuthError));
3525
3540
 
3526
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3541
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3527
3542
 
3528
3543
  /*
3529
3544
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3619,7 +3634,7 @@ var ThrottlingUtils = /** @class */ (function () {
3619
3634
  return ThrottlingUtils;
3620
3635
  }());
3621
3636
 
3622
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3637
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3623
3638
 
3624
3639
  /*
3625
3640
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3668,7 +3683,7 @@ var NetworkManager = /** @class */ (function () {
3668
3683
  return NetworkManager;
3669
3684
  }());
3670
3685
 
3671
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3686
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3672
3687
  /*
3673
3688
  * Copyright (c) Microsoft Corporation. All rights reserved.
3674
3689
  * Licensed under the MIT License.
@@ -3679,7 +3694,7 @@ var CcsCredentialType;
3679
3694
  CcsCredentialType["UPN"] = "UPN";
3680
3695
  })(CcsCredentialType || (CcsCredentialType = {}));
3681
3696
 
3682
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3697
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3683
3698
 
3684
3699
  /*
3685
3700
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3770,7 +3785,7 @@ var RequestValidator = /** @class */ (function () {
3770
3785
  return RequestValidator;
3771
3786
  }());
3772
3787
 
3773
- /*! @azure/msal-common v13.0.0 2023-05-01 */
3788
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
3774
3789
 
3775
3790
  /*
3776
3791
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4148,7 +4163,7 @@ var RequestParameterBuilder = /** @class */ (function () {
4148
4163
  return RequestParameterBuilder;
4149
4164
  }());
4150
4165
 
4151
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4166
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4152
4167
 
4153
4168
  /*
4154
4169
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4250,7 +4265,7 @@ var BaseClient = /** @class */ (function () {
4250
4265
  return BaseClient;
4251
4266
  }());
4252
4267
 
4253
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4268
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4254
4269
 
4255
4270
  /*
4256
4271
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4388,7 +4403,7 @@ var CredentialEntity = /** @class */ (function () {
4388
4403
  return CredentialEntity;
4389
4404
  }());
4390
4405
 
4391
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4406
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4392
4407
 
4393
4408
  /*
4394
4409
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4452,7 +4467,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
4452
4467
  return IdTokenEntity;
4453
4468
  }(CredentialEntity));
4454
4469
 
4455
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4470
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4456
4471
  /*
4457
4472
  * Copyright (c) Microsoft Corporation. All rights reserved.
4458
4473
  * Licensed under the MIT License.
@@ -4502,7 +4517,7 @@ var TimeUtils = /** @class */ (function () {
4502
4517
  return TimeUtils;
4503
4518
  }());
4504
4519
 
4505
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4520
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4506
4521
 
4507
4522
  /*
4508
4523
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4616,7 +4631,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
4616
4631
  return AccessTokenEntity;
4617
4632
  }(CredentialEntity));
4618
4633
 
4619
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4634
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4620
4635
 
4621
4636
  /*
4622
4637
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4683,7 +4698,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
4683
4698
  return RefreshTokenEntity;
4684
4699
  }(CredentialEntity));
4685
4700
 
4686
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4701
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4687
4702
 
4688
4703
  /*
4689
4704
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4762,7 +4777,7 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
4762
4777
  return InteractionRequiredAuthError;
4763
4778
  }(AuthError));
4764
4779
 
4765
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4780
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4766
4781
  /*
4767
4782
  * Copyright (c) Microsoft Corporation. All rights reserved.
4768
4783
  * Licensed under the MIT License.
@@ -4778,7 +4793,7 @@ var CacheRecord = /** @class */ (function () {
4778
4793
  return CacheRecord;
4779
4794
  }());
4780
4795
 
4781
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4796
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4782
4797
 
4783
4798
  /*
4784
4799
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4849,7 +4864,7 @@ var ProtocolUtils = /** @class */ (function () {
4849
4864
  return ProtocolUtils;
4850
4865
  }());
4851
4866
 
4852
- /*! @azure/msal-common v13.0.0 2023-05-01 */
4867
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
4853
4868
 
4854
4869
  /*
4855
4870
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5083,7 +5098,7 @@ var UrlString = /** @class */ (function () {
5083
5098
  return UrlString;
5084
5099
  }());
5085
5100
 
5086
- /*! @azure/msal-common v13.0.0 2023-05-01 */
5101
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
5087
5102
  /*
5088
5103
  * Copyright (c) Microsoft Corporation. All rights reserved.
5089
5104
  * Licensed under the MIT License.
@@ -5312,7 +5327,7 @@ var IntFields = new Set([
5312
5327
  "status",
5313
5328
  ]);
5314
5329
 
5315
- /*! @azure/msal-common v13.0.0 2023-05-01 */
5330
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
5316
5331
 
5317
5332
  /*
5318
5333
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5421,7 +5436,7 @@ var PopTokenGenerator = /** @class */ (function () {
5421
5436
  return PopTokenGenerator;
5422
5437
  }());
5423
5438
 
5424
- /*! @azure/msal-common v13.0.0 2023-05-01 */
5439
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
5425
5440
 
5426
5441
  /*
5427
5442
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5491,7 +5506,7 @@ var AppMetadataEntity = /** @class */ (function () {
5491
5506
  return AppMetadataEntity;
5492
5507
  }());
5493
5508
 
5494
- /*! @azure/msal-common v13.0.0 2023-05-01 */
5509
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
5495
5510
  /*
5496
5511
  * Copyright (c) Microsoft Corporation. All rights reserved.
5497
5512
  * Licensed under the MIT License.
@@ -5527,7 +5542,7 @@ var AppMetadataEntity = /** @class */ (function () {
5527
5542
  return TokenCacheContext;
5528
5543
  }());
5529
5544
 
5530
- /*! @azure/msal-common v13.0.0 2023-05-01 */
5545
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
5531
5546
 
5532
5547
  /*
5533
5548
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5814,7 +5829,7 @@ var ResponseHandler = /** @class */ (function () {
5814
5829
  return ResponseHandler;
5815
5830
  }());
5816
5831
 
5817
- /*! @azure/msal-common v13.0.0 2023-05-01 */
5832
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
5818
5833
 
5819
5834
  /*
5820
5835
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6244,7 +6259,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
6244
6259
  return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
6245
6260
  case 1:
6246
6261
  reqCnfData = _b.sent();
6247
- parameterBuilder.addPopToken(reqCnfData.reqCnfHash);
6262
+ parameterBuilder.addPopToken(reqCnfData.reqCnfString);
6248
6263
  _b.label = 2;
6249
6264
  case 2: return [2 /*return*/, parameterBuilder.createQueryString()];
6250
6265
  }
@@ -6292,7 +6307,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
6292
6307
  return AuthorizationCodeClient;
6293
6308
  }(BaseClient));
6294
6309
 
6295
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6310
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6296
6311
 
6297
6312
  /*
6298
6313
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6566,7 +6581,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
6566
6581
  return RefreshTokenClient;
6567
6582
  }(BaseClient));
6568
6583
 
6569
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6584
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6570
6585
 
6571
6586
  /*
6572
6587
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6610,11 +6625,11 @@ var SilentFlowClient = /** @class */ (function (_super) {
6610
6625
  * @param request
6611
6626
  */
6612
6627
  SilentFlowClient.prototype.acquireCachedToken = function (request) {
6613
- var _a, _b, _c, _d;
6628
+ var _a, _b, _c, _d, _e;
6614
6629
  return __awaiter(this, void 0, void 0, function () {
6615
6630
  var environment, cacheRecord;
6616
- return __generator(this, function (_e) {
6617
- switch (_e.label) {
6631
+ return __generator(this, function (_f) {
6632
+ switch (_f.label) {
6618
6633
  case 0:
6619
6634
  // Cannot renew token if no request object is given.
6620
6635
  if (!request) {
@@ -6626,6 +6641,12 @@ var SilentFlowClient = /** @class */ (function (_super) {
6626
6641
  this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.");
6627
6642
  throw ClientAuthError.createRefreshRequiredError();
6628
6643
  }
6644
+ else if (!this.config.cacheOptions.claimsBasedCachingEnabled && !StringUtils.isEmptyObj(request.claims)) {
6645
+ // Must refresh due to presence of claims in request preventing cache lookup
6646
+ (_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.CLAIMS_REQUESTED_CACHE_SKIPPED);
6647
+ this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims-based caching is disabled and claims were requested.");
6648
+ throw ClientAuthError.createRefreshRequiredError();
6649
+ }
6629
6650
  // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
6630
6651
  if (!request.account) {
6631
6652
  throw ClientAuthError.createNoAccountInSilentRequestError();
@@ -6634,20 +6655,20 @@ var SilentFlowClient = /** @class */ (function (_super) {
6634
6655
  cacheRecord = this.cacheManager.readCacheRecord(request.account, request, environment);
6635
6656
  if (!cacheRecord.accessToken) {
6636
6657
  // Must refresh due to non-existent access_token.
6637
- (_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);
6658
+ (_c = this.serverTelemetryManager) === null || _c === void 0 ? void 0 : _c.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);
6638
6659
  this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.");
6639
6660
  throw ClientAuthError.createRefreshRequiredError();
6640
6661
  }
6641
6662
  else if (TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||
6642
6663
  TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {
6643
6664
  // Must refresh due to expired access_token.
6644
- (_c = this.serverTelemetryManager) === null || _c === void 0 ? void 0 : _c.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);
6665
+ (_d = this.serverTelemetryManager) === null || _d === void 0 ? void 0 : _d.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);
6645
6666
  this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within " + this.config.systemOptions.tokenRenewalOffsetSeconds + " seconds.");
6646
6667
  throw ClientAuthError.createRefreshRequiredError();
6647
6668
  }
6648
6669
  else if (cacheRecord.accessToken.refreshOn && TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {
6649
6670
  // Must refresh due to the refresh_in value.
6650
- (_d = this.serverTelemetryManager) === null || _d === void 0 ? void 0 : _d.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);
6671
+ (_e = this.serverTelemetryManager) === null || _e === void 0 ? void 0 : _e.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);
6651
6672
  this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.");
6652
6673
  throw ClientAuthError.createRefreshRequiredError();
6653
6674
  }
@@ -6655,7 +6676,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
6655
6676
  this.config.serverTelemetryManager.incrementCacheHits();
6656
6677
  }
6657
6678
  return [4 /*yield*/, this.generateResultFromCacheRecord(cacheRecord, request)];
6658
- case 1: return [2 /*return*/, _e.sent()];
6679
+ case 1: return [2 /*return*/, _f.sent()];
6659
6680
  }
6660
6681
  });
6661
6682
  });
@@ -6690,7 +6711,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
6690
6711
  return SilentFlowClient;
6691
6712
  }(BaseClient));
6692
6713
 
6693
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6714
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6694
6715
  /*
6695
6716
  * Copyright (c) Microsoft Corporation. All rights reserved.
6696
6717
  * Licensed under the MIT License.
@@ -6702,7 +6723,7 @@ function isOpenIdConfigResponse(response) {
6702
6723
  response.hasOwnProperty("jwks_uri"));
6703
6724
  }
6704
6725
 
6705
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6726
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6706
6727
  /*
6707
6728
  * Copyright (c) Microsoft Corporation. All rights reserved.
6708
6729
  * Licensed under the MIT License.
@@ -6711,7 +6732,7 @@ var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/
6711
6732
  var EndpointMetadata = rawMetdataJSON.endpointMetadata;
6712
6733
  var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
6713
6734
 
6714
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6735
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6715
6736
  /*
6716
6737
  * Copyright (c) Microsoft Corporation. All rights reserved.
6717
6738
  * Licensed under the MIT License.
@@ -6725,7 +6746,7 @@ exports.ProtocolMode = void 0;
6725
6746
  ProtocolMode["OIDC"] = "OIDC";
6726
6747
  })(exports.ProtocolMode || (exports.ProtocolMode = {}));
6727
6748
 
6728
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6749
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6729
6750
 
6730
6751
  /*
6731
6752
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6802,7 +6823,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
6802
6823
  return AuthorityMetadataEntity;
6803
6824
  }());
6804
6825
 
6805
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6826
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6806
6827
  /*
6807
6828
  * Copyright (c) Microsoft Corporation. All rights reserved.
6808
6829
  * Licensed under the MIT License.
@@ -6812,7 +6833,7 @@ function isCloudInstanceDiscoveryResponse(response) {
6812
6833
  response.hasOwnProperty("metadata"));
6813
6834
  }
6814
6835
 
6815
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6836
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6816
6837
  /*
6817
6838
  * Copyright (c) Microsoft Corporation. All rights reserved.
6818
6839
  * Licensed under the MIT License.
@@ -6822,7 +6843,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
6822
6843
  response.hasOwnProperty("error_description"));
6823
6844
  }
6824
6845
 
6825
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6846
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6826
6847
 
6827
6848
  /*
6828
6849
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6954,7 +6975,7 @@ var RegionDiscovery = /** @class */ (function () {
6954
6975
  return RegionDiscovery;
6955
6976
  }());
6956
6977
 
6957
- /*! @azure/msal-common v13.0.0 2023-05-01 */
6978
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
6958
6979
 
6959
6980
  /*
6960
6981
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6977,23 +6998,31 @@ var Authority = /** @class */ (function () {
6977
6998
  this.correlationId = correlationId;
6978
6999
  this.regionDiscovery = new RegionDiscovery(networkInterface, this.performanceClient, this.correlationId);
6979
7000
  }
7001
+ /**
7002
+ * Get {@link AuthorityType}
7003
+ * @param authorityUri {@link IUri}
7004
+ * @private
7005
+ */
7006
+ Authority.prototype.getAuthorityType = function (authorityUri) {
7007
+ // CIAM auth url pattern is being standardized as: <tenant>.ciamlogin.com
7008
+ if (authorityUri.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {
7009
+ return AuthorityType.Ciam;
7010
+ }
7011
+ var pathSegments = authorityUri.PathSegments;
7012
+ if (pathSegments.length) {
7013
+ switch (pathSegments[0].toLowerCase()) {
7014
+ case Constants.ADFS:
7015
+ return AuthorityType.Adfs;
7016
+ case Constants.DSTS:
7017
+ return AuthorityType.Dsts;
7018
+ }
7019
+ }
7020
+ return AuthorityType.Default;
7021
+ };
6980
7022
  Object.defineProperty(Authority.prototype, "authorityType", {
6981
7023
  // See above for AuthorityType
6982
7024
  get: function () {
6983
- // CIAM auth url pattern is being standardized as: <tenant>.ciamlogin.com
6984
- if (this.canonicalAuthorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {
6985
- return AuthorityType.Ciam;
6986
- }
6987
- var pathSegments = this.canonicalAuthorityUrlComponents.PathSegments;
6988
- if (pathSegments.length) {
6989
- switch (pathSegments[0].toLowerCase()) {
6990
- case Constants.ADFS:
6991
- return AuthorityType.Adfs;
6992
- case Constants.DSTS:
6993
- return AuthorityType.Dsts;
6994
- }
6995
- }
6996
- return AuthorityType.Default;
7025
+ return this.getAuthorityType(this.canonicalAuthorityUrlComponents);
6997
7026
  },
6998
7027
  enumerable: false,
6999
7028
  configurable: true
@@ -7075,8 +7104,7 @@ var Authority = /** @class */ (function () {
7075
7104
  */
7076
7105
  get: function () {
7077
7106
  if (this.discoveryComplete()) {
7078
- var endpoint = this.replacePath(this.metadata.authorization_endpoint);
7079
- return this.replaceTenant(endpoint);
7107
+ return this.replacePath(this.metadata.authorization_endpoint);
7080
7108
  }
7081
7109
  else {
7082
7110
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7091,8 +7119,7 @@ var Authority = /** @class */ (function () {
7091
7119
  */
7092
7120
  get: function () {
7093
7121
  if (this.discoveryComplete()) {
7094
- var endpoint = this.replacePath(this.metadata.token_endpoint);
7095
- return this.replaceTenant(endpoint);
7122
+ return this.replacePath(this.metadata.token_endpoint);
7096
7123
  }
7097
7124
  else {
7098
7125
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7104,8 +7131,7 @@ var Authority = /** @class */ (function () {
7104
7131
  Object.defineProperty(Authority.prototype, "deviceCodeEndpoint", {
7105
7132
  get: function () {
7106
7133
  if (this.discoveryComplete()) {
7107
- var endpoint = this.replacePath(this.metadata.token_endpoint.replace("/token", "/devicecode"));
7108
- return this.replaceTenant(endpoint);
7134
+ return this.replacePath(this.metadata.token_endpoint.replace("/token", "/devicecode"));
7109
7135
  }
7110
7136
  else {
7111
7137
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7124,8 +7150,7 @@ var Authority = /** @class */ (function () {
7124
7150
  if (!this.metadata.end_session_endpoint) {
7125
7151
  throw ClientAuthError.createLogoutNotSupportedError();
7126
7152
  }
7127
- var endpoint = this.replacePath(this.metadata.end_session_endpoint);
7128
- return this.replaceTenant(endpoint);
7153
+ return this.replacePath(this.metadata.end_session_endpoint);
7129
7154
  }
7130
7155
  else {
7131
7156
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7140,8 +7165,7 @@ var Authority = /** @class */ (function () {
7140
7165
  */
7141
7166
  get: function () {
7142
7167
  if (this.discoveryComplete()) {
7143
- var endpoint = this.replacePath(this.metadata.issuer);
7144
- return this.replaceTenant(endpoint);
7168
+ return this.replacePath(this.metadata.issuer);
7145
7169
  }
7146
7170
  else {
7147
7171
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7156,8 +7180,7 @@ var Authority = /** @class */ (function () {
7156
7180
  */
7157
7181
  get: function () {
7158
7182
  if (this.discoveryComplete()) {
7159
- var endpoint = this.replacePath(this.metadata.jwks_uri);
7160
- return this.replaceTenant(endpoint);
7183
+ return this.replacePath(this.metadata.jwks_uri);
7161
7184
  }
7162
7185
  else {
7163
7186
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7166,6 +7189,17 @@ var Authority = /** @class */ (function () {
7166
7189
  enumerable: false,
7167
7190
  configurable: true
7168
7191
  });
7192
+ /**
7193
+ * Returns a flag indicating that tenant name can be replaced in authority {@link IUri}
7194
+ * @param authorityUri {@link IUri}
7195
+ * @private
7196
+ */
7197
+ Authority.prototype.canReplaceTenant = function (authorityUri) {
7198
+ return authorityUri.PathSegments.length === 1
7199
+ && !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0])
7200
+ && this.getAuthorityType(authorityUri) === AuthorityType.Default
7201
+ && this.protocolMode === exports.ProtocolMode.AAD;
7202
+ };
7169
7203
  /**
7170
7204
  * Replaces tenant in url path with current tenant. Defaults to common.
7171
7205
  * @param urlString
@@ -7178,17 +7212,31 @@ var Authority = /** @class */ (function () {
7178
7212
  * @param urlString
7179
7213
  */
7180
7214
  Authority.prototype.replacePath = function (urlString) {
7215
+ var _this = this;
7181
7216
  var endpoint = urlString;
7182
7217
  var cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);
7183
- var cachedAuthorityParts = cachedAuthorityUrl.getUrlComponents().PathSegments;
7218
+ var cachedAuthorityUrlComponents = cachedAuthorityUrl.getUrlComponents();
7219
+ var cachedAuthorityParts = cachedAuthorityUrlComponents.PathSegments;
7184
7220
  var currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;
7185
7221
  currentAuthorityParts.forEach(function (currentPart, index) {
7186
7222
  var cachedPart = cachedAuthorityParts[index];
7223
+ if (index === 0 && _this.canReplaceTenant(cachedAuthorityUrlComponents)) {
7224
+ var tenantId = (new UrlString(_this.metadata.authorization_endpoint)).getUrlComponents().PathSegments[0];
7225
+ /**
7226
+ * Check if AAD canonical authority contains tenant domain name, for example "testdomain.onmicrosoft.com",
7227
+ * by comparing its first path segment to the corresponding authorization endpoint path segment, which is
7228
+ * always resolved with tenant id by OIDC.
7229
+ */
7230
+ if (cachedPart !== tenantId) {
7231
+ _this.logger.verbose("Replacing tenant domain name " + cachedPart + " with id " + tenantId);
7232
+ cachedPart = tenantId;
7233
+ }
7234
+ }
7187
7235
  if (currentPart !== cachedPart) {
7188
7236
  endpoint = endpoint.replace("/" + cachedPart + "/", "/" + currentPart + "/");
7189
7237
  }
7190
7238
  });
7191
- return endpoint;
7239
+ return this.replaceTenant(endpoint);
7192
7240
  };
7193
7241
  Object.defineProperty(Authority.prototype, "defaultOpenIdConfigurationEndpoint", {
7194
7242
  /**
@@ -7368,42 +7416,35 @@ var Authority = /** @class */ (function () {
7368
7416
  };
7369
7417
  /**
7370
7418
  * Update the retrieved metadata with regional information.
7419
+ * User selected Azure region will be used if configured.
7371
7420
  */
7372
7421
  Authority.prototype.updateMetadataWithRegionalInformation = function (metadata) {
7373
- var _a, _b, _c, _d, _e, _f, _g;
7422
+ var _a, _b, _c, _d;
7374
7423
  return __awaiter(this, void 0, void 0, function () {
7375
- var autodetectedRegionName, azureRegion;
7376
- return __generator(this, function (_h) {
7377
- switch (_h.label) {
7424
+ var userConfiguredAzureRegion, autodetectedRegionName;
7425
+ return __generator(this, function (_e) {
7426
+ switch (_e.label) {
7378
7427
  case 0:
7379
7428
  (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7380
- (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7381
- return [4 /*yield*/, this.regionDiscovery.detectRegion((_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.environmentRegion, this.regionDiscoveryMetadata)];
7382
- case 1:
7383
- autodetectedRegionName = _h.sent();
7384
- azureRegion = ((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
7385
- ? autodetectedRegionName
7386
- : (_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion;
7387
- if (((_f = this.authorityOptions.azureRegionConfiguration) === null || _f === void 0 ? void 0 : _f.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
7388
- this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?
7389
- RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :
7390
- RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
7391
- }
7392
- else {
7393
- if (autodetectedRegionName) {
7394
- this.regionDiscoveryMetadata.region_outcome = (((_g = this.authorityOptions.azureRegionConfiguration) === null || _g === void 0 ? void 0 : _g.azureRegion) === autodetectedRegionName) ?
7395
- RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :
7396
- RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;
7397
- }
7398
- else {
7399
- this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
7400
- }
7429
+ userConfiguredAzureRegion = (_b = this.authorityOptions.azureRegionConfiguration) === null || _b === void 0 ? void 0 : _b.azureRegion;
7430
+ if (!userConfiguredAzureRegion) return [3 /*break*/, 2];
7431
+ if (userConfiguredAzureRegion !== Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
7432
+ this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
7433
+ this.regionDiscoveryMetadata.region_used = userConfiguredAzureRegion;
7434
+ return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, userConfiguredAzureRegion)];
7401
7435
  }
7402
- if (azureRegion) {
7403
- this.regionDiscoveryMetadata.region_used = azureRegion;
7404
- return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, azureRegion)];
7436
+ (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7437
+ return [4 /*yield*/, this.regionDiscovery.detectRegion((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.environmentRegion, this.regionDiscoveryMetadata)];
7438
+ case 1:
7439
+ autodetectedRegionName = _e.sent();
7440
+ if (autodetectedRegionName) {
7441
+ this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;
7442
+ this.regionDiscoveryMetadata.region_used = autodetectedRegionName;
7443
+ return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, autodetectedRegionName)];
7405
7444
  }
7406
- return [2 /*return*/, metadata];
7445
+ this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
7446
+ _e.label = 2;
7447
+ case 2: return [2 /*return*/, metadata];
7407
7448
  }
7408
7449
  });
7409
7450
  });
@@ -7716,10 +7757,18 @@ var Authority = /** @class */ (function () {
7716
7757
  }
7717
7758
  return ciamAuthority;
7718
7759
  };
7760
+ // Reserved tenant domain names that will not be replaced with tenant id
7761
+ Authority.reservedTenantDomains = (new Set([
7762
+ "{tenant}",
7763
+ "{tenantid}",
7764
+ AADAuthorityConstants.COMMON,
7765
+ AADAuthorityConstants.CONSUMERS,
7766
+ AADAuthorityConstants.ORGANIZATIONS
7767
+ ]));
7719
7768
  return Authority;
7720
7769
  }());
7721
7770
 
7722
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7771
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7723
7772
 
7724
7773
  /*
7725
7774
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7783,7 +7832,7 @@ var AuthorityFactory = /** @class */ (function () {
7783
7832
  return AuthorityFactory;
7784
7833
  }());
7785
7834
 
7786
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7835
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7787
7836
 
7788
7837
  /*
7789
7838
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7814,7 +7863,7 @@ var ServerTelemetryEntity = /** @class */ (function () {
7814
7863
  return ServerTelemetryEntity;
7815
7864
  }());
7816
7865
 
7817
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7866
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7818
7867
 
7819
7868
  /*
7820
7869
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7842,7 +7891,7 @@ var ThrottlingEntity = /** @class */ (function () {
7842
7891
  return ThrottlingEntity;
7843
7892
  }());
7844
7893
 
7845
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7894
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7846
7895
 
7847
7896
  /*
7848
7897
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7859,7 +7908,7 @@ var StubbedNetworkModule = {
7859
7908
  }
7860
7909
  };
7861
7910
 
7862
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7911
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7863
7912
 
7864
7913
  /*
7865
7914
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7904,7 +7953,7 @@ var JoseHeaderError = /** @class */ (function (_super) {
7904
7953
  return JoseHeaderError;
7905
7954
  }(AuthError));
7906
7955
 
7907
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7956
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7908
7957
 
7909
7958
  /*
7910
7959
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7944,7 +7993,7 @@ var JoseHeader = /** @class */ (function () {
7944
7993
  return JoseHeader;
7945
7994
  }());
7946
7995
 
7947
- /*! @azure/msal-common v13.0.0 2023-05-01 */
7996
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
7948
7997
 
7949
7998
  /*
7950
7999
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8003,7 +8052,7 @@ var AuthenticationHeaderParser = /** @class */ (function () {
8003
8052
  return AuthenticationHeaderParser;
8004
8053
  }());
8005
8054
 
8006
- /*! @azure/msal-common v13.0.0 2023-05-01 */
8055
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
8007
8056
 
8008
8057
  /*
8009
8058
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8165,7 +8214,7 @@ var ServerTelemetryManager = /** @class */ (function () {
8165
8214
  return ServerTelemetryManager;
8166
8215
  }());
8167
8216
 
8168
- /*! @azure/msal-common v13.0.0 2023-05-01 */
8217
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
8169
8218
 
8170
8219
  /*
8171
8220
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8568,7 +8617,7 @@ var PerformanceClient = /** @class */ (function () {
8568
8617
  return PerformanceClient;
8569
8618
  }());
8570
8619
 
8571
- /*! @azure/msal-common v13.0.0 2023-05-01 */
8620
+ /*! @azure/msal-common v13.2.0 2023-07-05 */
8572
8621
 
8573
8622
  /*
8574
8623
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10786,14 +10835,15 @@ var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
10786
10835
  temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
10787
10836
  storeAuthStateInCookie: false,
10788
10837
  secureCookies: false,
10789
- cacheMigrationEnabled: false
10838
+ cacheMigrationEnabled: false,
10839
+ claimsBasedCachingEnabled: true
10790
10840
  };
10791
10841
  return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
10792
10842
  };
10793
10843
 
10794
10844
  /* eslint-disable header/header */
10795
10845
  var name = "@azure/msal-browser";
10796
- var version = "2.37.0";
10846
+ var version = "2.38.0";
10797
10847
 
10798
10848
  /*
10799
10849
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11258,7 +11308,7 @@ var BaseInteractionClient = /** @class */ (function () {
11258
11308
  * Initializer function for all request APIs
11259
11309
  * @param request
11260
11310
  */
11261
- BaseInteractionClient.prototype.initializeBaseRequest = function (request) {
11311
+ BaseInteractionClient.prototype.initializeBaseRequest = function (request, account) {
11262
11312
  return __awaiter$1(this, void 0, void 0, function () {
11263
11313
  var authority, scopes, validatedRequest, _a;
11264
11314
  return __generator$1(this, function (_b) {
@@ -11267,6 +11317,12 @@ var BaseInteractionClient = /** @class */ (function () {
11267
11317
  this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
11268
11318
  this.logger.verbose("Initializing BaseAuthRequest");
11269
11319
  authority = request.authority || this.config.auth.authority;
11320
+ if (!account) return [3 /*break*/, 2];
11321
+ return [4 /*yield*/, this.validateRequestAuthority(authority, account)];
11322
+ case 1:
11323
+ _b.sent();
11324
+ _b.label = 2;
11325
+ case 2:
11270
11326
  scopes = __spread(((request && request.scopes) || []));
11271
11327
  validatedRequest = __assign$1(__assign$1({}, request), { correlationId: this.correlationId, authority: authority,
11272
11328
  scopes: scopes });
@@ -11286,13 +11342,13 @@ var BaseInteractionClient = /** @class */ (function () {
11286
11342
  }
11287
11343
  this.logger.verbose("Authentication Scheme set to \"" + validatedRequest.authenticationScheme + "\" as configured in Auth request");
11288
11344
  }
11289
- if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 2];
11345
+ if (!(this.config.cache.claimsBasedCachingEnabled && request.claims && !StringUtils.isEmptyObj(request.claims))) return [3 /*break*/, 4];
11290
11346
  _a = validatedRequest;
11291
11347
  return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];
11292
- case 1:
11348
+ case 3:
11293
11349
  _a.requestedClaimsHash = _b.sent();
11294
- _b.label = 2;
11295
- case 2: return [2 /*return*/, validatedRequest];
11350
+ _b.label = 4;
11351
+ case 4: return [2 /*return*/, validatedRequest];
11296
11352
  }
11297
11353
  });
11298
11354
  });
@@ -11309,6 +11365,26 @@ var BaseInteractionClient = /** @class */ (function () {
11309
11365
  var redirectUri = requestRedirectUri || this.config.auth.redirectUri || BrowserUtils.getCurrentUri();
11310
11366
  return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());
11311
11367
  };
11368
+ /*
11369
+ * If authority provided in the request does not match environment/authority specified
11370
+ * in the account or MSAL config, we throw an error.
11371
+ */
11372
+ BaseInteractionClient.prototype.validateRequestAuthority = function (authority, account) {
11373
+ return __awaiter$1(this, void 0, void 0, function () {
11374
+ var discoveredAuthority;
11375
+ return __generator$1(this, function (_a) {
11376
+ switch (_a.label) {
11377
+ case 0: return [4 /*yield*/, this.getDiscoveredAuthority(authority)];
11378
+ case 1:
11379
+ discoveredAuthority = _a.sent();
11380
+ if (!discoveredAuthority.isAlias(account.environment)) {
11381
+ throw ClientConfigurationError.createAuthorityMismatchError();
11382
+ }
11383
+ return [2 /*return*/];
11384
+ }
11385
+ });
11386
+ });
11387
+ };
11312
11388
  /**
11313
11389
  *
11314
11390
  * @param apiId
@@ -11530,6 +11606,9 @@ var StandardInteractionClient = /** @class */ (function (_super) {
11530
11606
  logLevel: logger.logLevel,
11531
11607
  correlationId: this.correlationId
11532
11608
  },
11609
+ cacheOptions: {
11610
+ claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled
11611
+ },
11533
11612
  cryptoInterface: this.browserCrypto,
11534
11613
  networkInterface: this.networkClient,
11535
11614
  storageInterface: this.browserStorage,
@@ -11973,6 +12052,7 @@ exports.EventType = void 0;
11973
12052
  EventType["LOGOUT_SUCCESS"] = "msal:logoutSuccess";
11974
12053
  EventType["LOGOUT_FAILURE"] = "msal:logoutFailure";
11975
12054
  EventType["LOGOUT_END"] = "msal:logoutEnd";
12055
+ EventType["RESTORE_FROM_BFCACHE"] = "msal:restoreFromBFCache";
11976
12056
  })(exports.EventType || (exports.EventType = {}));
11977
12057
 
11978
12058
  /*
@@ -12153,7 +12233,7 @@ var SilentCacheClient = /** @class */ (function (_super) {
12153
12233
  this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeSilentRequest, this.correlationId);
12154
12234
  this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
12155
12235
  _a = [__assign$1({}, request)];
12156
- return [4 /*yield*/, this.initializeBaseRequest(request)];
12236
+ return [4 /*yield*/, this.initializeBaseRequest(request, account)];
12157
12237
  case 1: return [2 /*return*/, __assign$1.apply(void 0, [__assign$1.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
12158
12238
  }
12159
12239
  });
@@ -12427,7 +12507,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12427
12507
  result = _a.sent();
12428
12508
  // cache accounts and tokens in the appropriate storage
12429
12509
  this.cacheAccount(accountEntity);
12430
- this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12510
+ this.cacheNativeTokens(response, request, homeAccountIdentifier, accountEntity, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12431
12511
  return [2 /*return*/, result];
12432
12512
  }
12433
12513
  });
@@ -12583,10 +12663,8 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12583
12663
  * @param tenantId
12584
12664
  * @param reqTimestamp
12585
12665
  */
12586
- NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12587
- // cache idToken in inmemory storage
12588
- var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12589
- this.nativeStorageManager.setIdTokenCredential(idTokenEntity);
12666
+ NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, accountEntity, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12667
+ var cachedIdToken = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12590
12668
  // cache accessToken in inmemory storage
12591
12669
  var expiresIn = (request.tokenType === exports.AuthenticationScheme.POP)
12592
12670
  ? Constants.SHR_NONCE_VALIDITY
@@ -12595,8 +12673,11 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12595
12673
  : response.expires_in) || 0;
12596
12674
  var tokenExpirationSeconds = reqTimestamp + expiresIn;
12597
12675
  var responseScopes = this.generateScopes(response, request);
12598
- var accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12599
- this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);
12676
+ var cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenObj
12677
+ ? idTokenObj.claims.tid || Constants.EMPTY_STRING
12678
+ : tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12679
+ var nativeCacheRecord = new CacheRecord(accountEntity, cachedIdToken, cachedAccessToken);
12680
+ this.nativeStorageManager.saveCacheRecord(nativeCacheRecord);
12600
12681
  };
12601
12682
  NativeInteractionClient.prototype.addTelemetryFromNativeResponse = function (response) {
12602
12683
  var mats = this.getMATSFromResponse(response);
@@ -12680,6 +12761,12 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12680
12761
  case 0:
12681
12762
  this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
12682
12763
  authority = request.authority || this.config.auth.authority;
12764
+ if (!request.account) return [3 /*break*/, 2];
12765
+ return [4 /*yield*/, this.validateRequestAuthority(authority, request.account)];
12766
+ case 1:
12767
+ _a.sent();
12768
+ _a.label = 2;
12769
+ case 2:
12683
12770
  canonicalAuthority = new UrlString(authority);
12684
12771
  canonicalAuthority.validateAsUri();
12685
12772
  scopes = request.scopes, remainingProperties = __rest(request, ["scopes"]);
@@ -12712,7 +12799,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12712
12799
  };
12713
12800
  validatedRequest = __assign$1(__assign$1({}, remainingProperties), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scope: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), prompt: getPrompt(), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign$1(__assign$1(__assign$1({}, request.extraQueryParameters), request.tokenQueryParameters), { telemetry: NativeConstants.MATS_TELEMETRY }), extendedExpiryToken: false // Make this configurable?
12714
12801
  });
12715
- if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
12802
+ if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 4];
12716
12803
  shrParameters = {
12717
12804
  resourceRequestUri: request.resourceRequestUri,
12718
12805
  resourceRequestMethod: request.resourceRequestMethod,
@@ -12721,13 +12808,13 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12721
12808
  };
12722
12809
  popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
12723
12810
  return [4 /*yield*/, popTokenGenerator.generateCnf(shrParameters)];
12724
- case 1:
12811
+ case 3:
12725
12812
  reqCnfData = _a.sent();
12726
- // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
12727
- validatedRequest.reqCnf = reqCnfData.reqCnfHash;
12813
+ // to reduce the URL length, it is recommended to send the short form of the req_cnf
12814
+ validatedRequest.reqCnf = reqCnfData.reqCnfString;
12728
12815
  validatedRequest.keyId = reqCnfData.kid;
12729
- _a.label = 2;
12730
- case 2: return [2 /*return*/, validatedRequest];
12816
+ _a.label = 4;
12817
+ case 4: return [2 /*return*/, validatedRequest];
12731
12818
  }
12732
12819
  });
12733
12820
  });
@@ -13029,6 +13116,7 @@ var RedirectClient = /** @class */ (function (_super) {
13029
13116
  if (event.persisted) {
13030
13117
  _this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache.");
13031
13118
  _this.browserStorage.cleanRequestByState(validRequest.state);
13119
+ _this.eventHandler.emitEvent(exports.EventType.RESTORE_FROM_BFCACHE, exports.InteractionType.Redirect);
13032
13120
  }
13033
13121
  };
13034
13122
  _a.label = 2;
@@ -13220,7 +13308,7 @@ var RedirectClient = /** @class */ (function (_super) {
13220
13308
  if (!this.nativeMessageHandler) {
13221
13309
  throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13222
13310
  }
13223
- nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, cachedRequest.correlationId);
13311
+ nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);
13224
13312
  userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;
13225
13313
  return [2 /*return*/, nativeInteractionClient.acquireToken(__assign$1(__assign$1({}, cachedRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently
13226
13314
  })).finally(function () {
@@ -13921,7 +14009,8 @@ function buildConfiguration(_a, isBrowserEnvironment) {
13921
14009
  storeAuthStateInCookie: false,
13922
14010
  secureCookies: false,
13923
14011
  // Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage
13924
- cacheMigrationEnabled: userInputCache && userInputCache.cacheLocation === exports.BrowserCacheLocation.LocalStorage ? true : false
14012
+ cacheMigrationEnabled: userInputCache && userInputCache.cacheLocation === exports.BrowserCacheLocation.LocalStorage ? true : false,
14013
+ claimsBasedCachingEnabled: true
13925
14014
  };
13926
14015
  // Default logger options for browser
13927
14016
  var DEFAULT_LOGGER_OPTIONS = {
@@ -14274,7 +14363,7 @@ var SilentRefreshClient = /** @class */ (function (_super) {
14274
14363
  this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14275
14364
  this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
14276
14365
  _a = [__assign$1({}, request)];
14277
- return [4 /*yield*/, this.initializeBaseRequest(request)];
14366
+ return [4 /*yield*/, this.initializeBaseRequest(request, request.account)];
14278
14367
  case 1:
14279
14368
  silentRequest = __assign$1.apply(void 0, _a.concat([_b.sent()]));
14280
14369
  acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
@@ -16606,7 +16695,8 @@ var ClientApplication = /** @class */ (function () {
16606
16695
  temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
16607
16696
  storeAuthStateInCookie: false,
16608
16697
  secureCookies: false,
16609
- cacheMigrationEnabled: false
16698
+ cacheMigrationEnabled: false,
16699
+ claimsBasedCachingEnabled: true
16610
16700
  };
16611
16701
  this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);
16612
16702
  // Initialize the token cache
@@ -17974,6 +18064,7 @@ var EventMessageUtils = /** @class */ (function () {
17974
18064
  case exports.EventType.LOGIN_FAILURE:
17975
18065
  case exports.EventType.ACQUIRE_TOKEN_SUCCESS:
17976
18066
  case exports.EventType.ACQUIRE_TOKEN_FAILURE:
18067
+ case exports.EventType.RESTORE_FROM_BFCACHE:
17977
18068
  if (message.interactionType === exports.InteractionType.Redirect || message.interactionType === exports.InteractionType.Popup) {
17978
18069
  if (currentStatus && currentStatus !== exports.InteractionStatus.Login && currentStatus !== exports.InteractionStatus.AcquireToken) {
17979
18070
  // Prevent this event from clearing any status other than login or acquireToken