@azure/msal-browser 2.21.0 → 2.22.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 (112) hide show
  1. package/CHANGELOG.json +73 -0
  2. package/CHANGELOG.md +18 -1
  3. package/README.md +1 -1
  4. package/dist/_virtual/_tslib.js +1 -1
  5. package/dist/app/ClientApplication.d.ts +7 -1
  6. package/dist/app/ClientApplication.d.ts.map +1 -1
  7. package/dist/app/ClientApplication.js +18 -3
  8. package/dist/app/ClientApplication.js.map +1 -1
  9. package/dist/app/IPublicClientApplication.js +1 -1
  10. package/dist/app/PublicClientApplication.d.ts +2 -2
  11. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  12. package/dist/app/PublicClientApplication.js +1 -1
  13. package/dist/app/PublicClientApplication.js.map +1 -1
  14. package/dist/cache/AsyncMemoryStorage.js +1 -1
  15. package/dist/cache/BrowserCacheManager.d.ts +14 -12
  16. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  17. package/dist/cache/BrowserCacheManager.js +11 -7
  18. package/dist/cache/BrowserCacheManager.js.map +1 -1
  19. package/dist/cache/BrowserStorage.js +1 -1
  20. package/dist/cache/DatabaseStorage.js +1 -1
  21. package/dist/cache/MemoryStorage.js +1 -1
  22. package/dist/cache/TokenCache.d.ts.map +1 -1
  23. package/dist/cache/TokenCache.js +4 -3
  24. package/dist/cache/TokenCache.js.map +1 -1
  25. package/dist/config/Configuration.d.ts +10 -9
  26. package/dist/config/Configuration.d.ts.map +1 -1
  27. package/dist/config/Configuration.js +7 -3
  28. package/dist/config/Configuration.js.map +1 -1
  29. package/dist/crypto/BrowserCrypto.js +1 -1
  30. package/dist/crypto/CryptoOps.js +1 -1
  31. package/dist/crypto/GuidGenerator.js +1 -1
  32. package/dist/crypto/PkceGenerator.js +1 -1
  33. package/dist/crypto/SignedHttpRequest.js +1 -1
  34. package/dist/encode/Base64Decode.js +1 -1
  35. package/dist/encode/Base64Encode.js +1 -1
  36. package/dist/error/BrowserAuthError.js +1 -1
  37. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  38. package/dist/event/EventHandler.js +1 -1
  39. package/dist/event/EventMessage.js +1 -1
  40. package/dist/event/EventType.js +1 -1
  41. package/dist/index.cjs.js +355 -234
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.d.ts +14 -2
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +14 -3
  46. package/dist/index.js.map +1 -1
  47. package/dist/interaction_client/BaseInteractionClient.d.ts +1 -1
  48. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  49. package/dist/interaction_client/BaseInteractionClient.js +1 -1
  50. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  51. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  52. package/dist/interaction_client/PopupClient.d.ts +4 -3
  53. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  54. package/dist/interaction_client/PopupClient.js +52 -60
  55. package/dist/interaction_client/PopupClient.js.map +1 -1
  56. package/dist/interaction_client/RedirectClient.d.ts +3 -3
  57. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  58. package/dist/interaction_client/RedirectClient.js +9 -8
  59. package/dist/interaction_client/RedirectClient.js.map +1 -1
  60. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  61. package/dist/interaction_client/SilentAuthCodeClient.js +2 -1
  62. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
  63. package/dist/interaction_client/SilentCacheClient.d.ts +2 -2
  64. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  65. package/dist/interaction_client/SilentCacheClient.js +4 -4
  66. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  67. package/dist/interaction_client/SilentIframeClient.d.ts +3 -3
  68. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  69. package/dist/interaction_client/SilentIframeClient.js +3 -2
  70. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  71. package/dist/interaction_client/SilentRefreshClient.d.ts +2 -2
  72. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  73. package/dist/interaction_client/SilentRefreshClient.js +4 -4
  74. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  75. package/dist/interaction_client/StandardInteractionClient.d.ts +10 -10
  76. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  77. package/dist/interaction_client/StandardInteractionClient.js +58 -44
  78. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  79. package/dist/interaction_handler/InteractionHandler.js +1 -1
  80. package/dist/interaction_handler/PopupHandler.d.ts.map +1 -1
  81. package/dist/interaction_handler/PopupHandler.js +1 -3
  82. package/dist/interaction_handler/PopupHandler.js.map +1 -1
  83. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  84. package/dist/interaction_handler/RedirectHandler.js +1 -2
  85. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  86. package/dist/interaction_handler/SilentHandler.js +1 -1
  87. package/dist/navigation/NavigationClient.js +1 -1
  88. package/dist/network/FetchClient.js +1 -1
  89. package/dist/network/XhrClient.js +1 -1
  90. package/dist/packageMetadata.d.ts +1 -1
  91. package/dist/packageMetadata.js +2 -2
  92. package/dist/packageMetadata.js.map +1 -1
  93. package/dist/request/EndSessionPopupRequest.d.ts +1 -0
  94. package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
  95. package/dist/request/EndSessionRequest.d.ts +1 -0
  96. package/dist/request/EndSessionRequest.d.ts.map +1 -1
  97. package/dist/utils/BrowserConstants.d.ts +2 -1
  98. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  99. package/dist/utils/BrowserConstants.js +2 -1
  100. package/dist/utils/BrowserConstants.js.map +1 -1
  101. package/dist/utils/BrowserProtocolUtils.js +1 -1
  102. package/dist/utils/BrowserStringUtils.js +1 -1
  103. package/dist/utils/BrowserUtils.js +1 -1
  104. package/dist/utils/MathUtils.js +1 -1
  105. package/dist/utils/PopupUtils.d.ts +1 -2
  106. package/dist/utils/PopupUtils.d.ts.map +1 -1
  107. package/dist/utils/PopupUtils.js +3 -3
  108. package/dist/utils/PopupUtils.js.map +1 -1
  109. package/lib/msal-browser.js +355 -234
  110. package/lib/msal-browser.js.map +1 -1
  111. package/lib/msal-browser.min.js +35 -30
  112. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.21.0 2022-01-04 */
1
+ /*! @azure/msal-browser v2.22.0 2022-02-08 */
2
2
  'use strict';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -107,7 +107,7 @@
107
107
  return ar;
108
108
  }
109
109
 
110
- /*! @azure/msal-common v6.0.0 2022-01-04 */
110
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
111
111
  /*! *****************************************************************************
112
112
  Copyright (c) Microsoft Corporation.
113
113
 
@@ -194,7 +194,7 @@
194
194
  return r;
195
195
  }
196
196
 
197
- /*! @azure/msal-common v6.0.0 2022-01-04 */
197
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
198
198
 
199
199
  /*
200
200
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -208,6 +208,7 @@
208
208
  // default authority
209
209
  DEFAULT_AUTHORITY: "https://login.microsoftonline.com/common/",
210
210
  DEFAULT_AUTHORITY_HOST: "login.microsoftonline.com",
211
+ DEFAULT_COMMON_TENANT: "common",
211
212
  // ADFS String
212
213
  ADFS: "adfs",
213
214
  // Default AAD Instance Discovery Endpoint
@@ -332,6 +333,7 @@
332
333
  AADServerParamKeys["FOCI"] = "foci";
333
334
  AADServerParamKeys["CCS_HEADER"] = "X-AnchorMailbox";
334
335
  AADServerParamKeys["RETURN_SPA_CODE"] = "return_spa_code";
336
+ AADServerParamKeys["LOGOUT_HINT"] = "logout_hint";
335
337
  })(AADServerParamKeys || (AADServerParamKeys = {}));
336
338
  /**
337
339
  * Claims request keys
@@ -556,7 +558,7 @@
556
558
  CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
557
559
  })(CacheOutcome || (CacheOutcome = {}));
558
560
 
559
- /*! @azure/msal-common v6.0.0 2022-01-04 */
561
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
560
562
 
561
563
  /*
562
564
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -600,7 +602,7 @@
600
602
  return AuthError;
601
603
  }(Error));
602
604
 
603
- /*! @azure/msal-common v6.0.0 2022-01-04 */
605
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
604
606
 
605
607
  /*
606
608
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -675,7 +677,7 @@
675
677
  }
676
678
  };
677
679
 
678
- /*! @azure/msal-common v6.0.0 2022-01-04 */
680
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
679
681
 
680
682
  /*
681
683
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1137,7 +1139,7 @@
1137
1139
  return ClientAuthError;
1138
1140
  }(AuthError));
1139
1141
 
1140
- /*! @azure/msal-common v6.0.0 2022-01-04 */
1142
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1141
1143
 
1142
1144
  /*
1143
1145
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1262,7 +1264,7 @@
1262
1264
  return StringUtils;
1263
1265
  }());
1264
1266
 
1265
- /*! @azure/msal-common v6.0.0 2022-01-04 */
1267
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1266
1268
 
1267
1269
  /*
1268
1270
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1442,12 +1444,31 @@
1442
1444
  return Logger;
1443
1445
  }());
1444
1446
 
1445
- /*! @azure/msal-common v6.0.0 2022-01-04 */
1447
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1446
1448
  /* eslint-disable header/header */
1447
1449
  var name$1 = "@azure/msal-common";
1448
- var version$1 = "6.0.0";
1450
+ var version$1 = "6.1.0";
1449
1451
 
1450
- /*! @azure/msal-common v6.0.0 2022-01-04 */
1452
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1453
+ /*
1454
+ * Copyright (c) Microsoft Corporation. All rights reserved.
1455
+ * Licensed under the MIT License.
1456
+ */
1457
+ exports.AzureCloudInstance = void 0;
1458
+ (function (AzureCloudInstance) {
1459
+ // AzureCloudInstance is not specified.
1460
+ AzureCloudInstance[AzureCloudInstance["None"] = 0] = "None";
1461
+ // Microsoft Azure public cloud
1462
+ AzureCloudInstance["AzurePublic"] = "https://login.microsoftonline.com";
1463
+ // Microsoft Chinese national cloud
1464
+ AzureCloudInstance["AzureChina"] = "https://login.chinacloudapi.cn";
1465
+ // Microsoft German national cloud ("Black Forest")
1466
+ AzureCloudInstance["AzureGermany"] = "https://login.microsoftonline.de";
1467
+ // US Government cloud
1468
+ AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1469
+ })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1470
+
1471
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1451
1472
 
1452
1473
  /*
1453
1474
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1606,7 +1627,7 @@
1606
1627
  return CredentialEntity;
1607
1628
  }());
1608
1629
 
1609
- /*! @azure/msal-common v6.0.0 2022-01-04 */
1630
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1610
1631
 
1611
1632
  /*
1612
1633
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1688,6 +1709,10 @@
1688
1709
  code: "untrusted_authority",
1689
1710
  desc: "The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."
1690
1711
  },
1712
+ invalidAzureCloudInstance: {
1713
+ code: "invalid_azure_cloud_instance",
1714
+ desc: "Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"
1715
+ },
1691
1716
  missingSshJwk: {
1692
1717
  code: "missing_ssh_jwk",
1693
1718
  desc: "Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."
@@ -1824,7 +1849,13 @@
1824
1849
  ClientConfigurationError.createUntrustedAuthorityError = function () {
1825
1850
  return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code, ClientConfigurationErrorMessage.untrustedAuthority.desc);
1826
1851
  };
1827
- /*
1852
+ /**
1853
+ * Throws error when the AzureCloudInstance is set to an invalid value
1854
+ */
1855
+ ClientConfigurationError.createInvalidAzureCloudInstanceError = function () {
1856
+ return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAzureCloudInstance.code, ClientConfigurationErrorMessage.invalidAzureCloudInstance.desc);
1857
+ };
1858
+ /**
1828
1859
  * Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request
1829
1860
  */
1830
1861
  ClientConfigurationError.createMissingSshJwkError = function () {
@@ -1851,7 +1882,7 @@
1851
1882
  return ClientConfigurationError;
1852
1883
  }(ClientAuthError));
1853
1884
 
1854
- /*! @azure/msal-common v6.0.0 2022-01-04 */
1885
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
1855
1886
 
1856
1887
  /*
1857
1888
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2035,7 +2066,7 @@
2035
2066
  return ScopeSet;
2036
2067
  }());
2037
2068
 
2038
- /*! @azure/msal-common v6.0.0 2022-01-04 */
2069
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2039
2070
 
2040
2071
  /*
2041
2072
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2073,7 +2104,7 @@
2073
2104
  };
2074
2105
  }
2075
2106
 
2076
- /*! @azure/msal-common v6.0.0 2022-01-04 */
2107
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2077
2108
  /*
2078
2109
  * Copyright (c) Microsoft Corporation. All rights reserved.
2079
2110
  * Licensed under the MIT License.
@@ -2087,7 +2118,7 @@
2087
2118
  AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
2088
2119
  })(AuthorityType || (AuthorityType = {}));
2089
2120
 
2090
- /*! @azure/msal-common v6.0.0 2022-01-04 */
2121
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2091
2122
 
2092
2123
  /*
2093
2124
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2321,7 +2352,7 @@
2321
2352
  return AccountEntity;
2322
2353
  }());
2323
2354
 
2324
- /*! @azure/msal-common v6.0.0 2022-01-04 */
2355
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2325
2356
 
2326
2357
  /*
2327
2358
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2359,7 +2390,7 @@
2359
2390
  return AuthToken;
2360
2391
  }());
2361
2392
 
2362
- /*! @azure/msal-common v6.0.0 2022-01-04 */
2393
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2363
2394
 
2364
2395
  /*
2365
2396
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3201,7 +3232,7 @@
3201
3232
  return DefaultStorageClass;
3202
3233
  }(CacheManager));
3203
3234
 
3204
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3235
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3205
3236
 
3206
3237
  /*
3207
3238
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3211,7 +3242,8 @@
3211
3242
  var DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
3212
3243
  var DEFAULT_SYSTEM_OPTIONS = {
3213
3244
  tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
3214
- preventCorsPreflight: false
3245
+ preventCorsPreflight: false,
3246
+ proxyUrl: "",
3215
3247
  };
3216
3248
  var DEFAULT_LOGGER_IMPLEMENTATION = {
3217
3249
  loggerCallback: function () {
@@ -3251,6 +3283,10 @@
3251
3283
  clientSecret: "",
3252
3284
  clientAssertion: undefined
3253
3285
  };
3286
+ var DEFAULT_AZURE_CLOUD_OPTIONS = {
3287
+ azureCloudInstance: exports.AzureCloudInstance.None,
3288
+ tenant: "" + Constants.DEFAULT_COMMON_TENANT
3289
+ };
3254
3290
  /**
3255
3291
  * Function that sets the default options when not explicitly configured from app developer
3256
3292
  *
@@ -3280,10 +3316,10 @@
3280
3316
  * @param authOptions
3281
3317
  */
3282
3318
  function buildAuthOptions(authOptions) {
3283
- return __assign({ clientCapabilities: [] }, authOptions);
3319
+ return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS }, authOptions);
3284
3320
  }
3285
3321
 
3286
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3322
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3287
3323
 
3288
3324
  /*
3289
3325
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3303,7 +3339,7 @@
3303
3339
  return ServerError;
3304
3340
  }(AuthError));
3305
3341
 
3306
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3342
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3307
3343
 
3308
3344
  /*
3309
3345
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3399,7 +3435,7 @@
3399
3435
  return ThrottlingUtils;
3400
3436
  }());
3401
3437
 
3402
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3438
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3403
3439
 
3404
3440
  /*
3405
3441
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3448,7 +3484,7 @@
3448
3484
  return NetworkManager;
3449
3485
  }());
3450
3486
 
3451
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3487
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3452
3488
  /*
3453
3489
  * Copyright (c) Microsoft Corporation. All rights reserved.
3454
3490
  * Licensed under the MIT License.
@@ -3459,7 +3495,7 @@
3459
3495
  CcsCredentialType["UPN"] = "UPN";
3460
3496
  })(CcsCredentialType || (CcsCredentialType = {}));
3461
3497
 
3462
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3498
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3463
3499
 
3464
3500
  /*
3465
3501
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3523,7 +3559,7 @@
3523
3559
  var response;
3524
3560
  return __generator(this, function (_a) {
3525
3561
  switch (_a.label) {
3526
- case 0: return [4 /*yield*/, this.networkManager.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers })];
3562
+ case 0: return [4 /*yield*/, this.networkManager.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers, proxyUrl: this.config.systemOptions.proxyUrl })];
3527
3563
  case 1:
3528
3564
  response = _a.sent();
3529
3565
  if (this.config.serverTelemetryManager && response.status < 500 && response.status !== 429) {
@@ -3548,7 +3584,7 @@
3548
3584
  return BaseClient;
3549
3585
  }());
3550
3586
 
3551
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3587
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3552
3588
 
3553
3589
  /*
3554
3590
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3634,7 +3670,7 @@
3634
3670
  return RequestValidator;
3635
3671
  }());
3636
3672
 
3637
- /*! @azure/msal-common v6.0.0 2022-01-04 */
3673
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3638
3674
 
3639
3675
  /*
3640
3676
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3961,6 +3997,12 @@
3961
3997
  RequestParameterBuilder.prototype.addThrottling = function () {
3962
3998
  this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);
3963
3999
  };
4000
+ /**
4001
+ * Adds logout_hint parameter for "silent" logout which prevent server account picker
4002
+ */
4003
+ RequestParameterBuilder.prototype.addLogoutHint = function (logoutHint) {
4004
+ this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));
4005
+ };
3964
4006
  /**
3965
4007
  * Utility to create a URL from the params map
3966
4008
  */
@@ -3974,7 +4016,7 @@
3974
4016
  return RequestParameterBuilder;
3975
4017
  }());
3976
4018
 
3977
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4019
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
3978
4020
 
3979
4021
  /*
3980
4022
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4039,7 +4081,7 @@
4039
4081
  return IdTokenEntity;
4040
4082
  }(CredentialEntity));
4041
4083
 
4042
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4084
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4043
4085
  /*
4044
4086
  * Copyright (c) Microsoft Corporation. All rights reserved.
4045
4087
  * Licensed under the MIT License.
@@ -4089,7 +4131,7 @@
4089
4131
  return TimeUtils;
4090
4132
  }());
4091
4133
 
4092
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4134
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4093
4135
 
4094
4136
  /*
4095
4137
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4203,7 +4245,7 @@
4203
4245
  return AccessTokenEntity;
4204
4246
  }(CredentialEntity));
4205
4247
 
4206
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4248
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4207
4249
 
4208
4250
  /*
4209
4251
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4270,7 +4312,7 @@
4270
4312
  return RefreshTokenEntity;
4271
4313
  }(CredentialEntity));
4272
4314
 
4273
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4315
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4274
4316
 
4275
4317
  /*
4276
4318
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4334,7 +4376,7 @@
4334
4376
  return InteractionRequiredAuthError;
4335
4377
  }(AuthError));
4336
4378
 
4337
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4379
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4338
4380
  /*
4339
4381
  * Copyright (c) Microsoft Corporation. All rights reserved.
4340
4382
  * Licensed under the MIT License.
@@ -4350,7 +4392,7 @@
4350
4392
  return CacheRecord;
4351
4393
  }());
4352
4394
 
4353
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4395
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4354
4396
 
4355
4397
  /*
4356
4398
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4421,7 +4463,7 @@
4421
4463
  return ProtocolUtils;
4422
4464
  }());
4423
4465
 
4424
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4466
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4425
4467
 
4426
4468
  /*
4427
4469
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4622,7 +4664,7 @@
4622
4664
  return UrlString;
4623
4665
  }());
4624
4666
 
4625
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4667
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4626
4668
 
4627
4669
  /*
4628
4670
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4697,7 +4739,7 @@
4697
4739
  return PopTokenGenerator;
4698
4740
  }());
4699
4741
 
4700
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4742
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4701
4743
 
4702
4744
  /*
4703
4745
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4767,7 +4809,7 @@
4767
4809
  return AppMetadataEntity;
4768
4810
  }());
4769
4811
 
4770
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4812
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4771
4813
  /*
4772
4814
  * Copyright (c) Microsoft Corporation. All rights reserved.
4773
4815
  * Licensed under the MIT License.
@@ -4803,7 +4845,7 @@
4803
4845
  return TokenCacheContext;
4804
4846
  }());
4805
4847
 
4806
- /*! @azure/msal-common v6.0.0 2022-01-04 */
4848
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
4807
4849
 
4808
4850
  /*
4809
4851
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5068,7 +5110,7 @@
5068
5110
  return ResponseHandler;
5069
5111
  }());
5070
5112
 
5071
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5113
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5072
5114
 
5073
5115
  /*
5074
5116
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5457,6 +5499,9 @@
5457
5499
  if (request.state) {
5458
5500
  parameterBuilder.addState(request.state);
5459
5501
  }
5502
+ if (request.logoutHint) {
5503
+ parameterBuilder.addLogoutHint(request.logoutHint);
5504
+ }
5460
5505
  if (request.extraQueryParameters) {
5461
5506
  parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
5462
5507
  }
@@ -5476,7 +5521,7 @@
5476
5521
  return AuthorizationCodeClient;
5477
5522
  }(BaseClient));
5478
5523
 
5479
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5524
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5480
5525
 
5481
5526
  /*
5482
5527
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5687,7 +5732,7 @@
5687
5732
  return RefreshTokenClient;
5688
5733
  }(BaseClient));
5689
5734
 
5690
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5735
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5691
5736
 
5692
5737
  /*
5693
5738
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5803,7 +5848,7 @@
5803
5848
  return SilentFlowClient;
5804
5849
  }(BaseClient));
5805
5850
 
5806
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5851
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5807
5852
  /*
5808
5853
  * Copyright (c) Microsoft Corporation. All rights reserved.
5809
5854
  * Licensed under the MIT License.
@@ -5814,7 +5859,7 @@
5814
5859
  response.hasOwnProperty("issuer"));
5815
5860
  }
5816
5861
 
5817
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5862
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5818
5863
  /*
5819
5864
  * Copyright (c) Microsoft Corporation. All rights reserved.
5820
5865
  * Licensed under the MIT License.
@@ -5828,7 +5873,7 @@
5828
5873
  ProtocolMode["OIDC"] = "OIDC";
5829
5874
  })(exports.ProtocolMode || (exports.ProtocolMode = {}));
5830
5875
 
5831
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5876
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5832
5877
 
5833
5878
  /*
5834
5879
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5903,7 +5948,7 @@
5903
5948
  return AuthorityMetadataEntity;
5904
5949
  }());
5905
5950
 
5906
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5951
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5907
5952
  /*
5908
5953
  * Copyright (c) Microsoft Corporation. All rights reserved.
5909
5954
  * Licensed under the MIT License.
@@ -5913,7 +5958,7 @@
5913
5958
  response.hasOwnProperty("metadata"));
5914
5959
  }
5915
5960
 
5916
- /*! @azure/msal-common v6.0.0 2022-01-04 */
5961
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
5917
5962
 
5918
5963
  /*
5919
5964
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5928,18 +5973,22 @@
5928
5973
  *
5929
5974
  * @returns Promise<string | null>
5930
5975
  */
5931
- RegionDiscovery.prototype.detectRegion = function (environmentRegion, regionDiscoveryMetadata) {
5976
+ RegionDiscovery.prototype.detectRegion = function (environmentRegion, regionDiscoveryMetadata, proxyUrl) {
5932
5977
  return __awaiter(this, void 0, void 0, function () {
5933
- var autodetectedRegionName, localIMDSVersionResponse, currentIMDSVersion, currentIMDSVersionResponse;
5978
+ var autodetectedRegionName, options, localIMDSVersionResponse, currentIMDSVersion, currentIMDSVersionResponse;
5934
5979
  return __generator(this, function (_a) {
5935
5980
  switch (_a.label) {
5936
5981
  case 0:
5937
5982
  autodetectedRegionName = environmentRegion;
5938
5983
  if (!!autodetectedRegionName) return [3 /*break*/, 8];
5984
+ options = RegionDiscovery.IMDS_OPTIONS;
5985
+ if (proxyUrl) {
5986
+ options.proxyUrl = proxyUrl;
5987
+ }
5939
5988
  _a.label = 1;
5940
5989
  case 1:
5941
5990
  _a.trys.push([1, 6, , 7]);
5942
- return [4 /*yield*/, this.getRegionFromIMDS(Constants.IMDS_VERSION)];
5991
+ return [4 /*yield*/, this.getRegionFromIMDS(Constants.IMDS_VERSION, options)];
5943
5992
  case 2:
5944
5993
  localIMDSVersionResponse = _a.sent();
5945
5994
  if (localIMDSVersionResponse.status === ResponseCodes.httpSuccess) {
@@ -5947,14 +5996,14 @@
5947
5996
  regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;
5948
5997
  }
5949
5998
  if (!(localIMDSVersionResponse.status === ResponseCodes.httpBadRequest)) return [3 /*break*/, 5];
5950
- return [4 /*yield*/, this.getCurrentVersion()];
5999
+ return [4 /*yield*/, this.getCurrentVersion(options)];
5951
6000
  case 3:
5952
6001
  currentIMDSVersion = _a.sent();
5953
6002
  if (!currentIMDSVersion) {
5954
6003
  regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;
5955
6004
  return [2 /*return*/, null];
5956
6005
  }
5957
- return [4 /*yield*/, this.getRegionFromIMDS(currentIMDSVersion)];
6006
+ return [4 /*yield*/, this.getRegionFromIMDS(currentIMDSVersion, options)];
5958
6007
  case 4:
5959
6008
  currentIMDSVersionResponse = _a.sent();
5960
6009
  if (currentIMDSVersionResponse.status === ResponseCodes.httpSuccess) {
@@ -5987,10 +6036,10 @@
5987
6036
  * @param imdsEndpointUrl
5988
6037
  * @returns Promise<NetworkResponse<string>>
5989
6038
  */
5990
- RegionDiscovery.prototype.getRegionFromIMDS = function (version) {
6039
+ RegionDiscovery.prototype.getRegionFromIMDS = function (version, options) {
5991
6040
  return __awaiter(this, void 0, void 0, function () {
5992
6041
  return __generator(this, function (_a) {
5993
- return [2 /*return*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + "?api-version=" + version + "&format=text", RegionDiscovery.IMDS_OPTIONS, Constants.IMDS_TIMEOUT)];
6042
+ return [2 /*return*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + "?api-version=" + version + "&format=text", options, Constants.IMDS_TIMEOUT)];
5994
6043
  });
5995
6044
  });
5996
6045
  };
@@ -5999,14 +6048,14 @@
5999
6048
  *
6000
6049
  * @returns Promise<string | null>
6001
6050
  */
6002
- RegionDiscovery.prototype.getCurrentVersion = function () {
6051
+ RegionDiscovery.prototype.getCurrentVersion = function (options) {
6003
6052
  return __awaiter(this, void 0, void 0, function () {
6004
6053
  var response;
6005
6054
  return __generator(this, function (_a) {
6006
6055
  switch (_a.label) {
6007
6056
  case 0:
6008
6057
  _a.trys.push([0, 2, , 3]);
6009
- return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + "?format=json", RegionDiscovery.IMDS_OPTIONS)];
6058
+ return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + "?format=json", options)];
6010
6059
  case 1:
6011
6060
  response = _a.sent();
6012
6061
  // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.
@@ -6023,11 +6072,15 @@
6023
6072
  });
6024
6073
  };
6025
6074
  // Options for the IMDS endpoint request
6026
- RegionDiscovery.IMDS_OPTIONS = { headers: { "Metadata": "true" } };
6075
+ RegionDiscovery.IMDS_OPTIONS = {
6076
+ headers: {
6077
+ Metadata: "true",
6078
+ },
6079
+ };
6027
6080
  return RegionDiscovery;
6028
6081
  }());
6029
6082
 
6030
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6083
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6031
6084
 
6032
6085
  /*
6033
6086
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6038,7 +6091,7 @@
6038
6091
  * endpoint. It will store the pertinent config data in this object for use during token calls.
6039
6092
  */
6040
6093
  var Authority = /** @class */ (function () {
6041
- function Authority(authority, networkInterface, cacheManager, authorityOptions) {
6094
+ function Authority(authority, networkInterface, cacheManager, authorityOptions, proxyUrl) {
6042
6095
  this.canonicalAuthority = authority;
6043
6096
  this._canonicalAuthority.validateAsUri();
6044
6097
  this.networkInterface = networkInterface;
@@ -6046,6 +6099,7 @@
6046
6099
  this.authorityOptions = authorityOptions;
6047
6100
  this.regionDiscovery = new RegionDiscovery(networkInterface);
6048
6101
  this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };
6102
+ this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;
6049
6103
  }
6050
6104
  Object.defineProperty(Authority.prototype, "authorityType", {
6051
6105
  // See above for AuthorityType
@@ -6314,7 +6368,7 @@
6314
6368
  metadata = _b.sent();
6315
6369
  if (!metadata) return [3 /*break*/, 4];
6316
6370
  if (!((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.azureRegion)) return [3 /*break*/, 3];
6317
- return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata)];
6371
+ return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl)];
6318
6372
  case 2:
6319
6373
  autodetectedRegionName = _b.sent();
6320
6374
  azureRegion = this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
@@ -6377,19 +6431,25 @@
6377
6431
  */
6378
6432
  Authority.prototype.getEndpointMetadataFromNetwork = function () {
6379
6433
  return __awaiter(this, void 0, void 0, function () {
6380
- var response;
6434
+ var options, response;
6381
6435
  return __generator(this, function (_a) {
6382
6436
  switch (_a.label) {
6383
6437
  case 0:
6384
- _a.trys.push([0, 2, , 3]);
6385
- return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint)];
6438
+ options = {};
6439
+ if (this.proxyUrl) {
6440
+ options.proxyUrl = this.proxyUrl;
6441
+ }
6442
+ _a.label = 1;
6386
6443
  case 1:
6444
+ _a.trys.push([1, 3, , 4]);
6445
+ return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];
6446
+ case 2:
6387
6447
  response = _a.sent();
6388
6448
  return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];
6389
- case 2:
6449
+ case 3:
6390
6450
  _a.sent();
6391
6451
  return [2 /*return*/, null];
6392
- case 3: return [2 /*return*/];
6452
+ case 4: return [2 /*return*/];
6393
6453
  }
6394
6454
  });
6395
6455
  });
@@ -6459,16 +6519,20 @@
6459
6519
  */
6460
6520
  Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
6461
6521
  return __awaiter(this, void 0, void 0, function () {
6462
- var instanceDiscoveryEndpoint, match, response, metadata;
6522
+ var instanceDiscoveryEndpoint, options, match, response, metadata;
6463
6523
  return __generator(this, function (_a) {
6464
6524
  switch (_a.label) {
6465
6525
  case 0:
6466
6526
  instanceDiscoveryEndpoint = "" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + "oauth2/v2.0/authorize";
6527
+ options = {};
6528
+ if (this.proxyUrl) {
6529
+ options.proxyUrl = this.proxyUrl;
6530
+ }
6467
6531
  match = null;
6468
6532
  _a.label = 1;
6469
6533
  case 1:
6470
6534
  _a.trys.push([1, 3, , 4]);
6471
- return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint)];
6535
+ return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
6472
6536
  case 2:
6473
6537
  response = _a.sent();
6474
6538
  metadata = isCloudInstanceDiscoveryResponse(response.body) ? response.body.metadata : [];
@@ -6483,7 +6547,7 @@
6483
6547
  return [2 /*return*/, null];
6484
6548
  case 4:
6485
6549
  if (!match) {
6486
- // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
6550
+ // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
6487
6551
  match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
6488
6552
  }
6489
6553
  return [2 /*return*/, match];
@@ -6501,6 +6565,19 @@
6501
6565
  });
6502
6566
  return matches.length > 0;
6503
6567
  };
6568
+ /**
6569
+ * helper function to populate the authority based on azureCloudOptions
6570
+ * @param authorityString
6571
+ * @param azureCloudOptions
6572
+ */
6573
+ Authority.generateAuthority = function (authorityString, azureCloudOptions) {
6574
+ var authorityAzureCloudInstance;
6575
+ if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== exports.AzureCloudInstance.None) {
6576
+ var tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;
6577
+ authorityAzureCloudInstance = azureCloudOptions.azureCloudInstance + "/" + tenant + "/";
6578
+ }
6579
+ return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;
6580
+ };
6504
6581
  /**
6505
6582
  * Creates cloud discovery metadata object from a given host
6506
6583
  * @param host
@@ -6593,7 +6670,7 @@
6593
6670
  return Authority;
6594
6671
  }());
6595
6672
 
6596
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6673
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6597
6674
 
6598
6675
  /*
6599
6676
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6612,13 +6689,13 @@
6612
6689
  * @param networkClient
6613
6690
  * @param protocolMode
6614
6691
  */
6615
- AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions) {
6692
+ AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions, proxyUrl) {
6616
6693
  return __awaiter(this, void 0, void 0, function () {
6617
6694
  var acquireTokenAuthority, e_1;
6618
6695
  return __generator(this, function (_a) {
6619
6696
  switch (_a.label) {
6620
6697
  case 0:
6621
- acquireTokenAuthority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions);
6698
+ acquireTokenAuthority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions, proxyUrl);
6622
6699
  _a.label = 1;
6623
6700
  case 1:
6624
6701
  _a.trys.push([1, 3, , 4]);
@@ -6644,17 +6721,17 @@
6644
6721
  * @param networkInterface
6645
6722
  * @param protocolMode
6646
6723
  */
6647
- AuthorityFactory.createInstance = function (authorityUrl, networkInterface, cacheManager, authorityOptions) {
6724
+ AuthorityFactory.createInstance = function (authorityUrl, networkInterface, cacheManager, authorityOptions, proxyUrl) {
6648
6725
  // Throw error if authority url is empty
6649
6726
  if (StringUtils.isEmpty(authorityUrl)) {
6650
6727
  throw ClientConfigurationError.createUrlEmptyError();
6651
6728
  }
6652
- return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions);
6729
+ return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, proxyUrl);
6653
6730
  };
6654
6731
  return AuthorityFactory;
6655
6732
  }());
6656
6733
 
6657
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6734
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6658
6735
 
6659
6736
  /*
6660
6737
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6685,7 +6762,7 @@
6685
6762
  return ServerTelemetryEntity;
6686
6763
  }());
6687
6764
 
6688
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6765
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6689
6766
 
6690
6767
  /*
6691
6768
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6713,7 +6790,7 @@
6713
6790
  return ThrottlingEntity;
6714
6791
  }());
6715
6792
 
6716
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6793
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6717
6794
 
6718
6795
  /*
6719
6796
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6730,7 +6807,7 @@
6730
6807
  }
6731
6808
  };
6732
6809
 
6733
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6810
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6734
6811
 
6735
6812
  /*
6736
6813
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6789,7 +6866,7 @@
6789
6866
  return AuthenticationHeaderParser;
6790
6867
  }());
6791
6868
 
6792
- /*! @azure/msal-common v6.0.0 2022-01-04 */
6869
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
6793
6870
 
6794
6871
  /*
6795
6872
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7005,7 +7082,7 @@
7005
7082
  /**
7006
7083
  * Temporary cache keys for MSAL, deleted after any request.
7007
7084
  */
7008
- var TemporaryCacheKeys;
7085
+ exports.TemporaryCacheKeys = void 0;
7009
7086
  (function (TemporaryCacheKeys) {
7010
7087
  TemporaryCacheKeys["AUTHORITY"] = "authority";
7011
7088
  TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
@@ -7020,7 +7097,7 @@
7020
7097
  TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
7021
7098
  TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
7022
7099
  TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
7023
- })(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
7100
+ })(exports.TemporaryCacheKeys || (exports.TemporaryCacheKeys = {}));
7024
7101
  /**
7025
7102
  * Cache keys stored in-memory
7026
7103
  */
@@ -7055,6 +7132,7 @@
7055
7132
  InteractionType["Redirect"] = "redirect";
7056
7133
  InteractionType["Popup"] = "popup";
7057
7134
  InteractionType["Silent"] = "silent";
7135
+ InteractionType["None"] = "none";
7058
7136
  })(exports.InteractionType || (exports.InteractionType = {}));
7059
7137
  /**
7060
7138
  * Types of interaction currently in progress.
@@ -9662,7 +9740,7 @@
9662
9740
  */
9663
9741
  BrowserCacheManager.prototype.generateAuthorityKey = function (stateString) {
9664
9742
  var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
9665
- return this.generateCacheKey(TemporaryCacheKeys.AUTHORITY + "." + stateId);
9743
+ return this.generateCacheKey(exports.TemporaryCacheKeys.AUTHORITY + "." + stateId);
9666
9744
  };
9667
9745
  /**
9668
9746
  * Create Nonce key to cache nonce
@@ -9670,7 +9748,7 @@
9670
9748
  */
9671
9749
  BrowserCacheManager.prototype.generateNonceKey = function (stateString) {
9672
9750
  var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
9673
- return this.generateCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN + "." + stateId);
9751
+ return this.generateCacheKey(exports.TemporaryCacheKeys.NONCE_IDTOKEN + "." + stateId);
9674
9752
  };
9675
9753
  /**
9676
9754
  * Creates full cache key for the request state
@@ -9679,7 +9757,7 @@
9679
9757
  BrowserCacheManager.prototype.generateStateKey = function (stateString) {
9680
9758
  // Use the library state id to key temp storage for uniqueness for multiple concurrent requests
9681
9759
  var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
9682
- return this.generateCacheKey(TemporaryCacheKeys.REQUEST_STATE + "." + stateId);
9760
+ return this.generateCacheKey(exports.TemporaryCacheKeys.REQUEST_STATE + "." + stateId);
9683
9761
  };
9684
9762
  /**
9685
9763
  * Gets the cached authority based on the cached state. Returns empty if no cached state found.
@@ -9714,14 +9792,14 @@
9714
9792
  credential: account.homeAccountId,
9715
9793
  type: CcsCredentialType.HOME_ACCOUNT_ID
9716
9794
  };
9717
- this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
9795
+ this.setTemporaryCache(exports.TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
9718
9796
  }
9719
9797
  else if (!StringUtils.isEmpty(loginHint)) {
9720
9798
  var ccsCredential = {
9721
9799
  credential: loginHint,
9722
9800
  type: CcsCredentialType.UPN
9723
9801
  };
9724
- this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
9802
+ this.setTemporaryCache(exports.TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
9725
9803
  }
9726
9804
  };
9727
9805
  /**
@@ -9745,11 +9823,11 @@
9745
9823
  this.removeItem(this.generateNonceKey(state));
9746
9824
  this.removeItem(this.generateAuthorityKey(state));
9747
9825
  }
9748
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
9749
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));
9750
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));
9751
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));
9752
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
9826
+ this.removeItem(this.generateCacheKey(exports.TemporaryCacheKeys.REQUEST_PARAMS));
9827
+ this.removeItem(this.generateCacheKey(exports.TemporaryCacheKeys.ORIGIN_URI));
9828
+ this.removeItem(this.generateCacheKey(exports.TemporaryCacheKeys.URL_HASH));
9829
+ this.removeItem(this.generateCacheKey(exports.TemporaryCacheKeys.CORRELATION_ID));
9830
+ this.removeItem(this.generateCacheKey(exports.TemporaryCacheKeys.CCS_CREDENTIAL));
9753
9831
  this.setInteractionInProgress(false);
9754
9832
  };
9755
9833
  /**
@@ -9778,7 +9856,7 @@
9778
9856
  // Loop through all keys to find state key
9779
9857
  this.getKeys().forEach(function (key) {
9780
9858
  // If this key is not the state key, move on
9781
- if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {
9859
+ if (key.indexOf(exports.TemporaryCacheKeys.REQUEST_STATE) === -1) {
9782
9860
  return;
9783
9861
  }
9784
9862
  // Retrieve state value, return if not a valid value
@@ -9799,7 +9877,7 @@
9799
9877
  BrowserCacheManager.prototype.cacheCodeRequest = function (authCodeRequest, browserCrypto) {
9800
9878
  this.logger.trace("BrowserCacheManager.cacheCodeRequest called");
9801
9879
  var encodedValue = browserCrypto.base64Encode(JSON.stringify(authCodeRequest));
9802
- this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);
9880
+ this.setTemporaryCache(exports.TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);
9803
9881
  };
9804
9882
  /**
9805
9883
  * Gets the token exchange parameters from the cache. Throws an error if nothing is found.
@@ -9807,7 +9885,7 @@
9807
9885
  BrowserCacheManager.prototype.getCachedRequest = function (state, browserCrypto) {
9808
9886
  this.logger.trace("BrowserCacheManager.getCachedRequest called");
9809
9887
  // Get token request from cache and parse as TokenExchangeParameters.
9810
- var encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);
9888
+ var encodedTokenRequest = this.getTemporaryCache(exports.TemporaryCacheKeys.REQUEST_PARAMS, true);
9811
9889
  if (!encodedTokenRequest) {
9812
9890
  throw BrowserAuthError.createNoTokenRequestCacheError();
9813
9891
  }
@@ -9815,7 +9893,7 @@
9815
9893
  if (!parsedRequest) {
9816
9894
  throw BrowserAuthError.createUnableToParseTokenRequestCacheError();
9817
9895
  }
9818
- this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
9896
+ this.removeItem(this.generateCacheKey(exports.TemporaryCacheKeys.REQUEST_PARAMS));
9819
9897
  // Get cached authority and use if no authority is cached with request.
9820
9898
  if (StringUtils.isEmpty(parsedRequest.authority)) {
9821
9899
  var authorityCacheKey = this.generateAuthorityKey(state);
@@ -9837,18 +9915,22 @@
9837
9915
  }
9838
9916
  };
9839
9917
  BrowserCacheManager.prototype.getInteractionInProgress = function () {
9840
- var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
9918
+ var key = Constants.CACHE_PREFIX + "." + exports.TemporaryCacheKeys.INTERACTION_STATUS_KEY;
9841
9919
  return this.getTemporaryCache(key, false);
9842
9920
  };
9843
9921
  BrowserCacheManager.prototype.setInteractionInProgress = function (inProgress) {
9844
- var clientId = this.getInteractionInProgress();
9845
9922
  // Ensure we don't overwrite interaction in progress for a different clientId
9846
- var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
9847
- if (inProgress && !clientId) {
9848
- // No interaction is in progress
9849
- this.setTemporaryCache(key, this.clientId, false);
9923
+ var key = Constants.CACHE_PREFIX + "." + exports.TemporaryCacheKeys.INTERACTION_STATUS_KEY;
9924
+ if (inProgress) {
9925
+ if (this.getInteractionInProgress()) {
9926
+ throw BrowserAuthError.createInteractionInProgressError();
9927
+ }
9928
+ else {
9929
+ // No interaction is in progress
9930
+ this.setTemporaryCache(key, this.clientId, false);
9931
+ }
9850
9932
  }
9851
- else if (!inProgress && clientId === this.clientId) {
9933
+ else if (!inProgress && this.getInteractionInProgress() === this.clientId) {
9852
9934
  this.removeItem(key);
9853
9935
  }
9854
9936
  };
@@ -10375,7 +10457,11 @@
10375
10457
  postLogoutRedirectUri: "",
10376
10458
  navigateToLoginRequestUrl: true,
10377
10459
  clientCapabilities: [],
10378
- protocolMode: exports.ProtocolMode.AAD
10460
+ protocolMode: exports.ProtocolMode.AAD,
10461
+ azureCloudOptions: {
10462
+ azureCloudInstance: exports.AzureCloudInstance.None,
10463
+ tenant: ""
10464
+ },
10379
10465
  };
10380
10466
  // Default cache options for browser
10381
10467
  var DEFAULT_CACHE_OPTIONS = {
@@ -10404,7 +10490,7 @@
10404
10490
 
10405
10491
  /* eslint-disable header/header */
10406
10492
  var name = "@azure/msal-browser";
10407
- var version = "2.21.0";
10493
+ var version = "2.22.0";
10408
10494
 
10409
10495
  /*
10410
10496
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10734,11 +10820,32 @@
10734
10820
  */
10735
10821
  StandardInteractionClient.prototype.initializeLogoutRequest = function (logoutRequest) {
10736
10822
  this.logger.verbose("initializeLogoutRequest called", logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.correlationId);
10737
- // Check if interaction is in progress. Throw error if true.
10738
- if (this.browserStorage.isInteractionInProgress()) {
10739
- throw BrowserAuthError.createInteractionInProgressError();
10740
- }
10741
10823
  var validLogoutRequest = __assign$1({ correlationId: this.browserCrypto.createNewGuid() }, logoutRequest);
10824
+ /**
10825
+ * Set logout_hint to be login_hint from ID Token Claims if present
10826
+ * and logoutHint attribute wasn't manually set in logout request
10827
+ */
10828
+ if (logoutRequest) {
10829
+ // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims
10830
+ if (!logoutRequest.logoutHint) {
10831
+ if (logoutRequest.account) {
10832
+ var logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);
10833
+ if (logoutHint) {
10834
+ this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided");
10835
+ validLogoutRequest.logoutHint = logoutHint;
10836
+ }
10837
+ }
10838
+ else {
10839
+ this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");
10840
+ }
10841
+ }
10842
+ else {
10843
+ this.logger.verbose("logoutHint has already been set in logoutRequest");
10844
+ }
10845
+ }
10846
+ else {
10847
+ this.logger.verbose("logoutHint will not be set since no logout request was configured");
10848
+ }
10742
10849
  /*
10743
10850
  * Only set redirect uri if logout request isn't provided or the set uri isn't null.
10744
10851
  * Otherwise, use passed uri, config, or current page.
@@ -10765,17 +10872,37 @@
10765
10872
  }
10766
10873
  return validLogoutRequest;
10767
10874
  };
10875
+ /**
10876
+ * Parses login_hint ID Token Claim out of AccountInfo object to be used as
10877
+ * logout_hint in end session request.
10878
+ * @param account
10879
+ */
10880
+ StandardInteractionClient.prototype.getLogoutHintFromIdTokenClaims = function (account) {
10881
+ var idTokenClaims = account.idTokenClaims;
10882
+ if (idTokenClaims) {
10883
+ if (idTokenClaims.login_hint) {
10884
+ return idTokenClaims.login_hint;
10885
+ }
10886
+ else {
10887
+ this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request");
10888
+ }
10889
+ }
10890
+ else {
10891
+ this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");
10892
+ }
10893
+ return null;
10894
+ };
10768
10895
  /**
10769
10896
  * Creates an Authorization Code Client with the given authority, or the default authority.
10770
10897
  * @param serverTelemetryManager
10771
10898
  * @param authorityUrl
10772
10899
  */
10773
- StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl) {
10900
+ StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
10774
10901
  return __awaiter$1(this, void 0, void 0, function () {
10775
10902
  var clientConfig;
10776
10903
  return __generator$1(this, function (_a) {
10777
10904
  switch (_a.label) {
10778
- case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
10905
+ case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions)];
10779
10906
  case 1:
10780
10907
  clientConfig = _a.sent();
10781
10908
  return [2 /*return*/, new AuthorizationCodeClient(clientConfig)];
@@ -10789,14 +10916,14 @@
10789
10916
  * @param requestAuthority
10790
10917
  * @param requestCorrelationId
10791
10918
  */
10792
- StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority) {
10919
+ StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
10793
10920
  return __awaiter$1(this, void 0, void 0, function () {
10794
10921
  var discoveredAuthority;
10795
10922
  return __generator$1(this, function (_a) {
10796
10923
  switch (_a.label) {
10797
10924
  case 0:
10798
10925
  this.logger.verbose("getClientConfiguration called");
10799
- return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority)];
10926
+ return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];
10800
10927
  case 1:
10801
10928
  discoveredAuthority = _a.sent();
10802
10929
  return [2 /*return*/, {
@@ -10856,9 +10983,9 @@
10856
10983
  * @param requestAuthority
10857
10984
  * @param requestCorrelationId
10858
10985
  */
10859
- StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority) {
10986
+ StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority, requestAzureCloudOptions) {
10860
10987
  return __awaiter$1(this, void 0, void 0, function () {
10861
- var authorityOptions;
10988
+ var authorityOptions, userAuthority, builtAuthority;
10862
10989
  return __generator$1(this, function (_a) {
10863
10990
  switch (_a.label) {
10864
10991
  case 0:
@@ -10867,38 +10994,12 @@
10867
10994
  protocolMode: this.config.auth.protocolMode,
10868
10995
  knownAuthorities: this.config.auth.knownAuthorities,
10869
10996
  cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
10870
- authorityMetadata: this.config.auth.authorityMetadata
10997
+ authorityMetadata: this.config.auth.authorityMetadata,
10871
10998
  };
10872
- if (!requestAuthority) return [3 /*break*/, 2];
10873
- this.logger.verbose("Creating discovered authority with request authority");
10874
- return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
10875
- case 1: return [2 /*return*/, _a.sent()];
10876
- case 2:
10999
+ userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;
11000
+ builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
10877
11001
  this.logger.verbose("Creating discovered authority with configured authority");
10878
- return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
10879
- case 3: return [2 /*return*/, _a.sent()];
10880
- }
10881
- });
10882
- });
10883
- };
10884
- /**
10885
- * Helper to validate app environment before making a request.
10886
- * @param request
10887
- * @param interactionType
10888
- */
10889
- StandardInteractionClient.prototype.preflightInteractiveRequest = function (request, interactionType) {
10890
- return __awaiter$1(this, void 0, void 0, function () {
10891
- return __generator$1(this, function (_a) {
10892
- switch (_a.label) {
10893
- case 0:
10894
- this.logger.verbose("preflightInteractiveRequest called, validating app environment", request === null || request === void 0 ? void 0 : request.correlationId);
10895
- // block the reload if it occurred inside a hidden iframe
10896
- BrowserUtils.blockReloadInHiddenIframes();
10897
- // Check if interaction is in progress. Throw error if true.
10898
- if (this.browserStorage.isInteractionInProgress(false)) {
10899
- throw BrowserAuthError.createInteractionInProgressError();
10900
- }
10901
- return [4 /*yield*/, this.initializeAuthorizationRequest(request, interactionType)];
11002
+ return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
10902
11003
  case 1: return [2 /*return*/, _a.sent()];
10903
11004
  }
10904
11005
  });
@@ -10920,7 +11021,7 @@
10920
11021
  browserState = {
10921
11022
  interactionType: interactionType
10922
11023
  };
10923
- state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || "", browserState);
11024
+ state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
10924
11025
  _a = [{}];
10925
11026
  return [4 /*yield*/, this.initializeBaseRequest(request)];
10926
11027
  case 1:
@@ -10938,7 +11039,6 @@
10938
11039
  validatedRequest.loginHint = legacyLoginHint;
10939
11040
  }
10940
11041
  }
10941
- this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || "", validatedRequest.account || null);
10942
11042
  return [2 /*return*/, validatedRequest];
10943
11043
  }
10944
11044
  });
@@ -11109,8 +11209,8 @@
11109
11209
  * @param clientId
11110
11210
  * @param request
11111
11211
  */
11112
- PopupUtils.generatePopupName = function (clientId, request) {
11113
- return BrowserConstants.POPUP_NAME_PREFIX + "." + clientId + "." + request.scopes.join("-") + "." + request.authority + "." + request.correlationId;
11212
+ PopupUtils.generatePopupName = function (clientId, scopes, authority, correlationId) {
11213
+ return BrowserConstants.POPUP_NAME_PREFIX + "." + clientId + "." + scopes.join("-") + "." + authority + "." + correlationId;
11114
11214
  };
11115
11215
  /**
11116
11216
  * Generates the name for the popup based on the client id and request for logouts
@@ -11243,7 +11343,7 @@
11243
11343
  */
11244
11344
  InteractionHandler.prototype.checkCcsCredentials = function () {
11245
11345
  // Look up ccs credential in temp cache
11246
- var cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);
11346
+ var cachedCcsCred = this.browserStorage.getTemporaryCache(exports.TemporaryCacheKeys.CCS_CREDENTIAL, true);
11247
11347
  if (cachedCcsCred) {
11248
11348
  try {
11249
11349
  return JSON.parse(cachedCcsCred);
@@ -11281,8 +11381,6 @@
11281
11381
  PopupHandler.prototype.initiateAuthRequest = function (requestUrl, params) {
11282
11382
  // Check that request url is not empty.
11283
11383
  if (!StringUtils.isEmpty(requestUrl)) {
11284
- // Set interaction status in the library.
11285
- this.browserStorage.setInteractionInProgress(true);
11286
11384
  this.browserRequestLogger.infoPii("Navigate to: " + requestUrl);
11287
11385
  // Open the popup window to requestUrl.
11288
11386
  return this.popupUtils.openPopup(requestUrl, params);
@@ -11332,36 +11430,25 @@
11332
11430
  * @param request
11333
11431
  */
11334
11432
  PopupClient.prototype.acquireToken = function (request) {
11335
- return __awaiter$1(this, void 0, void 0, function () {
11336
- var validRequest, popupName, popupWindowAttributes, popup, e_1;
11337
- return __generator$1(this, function (_a) {
11338
- switch (_a.label) {
11339
- case 0:
11340
- _a.trys.push([0, 2, , 3]);
11341
- return [4 /*yield*/, this.preflightInteractiveRequest(request, exports.InteractionType.Popup)];
11342
- case 1:
11343
- validRequest = _a.sent();
11344
- popupName = PopupUtils.generatePopupName(this.config.auth.clientId, validRequest);
11345
- popupWindowAttributes = request.popupWindowAttributes || {};
11346
- // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
11347
- if (this.config.system.asyncPopups) {
11348
- this.logger.verbose("asyncPopups set to true, acquiring token");
11349
- // Passes on popup position and dimensions if in request
11350
- return [2 /*return*/, this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes)];
11351
- }
11352
- else {
11353
- // asyncPopups flag is set to false. Opens popup before acquiring token.
11354
- this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
11355
- popup = PopupUtils.openSizedPopup("about:blank", popupName, popupWindowAttributes, this.logger);
11356
- return [2 /*return*/, this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes, popup)];
11357
- }
11358
- case 2:
11359
- e_1 = _a.sent();
11360
- return [2 /*return*/, Promise.reject(e_1)];
11361
- case 3: return [2 /*return*/];
11362
- }
11363
- });
11364
- });
11433
+ try {
11434
+ var popupName = PopupUtils.generatePopupName(this.config.auth.clientId, request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority, this.correlationId);
11435
+ var popupWindowAttributes = request.popupWindowAttributes || {};
11436
+ // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
11437
+ if (this.config.system.asyncPopups) {
11438
+ this.logger.verbose("asyncPopups set to true, acquiring token");
11439
+ // Passes on popup position and dimensions if in request
11440
+ return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);
11441
+ }
11442
+ else {
11443
+ // asyncPopups flag is set to false. Opens popup before acquiring token.
11444
+ this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
11445
+ var popup = PopupUtils.openSizedPopup("about:blank", popupName, popupWindowAttributes, this.logger);
11446
+ return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);
11447
+ }
11448
+ }
11449
+ catch (e) {
11450
+ return Promise.reject(e);
11451
+ }
11365
11452
  };
11366
11453
  /**
11367
11454
  * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
@@ -11402,26 +11489,30 @@
11402
11489
  *
11403
11490
  * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
11404
11491
  */
11405
- PopupClient.prototype.acquireTokenPopupAsync = function (validRequest, popupName, popupWindowAttributes, popup) {
11492
+ PopupClient.prototype.acquireTokenPopupAsync = function (request, popupName, popupWindowAttributes, popup) {
11406
11493
  return __awaiter$1(this, void 0, void 0, function () {
11407
- var serverTelemetryManager, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_2;
11494
+ var serverTelemetryManager, validRequest, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_1;
11408
11495
  return __generator$1(this, function (_a) {
11409
11496
  switch (_a.label) {
11410
11497
  case 0:
11411
11498
  this.logger.verbose("acquireTokenPopupAsync called");
11412
11499
  serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenPopup);
11413
- _a.label = 1;
11500
+ return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Popup)];
11414
11501
  case 1:
11415
- _a.trys.push([1, 7, , 8]);
11416
- return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
11502
+ validRequest = _a.sent();
11503
+ this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
11504
+ _a.label = 2;
11417
11505
  case 2:
11418
- authCodeRequest = _a.sent();
11419
- return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
11506
+ _a.trys.push([2, 8, , 9]);
11507
+ return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
11420
11508
  case 3:
11509
+ authCodeRequest = _a.sent();
11510
+ return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
11511
+ case 4:
11421
11512
  authClient = _a.sent();
11422
11513
  this.logger.verbose("Auth code client created");
11423
11514
  return [4 /*yield*/, authClient.getAuthCodeUrl(validRequest)];
11424
- case 4:
11515
+ case 5:
11425
11516
  navigateUrl = _a.sent();
11426
11517
  interactionHandler = new PopupHandler(authClient, this.browserStorage, authCodeRequest, this.logger);
11427
11518
  popupParameters = {
@@ -11432,28 +11523,28 @@
11432
11523
  popupWindow = interactionHandler.initiateAuthRequest(navigateUrl, popupParameters);
11433
11524
  this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow: popupWindow }, null);
11434
11525
  return [4 /*yield*/, interactionHandler.monitorPopupForHash(popupWindow)];
11435
- case 5:
11526
+ case 6:
11436
11527
  hash = _a.sent();
11437
11528
  state = this.validateAndExtractStateFromHash(hash, exports.InteractionType.Popup, validRequest.correlationId);
11438
11529
  // Remove throttle if it exists
11439
11530
  ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);
11440
11531
  return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
11441
- case 6:
11532
+ case 7:
11442
11533
  result = _a.sent();
11443
11534
  return [2 /*return*/, result];
11444
- case 7:
11445
- e_2 = _a.sent();
11535
+ case 8:
11536
+ e_1 = _a.sent();
11446
11537
  if (popup) {
11447
11538
  // Close the synchronous popup if an error is thrown before the window unload event is registered
11448
11539
  popup.close();
11449
11540
  }
11450
- if (e_2 instanceof AuthError) {
11451
- e_2.setCorrelationId(this.correlationId);
11541
+ if (e_1 instanceof AuthError) {
11542
+ e_1.setCorrelationId(this.correlationId);
11452
11543
  }
11453
- serverTelemetryManager.cacheFailedRequest(e_2);
11544
+ serverTelemetryManager.cacheFailedRequest(e_1);
11454
11545
  this.browserStorage.cleanRequestByState(validRequest.state);
11455
- throw e_2;
11456
- case 8: return [2 /*return*/];
11546
+ throw e_1;
11547
+ case 9: return [2 /*return*/];
11457
11548
  }
11458
11549
  });
11459
11550
  });
@@ -11469,7 +11560,7 @@
11469
11560
  */
11470
11561
  PopupClient.prototype.logoutPopupAsync = function (validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {
11471
11562
  return __awaiter$1(this, void 0, void 0, function () {
11472
- var serverTelemetryManager, authClient, logoutUri, popupUtils, popupWindow, e_3, navigationOptions, absoluteUrl, e_4;
11563
+ var serverTelemetryManager, authClient, logoutUri, popupUtils, popupWindow, e_2, navigationOptions, absoluteUrl, e_3;
11473
11564
  return __generator$1(this, function (_a) {
11474
11565
  switch (_a.label) {
11475
11566
  case 0:
@@ -11484,7 +11575,6 @@
11484
11575
  case 2:
11485
11576
  // Clear cache on logout
11486
11577
  _a.sent();
11487
- this.browserStorage.setInteractionInProgress(true);
11488
11578
  return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, requestAuthority)];
11489
11579
  case 3:
11490
11580
  authClient = _a.sent();
@@ -11505,8 +11595,8 @@
11505
11595
  this.logger.verbose("Popup successfully redirected to postLogoutRedirectUri");
11506
11596
  return [3 /*break*/, 7];
11507
11597
  case 6:
11508
- e_3 = _a.sent();
11509
- this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: " + e_3);
11598
+ e_2 = _a.sent();
11599
+ this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: " + e_2);
11510
11600
  return [3 /*break*/, 7];
11511
11601
  case 7:
11512
11602
  popupUtils.cleanPopup(popupWindow);
@@ -11518,7 +11608,7 @@
11518
11608
  };
11519
11609
  absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());
11520
11610
  this.logger.verbose("Redirecting main window to url specified in the request");
11521
- this.logger.verbosePii("Redirecing main window to: " + absoluteUrl);
11611
+ this.logger.verbosePii("Redirecting main window to: " + absoluteUrl);
11522
11612
  this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);
11523
11613
  }
11524
11614
  else {
@@ -11526,19 +11616,19 @@
11526
11616
  }
11527
11617
  return [3 /*break*/, 9];
11528
11618
  case 8:
11529
- e_4 = _a.sent();
11619
+ e_3 = _a.sent();
11530
11620
  if (popup) {
11531
11621
  // Close the synchronous popup if an error is thrown before the window unload event is registered
11532
11622
  popup.close();
11533
11623
  }
11534
- if (e_4 instanceof AuthError) {
11535
- e_4.setCorrelationId(this.correlationId);
11624
+ if (e_3 instanceof AuthError) {
11625
+ e_3.setCorrelationId(this.correlationId);
11536
11626
  }
11537
11627
  this.browserStorage.setInteractionInProgress(false);
11538
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e_4);
11628
+ this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e_3);
11539
11629
  this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
11540
- serverTelemetryManager.cacheFailedRequest(e_4);
11541
- throw e_4;
11630
+ serverTelemetryManager.cacheFailedRequest(e_3);
11631
+ throw e_3;
11542
11632
  case 9:
11543
11633
  this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
11544
11634
  return [2 /*return*/];
@@ -11575,11 +11665,10 @@
11575
11665
  // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true
11576
11666
  if (params.redirectStartPage) {
11577
11667
  this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page");
11578
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);
11668
+ this.browserStorage.setTemporaryCache(exports.TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);
11579
11669
  }
11580
11670
  // Set interaction status in the library.
11581
- this.browserStorage.setInteractionInProgress(true);
11582
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);
11671
+ this.browserStorage.setTemporaryCache(exports.TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);
11583
11672
  this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);
11584
11673
  this.browserRequestLogger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: " + requestUrl);
11585
11674
  navigationOptions = {
@@ -11696,9 +11785,10 @@
11696
11785
  var validRequest, serverTelemetryManager, authCodeRequest, authClient, interactionHandler, navigateUrl, redirectStartPage, e_1;
11697
11786
  return __generator$1(this, function (_a) {
11698
11787
  switch (_a.label) {
11699
- case 0: return [4 /*yield*/, this.preflightInteractiveRequest(request, exports.InteractionType.Redirect)];
11788
+ case 0: return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Redirect)];
11700
11789
  case 1:
11701
11790
  validRequest = _a.sent();
11791
+ this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
11702
11792
  serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenRedirect);
11703
11793
  _a.label = 2;
11704
11794
  case 2:
@@ -11706,7 +11796,7 @@
11706
11796
  return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
11707
11797
  case 3:
11708
11798
  authCodeRequest = _a.sent();
11709
- return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
11799
+ return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
11710
11800
  case 4:
11711
11801
  authClient = _a.sent();
11712
11802
  this.logger.verbose("Auth code client created");
@@ -11768,7 +11858,6 @@
11768
11858
  state = void 0;
11769
11859
  try {
11770
11860
  state = this.validateAndExtractStateFromHash(responseHash, exports.InteractionType.Redirect);
11771
- BrowserUtils.clearHash(window);
11772
11861
  this.logger.verbose("State extracted from hash");
11773
11862
  }
11774
11863
  catch (e) {
@@ -11776,7 +11865,7 @@
11776
11865
  this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
11777
11866
  return [2 /*return*/, null];
11778
11867
  }
11779
- loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || "";
11868
+ loginRequestUrl = this.browserStorage.getTemporaryCache(exports.TemporaryCacheKeys.ORIGIN_URI, true) || "";
11780
11869
  loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);
11781
11870
  currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);
11782
11871
  if (!(loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl)) return [3 /*break*/, 3];
@@ -11800,7 +11889,7 @@
11800
11889
  * Returned from authority using redirect - need to perform navigation before processing response
11801
11890
  * Cache the hash to be retrieved after the next redirect
11802
11891
  */
11803
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);
11892
+ this.browserStorage.setTemporaryCache(exports.TemporaryCacheKeys.URL_HASH, responseHash, true);
11804
11893
  navigationOptions = {
11805
11894
  apiId: exports.ApiId.handleRedirectPromise,
11806
11895
  timeout: this.config.system.redirectNavigationTimeout,
@@ -11810,7 +11899,7 @@
11810
11899
  if (!(!loginRequestUrl || loginRequestUrl === "null")) return [3 /*break*/, 6];
11811
11900
  homepage = BrowserUtils.getHomepage();
11812
11901
  // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage
11813
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);
11902
+ this.browserStorage.setTemporaryCache(exports.TemporaryCacheKeys.ORIGIN_URI, homepage, true);
11814
11903
  this.logger.warning("Unable to get valid login request url from cache, redirecting to home page");
11815
11904
  return [4 /*yield*/, this.navigationClient.navigateInternal(homepage, navigationOptions)];
11816
11905
  case 5:
@@ -11852,12 +11941,13 @@
11852
11941
  this.logger.verbose("getRedirectResponseHash called");
11853
11942
  // Get current location hash from window or cache.
11854
11943
  var isResponseHash = UrlString.hashContainsKnownProperties(hash);
11855
- var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
11856
- this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
11857
11944
  if (isResponseHash) {
11945
+ BrowserUtils.clearHash(window);
11858
11946
  this.logger.verbose("Hash contains known properties, returning response hash");
11859
11947
  return hash;
11860
11948
  }
11949
+ var cachedHash = this.browserStorage.getTemporaryCache(exports.TemporaryCacheKeys.URL_HASH, true);
11950
+ this.browserStorage.removeItem(this.browserStorage.generateCacheKey(exports.TemporaryCacheKeys.URL_HASH));
11861
11951
  this.logger.verbose("Hash does not contain known properties, returning cached hash");
11862
11952
  return cachedHash;
11863
11953
  };
@@ -12152,6 +12242,7 @@
12152
12242
  return [4 /*yield*/, this.initializeAuthorizationRequest(__assign$1(__assign$1({}, request), { prompt: PromptValue.NONE }), exports.InteractionType.Silent)];
12153
12243
  case 1:
12154
12244
  silentRequest = _a.sent();
12245
+ this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null);
12155
12246
  serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
12156
12247
  _a.label = 2;
12157
12248
  case 2:
@@ -12159,7 +12250,7 @@
12159
12250
  return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
12160
12251
  case 3:
12161
12252
  authCodeRequest = _a.sent();
12162
- return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority)];
12253
+ return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
12163
12254
  case 4:
12164
12255
  authClient = _a.sent();
12165
12256
  this.logger.verbose("Auth code client created");
@@ -12242,7 +12333,7 @@
12242
12333
  case 1:
12243
12334
  silentRequest = __assign$1.apply(void 0, _a.concat([_b.sent()]));
12244
12335
  serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
12245
- return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority)];
12336
+ return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
12246
12337
  case 2:
12247
12338
  refreshTokenClient = _b.sent();
12248
12339
  this.logger.verbose("Refresh token client created");
@@ -12270,12 +12361,12 @@
12270
12361
  * @param serverTelemetryManager
12271
12362
  * @param authorityUrl
12272
12363
  */
12273
- SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl) {
12364
+ SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
12274
12365
  return __awaiter$1(this, void 0, void 0, function () {
12275
12366
  var clientConfig;
12276
12367
  return __generator$1(this, function (_a) {
12277
12368
  switch (_a.label) {
12278
- case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
12369
+ case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
12279
12370
  case 1:
12280
12371
  clientConfig = _a.sent();
12281
12372
  return [2 /*return*/, new RefreshTokenClient(clientConfig)];
@@ -12318,13 +12409,14 @@
12318
12409
  this.loadAccessToken(request, response, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);
12319
12410
  }
12320
12411
  else if (request.authority) {
12412
+ var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);
12321
12413
  var authorityOptions = {
12322
12414
  protocolMode: this.config.auth.protocolMode,
12323
12415
  knownAuthorities: this.config.auth.knownAuthorities,
12324
12416
  cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
12325
- authorityMetadata: this.config.auth.authorityMetadata
12417
+ authorityMetadata: this.config.auth.authorityMetadata,
12326
12418
  };
12327
- var authority = new Authority(request.authority, this.config.system.networkClient, this.storage, authorityOptions);
12419
+ var authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
12328
12420
  // "clientInfo" from options takes precedence over "clientInfo" in response
12329
12421
  if (options.clientInfo) {
12330
12422
  this.logger.trace("TokenCache - homeAccountId from options");
@@ -12446,6 +12538,7 @@
12446
12538
  return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Silent)];
12447
12539
  case 1:
12448
12540
  silentRequest = _a.sent();
12541
+ this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null);
12449
12542
  serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
12450
12543
  _a.label = 2;
12451
12544
  case 2:
@@ -12563,7 +12656,7 @@
12563
12656
  if (typeof response === "undefined") {
12564
12657
  this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_START, exports.InteractionType.Redirect);
12565
12658
  this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");
12566
- correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || "";
12659
+ correlationId = this.browserStorage.getTemporaryCache(exports.TemporaryCacheKeys.CORRELATION_ID, true) || "";
12567
12660
  redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, correlationId);
12568
12661
  response = redirectClient.handleRedirectPromise(hash)
12569
12662
  .then(function (result) {
@@ -12620,8 +12713,8 @@
12620
12713
  var _this = this;
12621
12714
  return __generator$1(this, function (_a) {
12622
12715
  // Preflight request
12623
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Redirect);
12624
12716
  this.logger.verbose("acquireTokenRedirect called");
12717
+ this.preflightBrowserEnvironmentCheck(exports.InteractionType.Redirect);
12625
12718
  isLoggedIn = this.getAllAccounts().length > 0;
12626
12719
  if (isLoggedIn) {
12627
12720
  this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Redirect, request);
@@ -12655,8 +12748,8 @@
12655
12748
  ClientApplication.prototype.acquireTokenPopup = function (request) {
12656
12749
  var _this = this;
12657
12750
  try {
12658
- this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
12659
12751
  this.logger.verbose("acquireTokenPopup called", request.correlationId);
12752
+ this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
12660
12753
  }
12661
12754
  catch (e) {
12662
12755
  // Since this function is syncronous we need to reject
@@ -12991,6 +13084,21 @@
12991
13084
  !this.config.cache.storeAuthStateInCookie) {
12992
13085
  throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();
12993
13086
  }
13087
+ if (interactionType === exports.InteractionType.Redirect || interactionType === exports.InteractionType.Popup) {
13088
+ this.preflightInteractiveRequest();
13089
+ }
13090
+ };
13091
+ /**
13092
+ * Helper to validate app environment before making a request.
13093
+ * @param request
13094
+ * @param interactionType
13095
+ */
13096
+ ClientApplication.prototype.preflightInteractiveRequest = function () {
13097
+ this.logger.verbose("preflightInteractiveRequest called, validating app environment");
13098
+ // block the reload if it occurred inside a hidden iframe
13099
+ BrowserUtils.blockReloadInHiddenIframes();
13100
+ // Set interaction in progress temporary cache or throw if alread set.
13101
+ this.browserStorage.setInteractionInProgress(true);
12994
13102
  };
12995
13103
  /**
12996
13104
  * Adds event callbacks to array
@@ -13082,7 +13190,7 @@
13082
13190
  switch (_a.label) {
13083
13191
  case 0:
13084
13192
  serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
13085
- return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority)];
13193
+ return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
13086
13194
  case 1:
13087
13195
  silentAuthClient = _a.sent();
13088
13196
  this.logger.verbose("Silent auth client created");
@@ -13117,12 +13225,12 @@
13117
13225
  * @param serverTelemetryManager
13118
13226
  * @param authorityUrl
13119
13227
  */
13120
- SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl) {
13228
+ SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
13121
13229
  return __awaiter$1(this, void 0, void 0, function () {
13122
13230
  var clientConfig;
13123
13231
  return __generator$1(this, function (_a) {
13124
13232
  switch (_a.label) {
13125
- case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
13233
+ case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
13126
13234
  case 1:
13127
13235
  clientConfig = _a.sent();
13128
13236
  return [2 /*return*/, new SilentFlowClient(clientConfig)];
@@ -13525,21 +13633,34 @@
13525
13633
  exports.AuthenticationHeaderParser = AuthenticationHeaderParser;
13526
13634
  exports.BrowserAuthError = BrowserAuthError;
13527
13635
  exports.BrowserAuthErrorMessage = BrowserAuthErrorMessage;
13636
+ exports.BrowserCacheManager = BrowserCacheManager;
13528
13637
  exports.BrowserConfigurationAuthError = BrowserConfigurationAuthError;
13529
13638
  exports.BrowserConfigurationAuthErrorMessage = BrowserConfigurationAuthErrorMessage;
13639
+ exports.BrowserConstants = BrowserConstants;
13530
13640
  exports.BrowserUtils = BrowserUtils;
13531
13641
  exports.ClientAuthError = ClientAuthError;
13532
13642
  exports.ClientAuthErrorMessage = ClientAuthErrorMessage;
13533
13643
  exports.ClientConfigurationError = ClientConfigurationError;
13534
13644
  exports.ClientConfigurationErrorMessage = ClientConfigurationErrorMessage;
13645
+ exports.DEFAULT_IFRAME_TIMEOUT_MS = DEFAULT_IFRAME_TIMEOUT_MS;
13646
+ exports.EventHandler = EventHandler;
13535
13647
  exports.EventMessageUtils = EventMessageUtils;
13536
13648
  exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
13537
13649
  exports.InteractionRequiredAuthErrorMessage = InteractionRequiredAuthErrorMessage;
13538
13650
  exports.Logger = Logger;
13539
13651
  exports.NavigationClient = NavigationClient;
13652
+ exports.OIDC_DEFAULT_SCOPES = OIDC_DEFAULT_SCOPES;
13653
+ exports.PopupClient = PopupClient;
13654
+ exports.PopupUtils = PopupUtils;
13540
13655
  exports.PublicClientApplication = PublicClientApplication;
13656
+ exports.RedirectClient = RedirectClient;
13657
+ exports.RedirectHandler = RedirectHandler;
13541
13658
  exports.ServerError = ServerError;
13542
13659
  exports.SignedHttpRequest = SignedHttpRequest;
13660
+ exports.SilentCacheClient = SilentCacheClient;
13661
+ exports.SilentIframeClient = SilentIframeClient;
13662
+ exports.SilentRefreshClient = SilentRefreshClient;
13663
+ exports.StandardInteractionClient = StandardInteractionClient;
13543
13664
  exports.StringUtils = StringUtils;
13544
13665
  exports.UrlString = UrlString;
13545
13666
  exports.stubbedPublicClientApplication = stubbedPublicClientApplication;