@azure/msal-browser 2.29.0 → 2.30.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 (80) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.js +1 -1
  4. package/dist/app/IPublicClientApplication.js +1 -1
  5. package/dist/app/PublicClientApplication.js +1 -1
  6. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  7. package/dist/cache/AsyncMemoryStorage.js +1 -1
  8. package/dist/cache/BrowserCacheManager.js +1 -1
  9. package/dist/cache/BrowserStorage.js +1 -1
  10. package/dist/cache/CryptoKeyStore.js +1 -1
  11. package/dist/cache/DatabaseStorage.js +1 -1
  12. package/dist/cache/ITokenCache.d.ts +6 -3
  13. package/dist/cache/ITokenCache.d.ts.map +1 -1
  14. package/dist/cache/MemoryStorage.js +1 -1
  15. package/dist/cache/TokenCache.d.ts +33 -5
  16. package/dist/cache/TokenCache.d.ts.map +1 -1
  17. package/dist/cache/TokenCache.js +121 -20
  18. package/dist/cache/TokenCache.js.map +1 -1
  19. package/dist/config/Configuration.d.ts +4 -0
  20. package/dist/config/Configuration.d.ts.map +1 -1
  21. package/dist/config/Configuration.js +3 -3
  22. package/dist/config/Configuration.js.map +1 -1
  23. package/dist/crypto/BrowserCrypto.js +1 -1
  24. package/dist/crypto/CryptoOps.js +1 -1
  25. package/dist/crypto/GuidGenerator.js +1 -1
  26. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  27. package/dist/crypto/MsBrowserCrypto.js +1 -1
  28. package/dist/crypto/MsrBrowserCrypto.js +1 -1
  29. package/dist/crypto/PkceGenerator.js +1 -1
  30. package/dist/crypto/SignedHttpRequest.js +1 -1
  31. package/dist/encode/Base64Decode.js +1 -1
  32. package/dist/encode/Base64Encode.js +1 -1
  33. package/dist/error/BrowserAuthError.js +1 -1
  34. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  35. package/dist/error/NativeAuthError.js +1 -1
  36. package/dist/event/EventHandler.js +1 -1
  37. package/dist/event/EventMessage.js +1 -1
  38. package/dist/event/EventType.js +1 -1
  39. package/dist/index.cjs.js +197 -91
  40. package/dist/index.cjs.js.map +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/interaction_client/BaseInteractionClient.js +1 -1
  43. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  44. package/dist/interaction_client/NativeInteractionClient.js +1 -1
  45. package/dist/interaction_client/PopupClient.js +4 -4
  46. package/dist/interaction_client/PopupClient.js.map +1 -1
  47. package/dist/interaction_client/RedirectClient.js +1 -1
  48. package/dist/interaction_client/SilentAuthCodeClient.js +2 -2
  49. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
  50. package/dist/interaction_client/SilentCacheClient.js +1 -1
  51. package/dist/interaction_client/SilentIframeClient.js +2 -2
  52. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  53. package/dist/interaction_client/SilentRefreshClient.js +1 -1
  54. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  55. package/dist/interaction_handler/InteractionHandler.js +1 -1
  56. package/dist/interaction_handler/RedirectHandler.js +1 -1
  57. package/dist/interaction_handler/SilentHandler.d.ts +3 -1
  58. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  59. package/dist/interaction_handler/SilentHandler.js +5 -5
  60. package/dist/interaction_handler/SilentHandler.js.map +1 -1
  61. package/dist/internals.js +1 -1
  62. package/dist/navigation/NavigationClient.js +1 -1
  63. package/dist/network/FetchClient.js +1 -1
  64. package/dist/network/XhrClient.js +1 -1
  65. package/dist/packageMetadata.d.ts +1 -1
  66. package/dist/packageMetadata.js +2 -2
  67. package/dist/packageMetadata.js.map +1 -1
  68. package/dist/telemetry/BrowserPerformanceClient.js +1 -1
  69. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  70. package/dist/utils/BrowserConstants.d.ts +1 -1
  71. package/dist/utils/BrowserConstants.js +2 -2
  72. package/dist/utils/BrowserConstants.js.map +1 -1
  73. package/dist/utils/BrowserProtocolUtils.js +1 -1
  74. package/dist/utils/BrowserStringUtils.js +1 -1
  75. package/dist/utils/BrowserUtils.js +1 -1
  76. package/dist/utils/MathUtils.js +1 -1
  77. package/lib/msal-browser.js +197 -91
  78. package/lib/msal-browser.js.map +1 -1
  79. package/lib/msal-browser.min.js +32 -32
  80. package/package.json +2 -2
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.29.0 2022-10-03 */
1
+ /*! @azure/msal-browser v2.30.0 2022-10-10 */
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 v7.5.0 2022-10-03 */
120
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
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 v7.5.0 2022-10-03 */
207
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
208
208
 
209
209
  /*
210
210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -585,7 +585,7 @@ var JsonTypes;
585
585
  JsonTypes["Jwk"] = "JWK";
586
586
  })(JsonTypes || (JsonTypes = {}));
587
587
 
588
- /*! @azure/msal-common v7.5.0 2022-10-03 */
588
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
589
589
 
590
590
  /*
591
591
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -641,7 +641,7 @@ var AuthError = /** @class */ (function (_super) {
641
641
  return AuthError;
642
642
  }(Error));
643
643
 
644
- /*! @azure/msal-common v7.5.0 2022-10-03 */
644
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
645
645
 
646
646
  /*
647
647
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -716,7 +716,7 @@ var DEFAULT_CRYPTO_IMPLEMENTATION = {
716
716
  }
717
717
  };
718
718
 
719
- /*! @azure/msal-common v7.5.0 2022-10-03 */
719
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
720
720
 
721
721
  /*
722
722
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1211,7 +1211,7 @@ var ClientAuthError = /** @class */ (function (_super) {
1211
1211
  return ClientAuthError;
1212
1212
  }(AuthError));
1213
1213
 
1214
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1214
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1215
1215
 
1216
1216
  /*
1217
1217
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1336,7 +1336,7 @@ var StringUtils = /** @class */ (function () {
1336
1336
  return StringUtils;
1337
1337
  }());
1338
1338
 
1339
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1339
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1340
1340
 
1341
1341
  /*
1342
1342
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1516,12 +1516,12 @@ var Logger = /** @class */ (function () {
1516
1516
  return Logger;
1517
1517
  }());
1518
1518
 
1519
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1519
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1520
1520
  /* eslint-disable header/header */
1521
1521
  var name$1 = "@azure/msal-common";
1522
- var version$1 = "7.5.0";
1522
+ var version$1 = "7.6.0";
1523
1523
 
1524
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1524
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1525
1525
  /*
1526
1526
  * Copyright (c) Microsoft Corporation. All rights reserved.
1527
1527
  * Licensed under the MIT License.
@@ -1542,7 +1542,7 @@ exports.AzureCloudInstance = void 0;
1542
1542
  AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1543
1543
  })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1544
1544
 
1545
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1545
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1546
1546
 
1547
1547
  /*
1548
1548
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1701,7 +1701,7 @@ var CredentialEntity = /** @class */ (function () {
1701
1701
  return CredentialEntity;
1702
1702
  }());
1703
1703
 
1704
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1704
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1705
1705
 
1706
1706
  /*
1707
1707
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1956,7 +1956,7 @@ var ClientConfigurationError = /** @class */ (function (_super) {
1956
1956
  return ClientConfigurationError;
1957
1957
  }(ClientAuthError));
1958
1958
 
1959
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1959
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
1960
1960
 
1961
1961
  /*
1962
1962
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2140,7 +2140,7 @@ var ScopeSet = /** @class */ (function () {
2140
2140
  return ScopeSet;
2141
2141
  }());
2142
2142
 
2143
- /*! @azure/msal-common v7.5.0 2022-10-03 */
2143
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
2144
2144
 
2145
2145
  /*
2146
2146
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2178,7 +2178,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2178
2178
  };
2179
2179
  }
2180
2180
 
2181
- /*! @azure/msal-common v7.5.0 2022-10-03 */
2181
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
2182
2182
  /*
2183
2183
  * Copyright (c) Microsoft Corporation. All rights reserved.
2184
2184
  * Licensed under the MIT License.
@@ -2193,7 +2193,7 @@ var AuthorityType;
2193
2193
  AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
2194
2194
  })(AuthorityType || (AuthorityType = {}));
2195
2195
 
2196
- /*! @azure/msal-common v7.5.0 2022-10-03 */
2196
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
2197
2197
 
2198
2198
  /*
2199
2199
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2432,7 +2432,7 @@ var AccountEntity = /** @class */ (function () {
2432
2432
  return AccountEntity;
2433
2433
  }());
2434
2434
 
2435
- /*! @azure/msal-common v7.5.0 2022-10-03 */
2435
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
2436
2436
 
2437
2437
  /*
2438
2438
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2484,7 +2484,7 @@ var AuthToken = /** @class */ (function () {
2484
2484
  return AuthToken;
2485
2485
  }());
2486
2486
 
2487
- /*! @azure/msal-common v7.5.0 2022-10-03 */
2487
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
2488
2488
 
2489
2489
  /*
2490
2490
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2686,7 +2686,11 @@ var CacheManager = /** @class */ (function () {
2686
2686
  if (!!userAssertionHash && !_this.matchUserAssertionHash(entity, userAssertionHash)) {
2687
2687
  return;
2688
2688
  }
2689
- if (!!homeAccountId && !_this.matchHomeAccountId(entity, homeAccountId)) {
2689
+ /*
2690
+ * homeAccountId can undefined, and we want to filter out cached items that have a homeAccountId of ""
2691
+ * because we don't want a client_credential request to return a cached token that has a homeAccountId
2692
+ */
2693
+ if ((typeof homeAccountId === "string") && !_this.matchHomeAccountId(entity, homeAccountId)) {
2690
2694
  return;
2691
2695
  }
2692
2696
  if (!!environment && !_this.matchEnvironment(entity, environment)) {
@@ -3105,7 +3109,7 @@ var CacheManager = /** @class */ (function () {
3105
3109
  * @param homeAccountId
3106
3110
  */
3107
3111
  CacheManager.prototype.matchHomeAccountId = function (entity, homeAccountId) {
3108
- return !!(entity.homeAccountId && homeAccountId === entity.homeAccountId);
3112
+ return !!((typeof entity.homeAccountId === "string") && (homeAccountId === entity.homeAccountId));
3109
3113
  };
3110
3114
  /**
3111
3115
  * helper to match assertion
@@ -3359,7 +3363,7 @@ var DefaultStorageClass = /** @class */ (function (_super) {
3359
3363
  return DefaultStorageClass;
3360
3364
  }(CacheManager));
3361
3365
 
3362
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3366
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3363
3367
 
3364
3368
  /*
3365
3369
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3453,7 +3457,7 @@ function buildAuthOptions(authOptions) {
3453
3457
  return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
3454
3458
  }
3455
3459
 
3456
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3460
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3457
3461
 
3458
3462
  /*
3459
3463
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3473,7 +3477,7 @@ var ServerError = /** @class */ (function (_super) {
3473
3477
  return ServerError;
3474
3478
  }(AuthError));
3475
3479
 
3476
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3480
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3477
3481
 
3478
3482
  /*
3479
3483
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3569,7 +3573,7 @@ var ThrottlingUtils = /** @class */ (function () {
3569
3573
  return ThrottlingUtils;
3570
3574
  }());
3571
3575
 
3572
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3576
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3573
3577
 
3574
3578
  /*
3575
3579
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3618,7 +3622,7 @@ var NetworkManager = /** @class */ (function () {
3618
3622
  return NetworkManager;
3619
3623
  }());
3620
3624
 
3621
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3625
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3622
3626
  /*
3623
3627
  * Copyright (c) Microsoft Corporation. All rights reserved.
3624
3628
  * Licensed under the MIT License.
@@ -3629,7 +3633,7 @@ var CcsCredentialType;
3629
3633
  CcsCredentialType["UPN"] = "UPN";
3630
3634
  })(CcsCredentialType || (CcsCredentialType = {}));
3631
3635
 
3632
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3636
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3633
3637
 
3634
3638
  /*
3635
3639
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3720,7 +3724,7 @@ var BaseClient = /** @class */ (function () {
3720
3724
  return BaseClient;
3721
3725
  }());
3722
3726
 
3723
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3727
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3724
3728
 
3725
3729
  /*
3726
3730
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3806,7 +3810,7 @@ var RequestValidator = /** @class */ (function () {
3806
3810
  return RequestValidator;
3807
3811
  }());
3808
3812
 
3809
- /*! @azure/msal-common v7.5.0 2022-10-03 */
3813
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
3810
3814
 
3811
3815
  /*
3812
3816
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4184,7 +4188,7 @@ var RequestParameterBuilder = /** @class */ (function () {
4184
4188
  return RequestParameterBuilder;
4185
4189
  }());
4186
4190
 
4187
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4191
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4188
4192
 
4189
4193
  /*
4190
4194
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4248,7 +4252,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
4248
4252
  return IdTokenEntity;
4249
4253
  }(CredentialEntity));
4250
4254
 
4251
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4255
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4252
4256
  /*
4253
4257
  * Copyright (c) Microsoft Corporation. All rights reserved.
4254
4258
  * Licensed under the MIT License.
@@ -4298,7 +4302,7 @@ var TimeUtils = /** @class */ (function () {
4298
4302
  return TimeUtils;
4299
4303
  }());
4300
4304
 
4301
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4305
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4302
4306
 
4303
4307
  /*
4304
4308
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4412,7 +4416,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
4412
4416
  return AccessTokenEntity;
4413
4417
  }(CredentialEntity));
4414
4418
 
4415
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4419
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4416
4420
 
4417
4421
  /*
4418
4422
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4479,7 +4483,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
4479
4483
  return RefreshTokenEntity;
4480
4484
  }(CredentialEntity));
4481
4485
 
4482
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4486
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4483
4487
 
4484
4488
  /*
4485
4489
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4554,7 +4558,7 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
4554
4558
  return InteractionRequiredAuthError;
4555
4559
  }(AuthError));
4556
4560
 
4557
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4561
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4558
4562
  /*
4559
4563
  * Copyright (c) Microsoft Corporation. All rights reserved.
4560
4564
  * Licensed under the MIT License.
@@ -4570,7 +4574,7 @@ var CacheRecord = /** @class */ (function () {
4570
4574
  return CacheRecord;
4571
4575
  }());
4572
4576
 
4573
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4577
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4574
4578
 
4575
4579
  /*
4576
4580
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4641,7 +4645,7 @@ var ProtocolUtils = /** @class */ (function () {
4641
4645
  return ProtocolUtils;
4642
4646
  }());
4643
4647
 
4644
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4648
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4645
4649
 
4646
4650
  /*
4647
4651
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4875,7 +4879,7 @@ var UrlString = /** @class */ (function () {
4875
4879
  return UrlString;
4876
4880
  }());
4877
4881
 
4878
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4882
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4879
4883
 
4880
4884
  /*
4881
4885
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4976,7 +4980,7 @@ var PopTokenGenerator = /** @class */ (function () {
4976
4980
  return PopTokenGenerator;
4977
4981
  }());
4978
4982
 
4979
- /*! @azure/msal-common v7.5.0 2022-10-03 */
4983
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
4980
4984
 
4981
4985
  /*
4982
4986
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5046,7 +5050,7 @@ var AppMetadataEntity = /** @class */ (function () {
5046
5050
  return AppMetadataEntity;
5047
5051
  }());
5048
5052
 
5049
- /*! @azure/msal-common v7.5.0 2022-10-03 */
5053
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
5050
5054
  /*
5051
5055
  * Copyright (c) Microsoft Corporation. All rights reserved.
5052
5056
  * Licensed under the MIT License.
@@ -5082,7 +5086,7 @@ var AppMetadataEntity = /** @class */ (function () {
5082
5086
  return TokenCacheContext;
5083
5087
  }());
5084
5088
 
5085
- /*! @azure/msal-common v7.5.0 2022-10-03 */
5089
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
5086
5090
 
5087
5091
  /*
5088
5092
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5362,7 +5366,7 @@ var ResponseHandler = /** @class */ (function () {
5362
5366
  return ResponseHandler;
5363
5367
  }());
5364
5368
 
5365
- /*! @azure/msal-common v7.5.0 2022-10-03 */
5369
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
5366
5370
 
5367
5371
  /*
5368
5372
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5815,7 +5819,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5815
5819
  return AuthorizationCodeClient;
5816
5820
  }(BaseClient));
5817
5821
 
5818
- /*! @azure/msal-common v7.5.0 2022-10-03 */
5822
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
5819
5823
  /*
5820
5824
  * Copyright (c) Microsoft Corporation. All rights reserved.
5821
5825
  * Licensed under the MIT License.
@@ -5940,7 +5944,7 @@ var PerformanceEventStatus;
5940
5944
  PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
5941
5945
  })(PerformanceEventStatus || (PerformanceEventStatus = {}));
5942
5946
 
5943
- /*! @azure/msal-common v7.5.0 2022-10-03 */
5947
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
5944
5948
 
5945
5949
  /*
5946
5950
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6205,7 +6209,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
6205
6209
  return RefreshTokenClient;
6206
6210
  }(BaseClient));
6207
6211
 
6208
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6212
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6209
6213
 
6210
6214
  /*
6211
6215
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6329,7 +6333,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
6329
6333
  return SilentFlowClient;
6330
6334
  }(BaseClient));
6331
6335
 
6332
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6336
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6333
6337
  /*
6334
6338
  * Copyright (c) Microsoft Corporation. All rights reserved.
6335
6339
  * Licensed under the MIT License.
@@ -6341,7 +6345,7 @@ function isOpenIdConfigResponse(response) {
6341
6345
  response.hasOwnProperty("jwks_uri"));
6342
6346
  }
6343
6347
 
6344
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6348
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6345
6349
  /*
6346
6350
  * Copyright (c) Microsoft Corporation. All rights reserved.
6347
6351
  * Licensed under the MIT License.
@@ -6350,7 +6354,7 @@ var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/
6350
6354
  var EndpointMetadata = rawMetdataJSON.endpointMetadata;
6351
6355
  var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
6352
6356
 
6353
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6357
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6354
6358
  /*
6355
6359
  * Copyright (c) Microsoft Corporation. All rights reserved.
6356
6360
  * Licensed under the MIT License.
@@ -6364,7 +6368,7 @@ exports.ProtocolMode = void 0;
6364
6368
  ProtocolMode["OIDC"] = "OIDC";
6365
6369
  })(exports.ProtocolMode || (exports.ProtocolMode = {}));
6366
6370
 
6367
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6371
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6368
6372
 
6369
6373
  /*
6370
6374
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6441,7 +6445,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
6441
6445
  return AuthorityMetadataEntity;
6442
6446
  }());
6443
6447
 
6444
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6448
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6445
6449
  /*
6446
6450
  * Copyright (c) Microsoft Corporation. All rights reserved.
6447
6451
  * Licensed under the MIT License.
@@ -6451,7 +6455,7 @@ function isCloudInstanceDiscoveryResponse(response) {
6451
6455
  response.hasOwnProperty("metadata"));
6452
6456
  }
6453
6457
 
6454
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6458
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6455
6459
 
6456
6460
  /*
6457
6461
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6573,7 +6577,7 @@ var RegionDiscovery = /** @class */ (function () {
6573
6577
  return RegionDiscovery;
6574
6578
  }());
6575
6579
 
6576
- /*! @azure/msal-common v7.5.0 2022-10-03 */
6580
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
6577
6581
 
6578
6582
  /*
6579
6583
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7245,7 +7249,7 @@ var Authority = /** @class */ (function () {
7245
7249
  return Authority;
7246
7250
  }());
7247
7251
 
7248
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7252
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7249
7253
 
7250
7254
  /*
7251
7255
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7306,7 +7310,7 @@ var AuthorityFactory = /** @class */ (function () {
7306
7310
  return AuthorityFactory;
7307
7311
  }());
7308
7312
 
7309
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7313
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7310
7314
 
7311
7315
  /*
7312
7316
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7337,7 +7341,7 @@ var ServerTelemetryEntity = /** @class */ (function () {
7337
7341
  return ServerTelemetryEntity;
7338
7342
  }());
7339
7343
 
7340
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7344
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7341
7345
 
7342
7346
  /*
7343
7347
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7365,7 +7369,7 @@ var ThrottlingEntity = /** @class */ (function () {
7365
7369
  return ThrottlingEntity;
7366
7370
  }());
7367
7371
 
7368
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7372
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7369
7373
 
7370
7374
  /*
7371
7375
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7382,7 +7386,7 @@ var StubbedNetworkModule = {
7382
7386
  }
7383
7387
  };
7384
7388
 
7385
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7389
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7386
7390
 
7387
7391
  /*
7388
7392
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7427,7 +7431,7 @@ var JoseHeaderError = /** @class */ (function (_super) {
7427
7431
  return JoseHeaderError;
7428
7432
  }(AuthError));
7429
7433
 
7430
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7434
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7431
7435
 
7432
7436
  /*
7433
7437
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7467,7 +7471,7 @@ var JoseHeader = /** @class */ (function () {
7467
7471
  return JoseHeader;
7468
7472
  }());
7469
7473
 
7470
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7474
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7471
7475
 
7472
7476
  /*
7473
7477
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7526,7 +7530,7 @@ var AuthenticationHeaderParser = /** @class */ (function () {
7526
7530
  return AuthenticationHeaderParser;
7527
7531
  }());
7528
7532
 
7529
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7533
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7530
7534
 
7531
7535
  /*
7532
7536
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7688,7 +7692,7 @@ var ServerTelemetryManager = /** @class */ (function () {
7688
7692
  return ServerTelemetryManager;
7689
7693
  }());
7690
7694
 
7691
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7695
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7692
7696
 
7693
7697
  /*
7694
7698
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7967,7 +7971,7 @@ var PerformanceClient = /** @class */ (function () {
7967
7971
  return PerformanceClient;
7968
7972
  }());
7969
7973
 
7970
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7974
+ /*! @azure/msal-common v7.6.0 2022-10-10 */
7971
7975
 
7972
7976
  /*
7973
7977
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8505,7 +8509,7 @@ var BrowserConstants = {
8505
8509
  /**
8506
8510
  * Default popup monitor poll interval in milliseconds
8507
8511
  */
8508
- POLL_INTERVAL_MS: 50,
8512
+ DEFAULT_POLL_INTERVAL_MS: 30,
8509
8513
  /**
8510
8514
  * Msal-browser SKU
8511
8515
  */
@@ -9842,7 +9846,7 @@ var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
9842
9846
 
9843
9847
  /* eslint-disable header/header */
9844
9848
  var name = "@azure/msal-browser";
9845
- var version = "2.29.0";
9849
+ var version = "2.30.0";
9846
9850
 
9847
9851
  /*
9848
9852
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -12462,7 +12466,7 @@ var PopupClient = /** @class */ (function (_super) {
12462
12466
  * Polling for popups needs to be tick-based,
12463
12467
  * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).
12464
12468
  */
12465
- var maxTicks = _this.config.system.windowHashTimeout / BrowserConstants.POLL_INTERVAL_MS;
12469
+ var maxTicks = _this.config.system.windowHashTimeout / _this.config.system.pollIntervalMilliseconds;
12466
12470
  var ticks = 0;
12467
12471
  _this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");
12468
12472
  var intervalId = setInterval(function () {
@@ -12515,7 +12519,7 @@ var PopupClient = /** @class */ (function (_super) {
12515
12519
  clearInterval(intervalId);
12516
12520
  reject(BrowserAuthError.createMonitorPopupTimeoutError());
12517
12521
  }
12518
- }, BrowserConstants.POLL_INTERVAL_MS);
12522
+ }, _this.config.system.pollIntervalMilliseconds);
12519
12523
  });
12520
12524
  };
12521
12525
  /**
@@ -12553,7 +12557,7 @@ var PopupClient = /** @class */ (function (_super) {
12553
12557
  clearInterval(intervalId);
12554
12558
  _this.cleanPopup(popupWindow);
12555
12559
  resolve();
12556
- }, BrowserConstants.POLL_INTERVAL_MS);
12560
+ }, _this.config.system.pollIntervalMilliseconds);
12557
12561
  });
12558
12562
  };
12559
12563
  /**
@@ -12786,7 +12790,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12786
12790
  // Default system options for browser
12787
12791
  var DEFAULT_BROWSER_SYSTEM_OPTIONS = __assign$1(__assign$1({}, DEFAULT_SYSTEM_OPTIONS), { loggerOptions: DEFAULT_LOGGER_OPTIONS, networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule, navigationClient: new NavigationClient(), loadFrameTimeout: 0,
12788
12792
  // If loadFrameTimeout is provided, use that as default.
12789
- windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, cryptoOptions: {
12793
+ windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS, cryptoOptions: {
12790
12794
  useMsrCrypto: false,
12791
12795
  entropy: undefined
12792
12796
  } });
@@ -12811,9 +12815,10 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12811
12815
  */
12812
12816
  var SilentHandler = /** @class */ (function (_super) {
12813
12817
  __extends$1(SilentHandler, _super);
12814
- function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, navigateFrameWait) {
12818
+ function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, systemOptions) {
12815
12819
  var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger) || this;
12816
- _this.navigateFrameWait = navigateFrameWait;
12820
+ _this.navigateFrameWait = systemOptions.navigateFrameWait;
12821
+ _this.pollIntervalMilliseconds = systemOptions.pollIntervalMilliseconds;
12817
12822
  return _this;
12818
12823
  }
12819
12824
  /**
@@ -12891,7 +12896,7 @@ var SilentHandler = /** @class */ (function (_super) {
12891
12896
  resolve(contentHash);
12892
12897
  return;
12893
12898
  }
12894
- }, BrowserConstants.POLL_INTERVAL_MS);
12899
+ }, _this.pollIntervalMilliseconds);
12895
12900
  });
12896
12901
  };
12897
12902
  /**
@@ -13056,7 +13061,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
13056
13061
  return [4 /*yield*/, authClient.getAuthCodeUrl(__assign$1(__assign$1({}, silentRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme) }))];
13057
13062
  case 2:
13058
13063
  navigateUrl = _a.sent();
13059
- silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system.navigateFrameWait);
13064
+ silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
13060
13065
  return [4 /*yield*/, silentHandler.initiateAuthRequest(navigateUrl)];
13061
13066
  case 3:
13062
13067
  msalFrame = _a.sent();
@@ -14865,15 +14870,19 @@ var TokenCache = /** @class */ (function () {
14865
14870
  * @param request
14866
14871
  * @param response
14867
14872
  * @param options
14873
+ * @returns `AuthenticationResult` for the response that was loaded.
14868
14874
  */
14869
14875
  TokenCache.prototype.loadExternalTokens = function (request, response, options) {
14870
14876
  this.logger.info("TokenCache - loadExternalTokens called");
14871
14877
  if (!response.id_token) {
14872
14878
  throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes id token.");
14873
14879
  }
14880
+ var idToken = new AuthToken(response.id_token, this.cryptoObj);
14881
+ var cacheRecord;
14882
+ var authority;
14874
14883
  if (request.account) {
14875
- this.loadIdToken(response.id_token, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);
14876
- this.loadAccessToken(request, response, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);
14884
+ var cacheRecordAccount = this.loadAccount(idToken, request.account.environment, undefined, undefined, request.account.homeAccountId);
14885
+ cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment));
14877
14886
  }
14878
14887
  else if (request.authority) {
14879
14888
  var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);
@@ -14884,17 +14893,17 @@ var TokenCache = /** @class */ (function () {
14884
14893
  authorityMetadata: this.config.auth.authorityMetadata,
14885
14894
  skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
14886
14895
  };
14887
- var authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
14896
+ authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
14888
14897
  // "clientInfo" from options takes precedence over "clientInfo" in response
14889
14898
  if (options.clientInfo) {
14890
14899
  this.logger.trace("TokenCache - homeAccountId from options");
14891
- this.loadIdToken(response.id_token, options.clientInfo, authority.hostnameAndPort, authority.tenant, options);
14892
- this.loadAccessToken(request, response, options.clientInfo, authority.hostnameAndPort, authority.tenant, options);
14900
+ var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, options.clientInfo, authority.authorityType);
14901
+ cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
14893
14902
  }
14894
14903
  else if (response.client_info) {
14895
14904
  this.logger.trace("TokenCache - homeAccountId from response");
14896
- this.loadIdToken(response.id_token, response.client_info, authority.hostnameAndPort, authority.tenant, options);
14897
- this.loadAccessToken(request, response, response.client_info, authority.hostnameAndPort, authority.tenant, options);
14905
+ var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, response.client_info, authority.authorityType);
14906
+ cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
14898
14907
  }
14899
14908
  else {
14900
14909
  throw BrowserAuthError.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");
@@ -14903,6 +14912,39 @@ var TokenCache = /** @class */ (function () {
14903
14912
  else {
14904
14913
  throw BrowserAuthError.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");
14905
14914
  }
14915
+ return this.generateAuthenticationResult(request, idToken, cacheRecord, authority);
14916
+ };
14917
+ /**
14918
+ * Helper function to load account to msal-browser cache
14919
+ * @param idToken
14920
+ * @param environment
14921
+ * @param clientInfo
14922
+ * @param authorityType
14923
+ * @param requestHomeAccountId
14924
+ * @returns `AccountEntity`
14925
+ */
14926
+ TokenCache.prototype.loadAccount = function (idToken, environment, clientInfo, authorityType, requestHomeAccountId) {
14927
+ var homeAccountId;
14928
+ if (requestHomeAccountId) {
14929
+ homeAccountId = requestHomeAccountId;
14930
+ }
14931
+ else if (authorityType !== undefined && clientInfo) {
14932
+ homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authorityType, this.logger, this.cryptoObj, idToken);
14933
+ }
14934
+ if (!homeAccountId) {
14935
+ throw BrowserAuthError.createUnableToLoadTokenError("Unexpected missing homeAccountId");
14936
+ }
14937
+ var accountEntity = clientInfo ?
14938
+ AccountEntity.createAccount(clientInfo, homeAccountId, idToken, undefined, undefined, undefined, environment) :
14939
+ AccountEntity.createGenericAccount(homeAccountId, idToken, undefined, undefined, undefined, environment);
14940
+ if (this.isBrowserEnvironment) {
14941
+ this.logger.verbose("TokenCache - loading account");
14942
+ this.storage.setAccount(accountEntity);
14943
+ return accountEntity;
14944
+ }
14945
+ else {
14946
+ throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
14947
+ }
14906
14948
  };
14907
14949
  /**
14908
14950
  * Helper function to load id tokens to msal-browser cache
@@ -14910,18 +14952,14 @@ var TokenCache = /** @class */ (function () {
14910
14952
  * @param homeAccountId
14911
14953
  * @param environment
14912
14954
  * @param tenantId
14913
- * @param options
14955
+ * @returns `IdTokenEntity`
14914
14956
  */
14915
- TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId, options) {
14916
- var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);
14917
- var idAuthToken = new AuthToken(idToken, this.cryptoObj);
14918
- var accountEntity = options.clientInfo ?
14919
- AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined, environment) :
14920
- AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined, environment);
14957
+ TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId) {
14958
+ var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken.rawToken, this.config.auth.clientId, tenantId);
14921
14959
  if (this.isBrowserEnvironment) {
14922
14960
  this.logger.verbose("TokenCache - loading id token");
14923
- this.storage.setAccount(accountEntity);
14924
14961
  this.storage.setIdTokenCredential(idTokenEntity);
14962
+ return idTokenEntity;
14925
14963
  }
14926
14964
  else {
14927
14965
  throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
@@ -14931,16 +14969,15 @@ var TokenCache = /** @class */ (function () {
14931
14969
  * Helper function to load access tokens to msal-browser cache
14932
14970
  * @param request
14933
14971
  * @param response
14934
- * @param options
14935
14972
  * @param homeAccountId
14936
14973
  * @param environment
14937
14974
  * @param tenantId
14938
- * @returns
14975
+ * @returns `AccessTokenEntity`
14939
14976
  */
14940
14977
  TokenCache.prototype.loadAccessToken = function (request, response, homeAccountId, environment, tenantId, options) {
14941
14978
  if (!response.access_token) {
14942
14979
  this.logger.verbose("TokenCache - No access token provided for caching");
14943
- return;
14980
+ return null;
14944
14981
  }
14945
14982
  if (!response.expires_in) {
14946
14983
  throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");
@@ -14955,11 +14992,80 @@ var TokenCache = /** @class */ (function () {
14955
14992
  if (this.isBrowserEnvironment) {
14956
14993
  this.logger.verbose("TokenCache - loading access token");
14957
14994
  this.storage.setAccessTokenCredential(accessTokenEntity);
14995
+ return accessTokenEntity;
14958
14996
  }
14959
14997
  else {
14960
14998
  throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
14961
14999
  }
14962
15000
  };
15001
+ /**
15002
+ * Helper function to load refresh tokens to msal-browser cache
15003
+ * @param request
15004
+ * @param response
15005
+ * @param homeAccountId
15006
+ * @param environment
15007
+ * @returns `RefreshTokenEntity`
15008
+ */
15009
+ TokenCache.prototype.loadRefreshToken = function (request, response, homeAccountId, environment) {
15010
+ if (!response.refresh_token) {
15011
+ this.logger.verbose("TokenCache - No refresh token provided for caching");
15012
+ return null;
15013
+ }
15014
+ var refreshTokenEntity = RefreshTokenEntity.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);
15015
+ if (this.isBrowserEnvironment) {
15016
+ this.logger.verbose("TokenCache - loading refresh token");
15017
+ this.storage.setRefreshTokenCredential(refreshTokenEntity);
15018
+ return refreshTokenEntity;
15019
+ }
15020
+ else {
15021
+ throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
15022
+ }
15023
+ };
15024
+ /**
15025
+ * Helper function to generate an `AuthenticationResult` for the result.
15026
+ * @param request
15027
+ * @param idTokenObj
15028
+ * @param cacheRecord
15029
+ * @param authority
15030
+ * @returns `AuthenticationResult`
15031
+ */
15032
+ TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, authority) {
15033
+ var _a, _b, _c;
15034
+ var accessToken = Constants.EMPTY_STRING;
15035
+ var responseScopes = [];
15036
+ var expiresOn = null;
15037
+ var extExpiresOn;
15038
+ if (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) {
15039
+ accessToken = cacheRecord.accessToken.secret;
15040
+ responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
15041
+ expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
15042
+ extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
15043
+ }
15044
+ var uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;
15045
+ var tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;
15046
+ return {
15047
+ authority: authority ? authority.canonicalAuthority : Constants.EMPTY_STRING,
15048
+ uniqueId: uid,
15049
+ tenantId: tid,
15050
+ scopes: responseScopes,
15051
+ account: (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) ? cacheRecord.account.getAccountInfo() : null,
15052
+ idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
15053
+ idTokenClaims: idTokenObj ? idTokenObj.claims : {},
15054
+ accessToken: accessToken,
15055
+ fromCache: true,
15056
+ expiresOn: expiresOn,
15057
+ correlationId: request.correlationId || Constants.EMPTY_STRING,
15058
+ requestId: Constants.EMPTY_STRING,
15059
+ extExpiresOn: extExpiresOn,
15060
+ familyId: Constants.EMPTY_STRING,
15061
+ tokenType: ((_a = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
15062
+ state: Constants.EMPTY_STRING,
15063
+ cloudGraphHostName: ((_b = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,
15064
+ msGraphHost: ((_c = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,
15065
+ code: undefined,
15066
+ fromNativeBroker: false
15067
+ };
15068
+ };
14963
15069
  return TokenCache;
14964
15070
  }());
14965
15071
 
@@ -15017,7 +15123,7 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
15017
15123
  clientConfig = _a.sent();
15018
15124
  authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
15019
15125
  this.logger.verbose("Auth code client created");
15020
- silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system.navigateFrameWait);
15126
+ silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
15021
15127
  // Handle auth code parameters from request
15022
15128
  return [2 /*return*/, silentHandler.handleCodeResponseFromServer({
15023
15129
  code: request.code,