@azure/msal-browser 3.13.0 → 3.14.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 (93) hide show
  1. package/dist/app/IPublicClientApplication.d.ts +2 -1
  2. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  3. package/dist/app/IPublicClientApplication.mjs +4 -1
  4. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  5. package/dist/app/PublicClientApplication.mjs +1 -1
  6. package/dist/app/PublicClientNext.mjs +1 -1
  7. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  8. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +1 -1
  11. package/dist/cache/BrowserStorage.mjs +1 -1
  12. package/dist/cache/DatabaseStorage.mjs +1 -1
  13. package/dist/cache/MemoryStorage.mjs +1 -1
  14. package/dist/cache/TokenCache.mjs +1 -1
  15. package/dist/config/Configuration.mjs +1 -1
  16. package/dist/controllers/ControllerFactory.d.ts.map +1 -1
  17. package/dist/controllers/ControllerFactory.mjs +2 -3
  18. package/dist/controllers/ControllerFactory.mjs.map +1 -1
  19. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  20. package/dist/controllers/StandardController.d.ts.map +1 -1
  21. package/dist/controllers/StandardController.mjs +74 -37
  22. package/dist/controllers/StandardController.mjs.map +1 -1
  23. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  24. package/dist/crypto/BrowserCrypto.mjs +1 -1
  25. package/dist/crypto/CryptoOps.mjs +1 -1
  26. package/dist/crypto/PkceGenerator.mjs +1 -1
  27. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  28. package/dist/encode/Base64Decode.mjs +1 -1
  29. package/dist/encode/Base64Encode.mjs +1 -1
  30. package/dist/error/BrowserAuthError.mjs +1 -1
  31. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  32. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  33. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  34. package/dist/error/NativeAuthError.mjs +1 -1
  35. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  36. package/dist/error/NestedAppAuthError.mjs +1 -1
  37. package/dist/event/EventHandler.mjs +1 -1
  38. package/dist/event/EventMessage.mjs +1 -1
  39. package/dist/event/EventType.mjs +1 -1
  40. package/dist/index.mjs +1 -1
  41. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  42. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  43. package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
  44. package/dist/interaction_client/PopupClient.mjs +1 -1
  45. package/dist/interaction_client/RedirectClient.d.ts +4 -5
  46. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  47. package/dist/interaction_client/RedirectClient.mjs +5 -8
  48. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  49. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  50. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  51. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  52. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  53. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  54. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  55. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  56. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  57. package/dist/naa/BridgeError.mjs +1 -1
  58. package/dist/naa/BridgeProxy.mjs +1 -1
  59. package/dist/naa/BridgeStatusCode.mjs +1 -1
  60. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  61. package/dist/navigation/NavigationClient.mjs +1 -1
  62. package/dist/network/FetchClient.mjs +1 -1
  63. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  64. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  65. package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -1
  66. package/dist/operatingcontext/TeamsAppOperatingContext.mjs +10 -11
  67. package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
  68. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  69. package/dist/packageMetadata.d.ts +1 -1
  70. package/dist/packageMetadata.mjs +2 -2
  71. package/dist/request/RequestHelpers.mjs +1 -1
  72. package/dist/response/ResponseHandler.mjs +1 -1
  73. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  74. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  75. package/dist/utils/BrowserConstants.mjs +1 -1
  76. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  77. package/dist/utils/BrowserUtils.d.ts +3 -0
  78. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  79. package/dist/utils/BrowserUtils.mjs +2 -1
  80. package/dist/utils/BrowserUtils.mjs.map +1 -1
  81. package/lib/msal-browser.cjs +213 -141
  82. package/lib/msal-browser.cjs.map +1 -1
  83. package/lib/msal-browser.js +213 -141
  84. package/lib/msal-browser.js.map +1 -1
  85. package/lib/msal-browser.min.js +61 -60
  86. package/package.json +2 -2
  87. package/src/app/IPublicClientApplication.ts +5 -0
  88. package/src/controllers/ControllerFactory.ts +1 -4
  89. package/src/controllers/StandardController.ts +79 -45
  90. package/src/interaction_client/RedirectClient.ts +6 -12
  91. package/src/operatingcontext/TeamsAppOperatingContext.ts +14 -8
  92. package/src/packageMetadata.ts +1 -1
  93. package/src/utils/BrowserUtils.ts +4 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v3.13.0 2024-04-11 */
1
+ /*! @azure/msal-browser v3.14.0 2024-05-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -66,10 +66,11 @@ const Constants = {
66
66
  INVALID_INSTANCE: "invalid_instance",
67
67
  };
68
68
  const HttpStatus = {
69
- SUCCESS_RANGE_START: 200,
70
69
  SUCCESS: 200,
70
+ SUCCESS_RANGE_START: 200,
71
71
  SUCCESS_RANGE_END: 299,
72
72
  REDIRECT: 302,
73
+ CLIENT_ERROR: 400,
73
74
  CLIENT_ERROR_RANGE_START: 400,
74
75
  BAD_REQUEST: 400,
75
76
  UNAUTHORIZED: 401,
@@ -77,11 +78,12 @@ const HttpStatus = {
77
78
  REQUEST_TIMEOUT: 408,
78
79
  TOO_MANY_REQUESTS: 429,
79
80
  CLIENT_ERROR_RANGE_END: 499,
81
+ SERVER_ERROR: 500,
80
82
  SERVER_ERROR_RANGE_START: 500,
81
- INTERNAL_SERVER_ERROR: 500,
82
83
  SERVICE_UNAVAILABLE: 503,
83
84
  GATEWAY_TIMEOUT: 504,
84
85
  SERVER_ERROR_RANGE_END: 599,
86
+ MULTI_SIDED_ERROR: 600,
85
87
  };
86
88
  const OIDC_DEFAULT_SCOPES = [
87
89
  Constants.OPENID_SCOPE,
@@ -308,7 +310,7 @@ const JsonWebTokenTypes = {
308
310
  // Token renewal offset default in seconds
309
311
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
310
312
 
311
- /*! @azure/msal-common v14.9.0 2024-04-11 */
313
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
312
314
  /*
313
315
  * Copyright (c) Microsoft Corporation. All rights reserved.
314
316
  * Licensed under the MIT License.
@@ -325,7 +327,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
325
327
  unexpectedError: unexpectedError
326
328
  });
327
329
 
328
- /*! @azure/msal-common v14.9.0 2024-04-11 */
330
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
329
331
 
330
332
  /*
331
333
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -374,7 +376,7 @@ function createAuthError(code, additionalMessage) {
374
376
  : AuthErrorMessages[code]);
375
377
  }
376
378
 
377
- /*! @azure/msal-common v14.9.0 2024-04-11 */
379
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
378
380
  /*
379
381
  * Copyright (c) Microsoft Corporation. All rights reserved.
380
382
  * Licensed under the MIT License.
@@ -472,7 +474,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
472
474
  userTimeoutReached: userTimeoutReached
473
475
  });
474
476
 
475
- /*! @azure/msal-common v14.9.0 2024-04-11 */
477
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
476
478
 
477
479
  /*
478
480
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -724,7 +726,7 @@ function createClientAuthError(errorCode, additionalMessage) {
724
726
  return new ClientAuthError(errorCode, additionalMessage);
725
727
  }
726
728
 
727
- /*! @azure/msal-common v14.9.0 2024-04-11 */
729
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
728
730
 
729
731
  /*
730
732
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -757,7 +759,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
757
759
  },
758
760
  };
759
761
 
760
- /*! @azure/msal-common v14.9.0 2024-04-11 */
762
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
761
763
 
762
764
  /*
763
765
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -948,12 +950,12 @@ class Logger {
948
950
  }
949
951
  }
950
952
 
951
- /*! @azure/msal-common v14.9.0 2024-04-11 */
953
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
952
954
  /* eslint-disable header/header */
953
955
  const name$1 = "@azure/msal-common";
954
- const version$1 = "14.9.0";
956
+ const version$1 = "14.10.0";
955
957
 
956
- /*! @azure/msal-common v14.9.0 2024-04-11 */
958
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
957
959
  /*
958
960
  * Copyright (c) Microsoft Corporation. All rights reserved.
959
961
  * Licensed under the MIT License.
@@ -973,7 +975,7 @@ const AzureCloudInstance = {
973
975
  AzureUsGovernment: "https://login.microsoftonline.us",
974
976
  };
975
977
 
976
- /*! @azure/msal-common v14.9.0 2024-04-11 */
978
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
977
979
 
978
980
  /*
979
981
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1034,7 +1036,7 @@ function checkMaxAge(authTime, maxAge) {
1034
1036
  }
1035
1037
  }
1036
1038
 
1037
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1039
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1038
1040
  /*
1039
1041
  * Copyright (c) Microsoft Corporation. All rights reserved.
1040
1042
  * Licensed under the MIT License.
@@ -1071,7 +1073,7 @@ function wasClockTurnedBack(cachedAt) {
1071
1073
  return cachedAtSec > nowSeconds();
1072
1074
  }
1073
1075
 
1074
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1076
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1075
1077
 
1076
1078
  /*
1077
1079
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1398,7 +1400,7 @@ function isAuthorityMetadataExpired(metadata) {
1398
1400
  return metadata.expiresAt <= nowSeconds();
1399
1401
  }
1400
1402
 
1401
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1403
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1402
1404
  /*
1403
1405
  * Copyright (c) Microsoft Corporation. All rights reserved.
1404
1406
  * Licensed under the MIT License.
@@ -1452,7 +1454,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1452
1454
  urlParseError: urlParseError
1453
1455
  });
1454
1456
 
1455
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1457
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1456
1458
 
1457
1459
  /*
1458
1460
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1590,7 +1592,7 @@ function createClientConfigurationError(errorCode) {
1590
1592
  return new ClientConfigurationError(errorCode);
1591
1593
  }
1592
1594
 
1593
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1595
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1594
1596
  /*
1595
1597
  * Copyright (c) Microsoft Corporation. All rights reserved.
1596
1598
  * Licensed under the MIT License.
@@ -1687,7 +1689,7 @@ class StringUtils {
1687
1689
  }
1688
1690
  }
1689
1691
 
1690
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1692
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1691
1693
 
1692
1694
  /*
1693
1695
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1887,7 +1889,7 @@ class ScopeSet {
1887
1889
  }
1888
1890
  }
1889
1891
 
1890
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1892
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1891
1893
 
1892
1894
  /*
1893
1895
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1927,7 +1929,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
1927
1929
  };
1928
1930
  }
1929
1931
 
1930
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1932
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1931
1933
  /*
1932
1934
  * Copyright (c) Microsoft Corporation. All rights reserved.
1933
1935
  * Licensed under the MIT License.
@@ -1989,7 +1991,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
1989
1991
  return updatedAccountInfo;
1990
1992
  }
1991
1993
 
1992
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1994
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1993
1995
  /*
1994
1996
  * Copyright (c) Microsoft Corporation. All rights reserved.
1995
1997
  * Licensed under the MIT License.
@@ -2004,7 +2006,7 @@ const AuthorityType = {
2004
2006
  Ciam: 3,
2005
2007
  };
2006
2008
 
2007
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2009
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2008
2010
  /*
2009
2011
  * Copyright (c) Microsoft Corporation. All rights reserved.
2010
2012
  * Licensed under the MIT License.
@@ -2026,7 +2028,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2026
2028
  return null;
2027
2029
  }
2028
2030
 
2029
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2031
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2030
2032
  /*
2031
2033
  * Copyright (c) Microsoft Corporation. All rights reserved.
2032
2034
  * Licensed under the MIT License.
@@ -2039,7 +2041,7 @@ const ProtocolMode = {
2039
2041
  OIDC: "OIDC",
2040
2042
  };
2041
2043
 
2042
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2044
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2043
2045
 
2044
2046
  /*
2045
2047
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2286,7 +2288,7 @@ class AccountEntity {
2286
2288
  }
2287
2289
  }
2288
2290
 
2289
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2291
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2290
2292
 
2291
2293
  /*
2292
2294
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2333,7 +2335,7 @@ function getDeserializedResponse(responseString) {
2333
2335
  return null;
2334
2336
  }
2335
2337
 
2336
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2338
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2337
2339
 
2338
2340
  /*
2339
2341
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2497,7 +2499,7 @@ class UrlString {
2497
2499
  }
2498
2500
  }
2499
2501
 
2500
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2502
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2501
2503
 
2502
2504
  /*
2503
2505
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2637,7 +2639,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2637
2639
  return null;
2638
2640
  }
2639
2641
 
2640
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2642
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2641
2643
  /*
2642
2644
  * Copyright (c) Microsoft Corporation. All rights reserved.
2643
2645
  * Licensed under the MIT License.
@@ -2645,7 +2647,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2645
2647
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2646
2648
  const cacheUnknownErrorCode = "cache_error_unknown";
2647
2649
 
2648
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2650
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2649
2651
 
2650
2652
  /*
2651
2653
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2672,7 +2674,7 @@ class CacheError extends Error {
2672
2674
  }
2673
2675
  }
2674
2676
 
2675
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2677
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2676
2678
 
2677
2679
  /*
2678
2680
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3927,7 +3929,7 @@ class DefaultStorageClass extends CacheManager {
3927
3929
  }
3928
3930
  }
3929
3931
 
3930
- /*! @azure/msal-common v14.9.0 2024-04-11 */
3932
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
3931
3933
 
3932
3934
  /*
3933
3935
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4025,7 +4027,7 @@ function isOidcProtocolMode(config) {
4025
4027
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4026
4028
  }
4027
4029
 
4028
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4030
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4029
4031
 
4030
4032
  /*
4031
4033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4035,14 +4037,15 @@ function isOidcProtocolMode(config) {
4035
4037
  * Error thrown when there is an error with the server code, for example, unavailability.
4036
4038
  */
4037
4039
  class ServerError extends AuthError {
4038
- constructor(errorCode, errorMessage, subError) {
4040
+ constructor(errorCode, errorMessage, subError, errorNo) {
4039
4041
  super(errorCode, errorMessage, subError);
4040
4042
  this.name = "ServerError";
4043
+ this.errorNo = errorNo;
4041
4044
  Object.setPrototypeOf(this, ServerError.prototype);
4042
4045
  }
4043
4046
  }
4044
4047
 
4045
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4048
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4046
4049
 
4047
4050
  /*
4048
4051
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4140,7 +4143,7 @@ class ThrottlingUtils {
4140
4143
  }
4141
4144
  }
4142
4145
 
4143
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4146
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4144
4147
 
4145
4148
  /*
4146
4149
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4177,7 +4180,7 @@ class NetworkManager {
4177
4180
  }
4178
4181
  }
4179
4182
 
4180
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4183
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4181
4184
  /*
4182
4185
  * Copyright (c) Microsoft Corporation. All rights reserved.
4183
4186
  * Licensed under the MIT License.
@@ -4187,7 +4190,7 @@ const CcsCredentialType = {
4187
4190
  UPN: "UPN",
4188
4191
  };
4189
4192
 
4190
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4193
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4191
4194
  /*
4192
4195
  * Copyright (c) Microsoft Corporation. All rights reserved.
4193
4196
  * Licensed under the MIT License.
@@ -4234,7 +4237,7 @@ const SID = "sid";
4234
4237
  const LOGIN_HINT = "login_hint";
4235
4238
  const DOMAIN_HINT = "domain_hint";
4236
4239
 
4237
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4240
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4238
4241
 
4239
4242
  /*
4240
4243
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4318,7 +4321,7 @@ class RequestValidator {
4318
4321
  }
4319
4322
  }
4320
4323
 
4321
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4324
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4322
4325
 
4323
4326
  /*
4324
4327
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4702,7 +4705,7 @@ class RequestParameterBuilder {
4702
4705
  }
4703
4706
  }
4704
4707
 
4705
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4708
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4706
4709
  /*
4707
4710
  * Copyright (c) Microsoft Corporation. All rights reserved.
4708
4711
  * Licensed under the MIT License.
@@ -4714,7 +4717,7 @@ function isOpenIdConfigResponse(response) {
4714
4717
  response.hasOwnProperty("jwks_uri"));
4715
4718
  }
4716
4719
 
4717
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4720
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4718
4721
  /*
4719
4722
  * Copyright (c) Microsoft Corporation. All rights reserved.
4720
4723
  * Licensed under the MIT License.
@@ -4724,7 +4727,7 @@ function isCloudInstanceDiscoveryResponse(response) {
4724
4727
  response.hasOwnProperty("metadata"));
4725
4728
  }
4726
4729
 
4727
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4730
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4728
4731
  /*
4729
4732
  * Copyright (c) Microsoft Corporation. All rights reserved.
4730
4733
  * Licensed under the MIT License.
@@ -4734,7 +4737,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
4734
4737
  response.hasOwnProperty("error_description"));
4735
4738
  }
4736
4739
 
4737
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4740
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4738
4741
  /*
4739
4742
  * Copyright (c) Microsoft Corporation. All rights reserved.
4740
4743
  * Licensed under the MIT License.
@@ -5209,7 +5212,7 @@ const IntFields = new Set([
5209
5212
  "multiMatchedRT",
5210
5213
  ]);
5211
5214
 
5212
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5215
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
5213
5216
  /*
5214
5217
  * Copyright (c) Microsoft Corporation. All rights reserved.
5215
5218
  * Licensed under the MIT License.
@@ -5305,7 +5308,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
5305
5308
  };
5306
5309
  };
5307
5310
 
5308
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5311
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
5309
5312
 
5310
5313
  /*
5311
5314
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5414,7 +5417,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5414
5417
  },
5415
5418
  };
5416
5419
 
5417
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5420
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
5418
5421
 
5419
5422
  /*
5420
5423
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6253,7 +6256,7 @@ function buildStaticAuthorityOptions(authOptions) {
6253
6256
  };
6254
6257
  }
6255
6258
 
6256
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6259
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6257
6260
 
6258
6261
  /*
6259
6262
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6284,7 +6287,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6284
6287
  }
6285
6288
  }
6286
6289
 
6287
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6290
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6288
6291
 
6289
6292
  /*
6290
6293
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6387,7 +6390,7 @@ class BaseClient {
6387
6390
  }
6388
6391
  }
6389
6392
 
6390
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6393
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6391
6394
  /*
6392
6395
  * Copyright (c) Microsoft Corporation. All rights reserved.
6393
6396
  * Licensed under the MIT License.
@@ -6413,7 +6416,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6413
6416
  refreshTokenExpired: refreshTokenExpired
6414
6417
  });
6415
6418
 
6416
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6419
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6417
6420
 
6418
6421
  /*
6419
6422
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6464,7 +6467,7 @@ const InteractionRequiredAuthErrorMessage = {
6464
6467
  * Error thrown when user interaction is required.
6465
6468
  */
6466
6469
  class InteractionRequiredAuthError extends AuthError {
6467
- constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims) {
6470
+ constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
6468
6471
  super(errorCode, errorMessage, subError);
6469
6472
  Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
6470
6473
  this.timestamp = timestamp || Constants.EMPTY_STRING;
@@ -6472,6 +6475,7 @@ class InteractionRequiredAuthError extends AuthError {
6472
6475
  this.correlationId = correlationId || Constants.EMPTY_STRING;
6473
6476
  this.claims = claims || Constants.EMPTY_STRING;
6474
6477
  this.name = "InteractionRequiredAuthError";
6478
+ this.errorNo = errorNo;
6475
6479
  }
6476
6480
  }
6477
6481
  /**
@@ -6500,7 +6504,7 @@ function createInteractionRequiredAuthError(errorCode) {
6500
6504
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6501
6505
  }
6502
6506
 
6503
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6507
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6504
6508
  /*
6505
6509
  * Copyright (c) Microsoft Corporation. All rights reserved.
6506
6510
  * Licensed under the MIT License.
@@ -6516,7 +6520,7 @@ class CacheRecord {
6516
6520
  }
6517
6521
  }
6518
6522
 
6519
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6523
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6520
6524
 
6521
6525
  /*
6522
6526
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6588,7 +6592,7 @@ class ProtocolUtils {
6588
6592
  }
6589
6593
  }
6590
6594
 
6591
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6595
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6592
6596
 
6593
6597
  /*
6594
6598
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6673,7 +6677,7 @@ class PopTokenGenerator {
6673
6677
  }
6674
6678
  }
6675
6679
 
6676
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6680
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6677
6681
  /*
6678
6682
  * Copyright (c) Microsoft Corporation. All rights reserved.
6679
6683
  * Licensed under the MIT License.
@@ -6700,12 +6704,19 @@ class PopTokenGenerator {
6700
6704
  }
6701
6705
  }
6702
6706
 
6703
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6707
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6704
6708
 
6705
6709
  /*
6706
6710
  * Copyright (c) Microsoft Corporation. All rights reserved.
6707
6711
  * Licensed under the MIT License.
6708
6712
  */
6713
+ function parseServerErrorNo(serverResponse) {
6714
+ const errorCodePrefix = "code=";
6715
+ const errorCodePrefixIndex = serverResponse.error_uri?.lastIndexOf(errorCodePrefix);
6716
+ return errorCodePrefixIndex && errorCodePrefixIndex >= 0
6717
+ ? serverResponse.error_uri?.substring(errorCodePrefixIndex + errorCodePrefix.length)
6718
+ : undefined;
6719
+ }
6709
6720
  /**
6710
6721
  * Class that handles response parsing.
6711
6722
  * @internal
@@ -6753,10 +6764,11 @@ class ResponseHandler {
6753
6764
  if (serverResponse.error ||
6754
6765
  serverResponse.error_description ||
6755
6766
  serverResponse.suberror) {
6767
+ const serverErrorNo = parseServerErrorNo(serverResponse);
6756
6768
  if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
6757
- throw new InteractionRequiredAuthError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || "", serverResponse.trace_id || "", serverResponse.correlation_id || "", serverResponse.claims || "");
6769
+ throw new InteractionRequiredAuthError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || "", serverResponse.trace_id || "", serverResponse.correlation_id || "", serverResponse.claims || "", serverErrorNo);
6758
6770
  }
6759
- throw new ServerError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror);
6771
+ throw new ServerError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverErrorNo);
6760
6772
  }
6761
6773
  }
6762
6774
  /**
@@ -6770,7 +6782,10 @@ class ResponseHandler {
6770
6782
  serverResponse.error_description ||
6771
6783
  serverResponse.suberror) {
6772
6784
  const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;
6773
- const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror);
6785
+ const serverErrorNo = serverResponse.error_codes?.length
6786
+ ? serverResponse.error_codes[0]
6787
+ : undefined;
6788
+ const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo);
6774
6789
  // check if 500 error
6775
6790
  if (refreshAccessToken &&
6776
6791
  serverResponse.status &&
@@ -6790,7 +6805,7 @@ class ResponseHandler {
6790
6805
  return;
6791
6806
  }
6792
6807
  if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
6793
- throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING);
6808
+ throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING, serverErrorNo);
6794
6809
  }
6795
6810
  throw serverError;
6796
6811
  }
@@ -7053,7 +7068,25 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, idTokenClai
7053
7068
  return baseAccount;
7054
7069
  }
7055
7070
 
7056
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7071
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7072
+ /*
7073
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7074
+ * Licensed under the MIT License.
7075
+ */
7076
+ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
7077
+ if (typeof clientAssertion === "string") {
7078
+ return clientAssertion;
7079
+ }
7080
+ else {
7081
+ const config = {
7082
+ clientId: clientId,
7083
+ tokenEndpoint: tokenEndpoint,
7084
+ };
7085
+ return clientAssertion(config);
7086
+ }
7087
+ }
7088
+
7089
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7057
7090
 
7058
7091
  /*
7059
7092
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7214,7 +7247,7 @@ class AuthorizationCodeClient extends BaseClient {
7214
7247
  }
7215
7248
  if (this.config.clientCredentials.clientAssertion) {
7216
7249
  const clientAssertion = this.config.clientCredentials.clientAssertion;
7217
- parameterBuilder.addClientAssertion(clientAssertion.assertion);
7250
+ parameterBuilder.addClientAssertion(await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));
7218
7251
  parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
7219
7252
  }
7220
7253
  parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
@@ -7462,7 +7495,7 @@ class AuthorizationCodeClient extends BaseClient {
7462
7495
  }
7463
7496
  }
7464
7497
 
7465
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7498
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7466
7499
 
7467
7500
  /*
7468
7501
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7622,7 +7655,7 @@ class RefreshTokenClient extends BaseClient {
7622
7655
  }
7623
7656
  if (this.config.clientCredentials.clientAssertion) {
7624
7657
  const clientAssertion = this.config.clientCredentials.clientAssertion;
7625
- parameterBuilder.addClientAssertion(clientAssertion.assertion);
7658
+ parameterBuilder.addClientAssertion(await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));
7626
7659
  parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
7627
7660
  }
7628
7661
  if (request.authenticationScheme === AuthenticationScheme.POP) {
@@ -7669,7 +7702,7 @@ class RefreshTokenClient extends BaseClient {
7669
7702
  }
7670
7703
  }
7671
7704
 
7672
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7705
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7673
7706
 
7674
7707
  /*
7675
7708
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7805,7 +7838,7 @@ class SilentFlowClient extends BaseClient {
7805
7838
  }
7806
7839
  }
7807
7840
 
7808
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7841
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7809
7842
 
7810
7843
  /*
7811
7844
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7820,7 +7853,7 @@ const StubbedNetworkModule = {
7820
7853
  },
7821
7854
  };
7822
7855
 
7823
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7856
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7824
7857
  /*
7825
7858
  * Copyright (c) Microsoft Corporation. All rights reserved.
7826
7859
  * Licensed under the MIT License.
@@ -7828,7 +7861,7 @@ const StubbedNetworkModule = {
7828
7861
  const missingKidError = "missing_kid_error";
7829
7862
  const missingAlgError = "missing_alg_error";
7830
7863
 
7831
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7864
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7832
7865
 
7833
7866
  /*
7834
7867
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7853,7 +7886,7 @@ function createJoseHeaderError(code) {
7853
7886
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
7854
7887
  }
7855
7888
 
7856
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7889
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7857
7890
 
7858
7891
  /*
7859
7892
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7893,7 +7926,7 @@ class JoseHeader {
7893
7926
  }
7894
7927
  }
7895
7928
 
7896
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7929
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7897
7930
 
7898
7931
  /*
7899
7932
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7951,7 +7984,7 @@ class AuthenticationHeaderParser {
7951
7984
  }
7952
7985
  }
7953
7986
 
7954
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7987
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7955
7988
 
7956
7989
  /*
7957
7990
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8155,7 +8188,7 @@ class ServerTelemetryManager {
8155
8188
  }
8156
8189
  }
8157
8190
 
8158
- /*! @azure/msal-common v14.9.0 2024-04-11 */
8191
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
8159
8192
 
8160
8193
  /*
8161
8194
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8234,7 +8267,7 @@ class StubPerformanceClient {
8234
8267
  }
8235
8268
  }
8236
8269
 
8237
- /*! @azure/msal-common v14.9.0 2024-04-11 */
8270
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
8238
8271
 
8239
8272
  /*
8240
8273
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8332,6 +8365,10 @@ function addError(error, logger, event, stackMaxSize = 5) {
8332
8365
  else if (error instanceof AuthError) {
8333
8366
  event.errorCode = error.errorCode;
8334
8367
  event.subErrorCode = error.subError;
8368
+ if (error instanceof ServerError ||
8369
+ error instanceof InteractionRequiredAuthError) {
8370
+ event.serverErrorNo = error.errorNo;
8371
+ }
8335
8372
  return;
8336
8373
  }
8337
8374
  else if (error instanceof CacheError) {
@@ -8614,7 +8651,7 @@ class PerformanceClient {
8614
8651
  const context = JSON.stringify(endContext(event, this.abbreviations, this.eventStack.get(rootEvent.correlationId), error));
8615
8652
  if (isRoot) {
8616
8653
  queueInfo = this.getQueueInfo(event.correlationId);
8617
- this.discardCache(rootEvent.correlationId);
8654
+ this.discardMeasurements(rootEvent.correlationId);
8618
8655
  }
8619
8656
  else {
8620
8657
  rootEvent.incompleteSubMeasurements?.delete(event.eventId);
@@ -8736,21 +8773,13 @@ class PerformanceClient {
8736
8773
  };
8737
8774
  }
8738
8775
  /**
8739
- * Removes measurements for a given correlation id.
8776
+ * Removes measurements and aux data for a given correlation id.
8740
8777
  *
8741
8778
  * @param {string} correlationId
8742
8779
  */
8743
8780
  discardMeasurements(correlationId) {
8744
8781
  this.logger.trace("PerformanceClient: Performance measurements discarded", correlationId);
8745
8782
  this.eventsByCorrelationId.delete(correlationId);
8746
- }
8747
- /**
8748
- * Removes cache for a given correlation id.
8749
- *
8750
- * @param {string} correlationId correlation identifier
8751
- */
8752
- discardCache(correlationId) {
8753
- this.discardMeasurements(correlationId);
8754
8783
  this.logger.trace("PerformanceClient: QueueMeasurements discarded", correlationId);
8755
8784
  this.queueMeasurements.delete(correlationId);
8756
8785
  this.logger.trace("PerformanceClient: Pre-queue times discarded", correlationId);
@@ -8765,6 +8794,12 @@ class PerformanceClient {
8765
8794
  * @returns {string}
8766
8795
  */
8767
8796
  addPerformanceCallback(callback) {
8797
+ for (const [id, cb] of this.callbacks) {
8798
+ if (cb.toString() === callback.toString()) {
8799
+ this.logger.warning(`PerformanceClient: Performance callback is already registered with id: ${id}`);
8800
+ return id;
8801
+ }
8802
+ }
8768
8803
  const callbackId = this.generateId();
8769
8804
  this.callbacks.set(callbackId, callback);
8770
8805
  this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${callbackId}`);
@@ -9814,6 +9849,8 @@ var BrowserUtils = /*#__PURE__*/Object.freeze({
9814
9849
  createGuid: createGuid,
9815
9850
  getCurrentUri: getCurrentUri,
9816
9851
  getHomepage: getHomepage,
9852
+ invoke: invoke,
9853
+ invokeAsync: invokeAsync,
9817
9854
  isInIframe: isInIframe,
9818
9855
  isInPopup: isInPopup,
9819
9856
  preconnect: preconnect,
@@ -10094,7 +10131,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10094
10131
 
10095
10132
  /* eslint-disable header/header */
10096
10133
  const name = "@azure/msal-browser";
10097
- const version = "3.13.0";
10134
+ const version = "3.14.0";
10098
10135
 
10099
10136
  /*
10100
10137
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10397,6 +10434,9 @@ class TeamsAppOperatingContext extends BaseOperatingContext {
10397
10434
  * TODO: Add implementation to check for presence of inject Nested App Auth Bridge JavaScript interface
10398
10435
  *
10399
10436
  */
10437
+ if (!this.getConfig().auth.supportsNestedAppAuth) {
10438
+ return false;
10439
+ }
10400
10440
  try {
10401
10441
  if (typeof window !== "undefined") {
10402
10442
  const bridgeProxy = await BridgeProxy.create();
@@ -10411,22 +10451,18 @@ class TeamsAppOperatingContext extends BaseOperatingContext {
10411
10451
  await bridgeProxy.getActiveAccount();
10412
10452
  }
10413
10453
  }
10414
- catch (e) {
10415
- this.activeAccount = undefined;
10454
+ catch {
10455
+ // Ignore errors
10416
10456
  }
10417
10457
  this.bridgeProxy = bridgeProxy;
10418
10458
  this.available = bridgeProxy !== undefined;
10419
10459
  }
10420
- else {
10421
- this.available = false;
10422
- }
10423
10460
  }
10424
- catch (e) {
10425
- this.available = false;
10426
- }
10427
- finally {
10428
- return this.available;
10461
+ catch (ex) {
10462
+ this.logger.infoPii(`Could not initialize Nested App Auth bridge (${ex})`);
10429
10463
  }
10464
+ this.logger.info(`Nested App Auth Bridge available: ${this.available}`);
10465
+ return this.available;
10430
10466
  }
10431
10467
  }
10432
10468
  /*
@@ -10498,8 +10534,7 @@ async function createController(config) {
10498
10534
  const teamsApp = new TeamsAppOperatingContext(config);
10499
10535
  const operatingContexts = [standard.initialize(), teamsApp.initialize()];
10500
10536
  await Promise.all(operatingContexts);
10501
- if (teamsApp.isAvailable() &&
10502
- teamsApp.getConfig().auth.supportsNestedAppAuth) {
10537
+ if (teamsApp.isAvailable()) {
10503
10538
  const controller = await Promise.resolve().then(function () { return NestedAppAuthController$1; });
10504
10539
  return controller.NestedAppAuthController.createController(teamsApp);
10505
10540
  }
@@ -14692,11 +14727,10 @@ class RedirectClient extends StandardInteractionClient {
14692
14727
  * Checks if navigateToLoginRequestUrl is set, and:
14693
14728
  * - if true, performs logic to cache and navigate
14694
14729
  * - if false, handles hash string and parses response
14695
- * @param hash {string?} url hash
14696
- * @param performanceClient {IPerformanceClient?}
14697
- * @param correlationId {string?} correlation identifier
14730
+ * @param hash {string} url hash
14731
+ * @param parentMeasurement {InProgressPerformanceEvent} parent measurement
14698
14732
  */
14699
- async handleRedirectPromise(hash, performanceClient, correlationId) {
14733
+ async handleRedirectPromise(hash = "", parentMeasurement) {
14700
14734
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);
14701
14735
  try {
14702
14736
  if (!this.browserStorage.isInteractionInProgress(true)) {
@@ -14708,9 +14742,7 @@ class RedirectClient extends StandardInteractionClient {
14708
14742
  // Not a recognized server response hash or hash not associated with a redirect request
14709
14743
  this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache.");
14710
14744
  this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
14711
- if (performanceClient && correlationId) {
14712
- performanceClient?.addFields({ errorCode: "no_server_response" }, correlationId);
14713
- }
14745
+ parentMeasurement.event.errorCode = "no_server_response";
14714
14746
  return null;
14715
14747
  }
14716
14748
  // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated
@@ -15526,6 +15558,19 @@ class SilentAuthCodeClient extends StandardInteractionClient {
15526
15558
  * Copyright (c) Microsoft Corporation. All rights reserved.
15527
15559
  * Licensed under the MIT License.
15528
15560
  */
15561
+ function getAccountType(account) {
15562
+ const idTokenClaims = account?.idTokenClaims;
15563
+ if (idTokenClaims?.tfp || idTokenClaims?.acr) {
15564
+ return "B2C";
15565
+ }
15566
+ if (!idTokenClaims?.tid) {
15567
+ return undefined;
15568
+ }
15569
+ else if (idTokenClaims?.tid === "9188040d-6c67-4c5b-b112-36a304b66dad") {
15570
+ return "MSA";
15571
+ }
15572
+ return "AAD";
15573
+ }
15529
15574
  class StandardController {
15530
15575
  /**
15531
15576
  * @constructor
@@ -15695,7 +15740,7 @@ class StandardController {
15695
15740
  else {
15696
15741
  this.logger.trace("handleRedirectPromise - acquiring token from web flow");
15697
15742
  const redirectClient = this.createRedirectClient(correlationId);
15698
- redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), PerformanceEvents.HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(hash, this.performanceClient, rootMeasurement.event.correlationId);
15743
+ redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), PerformanceEvents.HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(hash, rootMeasurement);
15699
15744
  }
15700
15745
  return redirectResponse
15701
15746
  .then((result) => {
@@ -15710,10 +15755,24 @@ class StandardController {
15710
15755
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
15711
15756
  this.logger.verbose("handleRedirectResponse returned result, acquire token success");
15712
15757
  }
15713
- rootMeasurement.end({ success: true });
15758
+ rootMeasurement.end({
15759
+ success: true,
15760
+ accountType: getAccountType(result.account),
15761
+ });
15762
+ }
15763
+ else {
15764
+ /*
15765
+ * Instrument an event only if an error code is set. Otherwise, discard it when the redirect response
15766
+ * is empty and the error code is missing.
15767
+ */
15768
+ if (rootMeasurement.event.errorCode) {
15769
+ rootMeasurement.end({ success: false });
15770
+ }
15771
+ else {
15772
+ rootMeasurement.discard();
15773
+ }
15714
15774
  }
15715
15775
  this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
15716
- rootMeasurement.end({ success: false });
15717
15776
  return result;
15718
15777
  })
15719
15778
  .catch((e) => {
@@ -15803,6 +15862,10 @@ class StandardController {
15803
15862
  acquireTokenPopup(request) {
15804
15863
  const correlationId = this.getRequestCorrelationId(request);
15805
15864
  const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);
15865
+ atPopupMeasurement.add({
15866
+ scenarioId: request.scenarioId,
15867
+ accountType: getAccountType(request.account),
15868
+ });
15806
15869
  try {
15807
15870
  this.logger.verbose("acquireTokenPopup called", correlationId);
15808
15871
  preflightCheck(this.initialized);
@@ -15832,6 +15895,7 @@ class StandardController {
15832
15895
  success: true,
15833
15896
  isNativeBroker: true,
15834
15897
  requestId: response.requestId,
15898
+ accountType: getAccountType(response.account),
15835
15899
  });
15836
15900
  return response;
15837
15901
  })
@@ -15867,13 +15931,12 @@ class StandardController {
15867
15931
  else {
15868
15932
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
15869
15933
  }
15870
- atPopupMeasurement.add({
15871
- accessTokenSize: result.accessToken.length,
15872
- idTokenSize: result.idToken.length,
15873
- });
15874
15934
  atPopupMeasurement.end({
15875
15935
  success: true,
15876
15936
  requestId: result.requestId,
15937
+ accessTokenSize: result.accessToken.length,
15938
+ idTokenSize: result.idToken.length,
15939
+ accountType: getAccountType(result.account),
15877
15940
  });
15878
15941
  return result;
15879
15942
  })
@@ -15932,6 +15995,10 @@ class StandardController {
15932
15995
  this.ssoSilentMeasurement?.increment({
15933
15996
  visibilityChangeCount: 0,
15934
15997
  });
15998
+ this.ssoSilentMeasurement?.add({
15999
+ scenarioId: request.scenarioId,
16000
+ accountType: getAccountType(request.account),
16001
+ });
15935
16002
  document.addEventListener("visibilitychange", this.trackPageVisibilityWithMeasurement);
15936
16003
  this.logger.verbose("ssoSilent called", correlationId);
15937
16004
  this.eventHandler.emitEvent(EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
@@ -15954,14 +16021,13 @@ class StandardController {
15954
16021
  return result
15955
16022
  .then((response) => {
15956
16023
  this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
15957
- this.ssoSilentMeasurement?.add({
15958
- accessTokenSize: response.accessToken.length,
15959
- idTokenSize: response.idToken.length,
15960
- });
15961
16024
  this.ssoSilentMeasurement?.end({
15962
16025
  success: true,
15963
16026
  isNativeBroker: response.fromNativeBroker,
15964
16027
  requestId: response.requestId,
16028
+ accessTokenSize: response.accessToken.length,
16029
+ idTokenSize: response.idToken.length,
16030
+ accountType: getAccountType(response.account),
15965
16031
  });
15966
16032
  return response;
15967
16033
  })
@@ -15992,6 +16058,7 @@ class StandardController {
15992
16058
  preflightCheck(this.initialized);
15993
16059
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
15994
16060
  const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, correlationId);
16061
+ atbcMeasurement.add({ scenarioId: request.scenarioId });
15995
16062
  try {
15996
16063
  if (request.code && request.nativeAccountId) {
15997
16064
  // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
@@ -16009,14 +16076,13 @@ class StandardController {
16009
16076
  .then((result) => {
16010
16077
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
16011
16078
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
16012
- atbcMeasurement.add({
16013
- accessTokenSize: result.accessToken.length,
16014
- idTokenSize: result.idToken.length,
16015
- });
16016
16079
  atbcMeasurement.end({
16017
16080
  success: true,
16018
16081
  isNativeBroker: result.fromNativeBroker,
16019
16082
  requestId: result.requestId,
16083
+ accessTokenSize: result.accessToken.length,
16084
+ idTokenSize: result.idToken.length,
16085
+ accountType: getAccountType(result.account),
16020
16086
  });
16021
16087
  return result;
16022
16088
  })
@@ -16038,7 +16104,7 @@ class StandardController {
16038
16104
  }
16039
16105
  else if (request.nativeAccountId) {
16040
16106
  if (this.canUseNative(request, request.nativeAccountId)) {
16041
- return await this.acquireTokenNative({
16107
+ const result = await this.acquireTokenNative({
16042
16108
  ...request,
16043
16109
  correlationId,
16044
16110
  }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
@@ -16049,6 +16115,11 @@ class StandardController {
16049
16115
  }
16050
16116
  throw e;
16051
16117
  });
16118
+ atbcMeasurement.end({
16119
+ accountType: getAccountType(result.account),
16120
+ success: true,
16121
+ });
16122
+ return result;
16052
16123
  }
16053
16124
  else {
16054
16125
  throw createBrowserAuthError(unableToAcquireTokenFromNativePlatform);
@@ -16611,6 +16682,7 @@ class StandardController {
16611
16682
  const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);
16612
16683
  atsMeasurement.add({
16613
16684
  cacheLookupPolicy: request.cacheLookupPolicy,
16685
+ scenarioId: request.scenarioId,
16614
16686
  });
16615
16687
  preflightCheck(this.initialized);
16616
16688
  this.logger.verbose("acquireTokenSilent called", correlationId);
@@ -16618,6 +16690,7 @@ class StandardController {
16618
16690
  if (!account) {
16619
16691
  throw createBrowserAuthError(noAccountError);
16620
16692
  }
16693
+ atsMeasurement.add({ accountType: getAccountType(account) });
16621
16694
  const thumbprint = {
16622
16695
  clientId: this.config.auth.clientId,
16623
16696
  authority: request.authority || Constants.EMPTY_STRING,
@@ -16641,16 +16714,14 @@ class StandardController {
16641
16714
  }, account)
16642
16715
  .then((result) => {
16643
16716
  this.activeSilentTokenRequests.delete(silentRequestKey);
16644
- atsMeasurement.add({
16645
- accessTokenSize: result.accessToken.length,
16646
- idTokenSize: result.idToken.length,
16647
- });
16648
16717
  atsMeasurement.end({
16649
16718
  success: true,
16650
16719
  fromCache: result.fromCache,
16651
16720
  isNativeBroker: result.fromNativeBroker,
16652
16721
  cacheLookupPolicy: request.cacheLookupPolicy,
16653
16722
  requestId: result.requestId,
16723
+ accessTokenSize: result.accessToken.length,
16724
+ idTokenSize: result.idToken.length,
16654
16725
  });
16655
16726
  return result;
16656
16727
  })
@@ -16696,23 +16767,22 @@ class StandardController {
16696
16767
  const shouldTryToResolveSilently = checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, cacheLookupPolicy);
16697
16768
  if (shouldTryToResolveSilently) {
16698
16769
  if (!this.activeIframeRequest) {
16699
- let _resolve, _reject;
16770
+ let _resolve;
16700
16771
  // Always set the active request tracker immediately after checking it to prevent races
16701
16772
  this.activeIframeRequest = [
16702
- new Promise((resolve, reject) => {
16773
+ new Promise((resolve) => {
16703
16774
  _resolve = resolve;
16704
- _reject = reject;
16705
16775
  }),
16706
16776
  silentRequest.correlationId,
16707
16777
  ];
16708
16778
  this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.", silentRequest.correlationId);
16709
16779
  return invokeAsync(this.acquireTokenBySilentIframe.bind(this), PerformanceEvents.AcquireTokenBySilentIframe, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest)
16710
16780
  .then((iframeResult) => {
16711
- _resolve();
16781
+ _resolve(true);
16712
16782
  return iframeResult;
16713
16783
  })
16714
16784
  .catch((e) => {
16715
- _reject(e);
16785
+ _resolve(false);
16716
16786
  throw e;
16717
16787
  })
16718
16788
  .finally(() => {
@@ -16726,21 +16796,20 @@ class StandardController {
16726
16796
  awaitConcurrentIframeMeasure.add({
16727
16797
  awaitIframeCorrelationId: activeCorrelationId,
16728
16798
  });
16729
- // Await for errors first so we can distinguish errors thrown by activePromise versus errors thrown by .then below
16730
- await activePromise.catch(() => {
16731
- awaitConcurrentIframeMeasure.end({
16732
- success: false,
16733
- });
16734
- this.logger.info(`Iframe request with correlationId: ${activeCorrelationId} failed. Interaction is required.`);
16735
- // If previous iframe request failed, it's unlikely to succeed this time. Throw original error.
16736
- throw refreshTokenError;
16799
+ const activePromiseResult = await activePromise;
16800
+ awaitConcurrentIframeMeasure.end({
16801
+ success: activePromiseResult,
16737
16802
  });
16738
- return activePromise.then(() => {
16739
- awaitConcurrentIframeMeasure.end({ success: true });
16803
+ if (activePromiseResult) {
16740
16804
  this.logger.verbose(`Parallel iframe request with correlationId: ${activeCorrelationId} succeeded. Retrying cache and/or RT redemption`, silentRequest.correlationId);
16741
16805
  // Retry cache lookup and/or RT exchange after iframe completes
16742
16806
  return this.acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy);
16743
- });
16807
+ }
16808
+ else {
16809
+ this.logger.info(`Iframe request with correlationId: ${activeCorrelationId} failed. Interaction is required.`);
16810
+ // If previous iframe request failed, it's unlikely to succeed this time. Throw original error.
16811
+ throw refreshTokenError;
16812
+ }
16744
16813
  }
16745
16814
  else {
16746
16815
  // Cache policy set to skip and another iframe request is already in progress
@@ -17847,6 +17916,9 @@ const stubbedPublicClientApplication = {
17847
17916
  getAllAccounts: () => {
17848
17917
  return [];
17849
17918
  },
17919
+ getAccount: () => {
17920
+ return null;
17921
+ },
17850
17922
  getAccountByHomeId: () => {
17851
17923
  return null;
17852
17924
  },