@azure/msal-browser 2.29.0 → 2.31.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 (89) hide show
  1. package/README.md +1 -2
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.d.ts.map +1 -1
  4. package/dist/app/ClientApplication.js +13 -9
  5. package/dist/app/ClientApplication.js.map +1 -1
  6. package/dist/app/IPublicClientApplication.js +1 -1
  7. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  8. package/dist/app/PublicClientApplication.js +8 -6
  9. package/dist/app/PublicClientApplication.js.map +1 -1
  10. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +11 -0
  11. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  12. package/dist/broker/nativeBroker/NativeMessageHandler.js +16 -1
  13. package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
  14. package/dist/cache/AsyncMemoryStorage.js +1 -1
  15. package/dist/cache/BrowserCacheManager.js +1 -1
  16. package/dist/cache/BrowserStorage.js +1 -1
  17. package/dist/cache/CryptoKeyStore.js +1 -1
  18. package/dist/cache/DatabaseStorage.js +1 -1
  19. package/dist/cache/ITokenCache.d.ts +6 -3
  20. package/dist/cache/ITokenCache.d.ts.map +1 -1
  21. package/dist/cache/MemoryStorage.js +1 -1
  22. package/dist/cache/TokenCache.d.ts +33 -5
  23. package/dist/cache/TokenCache.d.ts.map +1 -1
  24. package/dist/cache/TokenCache.js +121 -20
  25. package/dist/cache/TokenCache.js.map +1 -1
  26. package/dist/config/Configuration.d.ts +4 -0
  27. package/dist/config/Configuration.d.ts.map +1 -1
  28. package/dist/config/Configuration.js +3 -3
  29. package/dist/config/Configuration.js.map +1 -1
  30. package/dist/crypto/BrowserCrypto.js +1 -1
  31. package/dist/crypto/CryptoOps.js +1 -1
  32. package/dist/crypto/GuidGenerator.js +1 -1
  33. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  34. package/dist/crypto/MsBrowserCrypto.js +1 -1
  35. package/dist/crypto/MsrBrowserCrypto.js +1 -1
  36. package/dist/crypto/PkceGenerator.js +1 -1
  37. package/dist/crypto/SignedHttpRequest.js +1 -1
  38. package/dist/encode/Base64Decode.js +1 -1
  39. package/dist/encode/Base64Encode.js +1 -1
  40. package/dist/error/BrowserAuthError.js +1 -1
  41. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  42. package/dist/error/NativeAuthError.js +1 -1
  43. package/dist/event/EventHandler.js +1 -1
  44. package/dist/event/EventMessage.js +1 -1
  45. package/dist/event/EventType.js +1 -1
  46. package/dist/index.cjs.js +296 -132
  47. package/dist/index.cjs.js.map +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/interaction_client/BaseInteractionClient.js +1 -1
  50. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  51. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  52. package/dist/interaction_client/NativeInteractionClient.js +28 -7
  53. package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
  54. package/dist/interaction_client/PopupClient.js +4 -4
  55. package/dist/interaction_client/PopupClient.js.map +1 -1
  56. package/dist/interaction_client/RedirectClient.js +1 -1
  57. package/dist/interaction_client/SilentAuthCodeClient.js +2 -2
  58. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
  59. package/dist/interaction_client/SilentCacheClient.js +1 -1
  60. package/dist/interaction_client/SilentIframeClient.js +2 -2
  61. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  62. package/dist/interaction_client/SilentRefreshClient.js +1 -1
  63. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  64. package/dist/interaction_handler/InteractionHandler.js +1 -1
  65. package/dist/interaction_handler/RedirectHandler.js +1 -1
  66. package/dist/interaction_handler/SilentHandler.d.ts +3 -1
  67. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  68. package/dist/interaction_handler/SilentHandler.js +5 -5
  69. package/dist/interaction_handler/SilentHandler.js.map +1 -1
  70. package/dist/internals.js +1 -1
  71. package/dist/navigation/NavigationClient.js +1 -1
  72. package/dist/network/FetchClient.js +1 -1
  73. package/dist/network/XhrClient.js +1 -1
  74. package/dist/packageMetadata.d.ts +1 -1
  75. package/dist/packageMetadata.js +2 -2
  76. package/dist/packageMetadata.js.map +1 -1
  77. package/dist/telemetry/BrowserPerformanceClient.js +1 -1
  78. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  79. package/dist/utils/BrowserConstants.d.ts +1 -1
  80. package/dist/utils/BrowserConstants.js +2 -2
  81. package/dist/utils/BrowserConstants.js.map +1 -1
  82. package/dist/utils/BrowserProtocolUtils.js +1 -1
  83. package/dist/utils/BrowserStringUtils.js +1 -1
  84. package/dist/utils/BrowserUtils.js +1 -1
  85. package/dist/utils/MathUtils.js +1 -1
  86. package/lib/msal-browser.js +296 -132
  87. package/lib/msal-browser.js.map +1 -1
  88. package/lib/msal-browser.min.js +44 -44
  89. 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.31.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 = "8.0.0";
1523
1523
 
1524
- /*! @azure/msal-common v7.5.0 2022-10-03 */
1524
+ /*! @azure/msal-common v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
5944
5948
 
5945
5949
  /*
5946
5950
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5955,27 +5959,28 @@ var RefreshTokenClient = /** @class */ (function (_super) {
5955
5959
  return _super.call(this, configuration, performanceClient) || this;
5956
5960
  }
5957
5961
  RefreshTokenClient.prototype.acquireToken = function (request) {
5958
- var _a, _b;
5962
+ var _a, _b, _c;
5959
5963
  return __awaiter(this, void 0, void 0, function () {
5960
5964
  var atsMeasurement, reqTimestamp, response, requestId, responseHandler;
5961
5965
  var _this = this;
5962
- return __generator(this, function (_c) {
5963
- switch (_c.label) {
5966
+ return __generator(this, function (_d) {
5967
+ switch (_d.label) {
5964
5968
  case 0:
5965
5969
  atsMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5966
5970
  this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
5967
5971
  reqTimestamp = TimeUtils.nowSeconds();
5968
5972
  return [4 /*yield*/, this.executeTokenRequest(request, this.authority)];
5969
5973
  case 1:
5970
- response = _c.sent();
5971
- requestId = (_b = response.headers) === null || _b === void 0 ? void 0 : _b[HeaderNames.X_MS_REQUEST_ID];
5974
+ response = _d.sent();
5975
+ atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
5976
+ refreshTokenSize: ((_b = response.body.refresh_token) === null || _b === void 0 ? void 0 : _b.length) || 0
5977
+ });
5978
+ requestId = (_c = response.headers) === null || _c === void 0 ? void 0 : _c[HeaderNames.X_MS_REQUEST_ID];
5972
5979
  responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
5973
5980
  responseHandler.validateTokenResponse(response.body);
5974
5981
  return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId).then(function (result) {
5975
- var _a;
5976
5982
  atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
5977
- success: true,
5978
- refreshTokenSize: ((_a = response.body.refresh_token) === null || _a === void 0 ? void 0 : _a.length) || 0
5983
+ success: true
5979
5984
  });
5980
5985
  return result;
5981
5986
  })
@@ -5984,8 +5989,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
5984
5989
  atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
5985
5990
  errorCode: error.errorCode,
5986
5991
  subErrorCode: error.subError,
5987
- success: false,
5988
- refreshTokenSize: undefined
5992
+ success: false
5989
5993
  });
5990
5994
  throw error;
5991
5995
  })];
@@ -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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
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 v8.0.0 2022-11-07 */
7692
7696
 
7693
7697
  /*
7694
7698
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7715,6 +7719,7 @@ var PerformanceClient = /** @class */ (function () {
7715
7719
  this.logger = logger;
7716
7720
  this.callbacks = new Map();
7717
7721
  this.eventsByCorrelationId = new Map();
7722
+ this.staticFieldsByCorrelationId = new Map();
7718
7723
  this.measurementsById = new Map();
7719
7724
  }
7720
7725
  /**
@@ -7741,8 +7746,6 @@ var PerformanceClient = /** @class */ (function () {
7741
7746
  authority: this.authority,
7742
7747
  libraryName: this.libraryName,
7743
7748
  libraryVersion: this.libraryVersion,
7744
- appName: (_a = this.applicationTelemetry) === null || _a === void 0 ? void 0 : _a.appName,
7745
- appVersion: (_b = this.applicationTelemetry) === null || _b === void 0 ? void 0 : _b.appVersion,
7746
7749
  clientId: this.clientId,
7747
7750
  name: measureName,
7748
7751
  startTimeMs: Date.now(),
@@ -7750,6 +7753,11 @@ var PerformanceClient = /** @class */ (function () {
7750
7753
  };
7751
7754
  // Store in progress events so they can be discarded if not ended properly
7752
7755
  this.cacheEventByCorrelationId(inProgressEvent);
7756
+ var staticFields = {
7757
+ appName: (_a = this.applicationTelemetry) === null || _a === void 0 ? void 0 : _a.appName,
7758
+ appVersion: (_b = this.applicationTelemetry) === null || _b === void 0 ? void 0 : _b.appVersion,
7759
+ };
7760
+ this.addStaticFields(staticFields, eventCorrelationId);
7753
7761
  this.cacheMeasurement(inProgressEvent, performanceMeasurement);
7754
7762
  // Return the event and functions the caller can use to properly end/flush the measurement
7755
7763
  return {
@@ -7767,6 +7775,9 @@ var PerformanceClient = /** @class */ (function () {
7767
7775
  discardMeasurement: function () {
7768
7776
  return _this.discardMeasurements(inProgressEvent.correlationId);
7769
7777
  },
7778
+ addStaticFields: function (fields) {
7779
+ return _this.addStaticFields(fields, inProgressEvent.correlationId);
7780
+ },
7770
7781
  measurement: performanceMeasurement,
7771
7782
  event: inProgressEvent
7772
7783
  };
@@ -7802,6 +7813,22 @@ var PerformanceClient = /** @class */ (function () {
7802
7813
  }
7803
7814
  return null;
7804
7815
  };
7816
+ /**
7817
+ * Saves extra information to be emitted when the measurements are flushed
7818
+ * @param fields
7819
+ * @param correlationId
7820
+ */
7821
+ PerformanceClient.prototype.addStaticFields = function (fields, correlationId) {
7822
+ var existingStaticFields = this.staticFieldsByCorrelationId.get(correlationId);
7823
+ if (existingStaticFields) {
7824
+ this.logger.trace("PerformanceClient: Updating static fields");
7825
+ this.staticFieldsByCorrelationId.set(correlationId, __assign(__assign({}, existingStaticFields), fields));
7826
+ }
7827
+ else {
7828
+ this.logger.trace("PerformanceClient: Adding static fields");
7829
+ this.staticFieldsByCorrelationId.set(correlationId, fields);
7830
+ }
7831
+ };
7805
7832
  /**
7806
7833
  * Upserts event into event cache.
7807
7834
  * First key is the correlation id, second key is the event id.
@@ -7891,19 +7918,12 @@ var PerformanceClient = /** @class */ (function () {
7891
7918
  else {
7892
7919
  _this.logger.verbose("PerformanceClient: Submeasurement for " + measureName + " already exists for " + current.name + ", ignoring", correlationId);
7893
7920
  }
7894
- if (current.accessTokenSize) {
7895
- previous.accessTokenSize = current.accessTokenSize;
7896
- }
7897
- if (current.idTokenSize) {
7898
- previous.idTokenSize = current.idTokenSize;
7899
- }
7900
- if (current.refreshTokenSize) {
7901
- previous.refreshTokenSize = current.refreshTokenSize;
7902
- }
7903
7921
  }
7904
7922
  return previous;
7905
7923
  }, topLevelEvent);
7906
- this.emitEvents([eventToEmit], eventToEmit.correlationId);
7924
+ var staticFields = this.staticFieldsByCorrelationId.get(correlationId);
7925
+ var finalEvent = __assign(__assign({}, eventToEmit), staticFields);
7926
+ this.emitEvents([finalEvent], eventToEmit.correlationId);
7907
7927
  }
7908
7928
  else {
7909
7929
  this.logger.verbose("PerformanceClient: No completed top-level measurements found for " + measureName, correlationId);
@@ -7967,7 +7987,7 @@ var PerformanceClient = /** @class */ (function () {
7967
7987
  return PerformanceClient;
7968
7988
  }());
7969
7989
 
7970
- /*! @azure/msal-common v7.5.0 2022-10-03 */
7990
+ /*! @azure/msal-common v8.0.0 2022-11-07 */
7971
7991
 
7972
7992
  /*
7973
7993
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8505,7 +8525,7 @@ var BrowserConstants = {
8505
8525
  /**
8506
8526
  * Default popup monitor poll interval in milliseconds
8507
8527
  */
8508
- POLL_INTERVAL_MS: 50,
8528
+ DEFAULT_POLL_INTERVAL_MS: 30,
8509
8529
  /**
8510
8530
  * Msal-browser SKU
8511
8531
  */
@@ -9842,7 +9862,7 @@ var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
9842
9862
 
9843
9863
  /* eslint-disable header/header */
9844
9864
  var name = "@azure/msal-browser";
9845
- var version = "2.29.0";
9865
+ var version = "2.31.0";
9846
9866
 
9847
9867
  /*
9848
9868
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11223,7 +11243,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
11223
11243
  result = _a.sent();
11224
11244
  nativeATMeasurement.endMeasurement({
11225
11245
  success: true,
11226
- isNativeBroker: true,
11246
+ isNativeBroker: false,
11227
11247
  fromCache: true
11228
11248
  });
11229
11249
  return [2 /*return*/, result];
@@ -11365,7 +11385,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
11365
11385
  */
11366
11386
  NativeInteractionClient.prototype.handleRedirectPromise = function () {
11367
11387
  return __awaiter$1(this, void 0, void 0, function () {
11368
- var cachedRequest, messageBody, reqTimestamp, response, result, e_4;
11388
+ var cachedRequest, prompt, request, messageBody, reqTimestamp, response, result, e_4;
11369
11389
  return __generator$1(this, function (_a) {
11370
11390
  switch (_a.label) {
11371
11391
  case 0:
@@ -11379,10 +11399,14 @@ var NativeInteractionClient = /** @class */ (function (_super) {
11379
11399
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.");
11380
11400
  return [2 /*return*/, null];
11381
11401
  }
11402
+ prompt = cachedRequest.prompt, request = __rest(cachedRequest, ["prompt"]);
11403
+ if (prompt) {
11404
+ this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.");
11405
+ }
11382
11406
  this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
11383
11407
  messageBody = {
11384
11408
  method: NativeExtensionMethod.GetToken,
11385
- request: cachedRequest
11409
+ request: request
11386
11410
  };
11387
11411
  reqTimestamp = TimeUtils.nowSeconds();
11388
11412
  _a.label = 1;
@@ -11393,7 +11417,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
11393
11417
  case 2:
11394
11418
  response = _a.sent();
11395
11419
  this.validateNativeResponse(response);
11396
- result = this.handleNativeResponse(response, cachedRequest, reqTimestamp);
11420
+ result = this.handleNativeResponse(response, request, reqTimestamp);
11397
11421
  this.browserStorage.setInteractionInProgress(false);
11398
11422
  return [2 /*return*/, result];
11399
11423
  case 3:
@@ -11421,12 +11445,30 @@ var NativeInteractionClient = /** @class */ (function (_super) {
11421
11445
  */
11422
11446
  NativeInteractionClient.prototype.handleNativeResponse = function (response, request, reqTimestamp) {
11423
11447
  return __awaiter$1(this, void 0, void 0, function () {
11424
- var idTokenObj, authority, authorityPreferredCache, homeAccountIdentifier, accountEntity, responseScopes, accountProperties, uid, tid, responseAccessToken, responseTokenType, _a, popTokenGenerator, shrParameters, mats, result, idTokenEntity, expiresIn, tokenExpirationSeconds, accessTokenEntity;
11448
+ var mats, idTokenObj, authority, authorityPreferredCache, homeAccountIdentifier, accountEntity, responseScopes, accountProperties, uid, tid, responseAccessToken, responseTokenType, _a, popTokenGenerator, shrParameters, result, idTokenEntity, expiresIn, tokenExpirationSeconds, accessTokenEntity;
11425
11449
  var _this = this;
11426
11450
  return __generator$1(this, function (_b) {
11427
11451
  switch (_b.label) {
11428
11452
  case 0:
11429
11453
  this.logger.trace("NativeInteractionClient - handleNativeResponse called.");
11454
+ mats = this.getMATSFromResponse(response);
11455
+ this.performanceClient.addStaticFields({
11456
+ extensionId: this.nativeMessageHandler.getExtensionId(),
11457
+ extensionVersion: this.nativeMessageHandler.getExtensionVersion(),
11458
+ matsBrokerVersion: mats ? mats.broker_version : undefined,
11459
+ matsAccountJoinOnStart: mats ? mats.account_join_on_start : undefined,
11460
+ matsAccountJoinOnEnd: mats ? mats.account_join_on_end : undefined,
11461
+ matsDeviceJoin: mats ? mats.device_join : undefined,
11462
+ matsPromptBehavior: mats ? mats.prompt_behavior : undefined,
11463
+ matsApiErrorCode: mats ? mats.api_error_code : undefined,
11464
+ matsUiVisible: mats ? mats.ui_visible : undefined,
11465
+ matsSilentCode: mats ? mats.silent_code : undefined,
11466
+ matsSilentBiSubCode: mats ? mats.silent_bi_sub_code : undefined,
11467
+ matsSilentMessage: mats ? mats.silent_message : undefined,
11468
+ matsSilentStatus: mats ? mats.silent_status : undefined,
11469
+ matsHttpStatus: mats ? mats.http_status : undefined,
11470
+ matsHttpEventCount: mats ? mats.http_event_count : undefined
11471
+ }, this.correlationId);
11430
11472
  if (response.account.id !== request.accountId) {
11431
11473
  // User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
11432
11474
  throw NativeAuthError.createUserSwitchError();
@@ -11482,7 +11524,6 @@ var NativeInteractionClient = /** @class */ (function (_super) {
11482
11524
  }
11483
11525
  _b.label = 5;
11484
11526
  case 5:
11485
- mats = this.getMATSFromResponse(response);
11486
11527
  result = {
11487
11528
  authority: authority.canonicalAuthority,
11488
11529
  uniqueId: uid,
@@ -11814,6 +11855,7 @@ var NativeMessageHandler = /** @class */ (function () {
11814
11855
  clearTimeout(this.timeoutId); // Clear setTimeout
11815
11856
  window.removeEventListener("message", this.windowListener, false); // Remove 'No extension' listener
11816
11857
  this.extensionId = request.extensionId;
11858
+ this.extensionVersion = request.body.version;
11817
11859
  this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: " + this.extensionId);
11818
11860
  handshakeResolver.resolve();
11819
11861
  this.handshakeResolvers.delete(request.responseId);
@@ -11832,6 +11874,20 @@ var NativeMessageHandler = /** @class */ (function () {
11832
11874
  }
11833
11875
  }
11834
11876
  };
11877
+ /**
11878
+ * Returns the Id for the browser extension this handler is communicating with
11879
+ * @returns
11880
+ */
11881
+ NativeMessageHandler.prototype.getExtensionId = function () {
11882
+ return this.extensionId;
11883
+ };
11884
+ /**
11885
+ * Returns the version for the browser extension this handler is communicating with
11886
+ * @returns
11887
+ */
11888
+ NativeMessageHandler.prototype.getExtensionVersion = function () {
11889
+ return this.extensionVersion;
11890
+ };
11835
11891
  /**
11836
11892
  * Returns boolean indicating whether or not the request should attempt to use native broker
11837
11893
  * @param logger
@@ -12462,7 +12518,7 @@ var PopupClient = /** @class */ (function (_super) {
12462
12518
  * Polling for popups needs to be tick-based,
12463
12519
  * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).
12464
12520
  */
12465
- var maxTicks = _this.config.system.windowHashTimeout / BrowserConstants.POLL_INTERVAL_MS;
12521
+ var maxTicks = _this.config.system.windowHashTimeout / _this.config.system.pollIntervalMilliseconds;
12466
12522
  var ticks = 0;
12467
12523
  _this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");
12468
12524
  var intervalId = setInterval(function () {
@@ -12515,7 +12571,7 @@ var PopupClient = /** @class */ (function (_super) {
12515
12571
  clearInterval(intervalId);
12516
12572
  reject(BrowserAuthError.createMonitorPopupTimeoutError());
12517
12573
  }
12518
- }, BrowserConstants.POLL_INTERVAL_MS);
12574
+ }, _this.config.system.pollIntervalMilliseconds);
12519
12575
  });
12520
12576
  };
12521
12577
  /**
@@ -12553,7 +12609,7 @@ var PopupClient = /** @class */ (function (_super) {
12553
12609
  clearInterval(intervalId);
12554
12610
  _this.cleanPopup(popupWindow);
12555
12611
  resolve();
12556
- }, BrowserConstants.POLL_INTERVAL_MS);
12612
+ }, _this.config.system.pollIntervalMilliseconds);
12557
12613
  });
12558
12614
  };
12559
12615
  /**
@@ -12786,7 +12842,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12786
12842
  // Default system options for browser
12787
12843
  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
12844
  // 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: {
12845
+ 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
12846
  useMsrCrypto: false,
12791
12847
  entropy: undefined
12792
12848
  } });
@@ -12811,9 +12867,10 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12811
12867
  */
12812
12868
  var SilentHandler = /** @class */ (function (_super) {
12813
12869
  __extends$1(SilentHandler, _super);
12814
- function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, navigateFrameWait) {
12870
+ function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, systemOptions) {
12815
12871
  var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger) || this;
12816
- _this.navigateFrameWait = navigateFrameWait;
12872
+ _this.navigateFrameWait = systemOptions.navigateFrameWait;
12873
+ _this.pollIntervalMilliseconds = systemOptions.pollIntervalMilliseconds;
12817
12874
  return _this;
12818
12875
  }
12819
12876
  /**
@@ -12891,7 +12948,7 @@ var SilentHandler = /** @class */ (function (_super) {
12891
12948
  resolve(contentHash);
12892
12949
  return;
12893
12950
  }
12894
- }, BrowserConstants.POLL_INTERVAL_MS);
12951
+ }, _this.pollIntervalMilliseconds);
12895
12952
  });
12896
12953
  };
12897
12954
  /**
@@ -13056,7 +13113,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
13056
13113
  return [4 /*yield*/, authClient.getAuthCodeUrl(__assign$1(__assign$1({}, silentRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme) }))];
13057
13114
  case 2:
13058
13115
  navigateUrl = _a.sent();
13059
- silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system.navigateFrameWait);
13116
+ silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
13060
13117
  return [4 /*yield*/, silentHandler.initiateAuthRequest(navigateUrl)];
13061
13118
  case 3:
13062
13119
  msalFrame = _a.sent();
@@ -14865,15 +14922,19 @@ var TokenCache = /** @class */ (function () {
14865
14922
  * @param request
14866
14923
  * @param response
14867
14924
  * @param options
14925
+ * @returns `AuthenticationResult` for the response that was loaded.
14868
14926
  */
14869
14927
  TokenCache.prototype.loadExternalTokens = function (request, response, options) {
14870
14928
  this.logger.info("TokenCache - loadExternalTokens called");
14871
14929
  if (!response.id_token) {
14872
14930
  throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes id token.");
14873
14931
  }
14932
+ var idToken = new AuthToken(response.id_token, this.cryptoObj);
14933
+ var cacheRecord;
14934
+ var authority;
14874
14935
  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);
14936
+ var cacheRecordAccount = this.loadAccount(idToken, request.account.environment, undefined, undefined, request.account.homeAccountId);
14937
+ 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
14938
  }
14878
14939
  else if (request.authority) {
14879
14940
  var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);
@@ -14884,17 +14945,17 @@ var TokenCache = /** @class */ (function () {
14884
14945
  authorityMetadata: this.config.auth.authorityMetadata,
14885
14946
  skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
14886
14947
  };
14887
- var authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
14948
+ authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
14888
14949
  // "clientInfo" from options takes precedence over "clientInfo" in response
14889
14950
  if (options.clientInfo) {
14890
14951
  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);
14952
+ var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, options.clientInfo, authority.authorityType);
14953
+ 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
14954
  }
14894
14955
  else if (response.client_info) {
14895
14956
  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);
14957
+ var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, response.client_info, authority.authorityType);
14958
+ 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
14959
  }
14899
14960
  else {
14900
14961
  throw BrowserAuthError.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");
@@ -14903,6 +14964,39 @@ var TokenCache = /** @class */ (function () {
14903
14964
  else {
14904
14965
  throw BrowserAuthError.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");
14905
14966
  }
14967
+ return this.generateAuthenticationResult(request, idToken, cacheRecord, authority);
14968
+ };
14969
+ /**
14970
+ * Helper function to load account to msal-browser cache
14971
+ * @param idToken
14972
+ * @param environment
14973
+ * @param clientInfo
14974
+ * @param authorityType
14975
+ * @param requestHomeAccountId
14976
+ * @returns `AccountEntity`
14977
+ */
14978
+ TokenCache.prototype.loadAccount = function (idToken, environment, clientInfo, authorityType, requestHomeAccountId) {
14979
+ var homeAccountId;
14980
+ if (requestHomeAccountId) {
14981
+ homeAccountId = requestHomeAccountId;
14982
+ }
14983
+ else if (authorityType !== undefined && clientInfo) {
14984
+ homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authorityType, this.logger, this.cryptoObj, idToken);
14985
+ }
14986
+ if (!homeAccountId) {
14987
+ throw BrowserAuthError.createUnableToLoadTokenError("Unexpected missing homeAccountId");
14988
+ }
14989
+ var accountEntity = clientInfo ?
14990
+ AccountEntity.createAccount(clientInfo, homeAccountId, idToken, undefined, undefined, undefined, environment) :
14991
+ AccountEntity.createGenericAccount(homeAccountId, idToken, undefined, undefined, undefined, environment);
14992
+ if (this.isBrowserEnvironment) {
14993
+ this.logger.verbose("TokenCache - loading account");
14994
+ this.storage.setAccount(accountEntity);
14995
+ return accountEntity;
14996
+ }
14997
+ else {
14998
+ throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
14999
+ }
14906
15000
  };
14907
15001
  /**
14908
15002
  * Helper function to load id tokens to msal-browser cache
@@ -14910,18 +15004,14 @@ var TokenCache = /** @class */ (function () {
14910
15004
  * @param homeAccountId
14911
15005
  * @param environment
14912
15006
  * @param tenantId
14913
- * @param options
15007
+ * @returns `IdTokenEntity`
14914
15008
  */
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);
15009
+ TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId) {
15010
+ var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken.rawToken, this.config.auth.clientId, tenantId);
14921
15011
  if (this.isBrowserEnvironment) {
14922
15012
  this.logger.verbose("TokenCache - loading id token");
14923
- this.storage.setAccount(accountEntity);
14924
15013
  this.storage.setIdTokenCredential(idTokenEntity);
15014
+ return idTokenEntity;
14925
15015
  }
14926
15016
  else {
14927
15017
  throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
@@ -14931,16 +15021,15 @@ var TokenCache = /** @class */ (function () {
14931
15021
  * Helper function to load access tokens to msal-browser cache
14932
15022
  * @param request
14933
15023
  * @param response
14934
- * @param options
14935
15024
  * @param homeAccountId
14936
15025
  * @param environment
14937
15026
  * @param tenantId
14938
- * @returns
15027
+ * @returns `AccessTokenEntity`
14939
15028
  */
14940
15029
  TokenCache.prototype.loadAccessToken = function (request, response, homeAccountId, environment, tenantId, options) {
14941
15030
  if (!response.access_token) {
14942
15031
  this.logger.verbose("TokenCache - No access token provided for caching");
14943
- return;
15032
+ return null;
14944
15033
  }
14945
15034
  if (!response.expires_in) {
14946
15035
  throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");
@@ -14955,11 +15044,80 @@ var TokenCache = /** @class */ (function () {
14955
15044
  if (this.isBrowserEnvironment) {
14956
15045
  this.logger.verbose("TokenCache - loading access token");
14957
15046
  this.storage.setAccessTokenCredential(accessTokenEntity);
15047
+ return accessTokenEntity;
15048
+ }
15049
+ else {
15050
+ throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
15051
+ }
15052
+ };
15053
+ /**
15054
+ * Helper function to load refresh tokens to msal-browser cache
15055
+ * @param request
15056
+ * @param response
15057
+ * @param homeAccountId
15058
+ * @param environment
15059
+ * @returns `RefreshTokenEntity`
15060
+ */
15061
+ TokenCache.prototype.loadRefreshToken = function (request, response, homeAccountId, environment) {
15062
+ if (!response.refresh_token) {
15063
+ this.logger.verbose("TokenCache - No refresh token provided for caching");
15064
+ return null;
15065
+ }
15066
+ var refreshTokenEntity = RefreshTokenEntity.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);
15067
+ if (this.isBrowserEnvironment) {
15068
+ this.logger.verbose("TokenCache - loading refresh token");
15069
+ this.storage.setRefreshTokenCredential(refreshTokenEntity);
15070
+ return refreshTokenEntity;
14958
15071
  }
14959
15072
  else {
14960
15073
  throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
14961
15074
  }
14962
15075
  };
15076
+ /**
15077
+ * Helper function to generate an `AuthenticationResult` for the result.
15078
+ * @param request
15079
+ * @param idTokenObj
15080
+ * @param cacheRecord
15081
+ * @param authority
15082
+ * @returns `AuthenticationResult`
15083
+ */
15084
+ TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, authority) {
15085
+ var _a, _b, _c;
15086
+ var accessToken = Constants.EMPTY_STRING;
15087
+ var responseScopes = [];
15088
+ var expiresOn = null;
15089
+ var extExpiresOn;
15090
+ if (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) {
15091
+ accessToken = cacheRecord.accessToken.secret;
15092
+ responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
15093
+ expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
15094
+ extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
15095
+ }
15096
+ 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;
15097
+ var tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;
15098
+ return {
15099
+ authority: authority ? authority.canonicalAuthority : Constants.EMPTY_STRING,
15100
+ uniqueId: uid,
15101
+ tenantId: tid,
15102
+ scopes: responseScopes,
15103
+ account: (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) ? cacheRecord.account.getAccountInfo() : null,
15104
+ idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
15105
+ idTokenClaims: idTokenObj ? idTokenObj.claims : {},
15106
+ accessToken: accessToken,
15107
+ fromCache: true,
15108
+ expiresOn: expiresOn,
15109
+ correlationId: request.correlationId || Constants.EMPTY_STRING,
15110
+ requestId: Constants.EMPTY_STRING,
15111
+ extExpiresOn: extExpiresOn,
15112
+ familyId: Constants.EMPTY_STRING,
15113
+ tokenType: ((_a = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
15114
+ state: Constants.EMPTY_STRING,
15115
+ cloudGraphHostName: ((_b = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,
15116
+ msGraphHost: ((_c = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,
15117
+ code: undefined,
15118
+ fromNativeBroker: false
15119
+ };
15120
+ };
14963
15121
  return TokenCache;
14964
15122
  }());
14965
15123
 
@@ -15017,7 +15175,7 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
15017
15175
  clientConfig = _a.sent();
15018
15176
  authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
15019
15177
  this.logger.verbose("Auth code client created");
15020
- silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system.navigateFrameWait);
15178
+ silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
15021
15179
  // Handle auth code parameters from request
15022
15180
  return [2 /*return*/, silentHandler.handleCodeResponseFromServer({
15023
15181
  code: request.code,
@@ -15423,8 +15581,6 @@ var ClientApplication = /** @class */ (function () {
15423
15581
  atPopupMeasurement.endMeasurement({
15424
15582
  success: true,
15425
15583
  isNativeBroker: true,
15426
- accessTokenSize: response.accessToken.length,
15427
- idTokenSize: response.idToken.length,
15428
15584
  requestId: response.requestId
15429
15585
  });
15430
15586
  atPopupMeasurement.flushMeasurement();
@@ -15459,10 +15615,12 @@ var ClientApplication = /** @class */ (function () {
15459
15615
  else {
15460
15616
  _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
15461
15617
  }
15618
+ atPopupMeasurement.addStaticFields({
15619
+ accessTokenSize: result.accessToken.length,
15620
+ idTokenSize: result.idToken.length
15621
+ });
15462
15622
  atPopupMeasurement.endMeasurement({
15463
15623
  success: true,
15464
- accessTokenSize: result.accessToken.length,
15465
- idTokenSize: result.idToken.length,
15466
15624
  requestId: result.requestId
15467
15625
  });
15468
15626
  atPopupMeasurement.flushMeasurement();
@@ -15531,11 +15689,13 @@ var ClientApplication = /** @class */ (function () {
15531
15689
  }
15532
15690
  return [2 /*return*/, result.then(function (response) {
15533
15691
  _this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
15692
+ ssoSilentMeasurement.addStaticFields({
15693
+ accessTokenSize: response.accessToken.length,
15694
+ idTokenSize: response.idToken.length
15695
+ });
15534
15696
  ssoSilentMeasurement.endMeasurement({
15535
15697
  success: true,
15536
15698
  isNativeBroker: response.fromNativeBroker,
15537
- accessTokenSize: response.accessToken.length,
15538
- idTokenSize: response.idToken.length,
15539
15699
  requestId: response.requestId
15540
15700
  });
15541
15701
  ssoSilentMeasurement.flushMeasurement();
@@ -15583,10 +15743,12 @@ var ClientApplication = /** @class */ (function () {
15583
15743
  .then(function (result) {
15584
15744
  _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
15585
15745
  _this.hybridAuthCodeResponses.delete(hybridAuthCode_1);
15746
+ atbcMeasurement.addStaticFields({
15747
+ accessTokenSize: result.accessToken.length,
15748
+ idTokenSize: result.idToken.length
15749
+ });
15586
15750
  atbcMeasurement.endMeasurement({
15587
15751
  success: true,
15588
- accessTokenSize: result.accessToken.length,
15589
- idTokenSize: result.idToken.length,
15590
15752
  isNativeBroker: result.fromNativeBroker,
15591
15753
  requestId: result.requestId
15592
15754
  });
@@ -16187,6 +16349,9 @@ var PublicClientApplication = /** @class */ (function (_super) {
16187
16349
  return __generator$1(this, function (_a) {
16188
16350
  correlationId = this.getRequestCorrelationId(request);
16189
16351
  atsMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilent, correlationId);
16352
+ atsMeasurement.addStaticFields({
16353
+ cacheLookupPolicy: request.cacheLookupPolicy
16354
+ });
16190
16355
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
16191
16356
  this.logger.verbose("acquireTokenSilent called", correlationId);
16192
16357
  account = request.account || this.getActiveAccount();
@@ -16212,13 +16377,14 @@ var PublicClientApplication = /** @class */ (function (_super) {
16212
16377
  response = this.acquireTokenSilentAsync(__assign$1(__assign$1({}, request), { correlationId: correlationId }), account)
16213
16378
  .then(function (result) {
16214
16379
  _this.activeSilentTokenRequests.delete(silentRequestKey);
16380
+ atsMeasurement.addStaticFields({
16381
+ accessTokenSize: result.accessToken.length,
16382
+ idTokenSize: result.idToken.length
16383
+ });
16215
16384
  atsMeasurement.endMeasurement({
16216
16385
  success: true,
16217
16386
  fromCache: result.fromCache,
16218
- accessTokenSize: result.accessToken.length,
16219
- idTokenSize: result.idToken.length,
16220
16387
  isNativeBroker: result.fromNativeBroker,
16221
- cacheLookupPolicy: request.cacheLookupPolicy,
16222
16388
  requestId: result.requestId
16223
16389
  });
16224
16390
  atsMeasurement.flushMeasurement();
@@ -16319,8 +16485,6 @@ var PublicClientApplication = /** @class */ (function (_super) {
16319
16485
  astsAsyncMeasurement.endMeasurement({
16320
16486
  success: true,
16321
16487
  fromCache: response.fromCache,
16322
- accessTokenSize: response.accessToken.length,
16323
- idTokenSize: response.idToken.length,
16324
16488
  isNativeBroker: response.fromNativeBroker,
16325
16489
  requestId: response.requestId
16326
16490
  });