@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,4 +1,4 @@
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
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -6,7 +6,7 @@
6
6
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
7
7
  })(this, (function (exports) { 'use strict';
8
8
 
9
- /*! @azure/msal-common v14.9.0 2024-04-11 */
9
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
12
12
  * Licensed under the MIT License.
@@ -70,10 +70,11 @@
70
70
  INVALID_INSTANCE: "invalid_instance",
71
71
  };
72
72
  const HttpStatus = {
73
- SUCCESS_RANGE_START: 200,
74
73
  SUCCESS: 200,
74
+ SUCCESS_RANGE_START: 200,
75
75
  SUCCESS_RANGE_END: 299,
76
76
  REDIRECT: 302,
77
+ CLIENT_ERROR: 400,
77
78
  CLIENT_ERROR_RANGE_START: 400,
78
79
  BAD_REQUEST: 400,
79
80
  UNAUTHORIZED: 401,
@@ -81,11 +82,12 @@
81
82
  REQUEST_TIMEOUT: 408,
82
83
  TOO_MANY_REQUESTS: 429,
83
84
  CLIENT_ERROR_RANGE_END: 499,
85
+ SERVER_ERROR: 500,
84
86
  SERVER_ERROR_RANGE_START: 500,
85
- INTERNAL_SERVER_ERROR: 500,
86
87
  SERVICE_UNAVAILABLE: 503,
87
88
  GATEWAY_TIMEOUT: 504,
88
89
  SERVER_ERROR_RANGE_END: 599,
90
+ MULTI_SIDED_ERROR: 600,
89
91
  };
90
92
  const OIDC_DEFAULT_SCOPES = [
91
93
  Constants.OPENID_SCOPE,
@@ -312,7 +314,7 @@
312
314
  // Token renewal offset default in seconds
313
315
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
314
316
 
315
- /*! @azure/msal-common v14.9.0 2024-04-11 */
317
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
316
318
  /*
317
319
  * Copyright (c) Microsoft Corporation. All rights reserved.
318
320
  * Licensed under the MIT License.
@@ -329,7 +331,7 @@
329
331
  unexpectedError: unexpectedError
330
332
  });
331
333
 
332
- /*! @azure/msal-common v14.9.0 2024-04-11 */
334
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
333
335
 
334
336
  /*
335
337
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -378,7 +380,7 @@
378
380
  : AuthErrorMessages[code]);
379
381
  }
380
382
 
381
- /*! @azure/msal-common v14.9.0 2024-04-11 */
383
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
382
384
  /*
383
385
  * Copyright (c) Microsoft Corporation. All rights reserved.
384
386
  * Licensed under the MIT License.
@@ -476,7 +478,7 @@
476
478
  userTimeoutReached: userTimeoutReached
477
479
  });
478
480
 
479
- /*! @azure/msal-common v14.9.0 2024-04-11 */
481
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
480
482
 
481
483
  /*
482
484
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -728,7 +730,7 @@
728
730
  return new ClientAuthError(errorCode, additionalMessage);
729
731
  }
730
732
 
731
- /*! @azure/msal-common v14.9.0 2024-04-11 */
733
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
732
734
 
733
735
  /*
734
736
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -761,7 +763,7 @@
761
763
  },
762
764
  };
763
765
 
764
- /*! @azure/msal-common v14.9.0 2024-04-11 */
766
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
765
767
 
766
768
  /*
767
769
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -952,12 +954,12 @@
952
954
  }
953
955
  }
954
956
 
955
- /*! @azure/msal-common v14.9.0 2024-04-11 */
957
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
956
958
  /* eslint-disable header/header */
957
959
  const name$1 = "@azure/msal-common";
958
- const version$1 = "14.9.0";
960
+ const version$1 = "14.10.0";
959
961
 
960
- /*! @azure/msal-common v14.9.0 2024-04-11 */
962
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
961
963
  /*
962
964
  * Copyright (c) Microsoft Corporation. All rights reserved.
963
965
  * Licensed under the MIT License.
@@ -977,7 +979,7 @@
977
979
  AzureUsGovernment: "https://login.microsoftonline.us",
978
980
  };
979
981
 
980
- /*! @azure/msal-common v14.9.0 2024-04-11 */
982
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
981
983
 
982
984
  /*
983
985
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1038,7 +1040,7 @@
1038
1040
  }
1039
1041
  }
1040
1042
 
1041
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1043
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1042
1044
  /*
1043
1045
  * Copyright (c) Microsoft Corporation. All rights reserved.
1044
1046
  * Licensed under the MIT License.
@@ -1075,7 +1077,7 @@
1075
1077
  return cachedAtSec > nowSeconds();
1076
1078
  }
1077
1079
 
1078
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1080
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1079
1081
 
1080
1082
  /*
1081
1083
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1402,7 +1404,7 @@
1402
1404
  return metadata.expiresAt <= nowSeconds();
1403
1405
  }
1404
1406
 
1405
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1407
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1406
1408
  /*
1407
1409
  * Copyright (c) Microsoft Corporation. All rights reserved.
1408
1410
  * Licensed under the MIT License.
@@ -1456,7 +1458,7 @@
1456
1458
  urlParseError: urlParseError
1457
1459
  });
1458
1460
 
1459
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1461
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1460
1462
 
1461
1463
  /*
1462
1464
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1594,7 +1596,7 @@
1594
1596
  return new ClientConfigurationError(errorCode);
1595
1597
  }
1596
1598
 
1597
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1599
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1598
1600
  /*
1599
1601
  * Copyright (c) Microsoft Corporation. All rights reserved.
1600
1602
  * Licensed under the MIT License.
@@ -1691,7 +1693,7 @@
1691
1693
  }
1692
1694
  }
1693
1695
 
1694
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1696
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1695
1697
 
1696
1698
  /*
1697
1699
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1891,7 +1893,7 @@
1891
1893
  }
1892
1894
  }
1893
1895
 
1894
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1896
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1895
1897
 
1896
1898
  /*
1897
1899
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1931,7 +1933,7 @@
1931
1933
  };
1932
1934
  }
1933
1935
 
1934
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1936
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1935
1937
  /*
1936
1938
  * Copyright (c) Microsoft Corporation. All rights reserved.
1937
1939
  * Licensed under the MIT License.
@@ -1993,7 +1995,7 @@
1993
1995
  return updatedAccountInfo;
1994
1996
  }
1995
1997
 
1996
- /*! @azure/msal-common v14.9.0 2024-04-11 */
1998
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
1997
1999
  /*
1998
2000
  * Copyright (c) Microsoft Corporation. All rights reserved.
1999
2001
  * Licensed under the MIT License.
@@ -2008,7 +2010,7 @@
2008
2010
  Ciam: 3,
2009
2011
  };
2010
2012
 
2011
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2013
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2012
2014
  /*
2013
2015
  * Copyright (c) Microsoft Corporation. All rights reserved.
2014
2016
  * Licensed under the MIT License.
@@ -2030,7 +2032,7 @@
2030
2032
  return null;
2031
2033
  }
2032
2034
 
2033
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2035
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2034
2036
  /*
2035
2037
  * Copyright (c) Microsoft Corporation. All rights reserved.
2036
2038
  * Licensed under the MIT License.
@@ -2043,7 +2045,7 @@
2043
2045
  OIDC: "OIDC",
2044
2046
  };
2045
2047
 
2046
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2048
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2047
2049
 
2048
2050
  /*
2049
2051
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2290,7 +2292,7 @@
2290
2292
  }
2291
2293
  }
2292
2294
 
2293
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2295
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2294
2296
 
2295
2297
  /*
2296
2298
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2337,7 +2339,7 @@
2337
2339
  return null;
2338
2340
  }
2339
2341
 
2340
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2342
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2341
2343
 
2342
2344
  /*
2343
2345
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2501,7 +2503,7 @@
2501
2503
  }
2502
2504
  }
2503
2505
 
2504
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2506
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2505
2507
 
2506
2508
  /*
2507
2509
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2641,7 +2643,7 @@
2641
2643
  return null;
2642
2644
  }
2643
2645
 
2644
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2646
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2645
2647
  /*
2646
2648
  * Copyright (c) Microsoft Corporation. All rights reserved.
2647
2649
  * Licensed under the MIT License.
@@ -2649,7 +2651,7 @@
2649
2651
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2650
2652
  const cacheUnknownErrorCode = "cache_error_unknown";
2651
2653
 
2652
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2654
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2653
2655
 
2654
2656
  /*
2655
2657
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2676,7 +2678,7 @@
2676
2678
  }
2677
2679
  }
2678
2680
 
2679
- /*! @azure/msal-common v14.9.0 2024-04-11 */
2681
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
2680
2682
 
2681
2683
  /*
2682
2684
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3931,7 +3933,7 @@
3931
3933
  }
3932
3934
  }
3933
3935
 
3934
- /*! @azure/msal-common v14.9.0 2024-04-11 */
3936
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
3935
3937
 
3936
3938
  /*
3937
3939
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4029,7 +4031,7 @@
4029
4031
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4030
4032
  }
4031
4033
 
4032
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4034
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4033
4035
 
4034
4036
  /*
4035
4037
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4039,14 +4041,15 @@
4039
4041
  * Error thrown when there is an error with the server code, for example, unavailability.
4040
4042
  */
4041
4043
  class ServerError extends AuthError {
4042
- constructor(errorCode, errorMessage, subError) {
4044
+ constructor(errorCode, errorMessage, subError, errorNo) {
4043
4045
  super(errorCode, errorMessage, subError);
4044
4046
  this.name = "ServerError";
4047
+ this.errorNo = errorNo;
4045
4048
  Object.setPrototypeOf(this, ServerError.prototype);
4046
4049
  }
4047
4050
  }
4048
4051
 
4049
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4052
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4050
4053
 
4051
4054
  /*
4052
4055
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4144,7 +4147,7 @@
4144
4147
  }
4145
4148
  }
4146
4149
 
4147
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4150
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4148
4151
 
4149
4152
  /*
4150
4153
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4181,7 +4184,7 @@
4181
4184
  }
4182
4185
  }
4183
4186
 
4184
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4187
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4185
4188
  /*
4186
4189
  * Copyright (c) Microsoft Corporation. All rights reserved.
4187
4190
  * Licensed under the MIT License.
@@ -4191,7 +4194,7 @@
4191
4194
  UPN: "UPN",
4192
4195
  };
4193
4196
 
4194
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4197
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4195
4198
  /*
4196
4199
  * Copyright (c) Microsoft Corporation. All rights reserved.
4197
4200
  * Licensed under the MIT License.
@@ -4238,7 +4241,7 @@
4238
4241
  const LOGIN_HINT = "login_hint";
4239
4242
  const DOMAIN_HINT = "domain_hint";
4240
4243
 
4241
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4244
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4242
4245
 
4243
4246
  /*
4244
4247
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4322,7 +4325,7 @@
4322
4325
  }
4323
4326
  }
4324
4327
 
4325
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4328
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4326
4329
 
4327
4330
  /*
4328
4331
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4706,7 +4709,7 @@
4706
4709
  }
4707
4710
  }
4708
4711
 
4709
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4712
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4710
4713
  /*
4711
4714
  * Copyright (c) Microsoft Corporation. All rights reserved.
4712
4715
  * Licensed under the MIT License.
@@ -4718,7 +4721,7 @@
4718
4721
  response.hasOwnProperty("jwks_uri"));
4719
4722
  }
4720
4723
 
4721
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4724
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4722
4725
  /*
4723
4726
  * Copyright (c) Microsoft Corporation. All rights reserved.
4724
4727
  * Licensed under the MIT License.
@@ -4728,7 +4731,7 @@
4728
4731
  response.hasOwnProperty("metadata"));
4729
4732
  }
4730
4733
 
4731
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4734
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4732
4735
  /*
4733
4736
  * Copyright (c) Microsoft Corporation. All rights reserved.
4734
4737
  * Licensed under the MIT License.
@@ -4738,7 +4741,7 @@
4738
4741
  response.hasOwnProperty("error_description"));
4739
4742
  }
4740
4743
 
4741
- /*! @azure/msal-common v14.9.0 2024-04-11 */
4744
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
4742
4745
  /*
4743
4746
  * Copyright (c) Microsoft Corporation. All rights reserved.
4744
4747
  * Licensed under the MIT License.
@@ -5213,7 +5216,7 @@
5213
5216
  "multiMatchedRT",
5214
5217
  ]);
5215
5218
 
5216
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5219
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
5217
5220
  /*
5218
5221
  * Copyright (c) Microsoft Corporation. All rights reserved.
5219
5222
  * Licensed under the MIT License.
@@ -5309,7 +5312,7 @@
5309
5312
  };
5310
5313
  };
5311
5314
 
5312
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5315
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
5313
5316
 
5314
5317
  /*
5315
5318
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5418,7 +5421,7 @@
5418
5421
  },
5419
5422
  };
5420
5423
 
5421
- /*! @azure/msal-common v14.9.0 2024-04-11 */
5424
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
5422
5425
 
5423
5426
  /*
5424
5427
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6257,7 +6260,7 @@
6257
6260
  };
6258
6261
  }
6259
6262
 
6260
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6263
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6261
6264
 
6262
6265
  /*
6263
6266
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6288,7 +6291,7 @@
6288
6291
  }
6289
6292
  }
6290
6293
 
6291
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6294
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6292
6295
 
6293
6296
  /*
6294
6297
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6391,7 +6394,7 @@
6391
6394
  }
6392
6395
  }
6393
6396
 
6394
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6397
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6395
6398
  /*
6396
6399
  * Copyright (c) Microsoft Corporation. All rights reserved.
6397
6400
  * Licensed under the MIT License.
@@ -6417,7 +6420,7 @@
6417
6420
  refreshTokenExpired: refreshTokenExpired
6418
6421
  });
6419
6422
 
6420
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6423
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6421
6424
 
6422
6425
  /*
6423
6426
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6468,7 +6471,7 @@
6468
6471
  * Error thrown when user interaction is required.
6469
6472
  */
6470
6473
  class InteractionRequiredAuthError extends AuthError {
6471
- constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims) {
6474
+ constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
6472
6475
  super(errorCode, errorMessage, subError);
6473
6476
  Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
6474
6477
  this.timestamp = timestamp || Constants.EMPTY_STRING;
@@ -6476,6 +6479,7 @@
6476
6479
  this.correlationId = correlationId || Constants.EMPTY_STRING;
6477
6480
  this.claims = claims || Constants.EMPTY_STRING;
6478
6481
  this.name = "InteractionRequiredAuthError";
6482
+ this.errorNo = errorNo;
6479
6483
  }
6480
6484
  }
6481
6485
  /**
@@ -6504,7 +6508,7 @@
6504
6508
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6505
6509
  }
6506
6510
 
6507
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6511
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6508
6512
  /*
6509
6513
  * Copyright (c) Microsoft Corporation. All rights reserved.
6510
6514
  * Licensed under the MIT License.
@@ -6520,7 +6524,7 @@
6520
6524
  }
6521
6525
  }
6522
6526
 
6523
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6527
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6524
6528
 
6525
6529
  /*
6526
6530
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6592,7 +6596,7 @@
6592
6596
  }
6593
6597
  }
6594
6598
 
6595
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6599
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6596
6600
 
6597
6601
  /*
6598
6602
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6677,7 +6681,7 @@
6677
6681
  }
6678
6682
  }
6679
6683
 
6680
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6684
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6681
6685
  /*
6682
6686
  * Copyright (c) Microsoft Corporation. All rights reserved.
6683
6687
  * Licensed under the MIT License.
@@ -6704,12 +6708,19 @@
6704
6708
  }
6705
6709
  }
6706
6710
 
6707
- /*! @azure/msal-common v14.9.0 2024-04-11 */
6711
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
6708
6712
 
6709
6713
  /*
6710
6714
  * Copyright (c) Microsoft Corporation. All rights reserved.
6711
6715
  * Licensed under the MIT License.
6712
6716
  */
6717
+ function parseServerErrorNo(serverResponse) {
6718
+ const errorCodePrefix = "code=";
6719
+ const errorCodePrefixIndex = serverResponse.error_uri?.lastIndexOf(errorCodePrefix);
6720
+ return errorCodePrefixIndex && errorCodePrefixIndex >= 0
6721
+ ? serverResponse.error_uri?.substring(errorCodePrefixIndex + errorCodePrefix.length)
6722
+ : undefined;
6723
+ }
6713
6724
  /**
6714
6725
  * Class that handles response parsing.
6715
6726
  * @internal
@@ -6757,10 +6768,11 @@
6757
6768
  if (serverResponse.error ||
6758
6769
  serverResponse.error_description ||
6759
6770
  serverResponse.suberror) {
6771
+ const serverErrorNo = parseServerErrorNo(serverResponse);
6760
6772
  if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
6761
- throw new InteractionRequiredAuthError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || "", serverResponse.trace_id || "", serverResponse.correlation_id || "", serverResponse.claims || "");
6773
+ throw new InteractionRequiredAuthError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || "", serverResponse.trace_id || "", serverResponse.correlation_id || "", serverResponse.claims || "", serverErrorNo);
6762
6774
  }
6763
- throw new ServerError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror);
6775
+ throw new ServerError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverErrorNo);
6764
6776
  }
6765
6777
  }
6766
6778
  /**
@@ -6774,7 +6786,10 @@
6774
6786
  serverResponse.error_description ||
6775
6787
  serverResponse.suberror) {
6776
6788
  const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;
6777
- const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror);
6789
+ const serverErrorNo = serverResponse.error_codes?.length
6790
+ ? serverResponse.error_codes[0]
6791
+ : undefined;
6792
+ const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo);
6778
6793
  // check if 500 error
6779
6794
  if (refreshAccessToken &&
6780
6795
  serverResponse.status &&
@@ -6794,7 +6809,7 @@
6794
6809
  return;
6795
6810
  }
6796
6811
  if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
6797
- 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);
6812
+ 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);
6798
6813
  }
6799
6814
  throw serverError;
6800
6815
  }
@@ -7057,7 +7072,25 @@
7057
7072
  return baseAccount;
7058
7073
  }
7059
7074
 
7060
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7075
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7076
+ /*
7077
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7078
+ * Licensed under the MIT License.
7079
+ */
7080
+ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
7081
+ if (typeof clientAssertion === "string") {
7082
+ return clientAssertion;
7083
+ }
7084
+ else {
7085
+ const config = {
7086
+ clientId: clientId,
7087
+ tokenEndpoint: tokenEndpoint,
7088
+ };
7089
+ return clientAssertion(config);
7090
+ }
7091
+ }
7092
+
7093
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7061
7094
 
7062
7095
  /*
7063
7096
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7218,7 +7251,7 @@
7218
7251
  }
7219
7252
  if (this.config.clientCredentials.clientAssertion) {
7220
7253
  const clientAssertion = this.config.clientCredentials.clientAssertion;
7221
- parameterBuilder.addClientAssertion(clientAssertion.assertion);
7254
+ parameterBuilder.addClientAssertion(await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));
7222
7255
  parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
7223
7256
  }
7224
7257
  parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
@@ -7466,7 +7499,7 @@
7466
7499
  }
7467
7500
  }
7468
7501
 
7469
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7502
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7470
7503
 
7471
7504
  /*
7472
7505
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7626,7 +7659,7 @@
7626
7659
  }
7627
7660
  if (this.config.clientCredentials.clientAssertion) {
7628
7661
  const clientAssertion = this.config.clientCredentials.clientAssertion;
7629
- parameterBuilder.addClientAssertion(clientAssertion.assertion);
7662
+ parameterBuilder.addClientAssertion(await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));
7630
7663
  parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
7631
7664
  }
7632
7665
  if (request.authenticationScheme === AuthenticationScheme.POP) {
@@ -7673,7 +7706,7 @@
7673
7706
  }
7674
7707
  }
7675
7708
 
7676
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7709
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7677
7710
 
7678
7711
  /*
7679
7712
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7809,7 +7842,7 @@
7809
7842
  }
7810
7843
  }
7811
7844
 
7812
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7845
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7813
7846
 
7814
7847
  /*
7815
7848
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7824,7 +7857,7 @@
7824
7857
  },
7825
7858
  };
7826
7859
 
7827
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7860
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7828
7861
  /*
7829
7862
  * Copyright (c) Microsoft Corporation. All rights reserved.
7830
7863
  * Licensed under the MIT License.
@@ -7832,7 +7865,7 @@
7832
7865
  const missingKidError = "missing_kid_error";
7833
7866
  const missingAlgError = "missing_alg_error";
7834
7867
 
7835
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7868
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7836
7869
 
7837
7870
  /*
7838
7871
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7857,7 +7890,7 @@
7857
7890
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
7858
7891
  }
7859
7892
 
7860
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7893
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7861
7894
 
7862
7895
  /*
7863
7896
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7897,7 +7930,7 @@
7897
7930
  }
7898
7931
  }
7899
7932
 
7900
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7933
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7901
7934
 
7902
7935
  /*
7903
7936
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7955,7 +7988,7 @@
7955
7988
  }
7956
7989
  }
7957
7990
 
7958
- /*! @azure/msal-common v14.9.0 2024-04-11 */
7991
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
7959
7992
 
7960
7993
  /*
7961
7994
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8159,7 +8192,7 @@
8159
8192
  }
8160
8193
  }
8161
8194
 
8162
- /*! @azure/msal-common v14.9.0 2024-04-11 */
8195
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
8163
8196
 
8164
8197
  /*
8165
8198
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8238,7 +8271,7 @@
8238
8271
  }
8239
8272
  }
8240
8273
 
8241
- /*! @azure/msal-common v14.9.0 2024-04-11 */
8274
+ /*! @azure/msal-common v14.10.0 2024-05-07 */
8242
8275
 
8243
8276
  /*
8244
8277
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8336,6 +8369,10 @@
8336
8369
  else if (error instanceof AuthError) {
8337
8370
  event.errorCode = error.errorCode;
8338
8371
  event.subErrorCode = error.subError;
8372
+ if (error instanceof ServerError ||
8373
+ error instanceof InteractionRequiredAuthError) {
8374
+ event.serverErrorNo = error.errorNo;
8375
+ }
8339
8376
  return;
8340
8377
  }
8341
8378
  else if (error instanceof CacheError) {
@@ -8618,7 +8655,7 @@
8618
8655
  const context = JSON.stringify(endContext(event, this.abbreviations, this.eventStack.get(rootEvent.correlationId), error));
8619
8656
  if (isRoot) {
8620
8657
  queueInfo = this.getQueueInfo(event.correlationId);
8621
- this.discardCache(rootEvent.correlationId);
8658
+ this.discardMeasurements(rootEvent.correlationId);
8622
8659
  }
8623
8660
  else {
8624
8661
  rootEvent.incompleteSubMeasurements?.delete(event.eventId);
@@ -8740,21 +8777,13 @@
8740
8777
  };
8741
8778
  }
8742
8779
  /**
8743
- * Removes measurements for a given correlation id.
8780
+ * Removes measurements and aux data for a given correlation id.
8744
8781
  *
8745
8782
  * @param {string} correlationId
8746
8783
  */
8747
8784
  discardMeasurements(correlationId) {
8748
8785
  this.logger.trace("PerformanceClient: Performance measurements discarded", correlationId);
8749
8786
  this.eventsByCorrelationId.delete(correlationId);
8750
- }
8751
- /**
8752
- * Removes cache for a given correlation id.
8753
- *
8754
- * @param {string} correlationId correlation identifier
8755
- */
8756
- discardCache(correlationId) {
8757
- this.discardMeasurements(correlationId);
8758
8787
  this.logger.trace("PerformanceClient: QueueMeasurements discarded", correlationId);
8759
8788
  this.queueMeasurements.delete(correlationId);
8760
8789
  this.logger.trace("PerformanceClient: Pre-queue times discarded", correlationId);
@@ -8769,6 +8798,12 @@
8769
8798
  * @returns {string}
8770
8799
  */
8771
8800
  addPerformanceCallback(callback) {
8801
+ for (const [id, cb] of this.callbacks) {
8802
+ if (cb.toString() === callback.toString()) {
8803
+ this.logger.warning(`PerformanceClient: Performance callback is already registered with id: ${id}`);
8804
+ return id;
8805
+ }
8806
+ }
8772
8807
  const callbackId = this.generateId();
8773
8808
  this.callbacks.set(callbackId, callback);
8774
8809
  this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${callbackId}`);
@@ -9818,6 +9853,8 @@
9818
9853
  createGuid: createGuid,
9819
9854
  getCurrentUri: getCurrentUri,
9820
9855
  getHomepage: getHomepage,
9856
+ invoke: invoke,
9857
+ invokeAsync: invokeAsync,
9821
9858
  isInIframe: isInIframe,
9822
9859
  isInPopup: isInPopup,
9823
9860
  preconnect: preconnect,
@@ -10098,7 +10135,7 @@
10098
10135
 
10099
10136
  /* eslint-disable header/header */
10100
10137
  const name = "@azure/msal-browser";
10101
- const version = "3.13.0";
10138
+ const version = "3.14.0";
10102
10139
 
10103
10140
  /*
10104
10141
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10401,6 +10438,9 @@
10401
10438
  * TODO: Add implementation to check for presence of inject Nested App Auth Bridge JavaScript interface
10402
10439
  *
10403
10440
  */
10441
+ if (!this.getConfig().auth.supportsNestedAppAuth) {
10442
+ return false;
10443
+ }
10404
10444
  try {
10405
10445
  if (typeof window !== "undefined") {
10406
10446
  const bridgeProxy = await BridgeProxy.create();
@@ -10415,22 +10455,18 @@
10415
10455
  await bridgeProxy.getActiveAccount();
10416
10456
  }
10417
10457
  }
10418
- catch (e) {
10419
- this.activeAccount = undefined;
10458
+ catch {
10459
+ // Ignore errors
10420
10460
  }
10421
10461
  this.bridgeProxy = bridgeProxy;
10422
10462
  this.available = bridgeProxy !== undefined;
10423
10463
  }
10424
- else {
10425
- this.available = false;
10426
- }
10427
10464
  }
10428
- catch (e) {
10429
- this.available = false;
10430
- }
10431
- finally {
10432
- return this.available;
10465
+ catch (ex) {
10466
+ this.logger.infoPii(`Could not initialize Nested App Auth bridge (${ex})`);
10433
10467
  }
10468
+ this.logger.info(`Nested App Auth Bridge available: ${this.available}`);
10469
+ return this.available;
10434
10470
  }
10435
10471
  }
10436
10472
  /*
@@ -10502,8 +10538,7 @@
10502
10538
  const teamsApp = new TeamsAppOperatingContext(config);
10503
10539
  const operatingContexts = [standard.initialize(), teamsApp.initialize()];
10504
10540
  await Promise.all(operatingContexts);
10505
- if (teamsApp.isAvailable() &&
10506
- teamsApp.getConfig().auth.supportsNestedAppAuth) {
10541
+ if (teamsApp.isAvailable()) {
10507
10542
  const controller = await Promise.resolve().then(function () { return NestedAppAuthController$1; });
10508
10543
  return controller.NestedAppAuthController.createController(teamsApp);
10509
10544
  }
@@ -14696,11 +14731,10 @@
14696
14731
  * Checks if navigateToLoginRequestUrl is set, and:
14697
14732
  * - if true, performs logic to cache and navigate
14698
14733
  * - if false, handles hash string and parses response
14699
- * @param hash {string?} url hash
14700
- * @param performanceClient {IPerformanceClient?}
14701
- * @param correlationId {string?} correlation identifier
14734
+ * @param hash {string} url hash
14735
+ * @param parentMeasurement {InProgressPerformanceEvent} parent measurement
14702
14736
  */
14703
- async handleRedirectPromise(hash, performanceClient, correlationId) {
14737
+ async handleRedirectPromise(hash = "", parentMeasurement) {
14704
14738
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);
14705
14739
  try {
14706
14740
  if (!this.browserStorage.isInteractionInProgress(true)) {
@@ -14712,9 +14746,7 @@
14712
14746
  // Not a recognized server response hash or hash not associated with a redirect request
14713
14747
  this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache.");
14714
14748
  this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
14715
- if (performanceClient && correlationId) {
14716
- performanceClient?.addFields({ errorCode: "no_server_response" }, correlationId);
14717
- }
14749
+ parentMeasurement.event.errorCode = "no_server_response";
14718
14750
  return null;
14719
14751
  }
14720
14752
  // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated
@@ -15530,6 +15562,19 @@
15530
15562
  * Copyright (c) Microsoft Corporation. All rights reserved.
15531
15563
  * Licensed under the MIT License.
15532
15564
  */
15565
+ function getAccountType(account) {
15566
+ const idTokenClaims = account?.idTokenClaims;
15567
+ if (idTokenClaims?.tfp || idTokenClaims?.acr) {
15568
+ return "B2C";
15569
+ }
15570
+ if (!idTokenClaims?.tid) {
15571
+ return undefined;
15572
+ }
15573
+ else if (idTokenClaims?.tid === "9188040d-6c67-4c5b-b112-36a304b66dad") {
15574
+ return "MSA";
15575
+ }
15576
+ return "AAD";
15577
+ }
15533
15578
  class StandardController {
15534
15579
  /**
15535
15580
  * @constructor
@@ -15699,7 +15744,7 @@
15699
15744
  else {
15700
15745
  this.logger.trace("handleRedirectPromise - acquiring token from web flow");
15701
15746
  const redirectClient = this.createRedirectClient(correlationId);
15702
- redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), PerformanceEvents.HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(hash, this.performanceClient, rootMeasurement.event.correlationId);
15747
+ redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), PerformanceEvents.HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(hash, rootMeasurement);
15703
15748
  }
15704
15749
  return redirectResponse
15705
15750
  .then((result) => {
@@ -15714,10 +15759,24 @@
15714
15759
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
15715
15760
  this.logger.verbose("handleRedirectResponse returned result, acquire token success");
15716
15761
  }
15717
- rootMeasurement.end({ success: true });
15762
+ rootMeasurement.end({
15763
+ success: true,
15764
+ accountType: getAccountType(result.account),
15765
+ });
15766
+ }
15767
+ else {
15768
+ /*
15769
+ * Instrument an event only if an error code is set. Otherwise, discard it when the redirect response
15770
+ * is empty and the error code is missing.
15771
+ */
15772
+ if (rootMeasurement.event.errorCode) {
15773
+ rootMeasurement.end({ success: false });
15774
+ }
15775
+ else {
15776
+ rootMeasurement.discard();
15777
+ }
15718
15778
  }
15719
15779
  this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
15720
- rootMeasurement.end({ success: false });
15721
15780
  return result;
15722
15781
  })
15723
15782
  .catch((e) => {
@@ -15807,6 +15866,10 @@
15807
15866
  acquireTokenPopup(request) {
15808
15867
  const correlationId = this.getRequestCorrelationId(request);
15809
15868
  const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);
15869
+ atPopupMeasurement.add({
15870
+ scenarioId: request.scenarioId,
15871
+ accountType: getAccountType(request.account),
15872
+ });
15810
15873
  try {
15811
15874
  this.logger.verbose("acquireTokenPopup called", correlationId);
15812
15875
  preflightCheck(this.initialized);
@@ -15836,6 +15899,7 @@
15836
15899
  success: true,
15837
15900
  isNativeBroker: true,
15838
15901
  requestId: response.requestId,
15902
+ accountType: getAccountType(response.account),
15839
15903
  });
15840
15904
  return response;
15841
15905
  })
@@ -15871,13 +15935,12 @@
15871
15935
  else {
15872
15936
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
15873
15937
  }
15874
- atPopupMeasurement.add({
15875
- accessTokenSize: result.accessToken.length,
15876
- idTokenSize: result.idToken.length,
15877
- });
15878
15938
  atPopupMeasurement.end({
15879
15939
  success: true,
15880
15940
  requestId: result.requestId,
15941
+ accessTokenSize: result.accessToken.length,
15942
+ idTokenSize: result.idToken.length,
15943
+ accountType: getAccountType(result.account),
15881
15944
  });
15882
15945
  return result;
15883
15946
  })
@@ -15936,6 +15999,10 @@
15936
15999
  this.ssoSilentMeasurement?.increment({
15937
16000
  visibilityChangeCount: 0,
15938
16001
  });
16002
+ this.ssoSilentMeasurement?.add({
16003
+ scenarioId: request.scenarioId,
16004
+ accountType: getAccountType(request.account),
16005
+ });
15939
16006
  document.addEventListener("visibilitychange", this.trackPageVisibilityWithMeasurement);
15940
16007
  this.logger.verbose("ssoSilent called", correlationId);
15941
16008
  this.eventHandler.emitEvent(EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
@@ -15958,14 +16025,13 @@
15958
16025
  return result
15959
16026
  .then((response) => {
15960
16027
  this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
15961
- this.ssoSilentMeasurement?.add({
15962
- accessTokenSize: response.accessToken.length,
15963
- idTokenSize: response.idToken.length,
15964
- });
15965
16028
  this.ssoSilentMeasurement?.end({
15966
16029
  success: true,
15967
16030
  isNativeBroker: response.fromNativeBroker,
15968
16031
  requestId: response.requestId,
16032
+ accessTokenSize: response.accessToken.length,
16033
+ idTokenSize: response.idToken.length,
16034
+ accountType: getAccountType(response.account),
15969
16035
  });
15970
16036
  return response;
15971
16037
  })
@@ -15996,6 +16062,7 @@
15996
16062
  preflightCheck(this.initialized);
15997
16063
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
15998
16064
  const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, correlationId);
16065
+ atbcMeasurement.add({ scenarioId: request.scenarioId });
15999
16066
  try {
16000
16067
  if (request.code && request.nativeAccountId) {
16001
16068
  // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
@@ -16013,14 +16080,13 @@
16013
16080
  .then((result) => {
16014
16081
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
16015
16082
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
16016
- atbcMeasurement.add({
16017
- accessTokenSize: result.accessToken.length,
16018
- idTokenSize: result.idToken.length,
16019
- });
16020
16083
  atbcMeasurement.end({
16021
16084
  success: true,
16022
16085
  isNativeBroker: result.fromNativeBroker,
16023
16086
  requestId: result.requestId,
16087
+ accessTokenSize: result.accessToken.length,
16088
+ idTokenSize: result.idToken.length,
16089
+ accountType: getAccountType(result.account),
16024
16090
  });
16025
16091
  return result;
16026
16092
  })
@@ -16042,7 +16108,7 @@
16042
16108
  }
16043
16109
  else if (request.nativeAccountId) {
16044
16110
  if (this.canUseNative(request, request.nativeAccountId)) {
16045
- return await this.acquireTokenNative({
16111
+ const result = await this.acquireTokenNative({
16046
16112
  ...request,
16047
16113
  correlationId,
16048
16114
  }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
@@ -16053,6 +16119,11 @@
16053
16119
  }
16054
16120
  throw e;
16055
16121
  });
16122
+ atbcMeasurement.end({
16123
+ accountType: getAccountType(result.account),
16124
+ success: true,
16125
+ });
16126
+ return result;
16056
16127
  }
16057
16128
  else {
16058
16129
  throw createBrowserAuthError(unableToAcquireTokenFromNativePlatform);
@@ -16615,6 +16686,7 @@
16615
16686
  const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);
16616
16687
  atsMeasurement.add({
16617
16688
  cacheLookupPolicy: request.cacheLookupPolicy,
16689
+ scenarioId: request.scenarioId,
16618
16690
  });
16619
16691
  preflightCheck(this.initialized);
16620
16692
  this.logger.verbose("acquireTokenSilent called", correlationId);
@@ -16622,6 +16694,7 @@
16622
16694
  if (!account) {
16623
16695
  throw createBrowserAuthError(noAccountError);
16624
16696
  }
16697
+ atsMeasurement.add({ accountType: getAccountType(account) });
16625
16698
  const thumbprint = {
16626
16699
  clientId: this.config.auth.clientId,
16627
16700
  authority: request.authority || Constants.EMPTY_STRING,
@@ -16645,16 +16718,14 @@
16645
16718
  }, account)
16646
16719
  .then((result) => {
16647
16720
  this.activeSilentTokenRequests.delete(silentRequestKey);
16648
- atsMeasurement.add({
16649
- accessTokenSize: result.accessToken.length,
16650
- idTokenSize: result.idToken.length,
16651
- });
16652
16721
  atsMeasurement.end({
16653
16722
  success: true,
16654
16723
  fromCache: result.fromCache,
16655
16724
  isNativeBroker: result.fromNativeBroker,
16656
16725
  cacheLookupPolicy: request.cacheLookupPolicy,
16657
16726
  requestId: result.requestId,
16727
+ accessTokenSize: result.accessToken.length,
16728
+ idTokenSize: result.idToken.length,
16658
16729
  });
16659
16730
  return result;
16660
16731
  })
@@ -16700,23 +16771,22 @@
16700
16771
  const shouldTryToResolveSilently = checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, cacheLookupPolicy);
16701
16772
  if (shouldTryToResolveSilently) {
16702
16773
  if (!this.activeIframeRequest) {
16703
- let _resolve, _reject;
16774
+ let _resolve;
16704
16775
  // Always set the active request tracker immediately after checking it to prevent races
16705
16776
  this.activeIframeRequest = [
16706
- new Promise((resolve, reject) => {
16777
+ new Promise((resolve) => {
16707
16778
  _resolve = resolve;
16708
- _reject = reject;
16709
16779
  }),
16710
16780
  silentRequest.correlationId,
16711
16781
  ];
16712
16782
  this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.", silentRequest.correlationId);
16713
16783
  return invokeAsync(this.acquireTokenBySilentIframe.bind(this), PerformanceEvents.AcquireTokenBySilentIframe, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest)
16714
16784
  .then((iframeResult) => {
16715
- _resolve();
16785
+ _resolve(true);
16716
16786
  return iframeResult;
16717
16787
  })
16718
16788
  .catch((e) => {
16719
- _reject(e);
16789
+ _resolve(false);
16720
16790
  throw e;
16721
16791
  })
16722
16792
  .finally(() => {
@@ -16730,21 +16800,20 @@
16730
16800
  awaitConcurrentIframeMeasure.add({
16731
16801
  awaitIframeCorrelationId: activeCorrelationId,
16732
16802
  });
16733
- // Await for errors first so we can distinguish errors thrown by activePromise versus errors thrown by .then below
16734
- await activePromise.catch(() => {
16735
- awaitConcurrentIframeMeasure.end({
16736
- success: false,
16737
- });
16738
- this.logger.info(`Iframe request with correlationId: ${activeCorrelationId} failed. Interaction is required.`);
16739
- // If previous iframe request failed, it's unlikely to succeed this time. Throw original error.
16740
- throw refreshTokenError;
16803
+ const activePromiseResult = await activePromise;
16804
+ awaitConcurrentIframeMeasure.end({
16805
+ success: activePromiseResult,
16741
16806
  });
16742
- return activePromise.then(() => {
16743
- awaitConcurrentIframeMeasure.end({ success: true });
16807
+ if (activePromiseResult) {
16744
16808
  this.logger.verbose(`Parallel iframe request with correlationId: ${activeCorrelationId} succeeded. Retrying cache and/or RT redemption`, silentRequest.correlationId);
16745
16809
  // Retry cache lookup and/or RT exchange after iframe completes
16746
16810
  return this.acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy);
16747
- });
16811
+ }
16812
+ else {
16813
+ this.logger.info(`Iframe request with correlationId: ${activeCorrelationId} failed. Interaction is required.`);
16814
+ // If previous iframe request failed, it's unlikely to succeed this time. Throw original error.
16815
+ throw refreshTokenError;
16816
+ }
16748
16817
  }
16749
16818
  else {
16750
16819
  // Cache policy set to skip and another iframe request is already in progress
@@ -17851,6 +17920,9 @@
17851
17920
  getAllAccounts: () => {
17852
17921
  return [];
17853
17922
  },
17923
+ getAccount: () => {
17924
+ return null;
17925
+ },
17854
17926
  getAccountByHomeId: () => {
17855
17927
  return null;
17856
17928
  },