@azure/msal-browser 2.36.0 → 2.37.1

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 (79) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.js +1 -1
  4. package/dist/app/IPublicClientApplication.js +1 -1
  5. package/dist/app/PublicClientApplication.js +1 -1
  6. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  7. package/dist/cache/AsyncMemoryStorage.js +1 -1
  8. package/dist/cache/BrowserCacheManager.js +1 -1
  9. package/dist/cache/BrowserStorage.js +1 -1
  10. package/dist/cache/CryptoKeyStore.js +1 -1
  11. package/dist/cache/DatabaseStorage.js +1 -1
  12. package/dist/cache/MemoryStorage.js +1 -1
  13. package/dist/cache/TokenCache.js +1 -1
  14. package/dist/config/Configuration.js +1 -1
  15. package/dist/crypto/BrowserCrypto.js +1 -1
  16. package/dist/crypto/CryptoOps.js +1 -1
  17. package/dist/crypto/GuidGenerator.js +1 -1
  18. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  19. package/dist/crypto/MsBrowserCrypto.js +1 -1
  20. package/dist/crypto/MsrBrowserCrypto.js +1 -1
  21. package/dist/crypto/PkceGenerator.js +1 -1
  22. package/dist/crypto/SignedHttpRequest.js +1 -1
  23. package/dist/encode/Base64Decode.js +1 -1
  24. package/dist/encode/Base64Encode.js +1 -1
  25. package/dist/error/BrowserAuthError.js +1 -1
  26. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  27. package/dist/error/NativeAuthError.js +1 -1
  28. package/dist/event/EventHandler.js +1 -1
  29. package/dist/event/EventMessage.d.ts.map +1 -1
  30. package/dist/event/EventMessage.js +2 -1
  31. package/dist/event/EventMessage.js.map +1 -1
  32. package/dist/event/EventType.d.ts +2 -1
  33. package/dist/event/EventType.d.ts.map +1 -1
  34. package/dist/event/EventType.js +2 -1
  35. package/dist/event/EventType.js.map +1 -1
  36. package/dist/index.cjs.js +229 -113
  37. package/dist/index.cjs.js.map +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/interaction_client/BaseInteractionClient.d.ts +2 -1
  40. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  41. package/dist/interaction_client/BaseInteractionClient.js +33 -7
  42. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  43. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  44. package/dist/interaction_client/NativeInteractionClient.d.ts +1 -1
  45. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  46. package/dist/interaction_client/NativeInteractionClient.js +22 -15
  47. package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
  48. package/dist/interaction_client/PopupClient.js +1 -1
  49. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  50. package/dist/interaction_client/RedirectClient.js +3 -2
  51. package/dist/interaction_client/RedirectClient.js.map +1 -1
  52. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  53. package/dist/interaction_client/SilentCacheClient.js +2 -2
  54. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  55. package/dist/interaction_client/SilentIframeClient.js +1 -1
  56. package/dist/interaction_client/SilentRefreshClient.js +2 -2
  57. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  58. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  59. package/dist/interaction_handler/InteractionHandler.js +1 -1
  60. package/dist/interaction_handler/RedirectHandler.js +1 -1
  61. package/dist/interaction_handler/SilentHandler.js +1 -1
  62. package/dist/internals.js +1 -1
  63. package/dist/navigation/NavigationClient.js +1 -1
  64. package/dist/network/FetchClient.js +1 -1
  65. package/dist/network/XhrClient.js +1 -1
  66. package/dist/packageMetadata.d.ts +1 -1
  67. package/dist/packageMetadata.js +2 -2
  68. package/dist/packageMetadata.js.map +1 -1
  69. package/dist/telemetry/BrowserPerformanceClient.js +1 -1
  70. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  71. package/dist/utils/BrowserConstants.js +1 -1
  72. package/dist/utils/BrowserProtocolUtils.js +1 -1
  73. package/dist/utils/BrowserStringUtils.js +1 -1
  74. package/dist/utils/BrowserUtils.js +1 -1
  75. package/dist/utils/MathUtils.js +1 -1
  76. package/lib/msal-browser.js +229 -113
  77. package/lib/msal-browser.js.map +1 -1
  78. package/lib/msal-browser.min.js +35 -35
  79. package/package.json +2 -2
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.36.0 2023-04-18 */
1
+ /*! @azure/msal-browser v2.37.1 2023-06-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -117,7 +117,7 @@ function __spread() {
117
117
  return ar;
118
118
  }
119
119
 
120
- /*! @azure/msal-common v12.0.0 2023-04-03 */
120
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
121
121
  /*! *****************************************************************************
122
122
  Copyright (c) Microsoft Corporation.
123
123
 
@@ -204,7 +204,7 @@ function __spreadArrays() {
204
204
  return r;
205
205
  }
206
206
 
207
- /*! @azure/msal-common v12.0.0 2023-04-03 */
207
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
208
208
 
209
209
  /*
210
210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -224,6 +224,9 @@ var Constants = {
224
224
  DSTS: "dstsv2",
225
225
  // Default AAD Instance Discovery Endpoint
226
226
  AAD_INSTANCE_DISCOVERY_ENDPT: "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",
227
+ // CIAM URL
228
+ CIAM_AUTH_URL: ".ciamlogin.com",
229
+ AAD_TENANT_DOMAIN_SUFFIX: ".onmicrosoft.com",
227
230
  // Resource delimiter - used for certain cache entries
228
231
  RESOURCE_DELIM: "|",
229
232
  // Placeholder for non-existent account ids/objects
@@ -573,7 +576,7 @@ var JsonTypes;
573
576
  JsonTypes["Pop"] = "pop";
574
577
  })(JsonTypes || (JsonTypes = {}));
575
578
 
576
- /*! @azure/msal-common v12.0.0 2023-04-03 */
579
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
577
580
 
578
581
  /*
579
582
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -629,7 +632,7 @@ var AuthError = /** @class */ (function (_super) {
629
632
  return AuthError;
630
633
  }(Error));
631
634
 
632
- /*! @azure/msal-common v12.0.0 2023-04-03 */
635
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
633
636
 
634
637
  /*
635
638
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -704,7 +707,7 @@ var DEFAULT_CRYPTO_IMPLEMENTATION = {
704
707
  }
705
708
  };
706
709
 
707
- /*! @azure/msal-common v12.0.0 2023-04-03 */
710
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
708
711
 
709
712
  /*
710
713
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1219,7 +1222,7 @@ var ClientAuthError = /** @class */ (function (_super) {
1219
1222
  return ClientAuthError;
1220
1223
  }(AuthError));
1221
1224
 
1222
- /*! @azure/msal-common v12.0.0 2023-04-03 */
1225
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
1223
1226
 
1224
1227
  /*
1225
1228
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1344,7 +1347,7 @@ var StringUtils = /** @class */ (function () {
1344
1347
  return StringUtils;
1345
1348
  }());
1346
1349
 
1347
- /*! @azure/msal-common v12.0.0 2023-04-03 */
1350
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
1348
1351
 
1349
1352
  /*
1350
1353
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1534,12 +1537,12 @@ var Logger = /** @class */ (function () {
1534
1537
  return Logger;
1535
1538
  }());
1536
1539
 
1537
- /*! @azure/msal-common v12.0.0 2023-04-03 */
1540
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
1538
1541
  /* eslint-disable header/header */
1539
1542
  var name$1 = "@azure/msal-common";
1540
- var version$1 = "12.0.0";
1543
+ var version$1 = "13.1.0";
1541
1544
 
1542
- /*! @azure/msal-common v12.0.0 2023-04-03 */
1545
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
1543
1546
  /*
1544
1547
  * Copyright (c) Microsoft Corporation. All rights reserved.
1545
1548
  * Licensed under the MIT License.
@@ -1560,7 +1563,7 @@ exports.AzureCloudInstance = void 0;
1560
1563
  AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1561
1564
  })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1562
1565
 
1563
- /*! @azure/msal-common v12.0.0 2023-04-03 */
1566
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
1564
1567
 
1565
1568
  /*
1566
1569
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1661,6 +1664,10 @@ var ClientConfigurationErrorMessage = {
1661
1664
  invalidAuthenticationHeader: {
1662
1665
  code: "invalid_authentication_header",
1663
1666
  desc: "Invalid authentication header provided"
1667
+ },
1668
+ authorityMismatch: {
1669
+ code: "authority_mismatch",
1670
+ desc: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."
1664
1671
  }
1665
1672
  };
1666
1673
  /**
@@ -1812,10 +1819,16 @@ var ClientConfigurationError = /** @class */ (function (_super) {
1812
1819
  ClientConfigurationError.createInvalidAuthenticationHeaderError = function (invalidHeaderName, details) {
1813
1820
  return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code, ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc + ". Invalid header: " + invalidHeaderName + ". Details: " + details);
1814
1821
  };
1822
+ /**
1823
+ * Create an error when the authority provided in request does not match authority provided in account or MSAL.js configuration.
1824
+ */
1825
+ ClientConfigurationError.createAuthorityMismatchError = function () {
1826
+ return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityMismatch.code, ClientConfigurationErrorMessage.authorityMismatch.desc);
1827
+ };
1815
1828
  return ClientConfigurationError;
1816
1829
  }(ClientAuthError));
1817
1830
 
1818
- /*! @azure/msal-common v12.0.0 2023-04-03 */
1831
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
1819
1832
 
1820
1833
  /*
1821
1834
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2014,7 +2027,7 @@ var ScopeSet = /** @class */ (function () {
2014
2027
  return ScopeSet;
2015
2028
  }());
2016
2029
 
2017
- /*! @azure/msal-common v12.0.0 2023-04-03 */
2030
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
2018
2031
 
2019
2032
  /*
2020
2033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2052,7 +2065,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2052
2065
  };
2053
2066
  }
2054
2067
 
2055
- /*! @azure/msal-common v12.0.0 2023-04-03 */
2068
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
2056
2069
  /*
2057
2070
  * Copyright (c) Microsoft Corporation. All rights reserved.
2058
2071
  * Licensed under the MIT License.
@@ -2065,9 +2078,10 @@ var AuthorityType;
2065
2078
  AuthorityType[AuthorityType["Default"] = 0] = "Default";
2066
2079
  AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
2067
2080
  AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
2081
+ AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
2068
2082
  })(AuthorityType || (AuthorityType = {}));
2069
2083
 
2070
- /*! @azure/msal-common v12.0.0 2023-04-03 */
2084
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
2071
2085
 
2072
2086
  /*
2073
2087
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2306,7 +2320,7 @@ var AccountEntity = /** @class */ (function () {
2306
2320
  return AccountEntity;
2307
2321
  }());
2308
2322
 
2309
- /*! @azure/msal-common v12.0.0 2023-04-03 */
2323
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
2310
2324
 
2311
2325
  /*
2312
2326
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2358,7 +2372,7 @@ var AuthToken = /** @class */ (function () {
2358
2372
  return AuthToken;
2359
2373
  }());
2360
2374
 
2361
- /*! @azure/msal-common v12.0.0 2023-04-03 */
2375
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
2362
2376
 
2363
2377
  /*
2364
2378
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3406,7 +3420,7 @@ var DefaultStorageClass = /** @class */ (function (_super) {
3406
3420
  return DefaultStorageClass;
3407
3421
  }(CacheManager));
3408
3422
 
3409
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3423
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3410
3424
 
3411
3425
  /*
3412
3426
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3499,7 +3513,7 @@ function buildAuthOptions(authOptions) {
3499
3513
  return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
3500
3514
  }
3501
3515
 
3502
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3516
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3503
3517
 
3504
3518
  /*
3505
3519
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3519,7 +3533,7 @@ var ServerError = /** @class */ (function (_super) {
3519
3533
  return ServerError;
3520
3534
  }(AuthError));
3521
3535
 
3522
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3536
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3523
3537
 
3524
3538
  /*
3525
3539
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3615,7 +3629,7 @@ var ThrottlingUtils = /** @class */ (function () {
3615
3629
  return ThrottlingUtils;
3616
3630
  }());
3617
3631
 
3618
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3632
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3619
3633
 
3620
3634
  /*
3621
3635
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3664,7 +3678,7 @@ var NetworkManager = /** @class */ (function () {
3664
3678
  return NetworkManager;
3665
3679
  }());
3666
3680
 
3667
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3681
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3668
3682
  /*
3669
3683
  * Copyright (c) Microsoft Corporation. All rights reserved.
3670
3684
  * Licensed under the MIT License.
@@ -3675,7 +3689,7 @@ var CcsCredentialType;
3675
3689
  CcsCredentialType["UPN"] = "UPN";
3676
3690
  })(CcsCredentialType || (CcsCredentialType = {}));
3677
3691
 
3678
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3692
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3679
3693
 
3680
3694
  /*
3681
3695
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3766,7 +3780,7 @@ var RequestValidator = /** @class */ (function () {
3766
3780
  return RequestValidator;
3767
3781
  }());
3768
3782
 
3769
- /*! @azure/msal-common v12.0.0 2023-04-03 */
3783
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
3770
3784
 
3771
3785
  /*
3772
3786
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4144,7 +4158,7 @@ var RequestParameterBuilder = /** @class */ (function () {
4144
4158
  return RequestParameterBuilder;
4145
4159
  }());
4146
4160
 
4147
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4161
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4148
4162
 
4149
4163
  /*
4150
4164
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4246,7 +4260,7 @@ var BaseClient = /** @class */ (function () {
4246
4260
  return BaseClient;
4247
4261
  }());
4248
4262
 
4249
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4263
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4250
4264
 
4251
4265
  /*
4252
4266
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4384,7 +4398,7 @@ var CredentialEntity = /** @class */ (function () {
4384
4398
  return CredentialEntity;
4385
4399
  }());
4386
4400
 
4387
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4401
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4388
4402
 
4389
4403
  /*
4390
4404
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4448,7 +4462,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
4448
4462
  return IdTokenEntity;
4449
4463
  }(CredentialEntity));
4450
4464
 
4451
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4465
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4452
4466
  /*
4453
4467
  * Copyright (c) Microsoft Corporation. All rights reserved.
4454
4468
  * Licensed under the MIT License.
@@ -4498,7 +4512,7 @@ var TimeUtils = /** @class */ (function () {
4498
4512
  return TimeUtils;
4499
4513
  }());
4500
4514
 
4501
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4515
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4502
4516
 
4503
4517
  /*
4504
4518
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4612,7 +4626,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
4612
4626
  return AccessTokenEntity;
4613
4627
  }(CredentialEntity));
4614
4628
 
4615
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4629
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4616
4630
 
4617
4631
  /*
4618
4632
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4679,7 +4693,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
4679
4693
  return RefreshTokenEntity;
4680
4694
  }(CredentialEntity));
4681
4695
 
4682
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4696
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4683
4697
 
4684
4698
  /*
4685
4699
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4758,7 +4772,7 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
4758
4772
  return InteractionRequiredAuthError;
4759
4773
  }(AuthError));
4760
4774
 
4761
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4775
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4762
4776
  /*
4763
4777
  * Copyright (c) Microsoft Corporation. All rights reserved.
4764
4778
  * Licensed under the MIT License.
@@ -4774,7 +4788,7 @@ var CacheRecord = /** @class */ (function () {
4774
4788
  return CacheRecord;
4775
4789
  }());
4776
4790
 
4777
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4791
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4778
4792
 
4779
4793
  /*
4780
4794
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4845,7 +4859,7 @@ var ProtocolUtils = /** @class */ (function () {
4845
4859
  return ProtocolUtils;
4846
4860
  }());
4847
4861
 
4848
- /*! @azure/msal-common v12.0.0 2023-04-03 */
4862
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
4849
4863
 
4850
4864
  /*
4851
4865
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5079,7 +5093,7 @@ var UrlString = /** @class */ (function () {
5079
5093
  return UrlString;
5080
5094
  }());
5081
5095
 
5082
- /*! @azure/msal-common v12.0.0 2023-04-03 */
5096
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
5083
5097
  /*
5084
5098
  * Copyright (c) Microsoft Corporation. All rights reserved.
5085
5099
  * Licensed under the MIT License.
@@ -5308,7 +5322,7 @@ var IntFields = new Set([
5308
5322
  "status",
5309
5323
  ]);
5310
5324
 
5311
- /*! @azure/msal-common v12.0.0 2023-04-03 */
5325
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
5312
5326
 
5313
5327
  /*
5314
5328
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5417,7 +5431,7 @@ var PopTokenGenerator = /** @class */ (function () {
5417
5431
  return PopTokenGenerator;
5418
5432
  }());
5419
5433
 
5420
- /*! @azure/msal-common v12.0.0 2023-04-03 */
5434
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
5421
5435
 
5422
5436
  /*
5423
5437
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5487,7 +5501,7 @@ var AppMetadataEntity = /** @class */ (function () {
5487
5501
  return AppMetadataEntity;
5488
5502
  }());
5489
5503
 
5490
- /*! @azure/msal-common v12.0.0 2023-04-03 */
5504
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
5491
5505
  /*
5492
5506
  * Copyright (c) Microsoft Corporation. All rights reserved.
5493
5507
  * Licensed under the MIT License.
@@ -5523,7 +5537,7 @@ var AppMetadataEntity = /** @class */ (function () {
5523
5537
  return TokenCacheContext;
5524
5538
  }());
5525
5539
 
5526
- /*! @azure/msal-common v12.0.0 2023-04-03 */
5540
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
5527
5541
 
5528
5542
  /*
5529
5543
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5810,7 +5824,7 @@ var ResponseHandler = /** @class */ (function () {
5810
5824
  return ResponseHandler;
5811
5825
  }());
5812
5826
 
5813
- /*! @azure/msal-common v12.0.0 2023-04-03 */
5827
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
5814
5828
 
5815
5829
  /*
5816
5830
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6240,7 +6254,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
6240
6254
  return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
6241
6255
  case 1:
6242
6256
  reqCnfData = _b.sent();
6243
- parameterBuilder.addPopToken(reqCnfData.reqCnfHash);
6257
+ parameterBuilder.addPopToken(reqCnfData.reqCnfString);
6244
6258
  _b.label = 2;
6245
6259
  case 2: return [2 /*return*/, parameterBuilder.createQueryString()];
6246
6260
  }
@@ -6288,7 +6302,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
6288
6302
  return AuthorizationCodeClient;
6289
6303
  }(BaseClient));
6290
6304
 
6291
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6305
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6292
6306
 
6293
6307
  /*
6294
6308
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6562,7 +6576,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
6562
6576
  return RefreshTokenClient;
6563
6577
  }(BaseClient));
6564
6578
 
6565
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6579
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6566
6580
 
6567
6581
  /*
6568
6582
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6686,7 +6700,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
6686
6700
  return SilentFlowClient;
6687
6701
  }(BaseClient));
6688
6702
 
6689
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6703
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6690
6704
  /*
6691
6705
  * Copyright (c) Microsoft Corporation. All rights reserved.
6692
6706
  * Licensed under the MIT License.
@@ -6698,7 +6712,7 @@ function isOpenIdConfigResponse(response) {
6698
6712
  response.hasOwnProperty("jwks_uri"));
6699
6713
  }
6700
6714
 
6701
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6715
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6702
6716
  /*
6703
6717
  * Copyright (c) Microsoft Corporation. All rights reserved.
6704
6718
  * Licensed under the MIT License.
@@ -6707,7 +6721,7 @@ var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/
6707
6721
  var EndpointMetadata = rawMetdataJSON.endpointMetadata;
6708
6722
  var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
6709
6723
 
6710
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6724
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6711
6725
  /*
6712
6726
  * Copyright (c) Microsoft Corporation. All rights reserved.
6713
6727
  * Licensed under the MIT License.
@@ -6721,7 +6735,7 @@ exports.ProtocolMode = void 0;
6721
6735
  ProtocolMode["OIDC"] = "OIDC";
6722
6736
  })(exports.ProtocolMode || (exports.ProtocolMode = {}));
6723
6737
 
6724
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6738
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6725
6739
 
6726
6740
  /*
6727
6741
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6798,7 +6812,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
6798
6812
  return AuthorityMetadataEntity;
6799
6813
  }());
6800
6814
 
6801
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6815
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6802
6816
  /*
6803
6817
  * Copyright (c) Microsoft Corporation. All rights reserved.
6804
6818
  * Licensed under the MIT License.
@@ -6808,7 +6822,7 @@ function isCloudInstanceDiscoveryResponse(response) {
6808
6822
  response.hasOwnProperty("metadata"));
6809
6823
  }
6810
6824
 
6811
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6825
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6812
6826
  /*
6813
6827
  * Copyright (c) Microsoft Corporation. All rights reserved.
6814
6828
  * Licensed under the MIT License.
@@ -6818,7 +6832,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
6818
6832
  response.hasOwnProperty("error_description"));
6819
6833
  }
6820
6834
 
6821
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6835
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6822
6836
 
6823
6837
  /*
6824
6838
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6950,7 +6964,7 @@ var RegionDiscovery = /** @class */ (function () {
6950
6964
  return RegionDiscovery;
6951
6965
  }());
6952
6966
 
6953
- /*! @azure/msal-common v12.0.0 2023-04-03 */
6967
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
6954
6968
 
6955
6969
  /*
6956
6970
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6973,19 +6987,31 @@ var Authority = /** @class */ (function () {
6973
6987
  this.correlationId = correlationId;
6974
6988
  this.regionDiscovery = new RegionDiscovery(networkInterface, this.performanceClient, this.correlationId);
6975
6989
  }
6990
+ /**
6991
+ * Get {@link AuthorityType}
6992
+ * @param authorityUri {@link IUri}
6993
+ * @private
6994
+ */
6995
+ Authority.prototype.getAuthorityType = function (authorityUri) {
6996
+ // CIAM auth url pattern is being standardized as: <tenant>.ciamlogin.com
6997
+ if (authorityUri.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {
6998
+ return AuthorityType.Ciam;
6999
+ }
7000
+ var pathSegments = authorityUri.PathSegments;
7001
+ if (pathSegments.length) {
7002
+ switch (pathSegments[0].toLowerCase()) {
7003
+ case Constants.ADFS:
7004
+ return AuthorityType.Adfs;
7005
+ case Constants.DSTS:
7006
+ return AuthorityType.Dsts;
7007
+ }
7008
+ }
7009
+ return AuthorityType.Default;
7010
+ };
6976
7011
  Object.defineProperty(Authority.prototype, "authorityType", {
6977
7012
  // See above for AuthorityType
6978
7013
  get: function () {
6979
- var pathSegments = this.canonicalAuthorityUrlComponents.PathSegments;
6980
- if (pathSegments.length) {
6981
- switch (pathSegments[0].toLowerCase()) {
6982
- case Constants.ADFS:
6983
- return AuthorityType.Adfs;
6984
- case Constants.DSTS:
6985
- return AuthorityType.Dsts;
6986
- }
6987
- }
6988
- return AuthorityType.Default;
7014
+ return this.getAuthorityType(this.canonicalAuthorityUrlComponents);
6989
7015
  },
6990
7016
  enumerable: false,
6991
7017
  configurable: true
@@ -7067,8 +7093,7 @@ var Authority = /** @class */ (function () {
7067
7093
  */
7068
7094
  get: function () {
7069
7095
  if (this.discoveryComplete()) {
7070
- var endpoint = this.replacePath(this.metadata.authorization_endpoint);
7071
- return this.replaceTenant(endpoint);
7096
+ return this.replacePath(this.metadata.authorization_endpoint);
7072
7097
  }
7073
7098
  else {
7074
7099
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7083,8 +7108,7 @@ var Authority = /** @class */ (function () {
7083
7108
  */
7084
7109
  get: function () {
7085
7110
  if (this.discoveryComplete()) {
7086
- var endpoint = this.replacePath(this.metadata.token_endpoint);
7087
- return this.replaceTenant(endpoint);
7111
+ return this.replacePath(this.metadata.token_endpoint);
7088
7112
  }
7089
7113
  else {
7090
7114
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7096,8 +7120,7 @@ var Authority = /** @class */ (function () {
7096
7120
  Object.defineProperty(Authority.prototype, "deviceCodeEndpoint", {
7097
7121
  get: function () {
7098
7122
  if (this.discoveryComplete()) {
7099
- var endpoint = this.replacePath(this.metadata.token_endpoint.replace("/token", "/devicecode"));
7100
- return this.replaceTenant(endpoint);
7123
+ return this.replacePath(this.metadata.token_endpoint.replace("/token", "/devicecode"));
7101
7124
  }
7102
7125
  else {
7103
7126
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7116,8 +7139,7 @@ var Authority = /** @class */ (function () {
7116
7139
  if (!this.metadata.end_session_endpoint) {
7117
7140
  throw ClientAuthError.createLogoutNotSupportedError();
7118
7141
  }
7119
- var endpoint = this.replacePath(this.metadata.end_session_endpoint);
7120
- return this.replaceTenant(endpoint);
7142
+ return this.replacePath(this.metadata.end_session_endpoint);
7121
7143
  }
7122
7144
  else {
7123
7145
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7132,8 +7154,7 @@ var Authority = /** @class */ (function () {
7132
7154
  */
7133
7155
  get: function () {
7134
7156
  if (this.discoveryComplete()) {
7135
- var endpoint = this.replacePath(this.metadata.issuer);
7136
- return this.replaceTenant(endpoint);
7157
+ return this.replacePath(this.metadata.issuer);
7137
7158
  }
7138
7159
  else {
7139
7160
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7148,8 +7169,7 @@ var Authority = /** @class */ (function () {
7148
7169
  */
7149
7170
  get: function () {
7150
7171
  if (this.discoveryComplete()) {
7151
- var endpoint = this.replacePath(this.metadata.jwks_uri);
7152
- return this.replaceTenant(endpoint);
7172
+ return this.replacePath(this.metadata.jwks_uri);
7153
7173
  }
7154
7174
  else {
7155
7175
  throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
@@ -7158,6 +7178,17 @@ var Authority = /** @class */ (function () {
7158
7178
  enumerable: false,
7159
7179
  configurable: true
7160
7180
  });
7181
+ /**
7182
+ * Returns a flag indicating that tenant name can be replaced in authority {@link IUri}
7183
+ * @param authorityUri {@link IUri}
7184
+ * @private
7185
+ */
7186
+ Authority.prototype.canReplaceTenant = function (authorityUri) {
7187
+ return authorityUri.PathSegments.length === 1
7188
+ && !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0])
7189
+ && this.getAuthorityType(authorityUri) === AuthorityType.Default
7190
+ && this.protocolMode === exports.ProtocolMode.AAD;
7191
+ };
7161
7192
  /**
7162
7193
  * Replaces tenant in url path with current tenant. Defaults to common.
7163
7194
  * @param urlString
@@ -7170,17 +7201,31 @@ var Authority = /** @class */ (function () {
7170
7201
  * @param urlString
7171
7202
  */
7172
7203
  Authority.prototype.replacePath = function (urlString) {
7204
+ var _this = this;
7173
7205
  var endpoint = urlString;
7174
7206
  var cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);
7175
- var cachedAuthorityParts = cachedAuthorityUrl.getUrlComponents().PathSegments;
7207
+ var cachedAuthorityUrlComponents = cachedAuthorityUrl.getUrlComponents();
7208
+ var cachedAuthorityParts = cachedAuthorityUrlComponents.PathSegments;
7176
7209
  var currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;
7177
7210
  currentAuthorityParts.forEach(function (currentPart, index) {
7178
7211
  var cachedPart = cachedAuthorityParts[index];
7212
+ if (index === 0 && _this.canReplaceTenant(cachedAuthorityUrlComponents)) {
7213
+ var tenantId = (new UrlString(_this.metadata.authorization_endpoint)).getUrlComponents().PathSegments[0];
7214
+ /**
7215
+ * Check if AAD canonical authority contains tenant domain name, for example "testdomain.onmicrosoft.com",
7216
+ * by comparing its first path segment to the corresponding authorization endpoint path segment, which is
7217
+ * always resolved with tenant id by OIDC.
7218
+ */
7219
+ if (cachedPart !== tenantId) {
7220
+ _this.logger.verbose("Replacing tenant domain name " + cachedPart + " with id " + tenantId);
7221
+ cachedPart = tenantId;
7222
+ }
7223
+ }
7179
7224
  if (currentPart !== cachedPart) {
7180
7225
  endpoint = endpoint.replace("/" + cachedPart + "/", "/" + currentPart + "/");
7181
7226
  }
7182
7227
  });
7183
- return endpoint;
7228
+ return this.replaceTenant(endpoint);
7184
7229
  };
7185
7230
  Object.defineProperty(Authority.prototype, "defaultOpenIdConfigurationEndpoint", {
7186
7231
  /**
@@ -7263,7 +7308,6 @@ var Authority = /** @class */ (function () {
7263
7308
  // No need to update
7264
7309
  return [2 /*return*/, AuthorityMetadataSource.CACHE];
7265
7310
  }
7266
- harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();
7267
7311
  (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7268
7312
  return [4 /*yield*/, this.getEndpointMetadataFromNetwork()];
7269
7313
  case 1:
@@ -7279,6 +7323,7 @@ var Authority = /** @class */ (function () {
7279
7323
  metadataEntity.updateEndpointMetadata(metadata, true);
7280
7324
  return [2 /*return*/, AuthorityMetadataSource.NETWORK];
7281
7325
  case 4:
7326
+ harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();
7282
7327
  if (!(harcodedMetadata && !this.authorityOptions.skipAuthorityMetadataCache)) return [3 /*break*/, 7];
7283
7328
  if (!((_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion)) return [3 /*break*/, 6];
7284
7329
  (_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
@@ -7403,8 +7448,8 @@ var Authority = /** @class */ (function () {
7403
7448
  /**
7404
7449
  * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache
7405
7450
  * and returns where the information was retrieved from
7406
- * @param cachedMetadata
7407
- * @param newMetadata
7451
+ * @param metadataEntity
7452
+ * @returns AuthorityMetadataSource
7408
7453
  */
7409
7454
  Authority.prototype.updateCloudDiscoveryMetadata = function (metadataEntity) {
7410
7455
  var _a, _b;
@@ -7414,6 +7459,7 @@ var Authority = /** @class */ (function () {
7414
7459
  switch (_c.label) {
7415
7460
  case 0:
7416
7461
  (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7462
+ // attempt to read metadata from the config
7417
7463
  this.logger.verbose("Attempting to get cloud discovery metadata in the config");
7418
7464
  this.logger.verbosePii("Known Authorities: " + (this.authorityOptions.knownAuthorities || Constants.NOT_APPLICABLE));
7419
7465
  this.logger.verbosePii("Authority Metadata: " + (this.authorityOptions.authorityMetadata || Constants.NOT_APPLICABLE));
@@ -7463,6 +7509,11 @@ var Authority = /** @class */ (function () {
7463
7509
  * Parse cloudDiscoveryMetadata config or check knownAuthorities
7464
7510
  */
7465
7511
  Authority.prototype.getCloudDiscoveryMetadataFromConfig = function () {
7512
+ // CIAM does not support cloud discovery metadata
7513
+ if (this.authorityType === AuthorityType.Ciam) {
7514
+ this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.");
7515
+ return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
7516
+ }
7466
7517
  // Check if network response was provided in config
7467
7518
  if (this.authorityOptions.cloudDiscoveryMetadata) {
7468
7519
  this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");
@@ -7682,10 +7733,38 @@ var Authority = /** @class */ (function () {
7682
7733
  }
7683
7734
  return metadata;
7684
7735
  };
7736
+ /**
7737
+ * Transform CIAM_AUTHORIY as per the below rules:
7738
+ * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it
7739
+ *
7740
+ * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`
7741
+ * `ciamlogin.com` can also change in the future and we should accommodate the same
7742
+ *
7743
+ * @param authority
7744
+ */
7745
+ Authority.transformCIAMAuthority = function (authority) {
7746
+ var ciamAuthority = authority.endsWith(Constants.FORWARD_SLASH) ? authority : "" + authority + Constants.FORWARD_SLASH;
7747
+ var authorityUrl = new UrlString(authority);
7748
+ var authorityUrlComponents = authorityUrl.getUrlComponents();
7749
+ // check if transformation is needed
7750
+ if (authorityUrlComponents.PathSegments.length === 0 && (authorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL))) {
7751
+ var tenantIdOrDomain = authorityUrlComponents.HostNameAndPort.split(".")[0];
7752
+ ciamAuthority = "" + ciamAuthority + tenantIdOrDomain + Constants.AAD_TENANT_DOMAIN_SUFFIX;
7753
+ }
7754
+ return ciamAuthority;
7755
+ };
7756
+ // Reserved tenant domain names that will not be replaced with tenant id
7757
+ Authority.reservedTenantDomains = (new Set([
7758
+ "{tenant}",
7759
+ "{tenantid}",
7760
+ AADAuthorityConstants.COMMON,
7761
+ AADAuthorityConstants.CONSUMERS,
7762
+ AADAuthorityConstants.ORGANIZATIONS
7763
+ ]));
7685
7764
  return Authority;
7686
7765
  }());
7687
7766
 
7688
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7767
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7689
7768
 
7690
7769
  /*
7691
7770
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7706,12 +7785,13 @@ var AuthorityFactory = /** @class */ (function () {
7706
7785
  */
7707
7786
  AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
7708
7787
  return __awaiter(this, void 0, void 0, function () {
7709
- var acquireTokenAuthority, e_1;
7788
+ var authorityUriFinal, acquireTokenAuthority, e_1;
7710
7789
  return __generator(this, function (_a) {
7711
7790
  switch (_a.label) {
7712
7791
  case 0:
7713
7792
  performanceClient === null || performanceClient === void 0 ? void 0 : performanceClient.addQueueMeasurement(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);
7714
- acquireTokenAuthority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);
7793
+ authorityUriFinal = Authority.transformCIAMAuthority(authorityUri);
7794
+ acquireTokenAuthority = AuthorityFactory.createInstance(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);
7715
7795
  _a.label = 1;
7716
7796
  case 1:
7717
7797
  _a.trys.push([1, 3, , 4]);
@@ -7748,7 +7828,7 @@ var AuthorityFactory = /** @class */ (function () {
7748
7828
  return AuthorityFactory;
7749
7829
  }());
7750
7830
 
7751
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7831
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7752
7832
 
7753
7833
  /*
7754
7834
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7779,7 +7859,7 @@ var ServerTelemetryEntity = /** @class */ (function () {
7779
7859
  return ServerTelemetryEntity;
7780
7860
  }());
7781
7861
 
7782
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7862
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7783
7863
 
7784
7864
  /*
7785
7865
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7807,7 +7887,7 @@ var ThrottlingEntity = /** @class */ (function () {
7807
7887
  return ThrottlingEntity;
7808
7888
  }());
7809
7889
 
7810
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7890
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7811
7891
 
7812
7892
  /*
7813
7893
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7824,7 +7904,7 @@ var StubbedNetworkModule = {
7824
7904
  }
7825
7905
  };
7826
7906
 
7827
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7907
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7828
7908
 
7829
7909
  /*
7830
7910
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7869,7 +7949,7 @@ var JoseHeaderError = /** @class */ (function (_super) {
7869
7949
  return JoseHeaderError;
7870
7950
  }(AuthError));
7871
7951
 
7872
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7952
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7873
7953
 
7874
7954
  /*
7875
7955
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7909,7 +7989,7 @@ var JoseHeader = /** @class */ (function () {
7909
7989
  return JoseHeader;
7910
7990
  }());
7911
7991
 
7912
- /*! @azure/msal-common v12.0.0 2023-04-03 */
7992
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7913
7993
 
7914
7994
  /*
7915
7995
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7968,7 +8048,7 @@ var AuthenticationHeaderParser = /** @class */ (function () {
7968
8048
  return AuthenticationHeaderParser;
7969
8049
  }());
7970
8050
 
7971
- /*! @azure/msal-common v12.0.0 2023-04-03 */
8051
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
7972
8052
 
7973
8053
  /*
7974
8054
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8130,7 +8210,7 @@ var ServerTelemetryManager = /** @class */ (function () {
8130
8210
  return ServerTelemetryManager;
8131
8211
  }());
8132
8212
 
8133
- /*! @azure/msal-common v12.0.0 2023-04-03 */
8213
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
8134
8214
 
8135
8215
  /*
8136
8216
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8533,7 +8613,7 @@ var PerformanceClient = /** @class */ (function () {
8533
8613
  return PerformanceClient;
8534
8614
  }());
8535
8615
 
8536
- /*! @azure/msal-common v12.0.0 2023-04-03 */
8616
+ /*! @azure/msal-common v13.1.0 2023-06-07 */
8537
8617
 
8538
8618
  /*
8539
8619
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10758,7 +10838,7 @@ var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
10758
10838
 
10759
10839
  /* eslint-disable header/header */
10760
10840
  var name = "@azure/msal-browser";
10761
- var version = "2.36.0";
10841
+ var version = "2.37.1";
10762
10842
 
10763
10843
  /*
10764
10844
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11223,7 +11303,7 @@ var BaseInteractionClient = /** @class */ (function () {
11223
11303
  * Initializer function for all request APIs
11224
11304
  * @param request
11225
11305
  */
11226
- BaseInteractionClient.prototype.initializeBaseRequest = function (request) {
11306
+ BaseInteractionClient.prototype.initializeBaseRequest = function (request, account) {
11227
11307
  return __awaiter$1(this, void 0, void 0, function () {
11228
11308
  var authority, scopes, validatedRequest, _a;
11229
11309
  return __generator$1(this, function (_b) {
@@ -11232,6 +11312,12 @@ var BaseInteractionClient = /** @class */ (function () {
11232
11312
  this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
11233
11313
  this.logger.verbose("Initializing BaseAuthRequest");
11234
11314
  authority = request.authority || this.config.auth.authority;
11315
+ if (!account) return [3 /*break*/, 2];
11316
+ return [4 /*yield*/, this.validateRequestAuthority(authority, account)];
11317
+ case 1:
11318
+ _b.sent();
11319
+ _b.label = 2;
11320
+ case 2:
11235
11321
  scopes = __spread(((request && request.scopes) || []));
11236
11322
  validatedRequest = __assign$1(__assign$1({}, request), { correlationId: this.correlationId, authority: authority,
11237
11323
  scopes: scopes });
@@ -11251,13 +11337,13 @@ var BaseInteractionClient = /** @class */ (function () {
11251
11337
  }
11252
11338
  this.logger.verbose("Authentication Scheme set to \"" + validatedRequest.authenticationScheme + "\" as configured in Auth request");
11253
11339
  }
11254
- if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 2];
11340
+ if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 4];
11255
11341
  _a = validatedRequest;
11256
11342
  return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];
11257
- case 1:
11343
+ case 3:
11258
11344
  _a.requestedClaimsHash = _b.sent();
11259
- _b.label = 2;
11260
- case 2: return [2 /*return*/, validatedRequest];
11345
+ _b.label = 4;
11346
+ case 4: return [2 /*return*/, validatedRequest];
11261
11347
  }
11262
11348
  });
11263
11349
  });
@@ -11274,6 +11360,26 @@ var BaseInteractionClient = /** @class */ (function () {
11274
11360
  var redirectUri = requestRedirectUri || this.config.auth.redirectUri || BrowserUtils.getCurrentUri();
11275
11361
  return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());
11276
11362
  };
11363
+ /*
11364
+ * If authority provided in the request does not match environment/authority specified
11365
+ * in the account or MSAL config, we throw an error.
11366
+ */
11367
+ BaseInteractionClient.prototype.validateRequestAuthority = function (authority, account) {
11368
+ return __awaiter$1(this, void 0, void 0, function () {
11369
+ var discoveredAuthority;
11370
+ return __generator$1(this, function (_a) {
11371
+ switch (_a.label) {
11372
+ case 0: return [4 /*yield*/, this.getDiscoveredAuthority(authority)];
11373
+ case 1:
11374
+ discoveredAuthority = _a.sent();
11375
+ if (!discoveredAuthority.isAlias(account.environment)) {
11376
+ throw ClientConfigurationError.createAuthorityMismatchError();
11377
+ }
11378
+ return [2 /*return*/];
11379
+ }
11380
+ });
11381
+ });
11382
+ };
11277
11383
  /**
11278
11384
  *
11279
11385
  * @param apiId
@@ -11938,6 +12044,7 @@ exports.EventType = void 0;
11938
12044
  EventType["LOGOUT_SUCCESS"] = "msal:logoutSuccess";
11939
12045
  EventType["LOGOUT_FAILURE"] = "msal:logoutFailure";
11940
12046
  EventType["LOGOUT_END"] = "msal:logoutEnd";
12047
+ EventType["RESTORE_FROM_BFCACHE"] = "msal:restoreFromBFCache";
11941
12048
  })(exports.EventType || (exports.EventType = {}));
11942
12049
 
11943
12050
  /*
@@ -12118,7 +12225,7 @@ var SilentCacheClient = /** @class */ (function (_super) {
12118
12225
  this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeSilentRequest, this.correlationId);
12119
12226
  this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
12120
12227
  _a = [__assign$1({}, request)];
12121
- return [4 /*yield*/, this.initializeBaseRequest(request)];
12228
+ return [4 /*yield*/, this.initializeBaseRequest(request, account)];
12122
12229
  case 1: return [2 /*return*/, __assign$1.apply(void 0, [__assign$1.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
12123
12230
  }
12124
12231
  });
@@ -12392,7 +12499,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12392
12499
  result = _a.sent();
12393
12500
  // cache accounts and tokens in the appropriate storage
12394
12501
  this.cacheAccount(accountEntity);
12395
- this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12502
+ this.cacheNativeTokens(response, request, homeAccountIdentifier, accountEntity, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12396
12503
  return [2 /*return*/, result];
12397
12504
  }
12398
12505
  });
@@ -12548,10 +12655,8 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12548
12655
  * @param tenantId
12549
12656
  * @param reqTimestamp
12550
12657
  */
12551
- NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12552
- // cache idToken in inmemory storage
12553
- var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12554
- this.nativeStorageManager.setIdTokenCredential(idTokenEntity);
12658
+ NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, accountEntity, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12659
+ var cachedIdToken = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12555
12660
  // cache accessToken in inmemory storage
12556
12661
  var expiresIn = (request.tokenType === exports.AuthenticationScheme.POP)
12557
12662
  ? Constants.SHR_NONCE_VALIDITY
@@ -12560,8 +12665,11 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12560
12665
  : response.expires_in) || 0;
12561
12666
  var tokenExpirationSeconds = reqTimestamp + expiresIn;
12562
12667
  var responseScopes = this.generateScopes(response, request);
12563
- var accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12564
- this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);
12668
+ var cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenObj
12669
+ ? idTokenObj.claims.tid || Constants.EMPTY_STRING
12670
+ : tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12671
+ var nativeCacheRecord = new CacheRecord(accountEntity, cachedIdToken, cachedAccessToken);
12672
+ this.nativeStorageManager.saveCacheRecord(nativeCacheRecord);
12565
12673
  };
12566
12674
  NativeInteractionClient.prototype.addTelemetryFromNativeResponse = function (response) {
12567
12675
  var mats = this.getMATSFromResponse(response);
@@ -12645,6 +12753,12 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12645
12753
  case 0:
12646
12754
  this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
12647
12755
  authority = request.authority || this.config.auth.authority;
12756
+ if (!request.account) return [3 /*break*/, 2];
12757
+ return [4 /*yield*/, this.validateRequestAuthority(authority, request.account)];
12758
+ case 1:
12759
+ _a.sent();
12760
+ _a.label = 2;
12761
+ case 2:
12648
12762
  canonicalAuthority = new UrlString(authority);
12649
12763
  canonicalAuthority.validateAsUri();
12650
12764
  scopes = request.scopes, remainingProperties = __rest(request, ["scopes"]);
@@ -12677,7 +12791,7 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12677
12791
  };
12678
12792
  validatedRequest = __assign$1(__assign$1({}, remainingProperties), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scope: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), prompt: getPrompt(), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign$1(__assign$1(__assign$1({}, request.extraQueryParameters), request.tokenQueryParameters), { telemetry: NativeConstants.MATS_TELEMETRY }), extendedExpiryToken: false // Make this configurable?
12679
12793
  });
12680
- if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
12794
+ if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 4];
12681
12795
  shrParameters = {
12682
12796
  resourceRequestUri: request.resourceRequestUri,
12683
12797
  resourceRequestMethod: request.resourceRequestMethod,
@@ -12686,13 +12800,13 @@ var NativeInteractionClient = /** @class */ (function (_super) {
12686
12800
  };
12687
12801
  popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
12688
12802
  return [4 /*yield*/, popTokenGenerator.generateCnf(shrParameters)];
12689
- case 1:
12803
+ case 3:
12690
12804
  reqCnfData = _a.sent();
12691
- // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
12692
- validatedRequest.reqCnf = reqCnfData.reqCnfHash;
12805
+ // to reduce the URL length, it is recommended to send the short form of the req_cnf
12806
+ validatedRequest.reqCnf = reqCnfData.reqCnfString;
12693
12807
  validatedRequest.keyId = reqCnfData.kid;
12694
- _a.label = 2;
12695
- case 2: return [2 /*return*/, validatedRequest];
12808
+ _a.label = 4;
12809
+ case 4: return [2 /*return*/, validatedRequest];
12696
12810
  }
12697
12811
  });
12698
12812
  });
@@ -12994,6 +13108,7 @@ var RedirectClient = /** @class */ (function (_super) {
12994
13108
  if (event.persisted) {
12995
13109
  _this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache.");
12996
13110
  _this.browserStorage.cleanRequestByState(validRequest.state);
13111
+ _this.eventHandler.emitEvent(exports.EventType.RESTORE_FROM_BFCACHE, exports.InteractionType.Redirect);
12997
13112
  }
12998
13113
  };
12999
13114
  _a.label = 2;
@@ -13185,7 +13300,7 @@ var RedirectClient = /** @class */ (function (_super) {
13185
13300
  if (!this.nativeMessageHandler) {
13186
13301
  throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13187
13302
  }
13188
- nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, cachedRequest.correlationId);
13303
+ nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);
13189
13304
  userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;
13190
13305
  return [2 /*return*/, nativeInteractionClient.acquireToken(__assign$1(__assign$1({}, cachedRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently
13191
13306
  })).finally(function () {
@@ -14239,7 +14354,7 @@ var SilentRefreshClient = /** @class */ (function (_super) {
14239
14354
  this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14240
14355
  this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
14241
14356
  _a = [__assign$1({}, request)];
14242
- return [4 /*yield*/, this.initializeBaseRequest(request)];
14357
+ return [4 /*yield*/, this.initializeBaseRequest(request, request.account)];
14243
14358
  case 1:
14244
14359
  silentRequest = __assign$1.apply(void 0, _a.concat([_b.sent()]));
14245
14360
  acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
@@ -17939,6 +18054,7 @@ var EventMessageUtils = /** @class */ (function () {
17939
18054
  case exports.EventType.LOGIN_FAILURE:
17940
18055
  case exports.EventType.ACQUIRE_TOKEN_SUCCESS:
17941
18056
  case exports.EventType.ACQUIRE_TOKEN_FAILURE:
18057
+ case exports.EventType.RESTORE_FROM_BFCACHE:
17942
18058
  if (message.interactionType === exports.InteractionType.Redirect || message.interactionType === exports.InteractionType.Popup) {
17943
18059
  if (currentStatus && currentStatus !== exports.InteractionStatus.Login && currentStatus !== exports.InteractionStatus.AcquireToken) {
17944
18060
  // Prevent this event from clearing any status other than login or acquireToken