@azure/msal-browser 2.32.0 → 2.32.2

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 (86) 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/ClientApplication.js.map +1 -1
  5. package/dist/app/IPublicClientApplication.js +1 -1
  6. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  7. package/dist/app/PublicClientApplication.js +7 -6
  8. package/dist/app/PublicClientApplication.js.map +1 -1
  9. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  10. package/dist/cache/AsyncMemoryStorage.js +1 -1
  11. package/dist/cache/BrowserCacheManager.d.ts +9 -0
  12. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  13. package/dist/cache/BrowserCacheManager.js +21 -7
  14. package/dist/cache/BrowserCacheManager.js.map +1 -1
  15. package/dist/cache/BrowserStorage.js +1 -1
  16. package/dist/cache/CryptoKeyStore.js +1 -1
  17. package/dist/cache/DatabaseStorage.js +1 -1
  18. package/dist/cache/MemoryStorage.js +1 -1
  19. package/dist/cache/TokenCache.js +1 -1
  20. package/dist/config/Configuration.d.ts.map +1 -1
  21. package/dist/config/Configuration.js +6 -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 +254 -154
  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/NativeInteractionClient.js.map +1 -1
  46. package/dist/interaction_client/PopupClient.js +1 -1
  47. package/dist/interaction_client/RedirectClient.js +1 -1
  48. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  49. package/dist/interaction_client/SilentCacheClient.js +1 -1
  50. package/dist/interaction_client/SilentIframeClient.js +1 -1
  51. package/dist/interaction_client/SilentRefreshClient.js +1 -1
  52. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  53. package/dist/interaction_client/StandardInteractionClient.js +12 -10
  54. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  55. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  56. package/dist/interaction_handler/InteractionHandler.js +1 -1
  57. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  58. package/dist/interaction_handler/RedirectHandler.js +1 -1
  59. package/dist/interaction_handler/SilentHandler.js +1 -1
  60. package/dist/internals.d.ts +2 -0
  61. package/dist/internals.d.ts.map +1 -1
  62. package/dist/internals.js +3 -1
  63. package/dist/internals.js.map +1 -1
  64. package/dist/navigation/NavigationClient.js +1 -1
  65. package/dist/network/FetchClient.js +1 -1
  66. package/dist/network/XhrClient.js +1 -1
  67. package/dist/packageMetadata.d.ts +1 -1
  68. package/dist/packageMetadata.js +2 -2
  69. package/dist/packageMetadata.js.map +1 -1
  70. package/dist/telemetry/BrowserPerformanceClient.d.ts +1 -1
  71. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  72. package/dist/telemetry/BrowserPerformanceClient.js +2 -2
  73. package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
  74. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  75. package/dist/utils/BrowserConstants.d.ts +2 -1
  76. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  77. package/dist/utils/BrowserConstants.js +2 -1
  78. package/dist/utils/BrowserConstants.js.map +1 -1
  79. package/dist/utils/BrowserProtocolUtils.js +1 -1
  80. package/dist/utils/BrowserStringUtils.js +1 -1
  81. package/dist/utils/BrowserUtils.js +1 -1
  82. package/dist/utils/MathUtils.js +1 -1
  83. package/lib/msal-browser.js +254 -154
  84. package/lib/msal-browser.js.map +1 -1
  85. package/lib/msal-browser.min.js +42 -41
  86. package/package.json +2 -2
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.32.0 2022-11-22 */
1
+ /*! @azure/msal-browser v2.32.2 2023-01-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 v9.0.0 2022-11-22 */
120
+ /*! @azure/msal-common v9.0.2 2023-01-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 v9.0.0 2022-11-22 */
207
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
208
208
 
209
209
  /*
210
210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -258,7 +258,8 @@ var Constants = {
258
258
  KNOWN_PUBLIC_CLOUDS: ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"],
259
259
  TOKEN_RESPONSE_TYPE: "token",
260
260
  ID_TOKEN_RESPONSE_TYPE: "id_token",
261
- SHR_NONCE_VALIDITY: 240
261
+ SHR_NONCE_VALIDITY: 240,
262
+ INVALID_INSTANCE: "invalid_instance",
262
263
  };
263
264
  var OIDC_DEFAULT_SCOPES = [
264
265
  Constants.OPENID_SCOPE,
@@ -279,6 +280,7 @@ var HeaderNames;
279
280
  HeaderNames["WWWAuthenticate"] = "WWW-Authenticate";
280
281
  HeaderNames["AuthenticationInfo"] = "Authentication-Info";
281
282
  HeaderNames["X_MS_REQUEST_ID"] = "x-ms-request-id";
283
+ HeaderNames["X_MS_HTTP_VERSION"] = "x-ms-httpver";
282
284
  })(HeaderNames || (HeaderNames = {}));
283
285
  /**
284
286
  * Persistent cache keys MSAL which stay while user is logged in.
@@ -586,7 +588,7 @@ var JsonTypes;
586
588
  JsonTypes["Jwk"] = "JWK";
587
589
  })(JsonTypes || (JsonTypes = {}));
588
590
 
589
- /*! @azure/msal-common v9.0.0 2022-11-22 */
591
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
590
592
 
591
593
  /*
592
594
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -642,7 +644,7 @@ var AuthError = /** @class */ (function (_super) {
642
644
  return AuthError;
643
645
  }(Error));
644
646
 
645
- /*! @azure/msal-common v9.0.0 2022-11-22 */
647
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
646
648
 
647
649
  /*
648
650
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -717,7 +719,7 @@ var DEFAULT_CRYPTO_IMPLEMENTATION = {
717
719
  }
718
720
  };
719
721
 
720
- /*! @azure/msal-common v9.0.0 2022-11-22 */
722
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
721
723
 
722
724
  /*
723
725
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1212,7 +1214,7 @@ var ClientAuthError = /** @class */ (function (_super) {
1212
1214
  return ClientAuthError;
1213
1215
  }(AuthError));
1214
1216
 
1215
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1217
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1216
1218
 
1217
1219
  /*
1218
1220
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1337,7 +1339,7 @@ var StringUtils = /** @class */ (function () {
1337
1339
  return StringUtils;
1338
1340
  }());
1339
1341
 
1340
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1342
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1341
1343
 
1342
1344
  /*
1343
1345
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1364,13 +1366,23 @@ var Logger = /** @class */ (function () {
1364
1366
  var defaultLoggerCallback = function () {
1365
1367
  return;
1366
1368
  };
1367
- this.localCallback = loggerOptions.loggerCallback || defaultLoggerCallback;
1368
- this.piiLoggingEnabled = loggerOptions.piiLoggingEnabled || false;
1369
- this.level = typeof (loggerOptions.logLevel) === "number" ? loggerOptions.logLevel : exports.LogLevel.Info;
1370
- this.correlationId = loggerOptions.correlationId || Constants.EMPTY_STRING;
1369
+ var setLoggerOptions = loggerOptions || Logger.createDefaultLoggerOptions();
1370
+ this.localCallback = setLoggerOptions.loggerCallback || defaultLoggerCallback;
1371
+ this.piiLoggingEnabled = setLoggerOptions.piiLoggingEnabled || false;
1372
+ this.level = typeof (setLoggerOptions.logLevel) === "number" ? setLoggerOptions.logLevel : exports.LogLevel.Info;
1373
+ this.correlationId = setLoggerOptions.correlationId || Constants.EMPTY_STRING;
1371
1374
  this.packageName = packageName || Constants.EMPTY_STRING;
1372
1375
  this.packageVersion = packageVersion || Constants.EMPTY_STRING;
1373
1376
  }
1377
+ Logger.createDefaultLoggerOptions = function () {
1378
+ return {
1379
+ loggerCallback: function () {
1380
+ // allow users to not set loggerCallback
1381
+ },
1382
+ piiLoggingEnabled: false,
1383
+ logLevel: exports.LogLevel.Info
1384
+ };
1385
+ };
1374
1386
  /**
1375
1387
  * Create new Logger with existing configurations.
1376
1388
  */
@@ -1517,12 +1529,12 @@ var Logger = /** @class */ (function () {
1517
1529
  return Logger;
1518
1530
  }());
1519
1531
 
1520
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1532
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1521
1533
  /* eslint-disable header/header */
1522
1534
  var name$1 = "@azure/msal-common";
1523
- var version$1 = "9.0.0";
1535
+ var version$1 = "9.0.2";
1524
1536
 
1525
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1537
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1526
1538
  /*
1527
1539
  * Copyright (c) Microsoft Corporation. All rights reserved.
1528
1540
  * Licensed under the MIT License.
@@ -1543,7 +1555,7 @@ exports.AzureCloudInstance = void 0;
1543
1555
  AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1544
1556
  })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1545
1557
 
1546
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1558
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1547
1559
 
1548
1560
  /*
1549
1561
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1620,19 +1632,16 @@ var CredentialEntity = /** @class */ (function () {
1620
1632
  * @param key
1621
1633
  */
1622
1634
  CredentialEntity.getCredentialType = function (key) {
1623
- // First keyword search will match all "AccessToken" and "AccessToken_With_AuthScheme" credentials
1624
- if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {
1625
- // Perform second search to differentiate between "AccessToken" and "AccessToken_With_AuthScheme" credential types
1626
- if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {
1627
- return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
1635
+ var separator = Separators.CACHE_KEY_SEPARATOR;
1636
+ // Match host names like "login.microsoftonline.com", "https://accounts.google.com:4000", etc.
1637
+ var domainRe = "(https?:\\/\\/)?([\\w-]+\\.)*([\\w-]{1,63})(\\.(\\w{2,3}))(\\:[0-9]{4,5})?";
1638
+ for (var _i = 0, _a = Object.keys(CredentialType); _i < _a.length; _i++) {
1639
+ var credKey = _a[_i];
1640
+ var credVal = CredentialType[credKey].toLowerCase();
1641
+ // Verify credential type is preceded by a valid host name (environment)
1642
+ if (key.toLowerCase().search("(?<=" + separator + domainRe + ")" + separator + credVal + separator) !== -1) {
1643
+ return CredentialType[credKey];
1628
1644
  }
1629
- return CredentialType.ACCESS_TOKEN;
1630
- }
1631
- else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {
1632
- return CredentialType.ID_TOKEN;
1633
- }
1634
- else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {
1635
- return CredentialType.REFRESH_TOKEN;
1636
1645
  }
1637
1646
  return Constants.NOT_DEFINED;
1638
1647
  };
@@ -1702,7 +1711,7 @@ var CredentialEntity = /** @class */ (function () {
1702
1711
  return CredentialEntity;
1703
1712
  }());
1704
1713
 
1705
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1714
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1706
1715
 
1707
1716
  /*
1708
1717
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1957,7 +1966,7 @@ var ClientConfigurationError = /** @class */ (function (_super) {
1957
1966
  return ClientConfigurationError;
1958
1967
  }(ClientAuthError));
1959
1968
 
1960
- /*! @azure/msal-common v9.0.0 2022-11-22 */
1969
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
1961
1970
 
1962
1971
  /*
1963
1972
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2141,7 +2150,7 @@ var ScopeSet = /** @class */ (function () {
2141
2150
  return ScopeSet;
2142
2151
  }());
2143
2152
 
2144
- /*! @azure/msal-common v9.0.0 2022-11-22 */
2153
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
2145
2154
 
2146
2155
  /*
2147
2156
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2179,7 +2188,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2179
2188
  };
2180
2189
  }
2181
2190
 
2182
- /*! @azure/msal-common v9.0.0 2022-11-22 */
2191
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
2183
2192
  /*
2184
2193
  * Copyright (c) Microsoft Corporation. All rights reserved.
2185
2194
  * Licensed under the MIT License.
@@ -2194,7 +2203,7 @@ var AuthorityType;
2194
2203
  AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
2195
2204
  })(AuthorityType || (AuthorityType = {}));
2196
2205
 
2197
- /*! @azure/msal-common v9.0.0 2022-11-22 */
2206
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
2198
2207
 
2199
2208
  /*
2200
2209
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2433,7 +2442,7 @@ var AccountEntity = /** @class */ (function () {
2433
2442
  return AccountEntity;
2434
2443
  }());
2435
2444
 
2436
- /*! @azure/msal-common v9.0.0 2022-11-22 */
2445
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
2437
2446
 
2438
2447
  /*
2439
2448
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2485,7 +2494,7 @@ var AuthToken = /** @class */ (function () {
2485
2494
  return AuthToken;
2486
2495
  }());
2487
2496
 
2488
- /*! @azure/msal-common v9.0.0 2022-11-22 */
2497
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
2489
2498
 
2490
2499
  /*
2491
2500
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3364,7 +3373,7 @@ var DefaultStorageClass = /** @class */ (function (_super) {
3364
3373
  return DefaultStorageClass;
3365
3374
  }(CacheManager));
3366
3375
 
3367
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3376
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3368
3377
 
3369
3378
  /*
3370
3379
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3458,7 +3467,7 @@ function buildAuthOptions(authOptions) {
3458
3467
  return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
3459
3468
  }
3460
3469
 
3461
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3470
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3462
3471
 
3463
3472
  /*
3464
3473
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3478,7 +3487,7 @@ var ServerError = /** @class */ (function (_super) {
3478
3487
  return ServerError;
3479
3488
  }(AuthError));
3480
3489
 
3481
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3490
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3482
3491
 
3483
3492
  /*
3484
3493
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3574,7 +3583,7 @@ var ThrottlingUtils = /** @class */ (function () {
3574
3583
  return ThrottlingUtils;
3575
3584
  }());
3576
3585
 
3577
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3586
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3578
3587
 
3579
3588
  /*
3580
3589
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3623,7 +3632,7 @@ var NetworkManager = /** @class */ (function () {
3623
3632
  return NetworkManager;
3624
3633
  }());
3625
3634
 
3626
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3635
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3627
3636
  /*
3628
3637
  * Copyright (c) Microsoft Corporation. All rights reserved.
3629
3638
  * Licensed under the MIT License.
@@ -3634,7 +3643,7 @@ var CcsCredentialType;
3634
3643
  CcsCredentialType["UPN"] = "UPN";
3635
3644
  })(CcsCredentialType || (CcsCredentialType = {}));
3636
3645
 
3637
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3646
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3638
3647
 
3639
3648
  /*
3640
3649
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3725,7 +3734,7 @@ var BaseClient = /** @class */ (function () {
3725
3734
  return BaseClient;
3726
3735
  }());
3727
3736
 
3728
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3737
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3729
3738
 
3730
3739
  /*
3731
3740
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3811,7 +3820,7 @@ var RequestValidator = /** @class */ (function () {
3811
3820
  return RequestValidator;
3812
3821
  }());
3813
3822
 
3814
- /*! @azure/msal-common v9.0.0 2022-11-22 */
3823
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
3815
3824
 
3816
3825
  /*
3817
3826
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4189,7 +4198,7 @@ var RequestParameterBuilder = /** @class */ (function () {
4189
4198
  return RequestParameterBuilder;
4190
4199
  }());
4191
4200
 
4192
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4201
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4193
4202
 
4194
4203
  /*
4195
4204
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4253,7 +4262,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
4253
4262
  return IdTokenEntity;
4254
4263
  }(CredentialEntity));
4255
4264
 
4256
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4265
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4257
4266
  /*
4258
4267
  * Copyright (c) Microsoft Corporation. All rights reserved.
4259
4268
  * Licensed under the MIT License.
@@ -4303,7 +4312,7 @@ var TimeUtils = /** @class */ (function () {
4303
4312
  return TimeUtils;
4304
4313
  }());
4305
4314
 
4306
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4315
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4307
4316
 
4308
4317
  /*
4309
4318
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4417,7 +4426,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
4417
4426
  return AccessTokenEntity;
4418
4427
  }(CredentialEntity));
4419
4428
 
4420
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4429
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4421
4430
 
4422
4431
  /*
4423
4432
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4484,7 +4493,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
4484
4493
  return RefreshTokenEntity;
4485
4494
  }(CredentialEntity));
4486
4495
 
4487
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4496
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4488
4497
 
4489
4498
  /*
4490
4499
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4559,7 +4568,7 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
4559
4568
  return InteractionRequiredAuthError;
4560
4569
  }(AuthError));
4561
4570
 
4562
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4571
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4563
4572
  /*
4564
4573
  * Copyright (c) Microsoft Corporation. All rights reserved.
4565
4574
  * Licensed under the MIT License.
@@ -4575,7 +4584,7 @@ var CacheRecord = /** @class */ (function () {
4575
4584
  return CacheRecord;
4576
4585
  }());
4577
4586
 
4578
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4587
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4579
4588
 
4580
4589
  /*
4581
4590
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4646,7 +4655,7 @@ var ProtocolUtils = /** @class */ (function () {
4646
4655
  return ProtocolUtils;
4647
4656
  }());
4648
4657
 
4649
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4658
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4650
4659
 
4651
4660
  /*
4652
4661
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4880,7 +4889,7 @@ var UrlString = /** @class */ (function () {
4880
4889
  return UrlString;
4881
4890
  }());
4882
4891
 
4883
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4892
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4884
4893
 
4885
4894
  /*
4886
4895
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4981,7 +4990,7 @@ var PopTokenGenerator = /** @class */ (function () {
4981
4990
  return PopTokenGenerator;
4982
4991
  }());
4983
4992
 
4984
- /*! @azure/msal-common v9.0.0 2022-11-22 */
4993
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
4985
4994
 
4986
4995
  /*
4987
4996
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5051,7 +5060,7 @@ var AppMetadataEntity = /** @class */ (function () {
5051
5060
  return AppMetadataEntity;
5052
5061
  }());
5053
5062
 
5054
- /*! @azure/msal-common v9.0.0 2022-11-22 */
5063
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
5055
5064
  /*
5056
5065
  * Copyright (c) Microsoft Corporation. All rights reserved.
5057
5066
  * Licensed under the MIT License.
@@ -5087,7 +5096,7 @@ var AppMetadataEntity = /** @class */ (function () {
5087
5096
  return TokenCacheContext;
5088
5097
  }());
5089
5098
 
5090
- /*! @azure/msal-common v9.0.0 2022-11-22 */
5099
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
5091
5100
 
5092
5101
  /*
5093
5102
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5358,7 +5367,7 @@ var ResponseHandler = /** @class */ (function () {
5358
5367
  cloudGraphHostName: ((_b = cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,
5359
5368
  msGraphHost: ((_c = cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,
5360
5369
  code: code,
5361
- fromNativeBroker: false
5370
+ fromNativeBroker: false,
5362
5371
  }];
5363
5372
  }
5364
5373
  });
@@ -5367,7 +5376,7 @@ var ResponseHandler = /** @class */ (function () {
5367
5376
  return ResponseHandler;
5368
5377
  }());
5369
5378
 
5370
- /*! @azure/msal-common v9.0.0 2022-11-22 */
5379
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
5371
5380
 
5372
5381
  /*
5373
5382
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5378,8 +5387,8 @@ var ResponseHandler = /** @class */ (function () {
5378
5387
  */
5379
5388
  var AuthorizationCodeClient = /** @class */ (function (_super) {
5380
5389
  __extends(AuthorizationCodeClient, _super);
5381
- function AuthorizationCodeClient(configuration) {
5382
- var _this = _super.call(this, configuration) || this;
5390
+ function AuthorizationCodeClient(configuration, performanceClient) {
5391
+ var _this = _super.call(this, configuration, performanceClient) || this;
5383
5392
  // Flag to indicate if client is for hybrid spa auth code redemption
5384
5393
  _this.includeRedirectUri = true;
5385
5394
  return _this;
@@ -5413,26 +5422,47 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5413
5422
  * @param request
5414
5423
  */
5415
5424
  AuthorizationCodeClient.prototype.acquireToken = function (request, authCodePayload) {
5416
- var _a;
5425
+ var _a, _b, _c;
5417
5426
  return __awaiter(this, void 0, void 0, function () {
5418
- var reqTimestamp, response, requestId, responseHandler;
5419
- return __generator(this, function (_b) {
5420
- switch (_b.label) {
5427
+ var atsMeasurement, reqTimestamp, response, requestId, httpVerAuthority, responseHandler;
5428
+ var _this = this;
5429
+ return __generator(this, function (_d) {
5430
+ switch (_d.label) {
5421
5431
  case 0:
5422
- this.logger.info("in acquireToken call");
5432
+ atsMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement("AuthCodeClientAcquireToken", request.correlationId);
5433
+ this.logger.info("in acquireToken call in auth-code client");
5423
5434
  if (!request || StringUtils.isEmpty(request.code)) {
5424
5435
  throw ClientAuthError.createTokenRequestCannotBeMadeError();
5425
5436
  }
5426
5437
  reqTimestamp = TimeUtils.nowSeconds();
5427
5438
  return [4 /*yield*/, this.executeTokenRequest(this.authority, request)];
5428
5439
  case 1:
5429
- response = _b.sent();
5430
- requestId = (_a = response.headers) === null || _a === void 0 ? void 0 : _a[HeaderNames.X_MS_REQUEST_ID];
5440
+ response = _d.sent();
5441
+ requestId = (_b = response.headers) === null || _b === void 0 ? void 0 : _b[HeaderNames.X_MS_REQUEST_ID];
5442
+ httpVerAuthority = (_c = response.headers) === null || _c === void 0 ? void 0 : _c[HeaderNames.X_MS_HTTP_VERSION];
5443
+ if (httpVerAuthority) {
5444
+ atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
5445
+ httpVerAuthority: httpVerAuthority
5446
+ });
5447
+ }
5431
5448
  responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
5432
5449
  // Validate response. This function throws a server error if an error is returned by the server.
5433
5450
  responseHandler.validateTokenResponse(response.body);
5434
- return [4 /*yield*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId)];
5435
- case 2: return [2 /*return*/, _b.sent()];
5451
+ return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId).then(function (result) {
5452
+ atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
5453
+ success: true
5454
+ });
5455
+ return result;
5456
+ })
5457
+ .catch(function (error) {
5458
+ _this.logger.verbose("Error in fetching token in ACC", request.correlationId);
5459
+ atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
5460
+ errorCode: error.errorCode,
5461
+ subErrorCode: error.subError,
5462
+ success: false
5463
+ });
5464
+ throw error;
5465
+ })];
5436
5466
  }
5437
5467
  });
5438
5468
  });
@@ -5820,7 +5850,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5820
5850
  return AuthorizationCodeClient;
5821
5851
  }(BaseClient));
5822
5852
 
5823
- /*! @azure/msal-common v9.0.0 2022-11-22 */
5853
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
5824
5854
  /*
5825
5855
  * Copyright (c) Microsoft Corporation. All rights reserved.
5826
5856
  * Licensed under the MIT License.
@@ -5931,6 +5961,11 @@ exports.PerformanceEvents = void 0;
5931
5961
  * Time taken for acquiring cached refresh token
5932
5962
  */
5933
5963
  PerformanceEvents["RefreshTokenClientAcquireTokenWithCachedRefreshToken"] = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
5964
+ PerformanceEvents["GetEndpointMetadataFromNetwork"] = "getEndpointMetadataFromNetwork";
5965
+ PerformanceEvents["GetCloudDiscoveryMetadataFromNetworkMeasurement"] = "getCloudDiscoveryMetadataFromNetworkMeasurement";
5966
+ PerformanceEvents["HandleRedirectPromiseMeasurement"] = "handleRedirectPromiseMeasurement";
5967
+ PerformanceEvents["UpdateCloudDiscoveryMetadataMeasurement"] = "updateCloudDiscoveryMetadataMeasurement";
5968
+ PerformanceEvents["UsernamePasswordClientAcquireToken"] = "usernamePasswordClientAcquireToken";
5934
5969
  })(exports.PerformanceEvents || (exports.PerformanceEvents = {}));
5935
5970
  /**
5936
5971
  * State of the performance event.
@@ -5945,7 +5980,7 @@ var PerformanceEventStatus;
5945
5980
  PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
5946
5981
  })(PerformanceEventStatus || (PerformanceEventStatus = {}));
5947
5982
 
5948
- /*! @azure/msal-common v9.0.0 2022-11-22 */
5983
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
5949
5984
 
5950
5985
  /*
5951
5986
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5960,23 +5995,29 @@ var RefreshTokenClient = /** @class */ (function (_super) {
5960
5995
  return _super.call(this, configuration, performanceClient) || this;
5961
5996
  }
5962
5997
  RefreshTokenClient.prototype.acquireToken = function (request) {
5963
- var _a, _b, _c;
5998
+ var _a, _b, _c, _d;
5964
5999
  return __awaiter(this, void 0, void 0, function () {
5965
- var atsMeasurement, reqTimestamp, response, requestId, responseHandler;
6000
+ var atsMeasurement, reqTimestamp, response, httpVerToken, requestId, responseHandler;
5966
6001
  var _this = this;
5967
- return __generator(this, function (_d) {
5968
- switch (_d.label) {
6002
+ return __generator(this, function (_e) {
6003
+ switch (_e.label) {
5969
6004
  case 0:
5970
6005
  atsMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5971
6006
  this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
5972
6007
  reqTimestamp = TimeUtils.nowSeconds();
5973
6008
  return [4 /*yield*/, this.executeTokenRequest(request, this.authority)];
5974
6009
  case 1:
5975
- response = _d.sent();
6010
+ response = _e.sent();
6011
+ httpVerToken = (_b = response.headers) === null || _b === void 0 ? void 0 : _b[HeaderNames.X_MS_HTTP_VERSION];
5976
6012
  atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
5977
- refreshTokenSize: ((_b = response.body.refresh_token) === null || _b === void 0 ? void 0 : _b.length) || 0
6013
+ refreshTokenSize: ((_c = response.body.refresh_token) === null || _c === void 0 ? void 0 : _c.length) || 0,
5978
6014
  });
5979
- requestId = (_c = response.headers) === null || _c === void 0 ? void 0 : _c[HeaderNames.X_MS_REQUEST_ID];
6015
+ if (httpVerToken) {
6016
+ atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
6017
+ httpVerToken: httpVerToken,
6018
+ });
6019
+ }
6020
+ requestId = (_d = response.headers) === null || _d === void 0 ? void 0 : _d[HeaderNames.X_MS_REQUEST_ID];
5980
6021
  responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
5981
6022
  responseHandler.validateTokenResponse(response.body);
5982
6023
  return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId).then(function (result) {
@@ -6210,7 +6251,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
6210
6251
  return RefreshTokenClient;
6211
6252
  }(BaseClient));
6212
6253
 
6213
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6254
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6214
6255
 
6215
6256
  /*
6216
6257
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6334,7 +6375,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
6334
6375
  return SilentFlowClient;
6335
6376
  }(BaseClient));
6336
6377
 
6337
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6378
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6338
6379
  /*
6339
6380
  * Copyright (c) Microsoft Corporation. All rights reserved.
6340
6381
  * Licensed under the MIT License.
@@ -6346,7 +6387,7 @@ function isOpenIdConfigResponse(response) {
6346
6387
  response.hasOwnProperty("jwks_uri"));
6347
6388
  }
6348
6389
 
6349
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6390
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6350
6391
  /*
6351
6392
  * Copyright (c) Microsoft Corporation. All rights reserved.
6352
6393
  * Licensed under the MIT License.
@@ -6355,7 +6396,7 @@ var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/
6355
6396
  var EndpointMetadata = rawMetdataJSON.endpointMetadata;
6356
6397
  var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
6357
6398
 
6358
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6399
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6359
6400
  /*
6360
6401
  * Copyright (c) Microsoft Corporation. All rights reserved.
6361
6402
  * Licensed under the MIT License.
@@ -6369,7 +6410,7 @@ exports.ProtocolMode = void 0;
6369
6410
  ProtocolMode["OIDC"] = "OIDC";
6370
6411
  })(exports.ProtocolMode || (exports.ProtocolMode = {}));
6371
6412
 
6372
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6413
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6373
6414
 
6374
6415
  /*
6375
6416
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6446,7 +6487,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
6446
6487
  return AuthorityMetadataEntity;
6447
6488
  }());
6448
6489
 
6449
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6490
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6450
6491
  /*
6451
6492
  * Copyright (c) Microsoft Corporation. All rights reserved.
6452
6493
  * Licensed under the MIT License.
@@ -6456,7 +6497,17 @@ function isCloudInstanceDiscoveryResponse(response) {
6456
6497
  response.hasOwnProperty("metadata"));
6457
6498
  }
6458
6499
 
6459
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6500
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6501
+ /*
6502
+ * Copyright (c) Microsoft Corporation. All rights reserved.
6503
+ * Licensed under the MIT License.
6504
+ */
6505
+ function isCloudInstanceDiscoveryErrorResponse(response) {
6506
+ return (response.hasOwnProperty("error") &&
6507
+ response.hasOwnProperty("error_description"));
6508
+ }
6509
+
6510
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6460
6511
 
6461
6512
  /*
6462
6513
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6578,7 +6629,7 @@ var RegionDiscovery = /** @class */ (function () {
6578
6629
  return RegionDiscovery;
6579
6630
  }());
6580
6631
 
6581
- /*! @azure/msal-common v9.0.0 2022-11-22 */
6632
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
6582
6633
 
6583
6634
  /*
6584
6635
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7055,7 +7106,7 @@ var Authority = /** @class */ (function () {
7055
7106
  case 1:
7056
7107
  metadata = _a.sent();
7057
7108
  if (metadata) {
7058
- this.logger.verbose("Found cloud discovery metadata from the network.");
7109
+ this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()");
7059
7110
  metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
7060
7111
  return [2 /*return*/, AuthorityMetadataSource.NETWORK];
7061
7112
  }
@@ -7066,8 +7117,8 @@ var Authority = /** @class */ (function () {
7066
7117
  metadataEntity.updateCloudDiscoveryMetadata(harcodedMetadata, false);
7067
7118
  return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];
7068
7119
  }
7069
- // Metadata could not be obtained from config, cache or network
7070
- this.logger.verbose("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded value. Throwing Untrusted Authority Error.");
7120
+ // Metadata could not be obtained from the config, cache, network or hardcoded values
7121
+ this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error.");
7071
7122
  throw ClientConfigurationError.createUntrustedAuthorityError();
7072
7123
  }
7073
7124
  });
@@ -7112,7 +7163,7 @@ var Authority = /** @class */ (function () {
7112
7163
  */
7113
7164
  Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
7114
7165
  return __awaiter(this, void 0, void 0, function () {
7115
- var instanceDiscoveryEndpoint, options, match, response, metadata;
7166
+ var instanceDiscoveryEndpoint, options, match, response, typedResponseBody, metadata, error_1, typedError;
7116
7167
  return __generator(this, function (_a) {
7117
7168
  switch (_a.label) {
7118
7169
  case 0:
@@ -7128,21 +7179,47 @@ var Authority = /** @class */ (function () {
7128
7179
  return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
7129
7180
  case 2:
7130
7181
  response = _a.sent();
7131
- metadata = isCloudInstanceDiscoveryResponse(response.body)
7132
- ? response.body.metadata
7133
- : [];
7134
- if (metadata.length === 0) {
7135
- // If no metadata is returned, authority is untrusted
7182
+ typedResponseBody = void 0;
7183
+ metadata = void 0;
7184
+ if (isCloudInstanceDiscoveryResponse(response.body)) {
7185
+ typedResponseBody = response.body;
7186
+ metadata = typedResponseBody.metadata;
7187
+ this.logger.verbosePii("tenant_discovery_endpoint is: " + typedResponseBody.tenant_discovery_endpoint);
7188
+ }
7189
+ else if (isCloudInstanceDiscoveryErrorResponse(response.body)) {
7190
+ this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: " + response.status);
7191
+ typedResponseBody = response.body;
7192
+ if (typedResponseBody.error === Constants.INVALID_INSTANCE) {
7193
+ this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.");
7194
+ return [2 /*return*/, null];
7195
+ }
7196
+ this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is " + typedResponseBody.error);
7197
+ this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is " + typedResponseBody.error_description);
7198
+ this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []");
7199
+ metadata = [];
7200
+ }
7201
+ else {
7202
+ this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse");
7136
7203
  return [2 /*return*/, null];
7137
7204
  }
7205
+ this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.");
7138
7206
  match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);
7139
7207
  return [3 /*break*/, 4];
7140
7208
  case 3:
7141
- _a.sent();
7209
+ error_1 = _a.sent();
7210
+ if (error_1 instanceof AuthError) {
7211
+ this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: " + error_1.errorCode + "\nError Description: " + error_1.errorMessage);
7212
+ }
7213
+ else {
7214
+ typedError = error_1;
7215
+ this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: " + typedError.name + "\nError Description: " + typedError.message);
7216
+ }
7142
7217
  return [2 /*return*/, null];
7143
7218
  case 4:
7219
+ // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
7144
7220
  if (!match) {
7145
- // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
7221
+ this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.");
7222
+ this.logger.verbose("Creating custom Authority for custom domain scenario.");
7146
7223
  match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
7147
7224
  }
7148
7225
  return [2 /*return*/, match];
@@ -7274,7 +7351,7 @@ var Authority = /** @class */ (function () {
7274
7351
  return Authority;
7275
7352
  }());
7276
7353
 
7277
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7354
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7278
7355
 
7279
7356
  /*
7280
7357
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7335,7 +7412,7 @@ var AuthorityFactory = /** @class */ (function () {
7335
7412
  return AuthorityFactory;
7336
7413
  }());
7337
7414
 
7338
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7415
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7339
7416
 
7340
7417
  /*
7341
7418
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7366,7 +7443,7 @@ var ServerTelemetryEntity = /** @class */ (function () {
7366
7443
  return ServerTelemetryEntity;
7367
7444
  }());
7368
7445
 
7369
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7446
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7370
7447
 
7371
7448
  /*
7372
7449
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7394,7 +7471,7 @@ var ThrottlingEntity = /** @class */ (function () {
7394
7471
  return ThrottlingEntity;
7395
7472
  }());
7396
7473
 
7397
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7474
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7398
7475
 
7399
7476
  /*
7400
7477
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7411,7 +7488,7 @@ var StubbedNetworkModule = {
7411
7488
  }
7412
7489
  };
7413
7490
 
7414
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7491
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7415
7492
 
7416
7493
  /*
7417
7494
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7456,7 +7533,7 @@ var JoseHeaderError = /** @class */ (function (_super) {
7456
7533
  return JoseHeaderError;
7457
7534
  }(AuthError));
7458
7535
 
7459
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7536
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7460
7537
 
7461
7538
  /*
7462
7539
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7496,7 +7573,7 @@ var JoseHeader = /** @class */ (function () {
7496
7573
  return JoseHeader;
7497
7574
  }());
7498
7575
 
7499
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7576
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7500
7577
 
7501
7578
  /*
7502
7579
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7555,7 +7632,7 @@ var AuthenticationHeaderParser = /** @class */ (function () {
7555
7632
  return AuthenticationHeaderParser;
7556
7633
  }());
7557
7634
 
7558
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7635
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7559
7636
 
7560
7637
  /*
7561
7638
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7717,7 +7794,7 @@ var ServerTelemetryManager = /** @class */ (function () {
7717
7794
  return ServerTelemetryManager;
7718
7795
  }());
7719
7796
 
7720
- /*! @azure/msal-common v9.0.0 2022-11-22 */
7797
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
7721
7798
 
7722
7799
  /*
7723
7800
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7763,7 +7840,7 @@ var PerformanceClient = /** @class */ (function () {
7763
7840
  this.logger.info("PerformanceClient: No correlation id provided for " + measureName + ", generating", eventCorrelationId);
7764
7841
  }
7765
7842
  this.logger.trace("PerformanceClient: Performance measurement started for " + measureName, eventCorrelationId);
7766
- var performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);
7843
+ var performanceMeasurement = this.startPerformanceMeasurement(measureName, eventCorrelationId);
7767
7844
  performanceMeasurement.startMeasurement();
7768
7845
  var inProgressEvent = {
7769
7846
  eventId: this.generateId(),
@@ -8012,7 +8089,7 @@ var PerformanceClient = /** @class */ (function () {
8012
8089
  return PerformanceClient;
8013
8090
  }());
8014
8091
 
8015
- /*! @azure/msal-common v9.0.0 2022-11-22 */
8092
+ /*! @azure/msal-common v9.0.2 2023-01-10 */
8016
8093
 
8017
8094
  /*
8018
8095
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8038,7 +8115,7 @@ var StubPerformanceClient = /** @class */ (function (_super) {
8038
8115
  StubPerformanceClient.prototype.generateId = function () {
8039
8116
  return "callback-id";
8040
8117
  };
8041
- StubPerformanceClient.prototype.startPerformanceMeasuremeant = function () {
8118
+ StubPerformanceClient.prototype.startPerformanceMeasurement = function () {
8042
8119
  return new StubPerformanceMeasurement();
8043
8120
  };
8044
8121
  return StubPerformanceClient;
@@ -8601,6 +8678,7 @@ var TemporaryCacheKeys;
8601
8678
  TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
8602
8679
  TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
8603
8680
  TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
8681
+ TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
8604
8682
  })(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
8605
8683
  /**
8606
8684
  * Cache keys stored in-memory
@@ -9283,17 +9361,17 @@ var BrowserCacheManager = /** @class */ (function (_super) {
9283
9361
  var activeAccountValueFilters = this.getItem(activeAccountKeyFilters);
9284
9362
  if (!activeAccountValueFilters) {
9285
9363
  // if new active account cache type isn't found, it's an old version, so look for that instead
9286
- this.logger.trace("No active account filters cache schema found, looking for legacy schema");
9364
+ this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");
9287
9365
  var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
9288
9366
  var activeAccountValueLocal = this.getItem(activeAccountKeyLocal);
9289
9367
  if (!activeAccountValueLocal) {
9290
- this.logger.trace("No active account found");
9368
+ this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
9291
9369
  return null;
9292
9370
  }
9293
9371
  var activeAccount = this.getAccountInfoByFilter({ localAccountId: activeAccountValueLocal })[0] || null;
9294
9372
  if (activeAccount) {
9295
- this.logger.trace("Legacy active account cache schema found");
9296
- this.logger.trace("Adding active account filters cache schema");
9373
+ this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found");
9374
+ this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema");
9297
9375
  this.setActiveAccount(activeAccount);
9298
9376
  return activeAccount;
9299
9377
  }
@@ -9301,13 +9379,13 @@ var BrowserCacheManager = /** @class */ (function (_super) {
9301
9379
  }
9302
9380
  var activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);
9303
9381
  if (activeAccountValueObj) {
9304
- this.logger.trace("Active account filters schema found");
9382
+ this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found");
9305
9383
  return this.getAccountInfoByFilter({
9306
9384
  homeAccountId: activeAccountValueObj.homeAccountId,
9307
9385
  localAccountId: activeAccountValueObj.localAccountId
9308
9386
  })[0] || null;
9309
9387
  }
9310
- this.logger.trace("No active account found");
9388
+ this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
9311
9389
  return null;
9312
9390
  };
9313
9391
  /**
@@ -9338,6 +9416,7 @@ var BrowserCacheManager = /** @class */ (function (_super) {
9338
9416
  */
9339
9417
  BrowserCacheManager.prototype.getAccountInfoByFilter = function (accountFilter) {
9340
9418
  var allAccounts = this.getAllAccounts();
9419
+ this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total " + allAccounts.length + " accounts found");
9341
9420
  return allAccounts.filter(function (accountObj) {
9342
9421
  if (accountFilter.username && accountFilter.username.toLowerCase() !== accountObj.username.toLowerCase()) {
9343
9422
  return false;
@@ -9874,6 +9953,19 @@ var BrowserCacheManager = /** @class */ (function (_super) {
9874
9953
  }
9875
9954
  return currentCacheKey;
9876
9955
  };
9956
+ /**
9957
+ * Returns application id as redirect context during AcquireTokenRedirect flow.
9958
+ */
9959
+ BrowserCacheManager.prototype.getRedirectRequestContext = function () {
9960
+ return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);
9961
+ };
9962
+ /**
9963
+ * Sets application id as the redirect context during AcquireTokenRedirect flow.
9964
+ * @param value
9965
+ */
9966
+ BrowserCacheManager.prototype.setRedirectRequestContext = function (value) {
9967
+ this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);
9968
+ };
9877
9969
  return BrowserCacheManager;
9878
9970
  }(CacheManager));
9879
9971
  var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
@@ -9887,7 +9979,7 @@ var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
9887
9979
 
9888
9980
  /* eslint-disable header/header */
9889
9981
  var name = "@azure/msal-browser";
9890
- var version = "2.32.0";
9982
+ var version = "2.32.2";
9891
9983
 
9892
9984
  /*
9893
9985
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10591,7 +10683,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
10591
10683
  */
10592
10684
  StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
10593
10685
  return __awaiter$1(this, void 0, void 0, function () {
10594
- var discoveredAuthority;
10686
+ var discoveredAuthority, logger;
10595
10687
  return __generator$1(this, function (_a) {
10596
10688
  switch (_a.label) {
10597
10689
  case 0:
@@ -10599,6 +10691,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
10599
10691
  return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];
10600
10692
  case 1:
10601
10693
  discoveredAuthority = _a.sent();
10694
+ logger = this.config.system.loggerOptions;
10602
10695
  return [2 /*return*/, {
10603
10696
  authOptions: {
10604
10697
  clientId: this.config.auth.clientId,
@@ -10610,9 +10703,9 @@ var StandardInteractionClient = /** @class */ (function (_super) {
10610
10703
  preventCorsPreflight: true
10611
10704
  },
10612
10705
  loggerOptions: {
10613
- loggerCallback: this.config.system.loggerOptions.loggerCallback,
10614
- piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,
10615
- logLevel: this.config.system.loggerOptions.logLevel,
10706
+ loggerCallback: logger.loggerCallback,
10707
+ piiLoggingEnabled: logger.piiLoggingEnabled,
10708
+ logLevel: logger.logLevel,
10616
10709
  correlationId: this.correlationId
10617
10710
  },
10618
10711
  cryptoInterface: this.browserCrypto,
@@ -10656,13 +10749,14 @@ var StandardInteractionClient = /** @class */ (function (_super) {
10656
10749
  * @param requestCorrelationId
10657
10750
  */
10658
10751
  StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority, requestAzureCloudOptions) {
10752
+ var _a;
10659
10753
  return __awaiter$1(this, void 0, void 0, function () {
10660
10754
  var getAuthorityMeasurement, authorityOptions, userAuthority, builtAuthority;
10661
- return __generator$1(this, function (_a) {
10662
- switch (_a.label) {
10755
+ return __generator$1(this, function (_b) {
10756
+ switch (_b.label) {
10663
10757
  case 0:
10664
10758
  this.logger.verbose("getDiscoveredAuthority called", this.correlationId);
10665
- getAuthorityMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
10759
+ getAuthorityMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
10666
10760
  authorityOptions = {
10667
10761
  protocolMode: this.config.auth.protocolMode,
10668
10762
  knownAuthorities: this.config.auth.knownAuthorities,
@@ -10676,7 +10770,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
10676
10770
  return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)
10677
10771
  .then(function (result) {
10678
10772
  getAuthorityMeasurement.endMeasurement({
10679
- success: true
10773
+ success: true,
10680
10774
  });
10681
10775
  return result;
10682
10776
  })
@@ -10688,7 +10782,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
10688
10782
  });
10689
10783
  throw error;
10690
10784
  })];
10691
- case 1: return [2 /*return*/, _a.sent()];
10785
+ case 1: return [2 /*return*/, _b.sent()];
10692
10786
  }
10693
10787
  });
10694
10788
  });
@@ -12860,7 +12954,9 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12860
12954
  // Default logger options for browser
12861
12955
  var DEFAULT_LOGGER_OPTIONS = {
12862
12956
  // eslint-disable-next-line @typescript-eslint/no-empty-function
12863
- loggerCallback: function () { },
12957
+ loggerCallback: function () {
12958
+ // allow users to not set logger call back
12959
+ },
12864
12960
  logLevel: exports.LogLevel.Info,
12865
12961
  piiLoggingEnabled: false
12866
12962
  };
@@ -12871,6 +12967,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12871
12967
  useMsrCrypto: false,
12872
12968
  entropy: undefined
12873
12969
  } });
12970
+ var providedSystemOptions = __assign$1(__assign$1({}, userInputSystem), { loggerOptions: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loggerOptions) || DEFAULT_LOGGER_OPTIONS });
12874
12971
  var DEFAULT_TELEMETRY_OPTIONS = {
12875
12972
  application: {
12876
12973
  appName: Constants.EMPTY_STRING,
@@ -12880,7 +12977,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
12880
12977
  var overlayedConfig = {
12881
12978
  auth: __assign$1(__assign$1({}, DEFAULT_AUTH_OPTIONS), userInputAuth),
12882
12979
  cache: __assign$1(__assign$1({}, DEFAULT_CACHE_OPTIONS), userInputCache),
12883
- system: __assign$1(__assign$1({}, DEFAULT_BROWSER_SYSTEM_OPTIONS), userInputSystem),
12980
+ system: __assign$1(__assign$1({}, DEFAULT_BROWSER_SYSTEM_OPTIONS), providedSystemOptions),
12884
12981
  telemetry: __assign$1(__assign$1({}, DEFAULT_TELEMETRY_OPTIONS), userInputTelemetry)
12885
12982
  };
12886
12983
  return overlayedConfig;
@@ -13371,27 +13468,6 @@ var EventHandler = /** @class */ (function () {
13371
13468
  return EventHandler;
13372
13469
  }());
13373
13470
 
13374
- /*
13375
- * Copyright (c) Microsoft Corporation. All rights reserved.
13376
- * Licensed under the MIT License.
13377
- */
13378
-
13379
- var internals = /*#__PURE__*/Object.freeze({
13380
- __proto__: null,
13381
- BrowserCacheManager: BrowserCacheManager,
13382
- StandardInteractionClient: StandardInteractionClient,
13383
- RedirectClient: RedirectClient,
13384
- PopupClient: PopupClient,
13385
- SilentIframeClient: SilentIframeClient,
13386
- SilentCacheClient: SilentCacheClient,
13387
- SilentRefreshClient: SilentRefreshClient,
13388
- RedirectHandler: RedirectHandler,
13389
- EventHandler: EventHandler,
13390
- NativeMessageHandler: NativeMessageHandler,
13391
- BrowserConstants: BrowserConstants,
13392
- get TemporaryCacheKeys () { return TemporaryCacheKeys; }
13393
- });
13394
-
13395
13471
  /*
13396
13472
  * Copyright (c) Microsoft Corporation. All rights reserved.
13397
13473
  * Licensed under the MIT License.
@@ -14926,6 +15002,29 @@ var CryptoOps = /** @class */ (function () {
14926
15002
  return CryptoOps;
14927
15003
  }());
14928
15004
 
15005
+ /*
15006
+ * Copyright (c) Microsoft Corporation. All rights reserved.
15007
+ * Licensed under the MIT License.
15008
+ */
15009
+
15010
+ var internals = /*#__PURE__*/Object.freeze({
15011
+ __proto__: null,
15012
+ BrowserCacheManager: BrowserCacheManager,
15013
+ StandardInteractionClient: StandardInteractionClient,
15014
+ RedirectClient: RedirectClient,
15015
+ PopupClient: PopupClient,
15016
+ SilentIframeClient: SilentIframeClient,
15017
+ SilentCacheClient: SilentCacheClient,
15018
+ SilentRefreshClient: SilentRefreshClient,
15019
+ RedirectHandler: RedirectHandler,
15020
+ EventHandler: EventHandler,
15021
+ NativeMessageHandler: NativeMessageHandler,
15022
+ BrowserConstants: BrowserConstants,
15023
+ get TemporaryCacheKeys () { return TemporaryCacheKeys; },
15024
+ CryptoOps: CryptoOps,
15025
+ NativeAuthError: NativeAuthError
15026
+ });
15027
+
14929
15028
  /*
14930
15029
  * Copyright (c) Microsoft Corporation. All rights reserved.
14931
15030
  * Licensed under the MIT License.
@@ -15305,7 +15404,7 @@ var BrowserPerformanceClient = /** @class */ (function (_super) {
15305
15404
  _this.guidGenerator = new GuidGenerator(_this.browserCrypto);
15306
15405
  return _this;
15307
15406
  }
15308
- BrowserPerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {
15407
+ BrowserPerformanceClient.prototype.startPerformanceMeasurement = function (measureName, correlationId) {
15309
15408
  return new BrowserPerformanceMeasurement(measureName, correlationId);
15310
15409
  };
15311
15410
  BrowserPerformanceClient.prototype.generateId = function () {
@@ -16410,7 +16509,8 @@ var PublicClientApplication = /** @class */ (function (_super) {
16410
16509
  success: true,
16411
16510
  fromCache: result.fromCache,
16412
16511
  isNativeBroker: result.fromNativeBroker,
16413
- requestId: result.requestId
16512
+ cacheLookupPolicy: request.cacheLookupPolicy,
16513
+ requestId: result.requestId,
16414
16514
  });
16415
16515
  atsMeasurement.flushMeasurement();
16416
16516
  return result;
@@ -16448,13 +16548,13 @@ var PublicClientApplication = /** @class */ (function (_super) {
16448
16548
  */
16449
16549
  PublicClientApplication.prototype.acquireTokenSilentAsync = function (request, account) {
16450
16550
  return __awaiter$1(this, void 0, void 0, function () {
16451
- var astsAsyncMeasurement, result, silentRequest, silentCacheClient, silentRequest_1, requestWithCLP_1;
16551
+ var atsAsyncMeasurement, result, silentRequest, silentCacheClient, silentRequest_1, requestWithCLP_1;
16452
16552
  var _this = this;
16453
16553
  return __generator$1(this, function (_a) {
16454
16554
  switch (_a.label) {
16455
16555
  case 0:
16456
16556
  this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
16457
- astsAsyncMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
16557
+ atsAsyncMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
16458
16558
  if (!(NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId)) return [3 /*break*/, 1];
16459
16559
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");
16460
16560
  silentRequest = __assign$1(__assign$1({}, request), { account: account });
@@ -16507,7 +16607,7 @@ var PublicClientApplication = /** @class */ (function (_super) {
16507
16607
  _a.label = 3;
16508
16608
  case 3: return [2 /*return*/, result.then(function (response) {
16509
16609
  _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
16510
- astsAsyncMeasurement.endMeasurement({
16610
+ atsAsyncMeasurement.endMeasurement({
16511
16611
  success: true,
16512
16612
  fromCache: response.fromCache,
16513
16613
  isNativeBroker: response.fromNativeBroker,
@@ -16516,7 +16616,7 @@ var PublicClientApplication = /** @class */ (function (_super) {
16516
16616
  return response;
16517
16617
  }).catch(function (tokenRenewalError) {
16518
16618
  _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
16519
- astsAsyncMeasurement.endMeasurement({
16619
+ atsAsyncMeasurement.endMeasurement({
16520
16620
  errorCode: tokenRenewalError.errorCode,
16521
16621
  subErrorCode: tokenRenewalError.subError,
16522
16622
  success: false