@azure/msal-browser 5.17.1 → 5.18.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 (251) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  4. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +2 -4
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  8. package/dist/cache/AccountManager.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +15 -7
  11. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  12. package/dist/cache/CacheHelpers.mjs +1 -1
  13. package/dist/cache/CacheKeys.mjs +1 -1
  14. package/dist/cache/CookieStorage.mjs +1 -1
  15. package/dist/cache/DatabaseStorage.mjs +1 -1
  16. package/dist/cache/EncryptedData.mjs +1 -1
  17. package/dist/cache/LocalStorage.mjs +1 -1
  18. package/dist/cache/MemoryStorage.mjs +1 -1
  19. package/dist/cache/SessionStorage.mjs +1 -1
  20. package/dist/cache/TokenCache.mjs +1 -1
  21. package/dist/config/Configuration.mjs +1 -1
  22. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  23. package/dist/controllers/StandardController.mjs +36 -28
  24. package/dist/controllers/StandardController.mjs.map +1 -1
  25. package/dist/crypto/BrowserCrypto.mjs +1 -1
  26. package/dist/crypto/CryptoOps.mjs +1 -1
  27. package/dist/crypto/PkceGenerator.mjs +1 -1
  28. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  29. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  30. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  31. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  32. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  33. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  34. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  35. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  36. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  49. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  50. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  51. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  52. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  53. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  54. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  55. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  56. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  57. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  58. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  59. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  60. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  61. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  62. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  63. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  64. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  65. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  66. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  67. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  68. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  69. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  70. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  71. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  72. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  73. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  74. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  75. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  76. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  77. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  78. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  79. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  80. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  81. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  82. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  83. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  84. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  85. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  86. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  87. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  88. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  89. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  90. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  91. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  92. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  93. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  94. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  95. package/dist/custom_auth/index.mjs +1 -1
  96. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  97. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  98. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  99. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  100. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  101. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  102. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  103. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  104. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  105. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  106. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  107. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  108. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  109. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  110. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  111. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  112. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  113. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  114. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  115. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  116. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  117. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  118. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  119. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  120. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  121. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  122. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  123. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  124. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  125. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  126. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  127. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  128. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  129. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  130. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  131. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  132. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  133. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  134. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  135. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  136. package/dist/encode/Base64Decode.mjs +1 -1
  137. package/dist/encode/Base64Encode.mjs +1 -1
  138. package/dist/error/BrowserAuthError.mjs +1 -1
  139. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  140. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  141. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  142. package/dist/error/NativeAuthError.mjs +1 -1
  143. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  144. package/dist/error/NestedAppAuthError.mjs +1 -1
  145. package/dist/event/EventHandler.mjs +1 -1
  146. package/dist/event/EventMessage.mjs +1 -1
  147. package/dist/event/EventType.mjs +1 -1
  148. package/dist/index.mjs +1 -1
  149. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  150. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  151. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +146 -61
  152. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  153. package/dist/interaction_client/PopupClient.mjs +1 -1
  154. package/dist/interaction_client/RedirectClient.mjs +1 -1
  155. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  156. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  157. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  158. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  159. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  160. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  161. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  162. package/dist/log-strings-mapping.json +246 -246
  163. package/dist/naa/BridgeError.mjs +1 -1
  164. package/dist/naa/BridgeProxy.mjs +1 -1
  165. package/dist/naa/BridgeStatusCode.mjs +1 -1
  166. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +4 -2
  167. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  168. package/dist/navigation/NavigationClient.mjs +1 -1
  169. package/dist/network/FetchClient.mjs +39 -13
  170. package/dist/network/FetchClient.mjs.map +1 -1
  171. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  172. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  173. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  174. package/dist/packageMetadata.mjs +2 -2
  175. package/dist/popup_relay/constants.mjs +1 -1
  176. package/dist/popup_relay/index.mjs +1 -1
  177. package/dist/popup_relay/relayClient.mjs +1 -1
  178. package/dist/protocol/Authorize.mjs +1 -1
  179. package/dist/redirect_bridge/index.mjs +1 -1
  180. package/dist/request/RequestHelpers.mjs +1 -1
  181. package/dist/response/ResponseHandler.mjs +1 -1
  182. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  183. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  184. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  185. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  186. package/dist/utils/BrowserConstants.mjs +1 -1
  187. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  188. package/dist/utils/BrowserUtils.mjs +1 -1
  189. package/dist/utils/Helpers.mjs +1 -1
  190. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  191. package/lib/custom-auth-path/log-strings-mapping.json +2 -2
  192. package/lib/custom-auth-path/msal-custom-auth.cjs +453 -207
  193. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  194. package/lib/custom-auth-path/msal-custom-auth.js +453 -207
  195. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  196. package/lib/log-strings-mapping.json +2 -2
  197. package/lib/msal-browser.cjs +458 -209
  198. package/lib/msal-browser.cjs.map +1 -1
  199. package/lib/msal-browser.js +458 -209
  200. package/lib/msal-browser.js.map +1 -1
  201. package/lib/msal-browser.min.js +2 -2
  202. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  203. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  204. package/lib/popup-relay/msal-popup-relay.js +2 -2
  205. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  206. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  207. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  208. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  209. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  210. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  211. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  212. package/package.json +2 -2
  213. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +0 -4
  214. package/src/broker/nativeBroker/PlatformAuthRequest.ts +6 -8
  215. package/src/cache/BrowserCacheManager.ts +24 -6
  216. package/src/controllers/StandardController.ts +44 -31
  217. package/src/interaction_client/PlatformAuthInteractionClient.ts +194 -74
  218. package/src/naa/TokenRequest.ts +1 -0
  219. package/src/naa/mapping/NestedAppAuthAdapter.ts +5 -0
  220. package/src/network/FetchClient.ts +62 -14
  221. package/src/packageMetadata.ts +1 -1
  222. package/src/webBrokerBridge/IWebBrokerBridgeMessage.ts +42 -0
  223. package/src/webBrokerBridge/PendingRequestRegistry.ts +79 -0
  224. package/src/webBrokerBridge/WebBrokerBridgeError.ts +69 -0
  225. package/src/webBrokerBridge/WebBrokerBridgeErrorMap.ts +108 -0
  226. package/src/webBrokerBridge/index.ts +25 -0
  227. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  228. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +4 -6
  229. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
  230. package/types/cache/BrowserCacheManager.d.ts +7 -5
  231. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  232. package/types/controllers/StandardController.d.ts +3 -0
  233. package/types/controllers/StandardController.d.ts.map +1 -1
  234. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  235. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +13 -3
  236. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  237. package/types/naa/TokenRequest.d.ts +1 -0
  238. package/types/naa/TokenRequest.d.ts.map +1 -1
  239. package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  240. package/types/network/FetchClient.d.ts.map +1 -1
  241. package/types/packageMetadata.d.ts +1 -1
  242. package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts +35 -0
  243. package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts.map +1 -0
  244. package/types/webBrokerBridge/PendingRequestRegistry.d.ts +27 -0
  245. package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -0
  246. package/types/webBrokerBridge/WebBrokerBridgeError.d.ts +50 -0
  247. package/types/webBrokerBridge/WebBrokerBridgeError.d.ts.map +1 -0
  248. package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts +10 -0
  249. package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts.map +1 -0
  250. package/types/webBrokerBridge/index.d.ts +16 -0
  251. package/types/webBrokerBridge/index.d.ts.map +1 -0
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v5.17.1 2026-07-15 */
1
+ /*! @azure/msal-browser v5.18.0 2026-08-04 */
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 v16.11.2 2026-07-15 */
9
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
12
12
  * Licensed under the MIT License.
@@ -56,9 +56,10 @@
56
56
  const EAR_JWK = "ear_jwk";
57
57
  const EAR_JWE_CRYPTO = "ear_jwe_crypto";
58
58
  const RESOURCE = "resource";
59
- const CLI_DATA = "clidata";
59
+ const CLI_DATA = "clidata";
60
+ const ATTRIBUTE_TOKENS = "attribute_tokens";
60
61
 
61
- /*! @azure/msal-common v16.11.2 2026-07-15 */
62
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
62
63
  /*
63
64
  * Copyright (c) Microsoft Corporation. All rights reserved.
64
65
  * Licensed under the MIT License.
@@ -294,7 +295,7 @@
294
295
  // Token renewal offset default in seconds
295
296
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
296
297
 
297
- /*! @azure/msal-common v16.11.2 2026-07-15 */
298
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
298
299
  /*
299
300
  * Copyright (c) Microsoft Corporation. All rights reserved.
300
301
  * Licensed under the MIT License.
@@ -323,7 +324,7 @@
323
324
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
324
325
  }
325
326
 
326
- /*! @azure/msal-common v16.11.2 2026-07-15 */
327
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
327
328
 
328
329
  /*
329
330
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -346,7 +347,7 @@
346
347
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
347
348
  }
348
349
 
349
- /*! @azure/msal-common v16.11.2 2026-07-15 */
350
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
350
351
  /*
351
352
  * Copyright (c) Microsoft Corporation. All rights reserved.
352
353
  * Licensed under the MIT License.
@@ -430,7 +431,7 @@
430
431
  userCanceled: userCanceled
431
432
  });
432
433
 
433
- /*! @azure/msal-common v16.11.2 2026-07-15 */
434
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
434
435
 
435
436
  /*
436
437
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -468,7 +469,7 @@
468
469
  };
469
470
  }
470
471
 
471
- /*! @azure/msal-common v16.11.2 2026-07-15 */
472
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
472
473
 
473
474
  /*
474
475
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -534,7 +535,7 @@
534
535
  return matches[2];
535
536
  }
536
537
 
537
- /*! @azure/msal-common v16.11.2 2026-07-15 */
538
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
538
539
 
539
540
  /*
540
541
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -622,7 +623,7 @@
622
623
  return updatedAccountInfo;
623
624
  }
624
625
 
625
- /*! @azure/msal-common v16.11.2 2026-07-15 */
626
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
626
627
  /*
627
628
  * Copyright (c) Microsoft Corporation. All rights reserved.
628
629
  * Licensed under the MIT License.
@@ -637,7 +638,7 @@
637
638
  Ciam: 3,
638
639
  };
639
640
 
640
- /*! @azure/msal-common v16.11.2 2026-07-15 */
641
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
641
642
  /*
642
643
  * Copyright (c) Microsoft Corporation. All rights reserved.
643
644
  * Licensed under the MIT License.
@@ -659,7 +660,7 @@
659
660
  return null;
660
661
  }
661
662
 
662
- /*! @azure/msal-common v16.11.2 2026-07-15 */
663
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
663
664
  /*
664
665
  * Copyright (c) Microsoft Corporation. All rights reserved.
665
666
  * Licensed under the MIT License.
@@ -683,7 +684,7 @@
683
684
  EAR: "EAR",
684
685
  };
685
686
 
686
- /*! @azure/msal-common v16.11.2 2026-07-15 */
687
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
687
688
  /**
688
689
  * Returns the AccountInfo interface for this account.
689
690
  * @internal
@@ -872,7 +873,7 @@
872
873
  entity.hasOwnProperty("authorityType"));
873
874
  }
874
875
 
875
- /*! @azure/msal-common v16.11.2 2026-07-15 */
876
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
876
877
  /*
877
878
  * Copyright (c) Microsoft Corporation. All rights reserved.
878
879
  * Licensed under the MIT License.
@@ -889,7 +890,7 @@
889
890
  unexpectedError: unexpectedError
890
891
  });
891
892
 
892
- /*! @azure/msal-common v16.11.2 2026-07-15 */
893
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
893
894
 
894
895
  /*
895
896
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -909,7 +910,7 @@
909
910
  return new ClientConfigurationError(errorCode, correlationId);
910
911
  }
911
912
 
912
- /*! @azure/msal-common v16.11.2 2026-07-15 */
913
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
913
914
  /*
914
915
  * Copyright (c) Microsoft Corporation. All rights reserved.
915
916
  * Licensed under the MIT License.
@@ -973,7 +974,7 @@
973
974
  urlParseError: urlParseError
974
975
  });
975
976
 
976
- /*! @azure/msal-common v16.11.2 2026-07-15 */
977
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
977
978
 
978
979
  /*
979
980
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1031,7 +1032,7 @@
1031
1032
  }
1032
1033
  }
1033
1034
 
1034
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1035
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1035
1036
  /*
1036
1037
  * Copyright (c) Microsoft Corporation. All rights reserved.
1037
1038
  * Licensed under the MIT License.
@@ -1043,7 +1044,7 @@
1043
1044
  response.hasOwnProperty("jwks_uri"));
1044
1045
  }
1045
1046
 
1046
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1047
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1047
1048
  /*
1048
1049
  * Copyright (c) Microsoft Corporation. All rights reserved.
1049
1050
  * Licensed under the MIT License.
@@ -1123,7 +1124,7 @@
1123
1124
  }
1124
1125
  }
1125
1126
 
1126
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1127
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1127
1128
 
1128
1129
  /*
1129
1130
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1281,7 +1282,7 @@
1281
1282
  }
1282
1283
  }
1283
1284
 
1284
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1285
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1285
1286
 
1286
1287
  /*
1287
1288
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1447,7 +1448,7 @@
1447
1448
  return null;
1448
1449
  }
1449
1450
 
1450
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1451
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1451
1452
  /*
1452
1453
  * Copyright (c) Microsoft Corporation. All rights reserved.
1453
1454
  * Licensed under the MIT License.
@@ -1467,7 +1468,7 @@
1467
1468
  AzureUsGovernment: "https://login.microsoftonline.us",
1468
1469
  };
1469
1470
 
1470
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1471
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1471
1472
  /*
1472
1473
  * Copyright (c) Microsoft Corporation. All rights reserved.
1473
1474
  * Licensed under the MIT License.
@@ -1477,7 +1478,7 @@
1477
1478
  response.hasOwnProperty("metadata"));
1478
1479
  }
1479
1480
 
1480
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1481
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1481
1482
  /*
1482
1483
  * Copyright (c) Microsoft Corporation. All rights reserved.
1483
1484
  * Licensed under the MIT License.
@@ -1487,7 +1488,7 @@
1487
1488
  response.hasOwnProperty("error_description"));
1488
1489
  }
1489
1490
 
1490
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1491
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1491
1492
  /*
1492
1493
  * Copyright (c) Microsoft Corporation. All rights reserved.
1493
1494
  * Licensed under the MIT License.
@@ -1558,7 +1559,7 @@
1558
1559
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1559
1560
  const SetUserData = "setUserData";
1560
1561
 
1561
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1562
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1562
1563
  /*
1563
1564
  * Copyright (c) Microsoft Corporation. All rights reserved.
1564
1565
  * Licensed under the MIT License.
@@ -1651,7 +1652,7 @@
1651
1652
  };
1652
1653
  };
1653
1654
 
1654
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1655
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1655
1656
 
1656
1657
  /*
1657
1658
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1762,7 +1763,7 @@
1762
1763
  },
1763
1764
  };
1764
1765
 
1765
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1766
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1766
1767
  /*
1767
1768
  * Copyright (c) Microsoft Corporation. All rights reserved.
1768
1769
  * Licensed under the MIT License.
@@ -1827,7 +1828,7 @@
1827
1828
  return cachedAtSec > nowSeconds();
1828
1829
  }
1829
1830
 
1830
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1831
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1831
1832
 
1832
1833
  /*
1833
1834
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2092,9 +2093,22 @@
2092
2093
  */
2093
2094
  function isAuthorityMetadataExpired(metadata) {
2094
2095
  return metadata.expiresAt <= nowSeconds();
2096
+ }
2097
+ /**
2098
+ * Serialize attribute tokens synchronously (sort and join).
2099
+ * This is a sync-only operation for use at request construction time.
2100
+ * @param attributeTokens - array of tokens
2101
+ * @returns serialized partition string or undefined if no tokens
2102
+ */
2103
+ function serializeAttributeTokens(attributeTokens) {
2104
+ if (!attributeTokens || attributeTokens.length === 0) {
2105
+ return undefined;
2106
+ }
2107
+ // Serialize: sort and join tokens
2108
+ return [...attributeTokens].sort().join(" ");
2095
2109
  }
2096
2110
 
2097
- /*! @azure/msal-common v16.11.2 2026-07-15 */
2111
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
2098
2112
 
2099
2113
  /*
2100
2114
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3064,7 +3078,7 @@
3064
3078
  };
3065
3079
  }
3066
3080
 
3067
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3081
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3068
3082
 
3069
3083
  /*
3070
3084
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3098,7 +3112,7 @@
3098
3112
  }
3099
3113
  }
3100
3114
 
3101
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3115
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3102
3116
 
3103
3117
  /*
3104
3118
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3294,7 +3308,7 @@
3294
3308
  }
3295
3309
  }
3296
3310
 
3297
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3311
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3298
3312
 
3299
3313
  /*
3300
3314
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3422,13 +3436,14 @@
3422
3436
  * @param claims - The claims string from the request
3423
3437
  * @param clientCapabilities - The client capabilities from configuration
3424
3438
  * @param skipBrokerClaims - When true and BROKER_CLIENT_ID is present, excludes clientCapabilities from claims
3439
+ * @param claimsToMerge - Optional client-originated claims JSON string (e.g. `claimsFromClient`) deep-merged into `claims` with precedence on conflicts
3425
3440
  */
3426
- function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims) {
3441
+ function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims, claimsToMerge) {
3427
3442
  // Skip clientCapabilities if skipBrokerClaims is set to true and this is a brokered authentication flow
3428
3443
  const configClaims = skipBrokerClaims && parameters.has(BROKER_CLIENT_ID)
3429
3444
  ? undefined
3430
3445
  : clientCapabilities;
3431
- const mergedClaims = buildMergedClaims$1(claims, configClaims, correlationId);
3446
+ const mergedClaims = buildMergedClaims$1(claims, configClaims, correlationId, claimsToMerge);
3432
3447
  parameters.set(CLAIMS, mergedClaims);
3433
3448
  }
3434
3449
  /**
@@ -3594,32 +3609,79 @@
3594
3609
  [ClaimsRequestKeys.LOGIN_HINT]: { essential: false },
3595
3610
  };
3596
3611
  /**
3597
- * Parses claims JSON, merges default optional idToken claims (signin_state, login_hint),
3598
- * and appends client capabilities (xms_cc) to the access_token section.
3612
+ * Parses a claims JSON string into an object, throwing a ClientConfigurationError
3613
+ * (error code `invalid_claims`) if the value is not a valid JSON object. The raw
3614
+ * claims value is never included in the error - it may contain sensitive data.
3615
+ * @param claims - Claims JSON string. Must be valid JSON representing an object.
3616
+ * @param correlationId - The request correlation id
3617
+ * @returns The parsed claims object
3618
+ */
3619
+ function parseClaims(claims, correlationId = "") {
3620
+ let parsed;
3621
+ try {
3622
+ parsed = JSON.parse(claims);
3623
+ }
3624
+ catch (e) {
3625
+ // Malformed JSON
3626
+ throw createClientConfigurationError(invalidClaims, correlationId);
3627
+ }
3628
+ if (!isPlainObject(parsed)) {
3629
+ // Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
3630
+ throw createClientConfigurationError(invalidClaims, correlationId);
3631
+ }
3632
+ return parsed;
3633
+ }
3634
+ /**
3635
+ * Type guard for a non-null, non-array object (a JSON "object" value).
3636
+ * @param value - The value to test
3637
+ * @returns True when value is a plain object that can be deep-merged
3638
+ */
3639
+ function isPlainObject(value) {
3640
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3641
+ }
3642
+ /**
3643
+ * Recursively deep-merges two parsed claims objects. Nested objects are merged key-by-key;
3644
+ * for any other value type (arrays, scalars, null) the value from `claimsToMerge` replaces
3645
+ * the base. This mirrors the deep merge used by msal-dotnet so that, for example, a server
3646
+ * `access_token` challenge and a client-originated `access_token` claim are combined rather
3647
+ * than one clobbering the other.
3648
+ * @param baseClaims - The parsed base claims object
3649
+ * @param claimsToMerge - The parsed claims object merged in with precedence
3650
+ * @returns The deep-merged claims object
3651
+ */
3652
+ function deepMergeClaims(baseClaims, claimsToMerge) {
3653
+ const merged = { ...baseClaims };
3654
+ for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
3655
+ const baseValue = merged[key];
3656
+ if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
3657
+ merged[key] = deepMergeClaims(baseValue, mergeInValue);
3658
+ }
3659
+ else {
3660
+ merged[key] = mergeInValue;
3661
+ }
3662
+ }
3663
+ return merged;
3664
+ }
3665
+ /**
3666
+ * Parses claims JSON, optionally deep-merges a second client-originated claims string
3667
+ * (`claimsToMerge`, e.g. `claimsFromClient`) with precedence on conflicting keys, merges
3668
+ * default optional idToken claims (signin_state, login_hint), and appends client
3669
+ * capabilities (xms_cc) to the access_token section.
3599
3670
  * Does not overwrite idToken claims already specified by the caller.
3600
3671
  * @param claims - Existing claims JSON string from the request (may be undefined)
3601
3672
  * @param clientCapabilities - Client capabilities array from configuration
3673
+ * @param correlationId - The request correlation id
3674
+ * @param claimsToMerge - Optional second claims JSON string (e.g. client-originated `claimsFromClient`)
3675
+ * deep-merged into `claims` with precedence on conflicts; parsed and validated when present. Nested
3676
+ * objects are merged recursively; arrays and scalar values are replaced.
3602
3677
  * @returns Merged claims JSON string
3603
3678
  */
3604
- function buildMergedClaims$1(claims, clientCapabilities, correlationId = "") {
3605
- let mergedClaims;
3679
+ function buildMergedClaims$1(claims, clientCapabilities, correlationId = "", claimsToMerge) {
3606
3680
  // Parse provided claims into JSON object or initialize empty object
3607
- if (!claims) {
3608
- mergedClaims = {};
3609
- }
3610
- else {
3611
- try {
3612
- const parsed = JSON.parse(claims);
3613
- if (typeof parsed !== "object" ||
3614
- parsed === null ||
3615
- Array.isArray(parsed)) {
3616
- throw new Error("Claims must be a JSON object");
3617
- }
3618
- mergedClaims = parsed;
3619
- }
3620
- catch (e) {
3621
- throw createClientConfigurationError(invalidClaims, correlationId);
3622
- }
3681
+ let mergedClaims = claims ? parseClaims(claims, correlationId) : {};
3682
+ // Deep-merge client-originated claims (e.g. `claimsFromClient`) with precedence on conflicts
3683
+ if (claimsToMerge?.trim()) {
3684
+ mergedClaims = deepMergeClaims(mergedClaims, parseClaims(claimsToMerge, correlationId));
3623
3685
  }
3624
3686
  // Add default optional idToken claims
3625
3687
  if (!Object.prototype.hasOwnProperty.call(mergedClaims, ClaimsRequestKeys.ID_TOKEN)) {
@@ -3707,9 +3769,28 @@
3707
3769
  if (resource) {
3708
3770
  parameters.set(RESOURCE, resource);
3709
3771
  }
3772
+ }
3773
+ /**
3774
+ * Add the `attribute_tokens` parameter to a /token request body.
3775
+ *
3776
+ * When `attributeTokens` is a non-empty array the values are sorted lexicographically and joined
3777
+ * with a single space, then written to the request body. When `attributeTokens` is an empty array
3778
+ * the parameter is deleted from the request body.
3779
+ *
3780
+ * @param parameters - request parameter map that will be serialized into the /token body
3781
+ * @param attributeTokens - caller-provided attribute token strings
3782
+ */
3783
+ function addAttributeTokens(parameters, attributeTokens) {
3784
+ const serialized = serializeAttributeTokens(attributeTokens);
3785
+ if (serialized) {
3786
+ parameters.set(ATTRIBUTE_TOKENS, serialized);
3787
+ }
3788
+ else {
3789
+ parameters.delete(ATTRIBUTE_TOKENS);
3790
+ }
3710
3791
  }
3711
3792
 
3712
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3793
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3713
3794
 
3714
3795
  /*
3715
3796
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3831,7 +3912,7 @@
3831
3912
  }
3832
3913
  }
3833
3914
 
3834
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3915
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3835
3916
 
3836
3917
  /*
3837
3918
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3874,7 +3955,7 @@
3874
3955
  },
3875
3956
  };
3876
3957
 
3877
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3958
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3878
3959
  /*
3879
3960
  * Copyright (c) Microsoft Corporation. All rights reserved.
3880
3961
  * Licensed under the MIT License.
@@ -4163,12 +4244,12 @@
4163
4244
  }
4164
4245
  }
4165
4246
 
4166
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4247
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4167
4248
  /* eslint-disable header/header */
4168
4249
  const name$1 = "@azure/msal-common";
4169
- const version$1 = "16.11.2";
4250
+ const version$1 = "16.12.0";
4170
4251
 
4171
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4252
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4172
4253
  /*
4173
4254
  * Copyright (c) Microsoft Corporation. All rights reserved.
4174
4255
  * Licensed under the MIT License.
@@ -4176,7 +4257,7 @@
4176
4257
  const cacheQuotaExceeded = "cache_quota_exceeded";
4177
4258
  const cacheErrorUnknown = "cache_error_unknown";
4178
4259
 
4179
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4260
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4180
4261
 
4181
4262
  /*
4182
4263
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4214,7 +4295,7 @@
4214
4295
  }
4215
4296
  }
4216
4297
 
4217
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4298
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4218
4299
 
4219
4300
  /*
4220
4301
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4441,9 +4522,17 @@
4441
4522
  }
4442
4523
  /**
4443
4524
  * saves access token credential
4444
- * @param credential
4525
+ * @param credential - the access token entity to save
4526
+ * @param correlationId - unique identifier for the request
4527
+ * @param kmsi - keep me signed in flag
4445
4528
  */
4446
4529
  async saveAccessToken(credential, correlationId, kmsi) {
4530
+ // Compute hash from components on the entity itself — no need to thread externally.
4531
+ let additionalCacheKeyHash;
4532
+ if (credential.additionalCacheKeyComponents &&
4533
+ Object.keys(credential.additionalCacheKeyComponents).length > 0) {
4534
+ additionalCacheKeyHash = await this.cryptoImpl.hashString(JSON.stringify(credential.additionalCacheKeyComponents));
4535
+ }
4447
4536
  const accessTokenFilter = {
4448
4537
  clientId: credential.clientId,
4449
4538
  credentialType: credential.credentialType,
@@ -4467,7 +4556,7 @@
4467
4556
  }
4468
4557
  }
4469
4558
  });
4470
- await this.setAccessTokenCredential(credential, correlationId, kmsi);
4559
+ await this.setAccessTokenCredential(credential, correlationId, kmsi, additionalCacheKeyHash);
4471
4560
  }
4472
4561
  /**
4473
4562
  * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
@@ -4879,6 +4968,12 @@
4879
4968
  AuthenticationScheme$1.BEARER.toLowerCase()
4880
4969
  ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
4881
4970
  : CredentialType.ACCESS_TOKEN;
4971
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
4972
+ const additionalCacheKeyComponents = attributeTokenPartition
4973
+ ? {
4974
+ attribute_tokens: attributeTokenPartition,
4975
+ }
4976
+ : undefined;
4882
4977
  const accessTokenFilter = {
4883
4978
  homeAccountId: account.homeAccountId,
4884
4979
  environment: account.environment,
@@ -4888,10 +4983,12 @@
4888
4983
  target: scopes,
4889
4984
  tokenType: authScheme,
4890
4985
  keyId: request.sshKid,
4986
+ additionalCacheKeyComponents: additionalCacheKeyComponents,
4891
4987
  };
4892
4988
  const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
4893
4989
  this.getTokenKeys().accessToken;
4894
4990
  const accessTokens = [];
4991
+ const matchedKeys = [];
4895
4992
  accessTokenKeys.forEach((key) => {
4896
4993
  // Validate key
4897
4994
  if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
@@ -4900,18 +4997,18 @@
4900
4997
  if (accessToken &&
4901
4998
  this.credentialMatchesFilter(accessToken, accessTokenFilter, correlationId)) {
4902
4999
  accessTokens.push(accessToken);
5000
+ matchedKeys.push(key);
4903
5001
  }
4904
5002
  }
4905
5003
  });
4906
- const numAccessTokens = accessTokens.length;
4907
- if (numAccessTokens < 1) {
5004
+ if (accessTokens.length < 1) {
4908
5005
  this.commonLogger.info("1nckna", correlationId);
4909
5006
  return null;
4910
5007
  }
4911
- else if (numAccessTokens > 1) {
5008
+ else if (accessTokens.length > 1) {
4912
5009
  this.commonLogger.info("1wkfwp", correlationId);
4913
- accessTokens.forEach((accessToken) => {
4914
- this.removeAccessToken(this.generateCredentialKey(accessToken), correlationId);
5010
+ matchedKeys.forEach((key) => {
5011
+ this.removeAccessToken(key, correlationId);
4915
5012
  });
4916
5013
  this.performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
4917
5014
  return null;
@@ -5354,7 +5451,9 @@
5354
5451
  getTokenKeys() {
5355
5452
  throw createClientAuthError(methodNotImplemented, "");
5356
5453
  }
5357
- generateCredentialKey() {
5454
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5455
+ generateCredentialKey(_credential, _hash) {
5456
+ /* eslint-enable @typescript-eslint/no-unused-vars */
5358
5457
  throw createClientAuthError(methodNotImplemented, "");
5359
5458
  }
5360
5459
  generateAccountKey() {
@@ -5362,7 +5461,7 @@
5362
5461
  }
5363
5462
  }
5364
5463
 
5365
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5464
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5366
5465
  /*
5367
5466
  * Copyright (c) Microsoft Corporation. All rights reserved.
5368
5467
  * Licensed under the MIT License.
@@ -5424,9 +5523,10 @@
5424
5523
  "networkRtt",
5425
5524
  "redirectBridgeTimeoutMs",
5426
5525
  "redirectBridgeMessageVersion",
5526
+ "fetchRetryCount",
5427
5527
  ]);
5428
5528
 
5429
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5529
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5430
5530
 
5431
5531
  /*
5432
5532
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5484,7 +5584,7 @@
5484
5584
  }
5485
5585
  }
5486
5586
 
5487
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5587
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5488
5588
 
5489
5589
  /*
5490
5590
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5580,7 +5680,7 @@
5580
5680
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5581
5681
  }
5582
5682
 
5583
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5683
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5584
5684
  /*
5585
5685
  * Copyright (c) Microsoft Corporation. All rights reserved.
5586
5686
  * Licensed under the MIT License.
@@ -5607,7 +5707,7 @@
5607
5707
  }
5608
5708
  }
5609
5709
 
5610
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5710
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5611
5711
 
5612
5712
  /*
5613
5713
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5687,7 +5787,7 @@
5687
5787
  }
5688
5788
  }
5689
5789
 
5690
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5790
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5691
5791
  /*
5692
5792
  * Copyright (c) Microsoft Corporation. All rights reserved.
5693
5793
  * Licensed under the MIT License.
@@ -5751,7 +5851,7 @@
5751
5851
  uiNotAllowed: uiNotAllowed
5752
5852
  });
5753
5853
 
5754
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5854
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5755
5855
 
5756
5856
  /*
5757
5857
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5818,7 +5918,7 @@
5818
5918
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
5819
5919
  }
5820
5920
 
5821
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5921
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5822
5922
 
5823
5923
  /*
5824
5924
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5837,7 +5937,7 @@
5837
5937
  }
5838
5938
  }
5839
5939
 
5840
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5940
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5841
5941
 
5842
5942
  /*
5843
5943
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5908,7 +6008,7 @@
5908
6008
  }
5909
6009
  }
5910
6010
 
5911
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6011
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5912
6012
 
5913
6013
  /*
5914
6014
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5997,7 +6097,15 @@
5997
6097
  // Add keyId from request to serverTokenResponse if defined
5998
6098
  serverTokenResponse.key_id =
5999
6099
  serverTokenResponse.key_id || request.sshKid || undefined;
6000
- const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, additionalCacheKeyComponents);
6100
+ // Compute components once for entity storage (fallback if hash not provided by client)
6101
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
6102
+ const cacheKeyComponents = additionalCacheKeyComponents ??
6103
+ (attributeTokenPartition
6104
+ ? {
6105
+ attribute_tokens: attributeTokenPartition,
6106
+ }
6107
+ : undefined);
6108
+ const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, cacheKeyComponents);
6001
6109
  let cacheContext;
6002
6110
  try {
6003
6111
  if (this.persistencePlugin && this.serializableCache) {
@@ -6259,7 +6367,7 @@
6259
6367
  return baseAccount;
6260
6368
  }
6261
6369
 
6262
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6370
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6263
6371
  /*
6264
6372
  * Copyright (c) Microsoft Corporation. All rights reserved.
6265
6373
  * Licensed under the MIT License.
@@ -6269,7 +6377,7 @@
6269
6377
  UPN: "UPN",
6270
6378
  };
6271
6379
 
6272
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6380
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6273
6381
  /*
6274
6382
  * Copyright (c) Microsoft Corporation. All rights reserved.
6275
6383
  * Licensed under the MIT License.
@@ -6288,7 +6396,8 @@
6288
6396
  }
6289
6397
  }
6290
6398
 
6291
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6399
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6400
+
6292
6401
  /*
6293
6402
  * Copyright (c) Microsoft Corporation. All rights reserved.
6294
6403
  * Licensed under the MIT License.
@@ -6307,10 +6416,11 @@
6307
6416
  sshKid: request.sshKid,
6308
6417
  embeddedClientId: request.embeddedClientId || request.extraParameters?.clientId,
6309
6418
  resource: request.resource,
6419
+ attributeTokens: serializeAttributeTokens(request.attributeTokens),
6310
6420
  };
6311
6421
  }
6312
6422
 
6313
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6423
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6314
6424
 
6315
6425
  /*
6316
6426
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6396,7 +6506,7 @@
6396
6506
  }
6397
6507
  }
6398
6508
 
6399
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6509
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6400
6510
 
6401
6511
  /*
6402
6512
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6427,7 +6537,7 @@
6427
6537
  return new NetworkError(error, httpStatus, responseHeaders);
6428
6538
  }
6429
6539
 
6430
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6540
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6431
6541
 
6432
6542
  /*
6433
6543
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6507,7 +6617,7 @@
6507
6617
  ThrottlingUtils.preProcess(cacheManager, thumbprint, correlationId);
6508
6618
  let response;
6509
6619
  try {
6510
- response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, options);
6620
+ response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
6511
6621
  const responseHeaders = response.headers || {};
6512
6622
  performanceClient?.addFields({
6513
6623
  refreshTokenSize: response.body.refresh_token?.length || 0,
@@ -6543,7 +6653,7 @@
6543
6653
  return response;
6544
6654
  }
6545
6655
 
6546
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6656
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6547
6657
 
6548
6658
  /*
6549
6659
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6664,6 +6774,12 @@
6664
6774
  // Add scope array, parameter builder will add default scopes and dedupe
6665
6775
  addScopes(parameters, request.scopes, request.correlationId, true, this.oidcDefaultScopes);
6666
6776
  addResource(parameters, request.resource);
6777
+ if (request.attributeTokens) {
6778
+ addAttributeTokens(parameters, request.attributeTokens);
6779
+ }
6780
+ this.performanceClient?.addFields({
6781
+ hasAttributeTokens: !!request.attributeTokens?.length,
6782
+ }, request.correlationId);
6667
6783
  // add code: user set, not validated
6668
6784
  addAuthorizationCode(parameters, request.code);
6669
6785
  // Add library metadata
@@ -6800,7 +6916,7 @@
6800
6916
  }
6801
6917
  }
6802
6918
 
6803
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6919
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6804
6920
 
6805
6921
  /*
6806
6922
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7027,7 +7143,7 @@
7027
7143
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7028
7144
  }
7029
7145
 
7030
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7146
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7031
7147
 
7032
7148
  /*
7033
7149
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7048,7 +7164,7 @@
7048
7164
  return new JoseHeaderError(code, correlationId);
7049
7165
  }
7050
7166
 
7051
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7167
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7052
7168
  /*
7053
7169
  * Copyright (c) Microsoft Corporation. All rights reserved.
7054
7170
  * Licensed under the MIT License.
@@ -7056,7 +7172,7 @@
7056
7172
  const missingKidError = "missing_kid_error";
7057
7173
  const missingAlgError = "missing_alg_error";
7058
7174
 
7059
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7175
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7060
7176
 
7061
7177
  /*
7062
7178
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7096,7 +7212,7 @@
7096
7212
  }
7097
7213
  }
7098
7214
 
7099
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7215
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7100
7216
 
7101
7217
  /*
7102
7218
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7645,7 +7761,7 @@
7645
7761
  }
7646
7762
  }
7647
7763
 
7648
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7764
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7649
7765
 
7650
7766
  /*
7651
7767
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7806,6 +7922,12 @@
7806
7922
  addServerTelemetry(parameters, this.serverTelemetryManager);
7807
7923
  }
7808
7924
  addRefreshToken(parameters, request.refreshToken);
7925
+ if (request.attributeTokens) {
7926
+ addAttributeTokens(parameters, request.attributeTokens);
7927
+ }
7928
+ this.performanceClient?.addFields({
7929
+ hasAttributeTokens: !!request.attributeTokens?.length,
7930
+ }, request.correlationId);
7809
7931
  if (this.config.clientCredentials.clientSecret) {
7810
7932
  addClientSecret(parameters, this.config.clientCredentials.clientSecret);
7811
7933
  }
@@ -7866,7 +7988,7 @@
7866
7988
  }
7867
7989
  }
7868
7990
 
7869
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7991
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7870
7992
 
7871
7993
  /*
7872
7994
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8159,7 +8281,7 @@
8159
8281
  clearNativeBrokerErrorCode() { }
8160
8282
  }
8161
8283
 
8162
- /*! @azure/msal-common v16.11.2 2026-07-15 */
8284
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
8163
8285
 
8164
8286
  /*
8165
8287
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8267,7 +8389,7 @@
8267
8389
  }
8268
8390
  }
8269
8391
 
8270
- /*! @azure/msal-common v16.11.2 2026-07-15 */
8392
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
8271
8393
 
8272
8394
  /*
8273
8395
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8283,7 +8405,7 @@
8283
8405
  },
8284
8406
  };
8285
8407
 
8286
- /*! @azure/msal-common v16.11.2 2026-07-15 */
8408
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
8287
8409
 
8288
8410
  /*
8289
8411
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10786,7 +10908,7 @@
10786
10908
 
10787
10909
  /* eslint-disable header/header */
10788
10910
  const name = "@azure/msal-browser";
10789
- const version = "5.17.1";
10911
+ const version = "5.18.0";
10790
10912
 
10791
10913
  /*
10792
10914
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11679,12 +11801,12 @@
11679
11801
  return parsedAccessToken;
11680
11802
  }
11681
11803
  /**
11682
- * set accessToken credential to the platform cache
11683
- * @param accessToken
11804
+ * Set accessToken credential to the platform cache
11805
+ * @param accessToken - the access token entity to cache
11684
11806
  */
11685
- async setAccessTokenCredential(accessToken, correlationId, kmsi) {
11807
+ async setAccessTokenCredential(accessToken, correlationId, kmsi, additionalCacheKeyHash) {
11686
11808
  this.logger.trace("1pondb", correlationId);
11687
- const accessTokenKey = this.generateCredentialKey(accessToken);
11809
+ const accessTokenKey = this.generateCredentialKey(accessToken, additionalCacheKeyHash);
11688
11810
  const timestamp = Date.now().toString();
11689
11811
  accessToken.lastUpdatedAt = timestamp;
11690
11812
  await this.setUserData(accessTokenKey, JSON.stringify(accessToken), correlationId, timestamp, kmsi);
@@ -11994,11 +12116,13 @@
11994
12116
  }
11995
12117
  /**
11996
12118
  * Generate Credential Key. All changes to the key REQUIRE a schema version update.
11997
- * Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>
12119
+ * Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>|<additional_cache_key_components_hash>
12120
+ *
11998
12121
  * @param credentialEntity
12122
+ * @param hash - optional precomputed hash of additionalCacheKeyComponents
11999
12123
  * @returns
12000
12124
  */
12001
- generateCredentialKey(credential) {
12125
+ generateCredentialKey(credential, additionalCacheKeyHash) {
12002
12126
  const familyId = (credential.credentialType ===
12003
12127
  CredentialType.REFRESH_TOKEN &&
12004
12128
  credential.familyId) ||
@@ -12018,6 +12142,12 @@
12018
12142
  credential.target || "",
12019
12143
  scheme,
12020
12144
  ];
12145
+ // Append precomputed component-hash segment.
12146
+ if (credential.additionalCacheKeyComponents &&
12147
+ Object.keys(credential.additionalCacheKeyComponents).length > 0 &&
12148
+ additionalCacheKeyHash) {
12149
+ credentialKey.push(additionalCacheKeyHash);
12150
+ }
12021
12151
  return credentialKey.join(CACHE_KEY_SEPARATOR).toLowerCase();
12022
12152
  }
12023
12153
  /**
@@ -13252,50 +13382,63 @@
13252
13382
  const nativeATMeasurement = this.performanceClient.startMeasurement(NativeInteractionClientAcquireToken, this.correlationId);
13253
13383
  const reqTimestamp = nowSeconds();
13254
13384
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
13385
+ // initialize native request (statically builds the request; does not contact the broker)
13386
+ let nativeRequest;
13255
13387
  try {
13256
- // initialize native request
13257
- const nativeRequest = await this.initializePlatformRequest(request);
13258
- // check if the tokens can be retrieved from internal cache
13259
- try {
13260
- const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
13261
- nativeATMeasurement.end({
13262
- success: true,
13388
+ nativeRequest = await this.initializePlatformRequest(request);
13389
+ }
13390
+ catch (e) {
13391
+ /*
13392
+ * Request initialization (e.g. PoP token generation or authority
13393
+ * resolution) failed before the broker was contacted, so end the
13394
+ * measurement here to avoid an orphaned sub-measurement.
13395
+ * Broker was never engaged, so this was not a native broker outcome.
13396
+ */
13397
+ nativeATMeasurement.add({
13398
+ isNativeBroker: false,
13399
+ });
13400
+ nativeATMeasurement.end({
13401
+ success: false,
13402
+ }, e);
13403
+ throw e;
13404
+ }
13405
+ // check if the tokens can be retrieved from internal cache
13406
+ try {
13407
+ const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
13408
+ // Served from the native internal cache; token did not come directly from the broker
13409
+ nativeATMeasurement.add({
13410
+ isNativeBroker: false,
13411
+ });
13412
+ nativeATMeasurement.end({
13413
+ success: true,
13414
+ fromCache: true,
13415
+ });
13416
+ return result;
13417
+ }
13418
+ catch (e) {
13419
+ if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
13420
+ this.logger.info("0eitbc", this.correlationId);
13421
+ nativeATMeasurement.add({
13263
13422
  isNativeBroker: false,
13264
- fromCache: true,
13265
- });
13266
- return result;
13267
- }
13268
- catch (e) {
13269
- if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
13270
- this.logger.info("0eitbc", this.correlationId);
13271
- nativeATMeasurement.end({
13272
- success: false,
13273
- brokerErrorCode: "cache_request_failed",
13274
- });
13275
- throw e;
13276
- }
13277
- // continue with a native call for any and all errors
13278
- this.logger.info("0957j1", this.correlationId);
13279
- }
13280
- const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
13281
- return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
13282
- .then((result) => {
13283
- nativeATMeasurement.end({
13284
- success: true,
13285
- isNativeBroker: true,
13286
- requestId: result.requestId,
13287
13423
  });
13288
- serverTelemetryManager.clearNativeBrokerErrorCode();
13289
- return result;
13290
- })
13291
- .catch((error) => {
13292
13424
  nativeATMeasurement.end({
13293
13425
  success: false,
13294
- errorCode: error.errorCode,
13295
- subErrorCode: error.subError,
13296
13426
  });
13297
- throw error;
13427
+ throw e;
13428
+ }
13429
+ // continue with a native call for any and all errors
13430
+ this.logger.info("0957j1", this.correlationId);
13431
+ }
13432
+ // dispatch the request to the broker
13433
+ try {
13434
+ const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
13435
+ const result = await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
13436
+ nativeATMeasurement.end({
13437
+ success: true,
13438
+ requestId: result.requestId,
13298
13439
  });
13440
+ serverTelemetryManager.clearNativeBrokerErrorCode();
13441
+ return result;
13299
13442
  }
13300
13443
  catch (e) {
13301
13444
  if (e instanceof NativeAuthError) {
@@ -13303,10 +13446,29 @@
13303
13446
  }
13304
13447
  nativeATMeasurement.end({
13305
13448
  success: false,
13306
- });
13449
+ }, e);
13450
+ this.setBrokerErrorTelemetry(e);
13307
13451
  throw e;
13308
13452
  }
13309
13453
  }
13454
+ /**
13455
+ * Records platform-broker error telemetry on the root event for the current
13456
+ * correlationId. `isNativeBroker` is set optimistically to true because the
13457
+ * broker was engaged; when the caller subsequently falls back to a web flow
13458
+ * that succeeds, the root success measurement overrides it to false via
13459
+ * `result.fromPlatformBroker`. Terminal broker errors (no fallback) retain
13460
+ * true. `brokerErrorName`/`brokerErrorCode` are recorded when the error is an `AuthError`.
13461
+ * @param error error thrown by the broker interaction
13462
+ */
13463
+ setBrokerErrorTelemetry(error) {
13464
+ if (error instanceof AuthError) {
13465
+ this.performanceClient.addFields({
13466
+ isNativeBroker: true,
13467
+ brokerErrorName: error.name,
13468
+ brokerErrorCode: error.errorCode,
13469
+ }, this.correlationId);
13470
+ }
13471
+ }
13310
13472
  /**
13311
13473
  * Creates silent flow request
13312
13474
  * @param request
@@ -13314,13 +13476,18 @@
13314
13476
  * @returns CommonSilentFlowRequest
13315
13477
  */
13316
13478
  createSilentCacheRequest(request, cachedAccount) {
13317
- return {
13479
+ const silentRequest = {
13318
13480
  authority: request.authority,
13319
13481
  correlationId: this.correlationId,
13320
13482
  scopes: ScopeSet.fromString(request.scope, this.correlationId).asArray(),
13321
13483
  account: cachedAccount,
13322
13484
  forceRefresh: false,
13323
13485
  };
13486
+ // Preserve FMI partition semantics for silent cache filtering.
13487
+ if (request.attributeTokens) {
13488
+ silentRequest.attributeTokens = request.attributeTokens.split(" ");
13489
+ }
13490
+ return silentRequest;
13324
13491
  }
13325
13492
  /**
13326
13493
  * Fetches the tokens from the cache if un-expired
@@ -13378,11 +13545,21 @@
13378
13545
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
13379
13546
  serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
13380
13547
  if (isFatalNativeAuthError(e)) {
13548
+ /*
13549
+ * Fatal error on redirect initiate always falls back to a
13550
+ * regular web redirect, so this request did not complete
13551
+ * natively. Token telemetry for the eventual outcome lands
13552
+ * in handleRedirectPromise (phase 2).
13553
+ */
13554
+ this.setBrokerErrorTelemetry(e);
13381
13555
  throw e;
13382
13556
  }
13383
13557
  }
13384
13558
  }
13385
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
13559
+ this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify({
13560
+ ...nativeRequest,
13561
+ storeInCache: request.storeInCache,
13562
+ }), true);
13386
13563
  const navigationOptions = {
13387
13564
  apiId: ApiId.acquireTokenRedirect,
13388
13565
  timeout: this.config.system.redirectNavigationTimeout,
@@ -13412,7 +13589,11 @@
13412
13589
  this.performanceClient?.addFields({ errorCode: "no_cached_request" }, this.correlationId);
13413
13590
  return null;
13414
13591
  }
13415
- const { prompt, ...request } = cachedRequest;
13592
+ /*
13593
+ * storeInCache is a client-side cache directive persisted alongside the cached
13594
+ * request (not a broker-contract parameter), so extract it here before resending.
13595
+ */
13596
+ const { prompt, storeInCache, ...request } = cachedRequest;
13416
13597
  if (prompt) {
13417
13598
  this.logger.verbose("0ac34v", this.correlationId);
13418
13599
  }
@@ -13421,13 +13602,13 @@
13421
13602
  try {
13422
13603
  this.logger.verbose("003x5a", this.correlationId);
13423
13604
  const response = await this.platformAuthProvider.sendMessage(request);
13424
- const authResult = await this.handleNativeResponse(response, request, reqTimestamp);
13605
+ const authResult = await this.handleNativeResponse(response, request, reqTimestamp, storeInCache);
13425
13606
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
13426
13607
  serverTelemetryManager.clearNativeBrokerErrorCode();
13427
- this.performanceClient?.addFields({ isNativeBroker: true }, this.correlationId);
13428
13608
  return authResult;
13429
13609
  }
13430
13610
  catch (e) {
13611
+ this.setBrokerErrorTelemetry(e);
13431
13612
  throw e;
13432
13613
  }
13433
13614
  }
@@ -13445,7 +13626,7 @@
13445
13626
  * @param request
13446
13627
  * @param reqTimestamp
13447
13628
  */
13448
- async handleNativeResponse(response, request, reqTimestamp) {
13629
+ async handleNativeResponse(response, request, reqTimestamp, storeInCache) {
13449
13630
  this.logger.trace("1bojln", this.correlationId);
13450
13631
  // generate identifiers
13451
13632
  const idTokenClaims = extractTokenClaims(response.id_token, base64Decode, this.correlationId);
@@ -13474,8 +13655,8 @@
13474
13655
  const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
13475
13656
  // cache accounts and tokens in the appropriate storage
13476
13657
  await this.cacheAccount(baseAccount, isKmsi(idTokenClaims));
13477
- await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache() // environment
13478
- );
13658
+ await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
13659
+ storeInCache);
13479
13660
  return result;
13480
13661
  }
13481
13662
  /**
@@ -13596,7 +13777,9 @@
13596
13777
  correlationId: this.correlationId,
13597
13778
  state: response.state,
13598
13779
  fromPlatformBroker: true,
13599
- ...(request.resource && { resource: request.resource }),
13780
+ ...(request.extraParameters?.resource && {
13781
+ resource: request.extraParameters.resource,
13782
+ }),
13600
13783
  };
13601
13784
  return result;
13602
13785
  }
@@ -13620,7 +13803,7 @@
13620
13803
  * @param tenantId
13621
13804
  * @param reqTimestamp
13622
13805
  */
13623
- async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment) {
13806
+ async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache) {
13624
13807
  const cachedIdToken = createIdTokenEntity(homeAccountIdentifier, environment, response.id_token || "", request.clientId, idTokenClaims.tid || "");
13625
13808
  // cache accessToken in inmemory storage
13626
13809
  const expiresIn = request.tokenType === AuthenticationScheme$1.POP
@@ -13630,16 +13813,21 @@
13630
13813
  : response.expires_in) || 0;
13631
13814
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
13632
13815
  const responseScopes = this.generateScopes(response.scope, request.scope);
13633
- const cachedAccessToken = createAccessTokenEntity(homeAccountIdentifier, environment, response.access_token, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, request.correlationId, undefined, request.tokenType, undefined, request.keyId);
13816
+ const additionalCacheKeyComponents = request.attributeTokens
13817
+ ? {
13818
+ attribute_tokens: request.attributeTokens,
13819
+ }
13820
+ : undefined;
13821
+ const cachedAccessToken = createAccessTokenEntity(homeAccountIdentifier, environment, response.access_token, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, request.correlationId, undefined, request.tokenType, undefined, request.keyId, additionalCacheKeyComponents);
13634
13822
  // save idtoken credential in configured browser storage
13635
- if (!!cachedIdToken && request.storeInCache?.idToken !== false) {
13823
+ if (!!cachedIdToken && storeInCache?.idToken !== false) {
13636
13824
  await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, isKmsi(idTokenClaims));
13637
13825
  }
13638
13826
  // save access token credential in memory storage
13639
13827
  const nativeCacheRecord = {
13640
13828
  accessToken: cachedAccessToken,
13641
13829
  };
13642
- return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, request.storeInCache);
13830
+ return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, storeInCache);
13643
13831
  }
13644
13832
  getExpiresInValue(tokenType, expiresIn) {
13645
13833
  return tokenType === AuthenticationScheme$1.POP
@@ -13711,13 +13899,19 @@
13711
13899
  const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
13712
13900
  ? undefined
13713
13901
  : this.config.auth.clientCapabilities;
13714
- // scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
13715
- const { scopes, claims, ...remainingProperties } = request;
13902
+ /*
13903
+ * scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
13904
+ * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
13905
+ */
13906
+ const { scopes, claims } = request;
13716
13907
  const scopeSet = new ScopeSet(scopes || [], this.correlationId);
13717
13908
  scopeSet.appendScopes(OIDC_DEFAULT_SCOPES$1);
13718
13909
  const mergedClaims = buildMergedClaims$1(claims, configClaims?.length ? configClaims : undefined);
13910
+ const hasAttributeTokens = !!request.attributeTokens?.length;
13911
+ this.performanceClient?.addFields({
13912
+ hasAttributeTokens,
13913
+ }, this.correlationId);
13719
13914
  const validatedRequest = {
13720
- ...remainingProperties,
13721
13915
  claims: mergedClaims,
13722
13916
  accountId: this.accountId,
13723
13917
  clientId: this.config.auth.clientId,
@@ -13726,19 +13920,32 @@
13726
13920
  redirectUri: getRedirectUri(request.redirectUri, this.config.auth.redirectUri, this.logger, this.correlationId),
13727
13921
  prompt: this.getPrompt(request.prompt),
13728
13922
  correlationId: this.correlationId,
13923
+ isSts: false,
13729
13924
  tokenType: request.authenticationScheme,
13730
13925
  windowTitleSubstring: document.title,
13926
+ nonce: request.nonce,
13927
+ state: request.state,
13928
+ loginHint: request.loginHint,
13731
13929
  extraParameters: {
13732
13930
  ...request.extraParameters,
13931
+ ...(request.resource && { resource: request.resource }), // resource is set for MCP scenarios
13733
13932
  },
13734
13933
  extendedExpiryToken: false,
13735
13934
  keyId: request.popKid,
13935
+ resourceRequestMethod: request.resourceRequestMethod,
13936
+ resourceRequestUri: request.resourceRequestUri,
13937
+ shrClaims: request.shrClaims,
13938
+ shrNonce: request.shrNonce,
13736
13939
  };
13940
+ if (hasAttributeTokens) {
13941
+ validatedRequest.attributeTokens =
13942
+ serializeAttributeTokens(request.attributeTokens);
13943
+ }
13737
13944
  // Check for PoP token requests: signPopToken should only be set to true if popKid is not set
13738
13945
  if (validatedRequest.signPopToken && !!request.popKid) {
13739
13946
  throw createBrowserAuthError(invalidPopTokenRequest, this.correlationId);
13740
13947
  }
13741
- this.handleExtraBrokerParams(validatedRequest);
13948
+ this.handleExtraBrokerParams(validatedRequest, request.embeddedClientId);
13742
13949
  validatedRequest.extraParameters =
13743
13950
  validatedRequest.extraParameters || {};
13744
13951
  validatedRequest.extraParameters.telemetry =
@@ -13813,19 +14020,19 @@
13813
14020
  * @param request {PlatformAuthRequest}
13814
14021
  * @private
13815
14022
  */
13816
- handleExtraBrokerParams(request) {
14023
+ handleExtraBrokerParams(request, embeddedClientId) {
13817
14024
  const hasExtraBrokerParams = request.extraParameters &&
13818
14025
  request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
13819
14026
  request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
13820
14027
  request.extraParameters.hasOwnProperty(CLIENT_ID);
13821
- if (!request.embeddedClientId && !hasExtraBrokerParams) {
14028
+ if (!embeddedClientId && !hasExtraBrokerParams) {
13822
14029
  return;
13823
14030
  }
13824
14031
  let child_client_id = "";
13825
14032
  const child_redirect_uri = request.redirectUri;
13826
- if (request.embeddedClientId) {
14033
+ if (embeddedClientId) {
13827
14034
  request.redirectUri = this.config.auth.redirectUri;
13828
- child_client_id = request.embeddedClientId;
14035
+ child_client_id = embeddedClientId;
13829
14036
  }
13830
14037
  else if (request.extraParameters) {
13831
14038
  request.redirectUri =
@@ -13833,7 +14040,15 @@
13833
14040
  child_client_id =
13834
14041
  request.extraParameters[CLIENT_ID];
13835
14042
  }
14043
+ const {
14044
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14045
+ [BROKER_CLIENT_ID]: _brkClientId,
14046
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14047
+ [BROKER_REDIRECT_URI]: _brkRedirectUri,
14048
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14049
+ [CLIENT_ID]: _clientId, ...remainingExtraParameters } = request.extraParameters || {};
13836
14050
  request.extraParameters = {
14051
+ ...remainingExtraParameters,
13837
14052
  child_client_id,
13838
14053
  child_redirect_uri,
13839
14054
  };
@@ -14258,6 +14473,8 @@
14258
14473
  * Copyright (c) Microsoft Corporation. All rights reserved.
14259
14474
  * Licensed under the MIT License.
14260
14475
  */
14476
+ const MAX_FETCH_POST_RETRIES = 1;
14477
+ const RETRY_DELAY_MS = 100;
14261
14478
  /**
14262
14479
  * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
14263
14480
  */
@@ -14306,21 +14523,40 @@
14306
14523
  async sendPostRequestAsync(url, options) {
14307
14524
  const reqBody = (options && options.body) || "";
14308
14525
  const reqHeaders = getFetchHeaders(options);
14526
+ const correlationId = options?.correlationId;
14527
+ const performanceClient = options?.performanceClient;
14309
14528
  let response;
14310
- let responseStatus = 0;
14311
- let responseHeaders = {};
14312
- try {
14313
- response = await fetch(url, {
14314
- method: HTTP_REQUEST_TYPE.POST,
14315
- headers: reqHeaders,
14316
- body: reqBody,
14317
- });
14529
+ let lastError;
14530
+ for (let attempt = 1; attempt <= MAX_FETCH_POST_RETRIES + 1; attempt++) {
14531
+ try {
14532
+ response = await fetch(url, {
14533
+ method: HTTP_REQUEST_TYPE.POST,
14534
+ headers: reqHeaders,
14535
+ body: reqBody,
14536
+ });
14537
+ break;
14538
+ }
14539
+ catch (e) {
14540
+ lastError = e;
14541
+ if (!shouldRetryPostFetchError(lastError, attempt)) {
14542
+ throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
14543
+ ? postRequestFailed
14544
+ : noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
14545
+ }
14546
+ // Brief backoff before retry
14547
+ await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS));
14548
+ if (correlationId) {
14549
+ performanceClient?.incrementFields({ fetchRetryCount: 1 }, correlationId);
14550
+ }
14551
+ }
14318
14552
  }
14319
- catch (e) {
14320
- throw createNetworkError(createBrowserAuthError(window.navigator.onLine
14553
+ if (!response) {
14554
+ throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
14321
14555
  ? postRequestFailed
14322
- : noNetworkConnectivity, ""), undefined, undefined, e);
14556
+ : noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
14323
14557
  }
14558
+ let responseStatus = 0;
14559
+ let responseHeaders = {};
14324
14560
  responseHeaders = getHeaderDict(response.headers);
14325
14561
  try {
14326
14562
  responseStatus = response.status;
@@ -14331,10 +14567,15 @@
14331
14567
  };
14332
14568
  }
14333
14569
  catch (e) {
14334
- throw createNetworkError(createBrowserAuthError(failedToParseResponse, ""), responseStatus, responseHeaders, e);
14570
+ throw createNetworkError(createBrowserAuthError(failedToParseResponse, correlationId || ""), responseStatus, responseHeaders, e);
14335
14571
  }
14336
14572
  }
14337
14573
  }
14574
+ function shouldRetryPostFetchError(error, attempt) {
14575
+ return (attempt <= MAX_FETCH_POST_RETRIES &&
14576
+ window.navigator.onLine !== false &&
14577
+ error.name !== "AbortError");
14578
+ }
14338
14579
  /**
14339
14580
  * Get Fetch API Headers object from string map
14340
14581
  * @param inputHeaders
@@ -14820,7 +15061,7 @@
14820
15061
  }
14821
15062
  initializePlatformDOMRequest(request) {
14822
15063
  this.logger.trace(`15d6yv ${this.platformAuthType}`, request.correlationId);
14823
- const { accountId, clientId, authority, scope, redirectUri, correlationId, state, storeInCache, embeddedClientId, extraParameters, ...remainingProperties } = request;
15064
+ const { accountId, clientId, authority, scope, redirectUri, correlationId, state, extraParameters, ...remainingProperties } = request;
14824
15065
  const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
14825
15066
  const platformDOMRequest = {
14826
15067
  accountId: accountId,
@@ -14836,8 +15077,6 @@
14836
15077
  redirectUri: redirectUri,
14837
15078
  scope: scope,
14838
15079
  state: state,
14839
- storeInCache: storeInCache,
14840
- embeddedClientId: embeddedClientId,
14841
15080
  };
14842
15081
  return platformDOMRequest;
14843
15082
  }
@@ -16621,6 +16860,7 @@
16621
16860
  this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, correlationId, exports.InteractionType.Redirect);
16622
16861
  rootMeasurement = this.performanceClient.startMeasurement(AcquireTokenRedirect, correlationId);
16623
16862
  this.logger.trace("12v7is", correlationId);
16863
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
16624
16864
  rootMeasurement.add({
16625
16865
  isPlatformBrokerRequest: true,
16626
16866
  });
@@ -16657,6 +16897,7 @@
16657
16897
  }
16658
16898
  rootMeasurement.end({
16659
16899
  success: true,
16900
+ isNativeBroker: result.fromPlatformBroker ?? false,
16660
16901
  }, undefined, result.account);
16661
16902
  // Fire-and-forget SSO capability verification in background
16662
16903
  this.verifySsoCapability(cachedRedirectRequest, exports.InteractionType.Redirect);
@@ -16666,8 +16907,8 @@
16666
16907
  * Instrument an event only if an error code is set. Otherwise, discard it when the redirect response
16667
16908
  * is empty and the error code is missing.
16668
16909
  */
16669
- if (rootMeasurement.event.errorCode) {
16670
- rootMeasurement.end({ success: false }, undefined);
16910
+ if (!!rootMeasurement.event.errorCode) {
16911
+ rootMeasurement.end({ success: false });
16671
16912
  }
16672
16913
  else {
16673
16914
  rootMeasurement.discard();
@@ -16726,10 +16967,6 @@
16726
16967
  this.canUsePlatformBroker(request)) {
16727
16968
  const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
16728
16969
  result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
16729
- atrMeasurement.add({
16730
- brokerErrorName: e.name,
16731
- brokerErrorCode: e.errorCode,
16732
- });
16733
16970
  if (e instanceof NativeAuthError &&
16734
16971
  isFatalNativeAuthError(e)) {
16735
16972
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -16798,6 +17035,7 @@
16798
17035
  let result;
16799
17036
  const pkce = this.getPreGeneratedPkceCodes(correlationId);
16800
17037
  if (this.canUsePlatformBroker(request)) {
17038
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
16801
17039
  atPopupMeasurement.add({
16802
17040
  isPlatformBrokerRequest: true,
16803
17041
  });
@@ -16808,15 +17046,11 @@
16808
17046
  .then((response) => {
16809
17047
  atPopupMeasurement.end({
16810
17048
  success: true,
16811
- isNativeBroker: true,
17049
+ isNativeBroker: response.fromPlatformBroker ?? false,
16812
17050
  }, undefined, response.account);
16813
17051
  return response;
16814
17052
  })
16815
17053
  .catch((e) => {
16816
- atPopupMeasurement.add({
16817
- brokerErrorName: e.name,
16818
- brokerErrorCode: e.errorCode,
16819
- });
16820
17054
  if (e instanceof NativeAuthError &&
16821
17055
  isFatalNativeAuthError(e)) {
16822
17056
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -16847,6 +17081,7 @@
16847
17081
  }
16848
17082
  atPopupMeasurement.end({
16849
17083
  success: true,
17084
+ isNativeBroker: result.fromPlatformBroker ?? false,
16850
17085
  accessTokenSize: result.accessToken.length,
16851
17086
  idTokenSize: result.idToken.length,
16852
17087
  }, undefined, result.account);
@@ -17040,14 +17275,11 @@
17040
17275
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, exports.InteractionType.Silent, validRequest);
17041
17276
  let result;
17042
17277
  if (this.canUsePlatformBroker(validRequest)) {
17278
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
17043
17279
  this.ssoSilentMeasurement?.add({
17044
17280
  isPlatformBrokerRequest: true,
17045
17281
  });
17046
17282
  result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
17047
- this.ssoSilentMeasurement?.add({
17048
- brokerErrorName: e.name,
17049
- brokerErrorCode: e.errorCode,
17050
- });
17051
17283
  // If native token acquisition fails for availability reasons fallback to standard flow
17052
17284
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
17053
17285
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -17070,7 +17302,7 @@
17070
17302
  }
17071
17303
  this.ssoSilentMeasurement?.end({
17072
17304
  success: true,
17073
- isNativeBroker: response.fromPlatformBroker,
17305
+ isNativeBroker: response.fromPlatformBroker ?? false,
17074
17306
  accessTokenSize: response.accessToken.length,
17075
17307
  idTokenSize: response.idToken.length,
17076
17308
  }, undefined, response.account);
@@ -17123,6 +17355,7 @@
17123
17355
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
17124
17356
  atbcMeasurement.end({
17125
17357
  success: true,
17358
+ isNativeBroker: false,
17126
17359
  accessTokenSize: result.accessToken.length,
17127
17360
  idTokenSize: result.idToken.length,
17128
17361
  }, undefined, result.account);
@@ -17153,10 +17386,6 @@
17153
17386
  ...request,
17154
17387
  correlationId,
17155
17388
  }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
17156
- atbcMeasurement.add({
17157
- brokerErrorName: e.name,
17158
- brokerErrorCode: e.errorCode,
17159
- });
17160
17389
  // If native token acquisition fails for availability reasons fallback to standard flow
17161
17390
  if (e instanceof NativeAuthError &&
17162
17391
  isFatalNativeAuthError(e)) {
@@ -17166,6 +17395,7 @@
17166
17395
  });
17167
17396
  atbcMeasurement.end({
17168
17397
  success: true,
17398
+ isNativeBroker: result.fromPlatformBroker ?? false,
17169
17399
  }, undefined, result.account);
17170
17400
  return result;
17171
17401
  }
@@ -17206,6 +17436,7 @@
17206
17436
  .then((response) => {
17207
17437
  this.acquireTokenByCodeAsyncMeasurement?.end({
17208
17438
  success: true,
17439
+ isNativeBroker: false,
17209
17440
  fromCache: response.fromCache,
17210
17441
  });
17211
17442
  return response;
@@ -17359,21 +17590,32 @@
17359
17590
  // Create idToken entity and store in browser storage
17360
17591
  const idTokenEntity = createIdTokenEntity(result.account.homeAccountId, result.account.environment, result.idToken, this.config.auth.clientId, result.tenantId);
17361
17592
  // Create accessToken entity and store in native internal storage
17593
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
17594
+ const additionalCacheKeyComponents = attributeTokenPartition
17595
+ ? {
17596
+ attribute_tokens: attributeTokenPartition,
17597
+ }
17598
+ : undefined;
17362
17599
  const accessTokenEntity = createAccessTokenEntity(result.account.homeAccountId, result.account.environment, result.accessToken, this.config.auth.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn
17363
17600
  ? toSecondsFromDate(result.expiresOn)
17364
17601
  : 0, result.extExpiresOn
17365
17602
  ? toSecondsFromDate(result.extExpiresOn)
17366
17603
  : 0, base64Decode, request.correlationId || "", undefined, // refreshOn
17367
17604
  result.tokenType, undefined, // userAssertionHash
17368
- request.sshKid);
17605
+ request.sshKid, additionalCacheKeyComponents);
17369
17606
  if (request.resource) {
17370
17607
  accessTokenEntity.resource = request.resource;
17371
17608
  }
17609
+ // Get attribute token partition hash for cache key isolation
17610
+ const components = additionalCacheKeyComponents;
17611
+ const additionalCacheKeyHash = components
17612
+ ? await this.browserCrypto.hashString(JSON.stringify(components))
17613
+ : undefined;
17372
17614
  const kmsi = isKmsi(result.idTokenClaims);
17373
17615
  // Store idToken in browser storage
17374
17616
  await this.browserStorage.setIdTokenCredential(idTokenEntity, result.correlationId, kmsi);
17375
17617
  // Store accessToken in native internal storage
17376
- await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi);
17618
+ await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi, additionalCacheKeyHash);
17377
17619
  }
17378
17620
  else {
17379
17621
  return this.browserStorage.hydrateCache(result, request);
@@ -17383,8 +17625,16 @@
17383
17625
  /**
17384
17626
  * Acquire a token from native device (e.g. WAM)
17385
17627
  * @param request
17628
+ * @param apiId
17629
+ * @param accountId
17630
+ * @param cacheLookupPolicy
17386
17631
  */
17387
17632
  async acquireTokenNative(request, apiId, accountId, cacheLookupPolicy) {
17633
+ /*
17634
+ * Callers always normalize correlationId onto the request before delegating
17635
+ * here, so it is guaranteed defined and is the single id used to key this
17636
+ * flow's telemetry.
17637
+ */
17388
17638
  const correlationId = this.getRequestCorrelationId(request);
17389
17639
  this.logger.trace("0b9y3p", correlationId);
17390
17640
  if (!this.platformAuthProvider) {
@@ -17638,6 +17888,7 @@
17638
17888
  .then((result) => {
17639
17889
  atsMeasurement.end({
17640
17890
  success: true,
17891
+ isNativeBroker: result.fromPlatformBroker ?? false,
17641
17892
  fromCache: result.fromCache,
17642
17893
  accessTokenSize: result.accessToken.length,
17643
17894
  idTokenSize: result.idToken.length,
@@ -17774,7 +18025,7 @@
17774
18025
  if (request.correlationId) {
17775
18026
  this.performanceClient.addFields({
17776
18027
  fromCache: response.fromCache,
17777
- isNativeBroker: response.fromPlatformBroker,
18028
+ isNativeBroker: response.fromPlatformBroker ?? false,
17778
18029
  }, request.correlationId);
17779
18030
  }
17780
18031
  return response;
@@ -17800,10 +18051,6 @@
17800
18051
  this.logger.verbose("0sczo4", silentRequest.correlationId);
17801
18052
  this.performanceClient.addFields({ isPlatformBrokerRequest: true }, silentRequest.correlationId);
17802
18053
  return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow, silentRequest.account.nativeAccountId, cacheLookupPolicy).catch(async (e) => {
17803
- this.performanceClient.addFields({
17804
- brokerErrorName: e.name,
17805
- brokerErrorCode: e.errorCode,
17806
- }, silentRequest.correlationId);
17807
18054
  // If native token acquisition fails for availability reasons fallback to web flow
17808
18055
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
17809
18056
  this.logger.verbose("07rkmb", silentRequest.correlationId);
@@ -18092,6 +18339,7 @@
18092
18339
  const correlationId = request.correlationId || this.crypto.createNewGuid();
18093
18340
  const claims = buildMergedClaims$1(request.claims, this.clientCapabilities);
18094
18341
  const scopes = request.scopes || OIDC_DEFAULT_SCOPES$1;
18342
+ const attributeTokens = serializeAttributeTokens(request.attributeTokens);
18095
18343
  const tokenRequest = {
18096
18344
  platformBrokerId: request.account?.homeAccountId,
18097
18345
  clientId: this.clientId,
@@ -18104,6 +18352,7 @@
18104
18352
  authenticationScheme: request.authenticationScheme ||
18105
18353
  AuthenticationScheme$1.BEARER,
18106
18354
  extraParameters: extraParams,
18355
+ attributeTokens,
18107
18356
  };
18108
18357
  return tokenRequest;
18109
18358
  }