@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.msalCustomAuth = {}));
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.
@@ -289,7 +290,7 @@
289
290
  // Token renewal offset default in seconds
290
291
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
291
292
 
292
- /*! @azure/msal-common v16.11.2 2026-07-15 */
293
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
293
294
  /*
294
295
  * Copyright (c) Microsoft Corporation. All rights reserved.
295
296
  * Licensed under the MIT License.
@@ -318,7 +319,7 @@
318
319
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
319
320
  }
320
321
 
321
- /*! @azure/msal-common v16.11.2 2026-07-15 */
322
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
322
323
 
323
324
  /*
324
325
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -341,7 +342,7 @@
341
342
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
342
343
  }
343
344
 
344
- /*! @azure/msal-common v16.11.2 2026-07-15 */
345
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
345
346
  /*
346
347
  * Copyright (c) Microsoft Corporation. All rights reserved.
347
348
  * Licensed under the MIT License.
@@ -378,7 +379,7 @@
378
379
  const resourceParameterRequired = "resource_parameter_required";
379
380
  const misplacedResourceParam = "misplaced_resource_parameter";
380
381
 
381
- /*! @azure/msal-common v16.11.2 2026-07-15 */
382
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
382
383
 
383
384
  /*
384
385
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -416,7 +417,7 @@
416
417
  };
417
418
  }
418
419
 
419
- /*! @azure/msal-common v16.11.2 2026-07-15 */
420
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
420
421
 
421
422
  /*
422
423
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -482,7 +483,7 @@
482
483
  return matches[2];
483
484
  }
484
485
 
485
- /*! @azure/msal-common v16.11.2 2026-07-15 */
486
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
486
487
 
487
488
  /*
488
489
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -570,7 +571,7 @@
570
571
  return updatedAccountInfo;
571
572
  }
572
573
 
573
- /*! @azure/msal-common v16.11.2 2026-07-15 */
574
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
574
575
  /*
575
576
  * Copyright (c) Microsoft Corporation. All rights reserved.
576
577
  * Licensed under the MIT License.
@@ -585,7 +586,7 @@
585
586
  Ciam: 3,
586
587
  };
587
588
 
588
- /*! @azure/msal-common v16.11.2 2026-07-15 */
589
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
589
590
  /*
590
591
  * Copyright (c) Microsoft Corporation. All rights reserved.
591
592
  * Licensed under the MIT License.
@@ -607,7 +608,7 @@
607
608
  return null;
608
609
  }
609
610
 
610
- /*! @azure/msal-common v16.11.2 2026-07-15 */
611
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
611
612
  /*
612
613
  * Copyright (c) Microsoft Corporation. All rights reserved.
613
614
  * Licensed under the MIT License.
@@ -631,7 +632,7 @@
631
632
  EAR: "EAR",
632
633
  };
633
634
 
634
- /*! @azure/msal-common v16.11.2 2026-07-15 */
635
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
635
636
  /**
636
637
  * Returns the AccountInfo interface for this account.
637
638
  * @internal
@@ -820,7 +821,7 @@
820
821
  entity.hasOwnProperty("authorityType"));
821
822
  }
822
823
 
823
- /*! @azure/msal-common v16.11.2 2026-07-15 */
824
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
824
825
  /*
825
826
  * Copyright (c) Microsoft Corporation. All rights reserved.
826
827
  * Licensed under the MIT License.
@@ -830,7 +831,7 @@
830
831
  */
831
832
  const unexpectedError = "unexpected_error";
832
833
 
833
- /*! @azure/msal-common v16.11.2 2026-07-15 */
834
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
834
835
 
835
836
  /*
836
837
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -850,7 +851,7 @@
850
851
  return new ClientConfigurationError(errorCode, correlationId);
851
852
  }
852
853
 
853
- /*! @azure/msal-common v16.11.2 2026-07-15 */
854
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
854
855
  /*
855
856
  * Copyright (c) Microsoft Corporation. All rights reserved.
856
857
  * Licensed under the MIT License.
@@ -876,7 +877,7 @@
876
877
  const invalidPlatformBrokerConfiguration = "invalid_platform_broker_configuration";
877
878
  const issuerValidationFailed = "issuer_validation_failed";
878
879
 
879
- /*! @azure/msal-common v16.11.2 2026-07-15 */
880
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
880
881
  /*
881
882
  * Copyright (c) Microsoft Corporation. All rights reserved.
882
883
  * Licensed under the MIT License.
@@ -888,7 +889,7 @@
888
889
  response.hasOwnProperty("jwks_uri"));
889
890
  }
890
891
 
891
- /*! @azure/msal-common v16.11.2 2026-07-15 */
892
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
892
893
  /*
893
894
  * Copyright (c) Microsoft Corporation. All rights reserved.
894
895
  * Licensed under the MIT License.
@@ -968,7 +969,7 @@
968
969
  }
969
970
  }
970
971
 
971
- /*! @azure/msal-common v16.11.2 2026-07-15 */
972
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
972
973
 
973
974
  /*
974
975
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1126,7 +1127,7 @@
1126
1127
  }
1127
1128
  }
1128
1129
 
1129
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1130
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1130
1131
 
1131
1132
  /*
1132
1133
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1292,7 +1293,7 @@
1292
1293
  return null;
1293
1294
  }
1294
1295
 
1295
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1296
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1296
1297
  /*
1297
1298
  * Copyright (c) Microsoft Corporation. All rights reserved.
1298
1299
  * Licensed under the MIT License.
@@ -1301,7 +1302,7 @@
1301
1302
  // AzureCloudInstance is not specified.
1302
1303
  None: "none"};
1303
1304
 
1304
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1305
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1305
1306
  /*
1306
1307
  * Copyright (c) Microsoft Corporation. All rights reserved.
1307
1308
  * Licensed under the MIT License.
@@ -1311,7 +1312,7 @@
1311
1312
  response.hasOwnProperty("metadata"));
1312
1313
  }
1313
1314
 
1314
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1315
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1315
1316
  /*
1316
1317
  * Copyright (c) Microsoft Corporation. All rights reserved.
1317
1318
  * Licensed under the MIT License.
@@ -1321,7 +1322,7 @@
1321
1322
  response.hasOwnProperty("error_description"));
1322
1323
  }
1323
1324
 
1324
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1325
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1325
1326
  /*
1326
1327
  * Copyright (c) Microsoft Corporation. All rights reserved.
1327
1328
  * Licensed under the MIT License.
@@ -1392,7 +1393,7 @@
1392
1393
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1393
1394
  const SetUserData = "setUserData";
1394
1395
 
1395
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1396
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1396
1397
  /*
1397
1398
  * Copyright (c) Microsoft Corporation. All rights reserved.
1398
1399
  * Licensed under the MIT License.
@@ -1485,7 +1486,7 @@
1485
1486
  };
1486
1487
  };
1487
1488
 
1488
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1489
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1489
1490
 
1490
1491
  /*
1491
1492
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1596,7 +1597,7 @@
1596
1597
  },
1597
1598
  };
1598
1599
 
1599
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1600
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1600
1601
  /*
1601
1602
  * Copyright (c) Microsoft Corporation. All rights reserved.
1602
1603
  * Licensed under the MIT License.
@@ -1661,7 +1662,7 @@
1661
1662
  return cachedAtSec > nowSeconds();
1662
1663
  }
1663
1664
 
1664
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1665
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1665
1666
 
1666
1667
  /*
1667
1668
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1926,9 +1927,22 @@
1926
1927
  */
1927
1928
  function isAuthorityMetadataExpired(metadata) {
1928
1929
  return metadata.expiresAt <= nowSeconds();
1930
+ }
1931
+ /**
1932
+ * Serialize attribute tokens synchronously (sort and join).
1933
+ * This is a sync-only operation for use at request construction time.
1934
+ * @param attributeTokens - array of tokens
1935
+ * @returns serialized partition string or undefined if no tokens
1936
+ */
1937
+ function serializeAttributeTokens(attributeTokens) {
1938
+ if (!attributeTokens || attributeTokens.length === 0) {
1939
+ return undefined;
1940
+ }
1941
+ // Serialize: sort and join tokens
1942
+ return [...attributeTokens].sort().join(" ");
1929
1943
  }
1930
1944
 
1931
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1945
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1932
1946
 
1933
1947
  /*
1934
1948
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2898,7 +2912,7 @@
2898
2912
  };
2899
2913
  }
2900
2914
 
2901
- /*! @azure/msal-common v16.11.2 2026-07-15 */
2915
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
2902
2916
 
2903
2917
  /*
2904
2918
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2932,7 +2946,7 @@
2932
2946
  }
2933
2947
  }
2934
2948
 
2935
- /*! @azure/msal-common v16.11.2 2026-07-15 */
2949
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
2936
2950
 
2937
2951
  /*
2938
2952
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3128,7 +3142,7 @@
3128
3142
  }
3129
3143
  }
3130
3144
 
3131
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3145
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3132
3146
 
3133
3147
  /*
3134
3148
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3256,13 +3270,14 @@
3256
3270
  * @param claims - The claims string from the request
3257
3271
  * @param clientCapabilities - The client capabilities from configuration
3258
3272
  * @param skipBrokerClaims - When true and BROKER_CLIENT_ID is present, excludes clientCapabilities from claims
3273
+ * @param claimsToMerge - Optional client-originated claims JSON string (e.g. `claimsFromClient`) deep-merged into `claims` with precedence on conflicts
3259
3274
  */
3260
- function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims) {
3275
+ function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims, claimsToMerge) {
3261
3276
  // Skip clientCapabilities if skipBrokerClaims is set to true and this is a brokered authentication flow
3262
3277
  const configClaims = skipBrokerClaims && parameters.has(BROKER_CLIENT_ID)
3263
3278
  ? undefined
3264
3279
  : clientCapabilities;
3265
- const mergedClaims = buildMergedClaims(claims, configClaims, correlationId);
3280
+ const mergedClaims = buildMergedClaims(claims, configClaims, correlationId, claimsToMerge);
3266
3281
  parameters.set(CLAIMS, mergedClaims);
3267
3282
  }
3268
3283
  /**
@@ -3428,32 +3443,79 @@
3428
3443
  [ClaimsRequestKeys.LOGIN_HINT]: { essential: false },
3429
3444
  };
3430
3445
  /**
3431
- * Parses claims JSON, merges default optional idToken claims (signin_state, login_hint),
3432
- * and appends client capabilities (xms_cc) to the access_token section.
3446
+ * Parses a claims JSON string into an object, throwing a ClientConfigurationError
3447
+ * (error code `invalid_claims`) if the value is not a valid JSON object. The raw
3448
+ * claims value is never included in the error - it may contain sensitive data.
3449
+ * @param claims - Claims JSON string. Must be valid JSON representing an object.
3450
+ * @param correlationId - The request correlation id
3451
+ * @returns The parsed claims object
3452
+ */
3453
+ function parseClaims(claims, correlationId = "") {
3454
+ let parsed;
3455
+ try {
3456
+ parsed = JSON.parse(claims);
3457
+ }
3458
+ catch (e) {
3459
+ // Malformed JSON
3460
+ throw createClientConfigurationError(invalidClaims, correlationId);
3461
+ }
3462
+ if (!isPlainObject(parsed)) {
3463
+ // Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
3464
+ throw createClientConfigurationError(invalidClaims, correlationId);
3465
+ }
3466
+ return parsed;
3467
+ }
3468
+ /**
3469
+ * Type guard for a non-null, non-array object (a JSON "object" value).
3470
+ * @param value - The value to test
3471
+ * @returns True when value is a plain object that can be deep-merged
3472
+ */
3473
+ function isPlainObject(value) {
3474
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3475
+ }
3476
+ /**
3477
+ * Recursively deep-merges two parsed claims objects. Nested objects are merged key-by-key;
3478
+ * for any other value type (arrays, scalars, null) the value from `claimsToMerge` replaces
3479
+ * the base. This mirrors the deep merge used by msal-dotnet so that, for example, a server
3480
+ * `access_token` challenge and a client-originated `access_token` claim are combined rather
3481
+ * than one clobbering the other.
3482
+ * @param baseClaims - The parsed base claims object
3483
+ * @param claimsToMerge - The parsed claims object merged in with precedence
3484
+ * @returns The deep-merged claims object
3485
+ */
3486
+ function deepMergeClaims(baseClaims, claimsToMerge) {
3487
+ const merged = { ...baseClaims };
3488
+ for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
3489
+ const baseValue = merged[key];
3490
+ if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
3491
+ merged[key] = deepMergeClaims(baseValue, mergeInValue);
3492
+ }
3493
+ else {
3494
+ merged[key] = mergeInValue;
3495
+ }
3496
+ }
3497
+ return merged;
3498
+ }
3499
+ /**
3500
+ * Parses claims JSON, optionally deep-merges a second client-originated claims string
3501
+ * (`claimsToMerge`, e.g. `claimsFromClient`) with precedence on conflicting keys, merges
3502
+ * default optional idToken claims (signin_state, login_hint), and appends client
3503
+ * capabilities (xms_cc) to the access_token section.
3433
3504
  * Does not overwrite idToken claims already specified by the caller.
3434
3505
  * @param claims - Existing claims JSON string from the request (may be undefined)
3435
3506
  * @param clientCapabilities - Client capabilities array from configuration
3507
+ * @param correlationId - The request correlation id
3508
+ * @param claimsToMerge - Optional second claims JSON string (e.g. client-originated `claimsFromClient`)
3509
+ * deep-merged into `claims` with precedence on conflicts; parsed and validated when present. Nested
3510
+ * objects are merged recursively; arrays and scalar values are replaced.
3436
3511
  * @returns Merged claims JSON string
3437
3512
  */
3438
- function buildMergedClaims(claims, clientCapabilities, correlationId = "") {
3439
- let mergedClaims;
3513
+ function buildMergedClaims(claims, clientCapabilities, correlationId = "", claimsToMerge) {
3440
3514
  // Parse provided claims into JSON object or initialize empty object
3441
- if (!claims) {
3442
- mergedClaims = {};
3443
- }
3444
- else {
3445
- try {
3446
- const parsed = JSON.parse(claims);
3447
- if (typeof parsed !== "object" ||
3448
- parsed === null ||
3449
- Array.isArray(parsed)) {
3450
- throw new Error("Claims must be a JSON object");
3451
- }
3452
- mergedClaims = parsed;
3453
- }
3454
- catch (e) {
3455
- throw createClientConfigurationError(invalidClaims, correlationId);
3456
- }
3515
+ let mergedClaims = claims ? parseClaims(claims, correlationId) : {};
3516
+ // Deep-merge client-originated claims (e.g. `claimsFromClient`) with precedence on conflicts
3517
+ if (claimsToMerge?.trim()) {
3518
+ mergedClaims = deepMergeClaims(mergedClaims, parseClaims(claimsToMerge, correlationId));
3457
3519
  }
3458
3520
  // Add default optional idToken claims
3459
3521
  if (!Object.prototype.hasOwnProperty.call(mergedClaims, ClaimsRequestKeys.ID_TOKEN)) {
@@ -3541,9 +3603,28 @@
3541
3603
  if (resource) {
3542
3604
  parameters.set(RESOURCE, resource);
3543
3605
  }
3606
+ }
3607
+ /**
3608
+ * Add the `attribute_tokens` parameter to a /token request body.
3609
+ *
3610
+ * When `attributeTokens` is a non-empty array the values are sorted lexicographically and joined
3611
+ * with a single space, then written to the request body. When `attributeTokens` is an empty array
3612
+ * the parameter is deleted from the request body.
3613
+ *
3614
+ * @param parameters - request parameter map that will be serialized into the /token body
3615
+ * @param attributeTokens - caller-provided attribute token strings
3616
+ */
3617
+ function addAttributeTokens(parameters, attributeTokens) {
3618
+ const serialized = serializeAttributeTokens(attributeTokens);
3619
+ if (serialized) {
3620
+ parameters.set(ATTRIBUTE_TOKENS, serialized);
3621
+ }
3622
+ else {
3623
+ parameters.delete(ATTRIBUTE_TOKENS);
3624
+ }
3544
3625
  }
3545
3626
 
3546
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3627
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3547
3628
 
3548
3629
  /*
3549
3630
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3665,7 +3746,7 @@
3665
3746
  }
3666
3747
  }
3667
3748
 
3668
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3749
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3669
3750
 
3670
3751
  /*
3671
3752
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3708,7 +3789,7 @@
3708
3789
  },
3709
3790
  };
3710
3791
 
3711
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3792
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3712
3793
  /*
3713
3794
  * Copyright (c) Microsoft Corporation. All rights reserved.
3714
3795
  * Licensed under the MIT License.
@@ -3983,12 +4064,12 @@
3983
4064
  }
3984
4065
  }
3985
4066
 
3986
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4067
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3987
4068
  /* eslint-disable header/header */
3988
4069
  const name$1 = "@azure/msal-common";
3989
- const version$1 = "16.11.2";
4070
+ const version$1 = "16.12.0";
3990
4071
 
3991
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4072
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3992
4073
  /*
3993
4074
  * Copyright (c) Microsoft Corporation. All rights reserved.
3994
4075
  * Licensed under the MIT License.
@@ -3996,7 +4077,7 @@
3996
4077
  const cacheQuotaExceeded = "cache_quota_exceeded";
3997
4078
  const cacheErrorUnknown = "cache_error_unknown";
3998
4079
 
3999
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4080
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4000
4081
 
4001
4082
  /*
4002
4083
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4034,7 +4115,7 @@
4034
4115
  }
4035
4116
  }
4036
4117
 
4037
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4118
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4038
4119
 
4039
4120
  /*
4040
4121
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4261,9 +4342,17 @@
4261
4342
  }
4262
4343
  /**
4263
4344
  * saves access token credential
4264
- * @param credential
4345
+ * @param credential - the access token entity to save
4346
+ * @param correlationId - unique identifier for the request
4347
+ * @param kmsi - keep me signed in flag
4265
4348
  */
4266
4349
  async saveAccessToken(credential, correlationId, kmsi) {
4350
+ // Compute hash from components on the entity itself — no need to thread externally.
4351
+ let additionalCacheKeyHash;
4352
+ if (credential.additionalCacheKeyComponents &&
4353
+ Object.keys(credential.additionalCacheKeyComponents).length > 0) {
4354
+ additionalCacheKeyHash = await this.cryptoImpl.hashString(JSON.stringify(credential.additionalCacheKeyComponents));
4355
+ }
4267
4356
  const accessTokenFilter = {
4268
4357
  clientId: credential.clientId,
4269
4358
  credentialType: credential.credentialType,
@@ -4287,7 +4376,7 @@
4287
4376
  }
4288
4377
  }
4289
4378
  });
4290
- await this.setAccessTokenCredential(credential, correlationId, kmsi);
4379
+ await this.setAccessTokenCredential(credential, correlationId, kmsi, additionalCacheKeyHash);
4291
4380
  }
4292
4381
  /**
4293
4382
  * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
@@ -4698,6 +4787,12 @@
4698
4787
  AuthenticationScheme.BEARER.toLowerCase()
4699
4788
  ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
4700
4789
  : CredentialType.ACCESS_TOKEN;
4790
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
4791
+ const additionalCacheKeyComponents = attributeTokenPartition
4792
+ ? {
4793
+ attribute_tokens: attributeTokenPartition,
4794
+ }
4795
+ : undefined;
4701
4796
  const accessTokenFilter = {
4702
4797
  homeAccountId: account.homeAccountId,
4703
4798
  environment: account.environment,
@@ -4707,10 +4802,12 @@
4707
4802
  target: scopes,
4708
4803
  tokenType: authScheme,
4709
4804
  keyId: request.sshKid,
4805
+ additionalCacheKeyComponents: additionalCacheKeyComponents,
4710
4806
  };
4711
4807
  const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
4712
4808
  this.getTokenKeys().accessToken;
4713
4809
  const accessTokens = [];
4810
+ const matchedKeys = [];
4714
4811
  accessTokenKeys.forEach((key) => {
4715
4812
  // Validate key
4716
4813
  if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
@@ -4719,18 +4816,18 @@
4719
4816
  if (accessToken &&
4720
4817
  this.credentialMatchesFilter(accessToken, accessTokenFilter, correlationId)) {
4721
4818
  accessTokens.push(accessToken);
4819
+ matchedKeys.push(key);
4722
4820
  }
4723
4821
  }
4724
4822
  });
4725
- const numAccessTokens = accessTokens.length;
4726
- if (numAccessTokens < 1) {
4823
+ if (accessTokens.length < 1) {
4727
4824
  this.commonLogger.info("1nckna", correlationId);
4728
4825
  return null;
4729
4826
  }
4730
- else if (numAccessTokens > 1) {
4827
+ else if (accessTokens.length > 1) {
4731
4828
  this.commonLogger.info("1wkfwp", correlationId);
4732
- accessTokens.forEach((accessToken) => {
4733
- this.removeAccessToken(this.generateCredentialKey(accessToken), correlationId);
4829
+ matchedKeys.forEach((key) => {
4830
+ this.removeAccessToken(key, correlationId);
4734
4831
  });
4735
4832
  this.performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
4736
4833
  return null;
@@ -5173,7 +5270,9 @@
5173
5270
  getTokenKeys() {
5174
5271
  throw createClientAuthError(methodNotImplemented, "");
5175
5272
  }
5176
- generateCredentialKey() {
5273
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5274
+ generateCredentialKey(_credential, _hash) {
5275
+ /* eslint-enable @typescript-eslint/no-unused-vars */
5177
5276
  throw createClientAuthError(methodNotImplemented, "");
5178
5277
  }
5179
5278
  generateAccountKey() {
@@ -5181,7 +5280,7 @@
5181
5280
  }
5182
5281
  }
5183
5282
 
5184
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5283
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5185
5284
  /*
5186
5285
  * Copyright (c) Microsoft Corporation. All rights reserved.
5187
5286
  * Licensed under the MIT License.
@@ -5195,7 +5294,7 @@
5195
5294
  const PerformanceEventStatus = {
5196
5295
  InProgress: 1};
5197
5296
 
5198
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5297
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5199
5298
 
5200
5299
  /*
5201
5300
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5253,7 +5352,7 @@
5253
5352
  }
5254
5353
  }
5255
5354
 
5256
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5355
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5257
5356
 
5258
5357
  /*
5259
5358
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5349,7 +5448,7 @@
5349
5448
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5350
5449
  }
5351
5450
 
5352
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5451
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5353
5452
  /*
5354
5453
  * Copyright (c) Microsoft Corporation. All rights reserved.
5355
5454
  * Licensed under the MIT License.
@@ -5376,7 +5475,7 @@
5376
5475
  }
5377
5476
  }
5378
5477
 
5379
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5478
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5380
5479
 
5381
5480
  /*
5382
5481
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5456,7 +5555,7 @@
5456
5555
  }
5457
5556
  }
5458
5557
 
5459
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5558
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5460
5559
  /*
5461
5560
  * Copyright (c) Microsoft Corporation. All rights reserved.
5462
5561
  * Licensed under the MIT License.
@@ -5507,7 +5606,7 @@
5507
5606
  */
5508
5607
  const interruptedUser = "interrupted_user";
5509
5608
 
5510
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5609
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5511
5610
 
5512
5611
  /*
5513
5612
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5574,7 +5673,7 @@
5574
5673
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
5575
5674
  }
5576
5675
 
5577
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5676
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5578
5677
 
5579
5678
  /*
5580
5679
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5593,7 +5692,7 @@
5593
5692
  }
5594
5693
  }
5595
5694
 
5596
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5695
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5597
5696
 
5598
5697
  /*
5599
5698
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5664,7 +5763,7 @@
5664
5763
  }
5665
5764
  }
5666
5765
 
5667
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5766
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5668
5767
 
5669
5768
  /*
5670
5769
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5753,7 +5852,15 @@
5753
5852
  // Add keyId from request to serverTokenResponse if defined
5754
5853
  serverTokenResponse.key_id =
5755
5854
  serverTokenResponse.key_id || request.sshKid || undefined;
5756
- const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, additionalCacheKeyComponents);
5855
+ // Compute components once for entity storage (fallback if hash not provided by client)
5856
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
5857
+ const cacheKeyComponents = additionalCacheKeyComponents ??
5858
+ (attributeTokenPartition
5859
+ ? {
5860
+ attribute_tokens: attributeTokenPartition,
5861
+ }
5862
+ : undefined);
5863
+ const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, cacheKeyComponents);
5757
5864
  let cacheContext;
5758
5865
  try {
5759
5866
  if (this.persistencePlugin && this.serializableCache) {
@@ -6015,7 +6122,7 @@
6015
6122
  return baseAccount;
6016
6123
  }
6017
6124
 
6018
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6125
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6019
6126
  /*
6020
6127
  * Copyright (c) Microsoft Corporation. All rights reserved.
6021
6128
  * Licensed under the MIT License.
@@ -6025,7 +6132,7 @@
6025
6132
  UPN: "UPN",
6026
6133
  };
6027
6134
 
6028
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6135
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6029
6136
  /*
6030
6137
  * Copyright (c) Microsoft Corporation. All rights reserved.
6031
6138
  * Licensed under the MIT License.
@@ -6044,7 +6151,8 @@
6044
6151
  }
6045
6152
  }
6046
6153
 
6047
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6154
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6155
+
6048
6156
  /*
6049
6157
  * Copyright (c) Microsoft Corporation. All rights reserved.
6050
6158
  * Licensed under the MIT License.
@@ -6063,10 +6171,11 @@
6063
6171
  sshKid: request.sshKid,
6064
6172
  embeddedClientId: request.embeddedClientId || request.extraParameters?.clientId,
6065
6173
  resource: request.resource,
6174
+ attributeTokens: serializeAttributeTokens(request.attributeTokens),
6066
6175
  };
6067
6176
  }
6068
6177
 
6069
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6178
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6070
6179
 
6071
6180
  /*
6072
6181
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6152,7 +6261,7 @@
6152
6261
  }
6153
6262
  }
6154
6263
 
6155
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6264
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6156
6265
 
6157
6266
  /*
6158
6267
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6183,7 +6292,7 @@
6183
6292
  return new NetworkError(error, httpStatus, responseHeaders);
6184
6293
  }
6185
6294
 
6186
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6295
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6187
6296
 
6188
6297
  /*
6189
6298
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6263,7 +6372,7 @@
6263
6372
  ThrottlingUtils.preProcess(cacheManager, thumbprint, correlationId);
6264
6373
  let response;
6265
6374
  try {
6266
- response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, options);
6375
+ response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
6267
6376
  const responseHeaders = response.headers || {};
6268
6377
  performanceClient?.addFields({
6269
6378
  refreshTokenSize: response.body.refresh_token?.length || 0,
@@ -6299,7 +6408,7 @@
6299
6408
  return response;
6300
6409
  }
6301
6410
 
6302
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6411
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6303
6412
 
6304
6413
  /*
6305
6414
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6420,6 +6529,12 @@
6420
6529
  // Add scope array, parameter builder will add default scopes and dedupe
6421
6530
  addScopes(parameters, request.scopes, request.correlationId, true, this.oidcDefaultScopes);
6422
6531
  addResource(parameters, request.resource);
6532
+ if (request.attributeTokens) {
6533
+ addAttributeTokens(parameters, request.attributeTokens);
6534
+ }
6535
+ this.performanceClient?.addFields({
6536
+ hasAttributeTokens: !!request.attributeTokens?.length,
6537
+ }, request.correlationId);
6423
6538
  // add code: user set, not validated
6424
6539
  addAuthorizationCode(parameters, request.code);
6425
6540
  // Add library metadata
@@ -6556,7 +6671,7 @@
6556
6671
  }
6557
6672
  }
6558
6673
 
6559
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6674
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6560
6675
 
6561
6676
  /*
6562
6677
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6783,7 +6898,7 @@
6783
6898
  return account.loginHint || account.idTokenClaims?.login_hint || null;
6784
6899
  }
6785
6900
 
6786
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6901
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6787
6902
 
6788
6903
  /*
6789
6904
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6804,7 +6919,7 @@
6804
6919
  return new JoseHeaderError(code, correlationId);
6805
6920
  }
6806
6921
 
6807
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6922
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6808
6923
  /*
6809
6924
  * Copyright (c) Microsoft Corporation. All rights reserved.
6810
6925
  * Licensed under the MIT License.
@@ -6812,7 +6927,7 @@
6812
6927
  const missingKidError = "missing_kid_error";
6813
6928
  const missingAlgError = "missing_alg_error";
6814
6929
 
6815
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6930
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6816
6931
 
6817
6932
  /*
6818
6933
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6852,7 +6967,7 @@
6852
6967
  }
6853
6968
  }
6854
6969
 
6855
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6970
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6856
6971
 
6857
6972
  /*
6858
6973
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7013,6 +7128,12 @@
7013
7128
  addServerTelemetry(parameters, this.serverTelemetryManager);
7014
7129
  }
7015
7130
  addRefreshToken(parameters, request.refreshToken);
7131
+ if (request.attributeTokens) {
7132
+ addAttributeTokens(parameters, request.attributeTokens);
7133
+ }
7134
+ this.performanceClient?.addFields({
7135
+ hasAttributeTokens: !!request.attributeTokens?.length,
7136
+ }, request.correlationId);
7016
7137
  if (this.config.clientCredentials.clientSecret) {
7017
7138
  addClientSecret(parameters, this.config.clientCredentials.clientSecret);
7018
7139
  }
@@ -7073,7 +7194,7 @@
7073
7194
  }
7074
7195
  }
7075
7196
 
7076
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7197
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7077
7198
 
7078
7199
  /*
7079
7200
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7366,7 +7487,7 @@
7366
7487
  clearNativeBrokerErrorCode() { }
7367
7488
  }
7368
7489
 
7369
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7490
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7370
7491
 
7371
7492
  /*
7372
7493
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7474,7 +7595,7 @@
7474
7595
  }
7475
7596
  }
7476
7597
 
7477
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7598
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7478
7599
 
7479
7600
  /*
7480
7601
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7490,7 +7611,7 @@
7490
7611
  },
7491
7612
  };
7492
7613
 
7493
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7614
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7494
7615
 
7495
7616
  /*
7496
7617
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7918,7 +8039,7 @@
7918
8039
 
7919
8040
  /* eslint-disable header/header */
7920
8041
  const name = "@azure/msal-browser";
7921
- const version = "5.17.1";
8042
+ const version = "5.18.0";
7922
8043
 
7923
8044
  /*
7924
8045
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -16075,12 +16196,12 @@
16075
16196
  return parsedAccessToken;
16076
16197
  }
16077
16198
  /**
16078
- * set accessToken credential to the platform cache
16079
- * @param accessToken
16199
+ * Set accessToken credential to the platform cache
16200
+ * @param accessToken - the access token entity to cache
16080
16201
  */
16081
- async setAccessTokenCredential(accessToken, correlationId, kmsi) {
16202
+ async setAccessTokenCredential(accessToken, correlationId, kmsi, additionalCacheKeyHash) {
16082
16203
  this.logger.trace("BrowserCacheManager.setAccessTokenCredential called", correlationId);
16083
- const accessTokenKey = this.generateCredentialKey(accessToken);
16204
+ const accessTokenKey = this.generateCredentialKey(accessToken, additionalCacheKeyHash);
16084
16205
  const timestamp = Date.now().toString();
16085
16206
  accessToken.lastUpdatedAt = timestamp;
16086
16207
  await this.setUserData(accessTokenKey, JSON.stringify(accessToken), correlationId, timestamp, kmsi);
@@ -16390,11 +16511,13 @@
16390
16511
  }
16391
16512
  /**
16392
16513
  * Generate Credential Key. All changes to the key REQUIRE a schema version update.
16393
- * Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>
16514
+ * Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>|<additional_cache_key_components_hash>
16515
+ *
16394
16516
  * @param credentialEntity
16517
+ * @param hash - optional precomputed hash of additionalCacheKeyComponents
16395
16518
  * @returns
16396
16519
  */
16397
- generateCredentialKey(credential) {
16520
+ generateCredentialKey(credential, additionalCacheKeyHash) {
16398
16521
  const familyId = (credential.credentialType ===
16399
16522
  CredentialType.REFRESH_TOKEN &&
16400
16523
  credential.familyId) ||
@@ -16414,6 +16537,12 @@
16414
16537
  credential.target || "",
16415
16538
  scheme,
16416
16539
  ];
16540
+ // Append precomputed component-hash segment.
16541
+ if (credential.additionalCacheKeyComponents &&
16542
+ Object.keys(credential.additionalCacheKeyComponents).length > 0 &&
16543
+ additionalCacheKeyHash) {
16544
+ credentialKey.push(additionalCacheKeyHash);
16545
+ }
16417
16546
  return credentialKey.join(CACHE_KEY_SEPARATOR).toLowerCase();
16418
16547
  }
16419
16548
  /**
@@ -17229,50 +17358,63 @@
17229
17358
  const nativeATMeasurement = this.performanceClient.startMeasurement(NativeInteractionClientAcquireToken, this.correlationId);
17230
17359
  const reqTimestamp = nowSeconds();
17231
17360
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
17361
+ // initialize native request (statically builds the request; does not contact the broker)
17362
+ let nativeRequest;
17232
17363
  try {
17233
- // initialize native request
17234
- const nativeRequest = await this.initializePlatformRequest(request);
17235
- // check if the tokens can be retrieved from internal cache
17236
- try {
17237
- const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
17238
- nativeATMeasurement.end({
17239
- success: true,
17364
+ nativeRequest = await this.initializePlatformRequest(request);
17365
+ }
17366
+ catch (e) {
17367
+ /*
17368
+ * Request initialization (e.g. PoP token generation or authority
17369
+ * resolution) failed before the broker was contacted, so end the
17370
+ * measurement here to avoid an orphaned sub-measurement.
17371
+ * Broker was never engaged, so this was not a native broker outcome.
17372
+ */
17373
+ nativeATMeasurement.add({
17374
+ isNativeBroker: false,
17375
+ });
17376
+ nativeATMeasurement.end({
17377
+ success: false,
17378
+ }, e);
17379
+ throw e;
17380
+ }
17381
+ // check if the tokens can be retrieved from internal cache
17382
+ try {
17383
+ const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
17384
+ // Served from the native internal cache; token did not come directly from the broker
17385
+ nativeATMeasurement.add({
17386
+ isNativeBroker: false,
17387
+ });
17388
+ nativeATMeasurement.end({
17389
+ success: true,
17390
+ fromCache: true,
17391
+ });
17392
+ return result;
17393
+ }
17394
+ catch (e) {
17395
+ if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
17396
+ this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy", this.correlationId);
17397
+ nativeATMeasurement.add({
17240
17398
  isNativeBroker: false,
17241
- fromCache: true,
17242
- });
17243
- return result;
17244
- }
17245
- catch (e) {
17246
- if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
17247
- this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy", this.correlationId);
17248
- nativeATMeasurement.end({
17249
- success: false,
17250
- brokerErrorCode: "cache_request_failed",
17251
- });
17252
- throw e;
17253
- }
17254
- // continue with a native call for any and all errors
17255
- this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call", this.correlationId);
17256
- }
17257
- const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
17258
- return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
17259
- .then((result) => {
17260
- nativeATMeasurement.end({
17261
- success: true,
17262
- isNativeBroker: true,
17263
- requestId: result.requestId,
17264
17399
  });
17265
- serverTelemetryManager.clearNativeBrokerErrorCode();
17266
- return result;
17267
- })
17268
- .catch((error) => {
17269
17400
  nativeATMeasurement.end({
17270
17401
  success: false,
17271
- errorCode: error.errorCode,
17272
- subErrorCode: error.subError,
17273
17402
  });
17274
- throw error;
17403
+ throw e;
17404
+ }
17405
+ // continue with a native call for any and all errors
17406
+ this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call", this.correlationId);
17407
+ }
17408
+ // dispatch the request to the broker
17409
+ try {
17410
+ const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
17411
+ const result = await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
17412
+ nativeATMeasurement.end({
17413
+ success: true,
17414
+ requestId: result.requestId,
17275
17415
  });
17416
+ serverTelemetryManager.clearNativeBrokerErrorCode();
17417
+ return result;
17276
17418
  }
17277
17419
  catch (e) {
17278
17420
  if (e instanceof NativeAuthError) {
@@ -17280,10 +17422,29 @@
17280
17422
  }
17281
17423
  nativeATMeasurement.end({
17282
17424
  success: false,
17283
- });
17425
+ }, e);
17426
+ this.setBrokerErrorTelemetry(e);
17284
17427
  throw e;
17285
17428
  }
17286
17429
  }
17430
+ /**
17431
+ * Records platform-broker error telemetry on the root event for the current
17432
+ * correlationId. `isNativeBroker` is set optimistically to true because the
17433
+ * broker was engaged; when the caller subsequently falls back to a web flow
17434
+ * that succeeds, the root success measurement overrides it to false via
17435
+ * `result.fromPlatformBroker`. Terminal broker errors (no fallback) retain
17436
+ * true. `brokerErrorName`/`brokerErrorCode` are recorded when the error is an `AuthError`.
17437
+ * @param error error thrown by the broker interaction
17438
+ */
17439
+ setBrokerErrorTelemetry(error) {
17440
+ if (error instanceof AuthError) {
17441
+ this.performanceClient.addFields({
17442
+ isNativeBroker: true,
17443
+ brokerErrorName: error.name,
17444
+ brokerErrorCode: error.errorCode,
17445
+ }, this.correlationId);
17446
+ }
17447
+ }
17287
17448
  /**
17288
17449
  * Creates silent flow request
17289
17450
  * @param request
@@ -17291,13 +17452,18 @@
17291
17452
  * @returns CommonSilentFlowRequest
17292
17453
  */
17293
17454
  createSilentCacheRequest(request, cachedAccount) {
17294
- return {
17455
+ const silentRequest = {
17295
17456
  authority: request.authority,
17296
17457
  correlationId: this.correlationId,
17297
17458
  scopes: ScopeSet.fromString(request.scope, this.correlationId).asArray(),
17298
17459
  account: cachedAccount,
17299
17460
  forceRefresh: false,
17300
17461
  };
17462
+ // Preserve FMI partition semantics for silent cache filtering.
17463
+ if (request.attributeTokens) {
17464
+ silentRequest.attributeTokens = request.attributeTokens.split(" ");
17465
+ }
17466
+ return silentRequest;
17301
17467
  }
17302
17468
  /**
17303
17469
  * Fetches the tokens from the cache if un-expired
@@ -17355,11 +17521,21 @@
17355
17521
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
17356
17522
  serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
17357
17523
  if (isFatalNativeAuthError(e)) {
17524
+ /*
17525
+ * Fatal error on redirect initiate always falls back to a
17526
+ * regular web redirect, so this request did not complete
17527
+ * natively. Token telemetry for the eventual outcome lands
17528
+ * in handleRedirectPromise (phase 2).
17529
+ */
17530
+ this.setBrokerErrorTelemetry(e);
17358
17531
  throw e;
17359
17532
  }
17360
17533
  }
17361
17534
  }
17362
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
17535
+ this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify({
17536
+ ...nativeRequest,
17537
+ storeInCache: request.storeInCache,
17538
+ }), true);
17363
17539
  const navigationOptions = {
17364
17540
  apiId: ApiId.acquireTokenRedirect,
17365
17541
  timeout: this.config.system.redirectNavigationTimeout,
@@ -17389,7 +17565,11 @@
17389
17565
  this.performanceClient?.addFields({ errorCode: "no_cached_request" }, this.correlationId);
17390
17566
  return null;
17391
17567
  }
17392
- const { prompt, ...request } = cachedRequest;
17568
+ /*
17569
+ * storeInCache is a client-side cache directive persisted alongside the cached
17570
+ * request (not a broker-contract parameter), so extract it here before resending.
17571
+ */
17572
+ const { prompt, storeInCache, ...request } = cachedRequest;
17393
17573
  if (prompt) {
17394
17574
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.", this.correlationId);
17395
17575
  }
@@ -17398,13 +17578,13 @@
17398
17578
  try {
17399
17579
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.", this.correlationId);
17400
17580
  const response = await this.platformAuthProvider.sendMessage(request);
17401
- const authResult = await this.handleNativeResponse(response, request, reqTimestamp);
17581
+ const authResult = await this.handleNativeResponse(response, request, reqTimestamp, storeInCache);
17402
17582
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
17403
17583
  serverTelemetryManager.clearNativeBrokerErrorCode();
17404
- this.performanceClient?.addFields({ isNativeBroker: true }, this.correlationId);
17405
17584
  return authResult;
17406
17585
  }
17407
17586
  catch (e) {
17587
+ this.setBrokerErrorTelemetry(e);
17408
17588
  throw e;
17409
17589
  }
17410
17590
  }
@@ -17422,7 +17602,7 @@
17422
17602
  * @param request
17423
17603
  * @param reqTimestamp
17424
17604
  */
17425
- async handleNativeResponse(response, request, reqTimestamp) {
17605
+ async handleNativeResponse(response, request, reqTimestamp, storeInCache) {
17426
17606
  this.logger.trace("NativeInteractionClient - handleNativeResponse called.", this.correlationId);
17427
17607
  // generate identifiers
17428
17608
  const idTokenClaims = extractTokenClaims(response.id_token, base64Decode, this.correlationId);
@@ -17451,8 +17631,8 @@
17451
17631
  const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
17452
17632
  // cache accounts and tokens in the appropriate storage
17453
17633
  await this.cacheAccount(baseAccount, isKmsi(idTokenClaims));
17454
- await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache() // environment
17455
- );
17634
+ await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
17635
+ storeInCache);
17456
17636
  return result;
17457
17637
  }
17458
17638
  /**
@@ -17573,7 +17753,9 @@
17573
17753
  correlationId: this.correlationId,
17574
17754
  state: response.state,
17575
17755
  fromPlatformBroker: true,
17576
- ...(request.resource && { resource: request.resource }),
17756
+ ...(request.extraParameters?.resource && {
17757
+ resource: request.extraParameters.resource,
17758
+ }),
17577
17759
  };
17578
17760
  return result;
17579
17761
  }
@@ -17597,7 +17779,7 @@
17597
17779
  * @param tenantId
17598
17780
  * @param reqTimestamp
17599
17781
  */
17600
- async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment) {
17782
+ async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache) {
17601
17783
  const cachedIdToken = createIdTokenEntity(homeAccountIdentifier, environment, response.id_token || "", request.clientId, idTokenClaims.tid || "");
17602
17784
  // cache accessToken in inmemory storage
17603
17785
  const expiresIn = request.tokenType === AuthenticationScheme.POP
@@ -17607,16 +17789,21 @@
17607
17789
  : response.expires_in) || 0;
17608
17790
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
17609
17791
  const responseScopes = this.generateScopes(response.scope, request.scope);
17610
- 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);
17792
+ const additionalCacheKeyComponents = request.attributeTokens
17793
+ ? {
17794
+ attribute_tokens: request.attributeTokens,
17795
+ }
17796
+ : undefined;
17797
+ 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);
17611
17798
  // save idtoken credential in configured browser storage
17612
- if (!!cachedIdToken && request.storeInCache?.idToken !== false) {
17799
+ if (!!cachedIdToken && storeInCache?.idToken !== false) {
17613
17800
  await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, isKmsi(idTokenClaims));
17614
17801
  }
17615
17802
  // save access token credential in memory storage
17616
17803
  const nativeCacheRecord = {
17617
17804
  accessToken: cachedAccessToken,
17618
17805
  };
17619
- return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, request.storeInCache);
17806
+ return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, storeInCache);
17620
17807
  }
17621
17808
  getExpiresInValue(tokenType, expiresIn) {
17622
17809
  return tokenType === AuthenticationScheme.POP
@@ -17688,13 +17875,19 @@
17688
17875
  const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
17689
17876
  ? undefined
17690
17877
  : this.config.auth.clientCapabilities;
17691
- // 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.
17692
- const { scopes, claims, ...remainingProperties } = request;
17878
+ /*
17879
+ * 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.
17880
+ * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
17881
+ */
17882
+ const { scopes, claims } = request;
17693
17883
  const scopeSet = new ScopeSet(scopes || [], this.correlationId);
17694
17884
  scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
17695
17885
  const mergedClaims = buildMergedClaims(claims, configClaims?.length ? configClaims : undefined);
17886
+ const hasAttributeTokens = !!request.attributeTokens?.length;
17887
+ this.performanceClient?.addFields({
17888
+ hasAttributeTokens,
17889
+ }, this.correlationId);
17696
17890
  const validatedRequest = {
17697
- ...remainingProperties,
17698
17891
  claims: mergedClaims,
17699
17892
  accountId: this.accountId,
17700
17893
  clientId: this.config.auth.clientId,
@@ -17703,19 +17896,32 @@
17703
17896
  redirectUri: getRedirectUri(request.redirectUri, this.config.auth.redirectUri, this.logger, this.correlationId),
17704
17897
  prompt: this.getPrompt(request.prompt),
17705
17898
  correlationId: this.correlationId,
17899
+ isSts: false,
17706
17900
  tokenType: request.authenticationScheme,
17707
17901
  windowTitleSubstring: document.title,
17902
+ nonce: request.nonce,
17903
+ state: request.state,
17904
+ loginHint: request.loginHint,
17708
17905
  extraParameters: {
17709
17906
  ...request.extraParameters,
17907
+ ...(request.resource && { resource: request.resource }), // resource is set for MCP scenarios
17710
17908
  },
17711
17909
  extendedExpiryToken: false,
17712
17910
  keyId: request.popKid,
17911
+ resourceRequestMethod: request.resourceRequestMethod,
17912
+ resourceRequestUri: request.resourceRequestUri,
17913
+ shrClaims: request.shrClaims,
17914
+ shrNonce: request.shrNonce,
17713
17915
  };
17916
+ if (hasAttributeTokens) {
17917
+ validatedRequest.attributeTokens =
17918
+ serializeAttributeTokens(request.attributeTokens);
17919
+ }
17714
17920
  // Check for PoP token requests: signPopToken should only be set to true if popKid is not set
17715
17921
  if (validatedRequest.signPopToken && !!request.popKid) {
17716
17922
  throw createBrowserAuthError(invalidPopTokenRequest, this.correlationId);
17717
17923
  }
17718
- this.handleExtraBrokerParams(validatedRequest);
17924
+ this.handleExtraBrokerParams(validatedRequest, request.embeddedClientId);
17719
17925
  validatedRequest.extraParameters =
17720
17926
  validatedRequest.extraParameters || {};
17721
17927
  validatedRequest.extraParameters.telemetry =
@@ -17790,19 +17996,19 @@
17790
17996
  * @param request {PlatformAuthRequest}
17791
17997
  * @private
17792
17998
  */
17793
- handleExtraBrokerParams(request) {
17999
+ handleExtraBrokerParams(request, embeddedClientId) {
17794
18000
  const hasExtraBrokerParams = request.extraParameters &&
17795
18001
  request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
17796
18002
  request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
17797
18003
  request.extraParameters.hasOwnProperty(CLIENT_ID);
17798
- if (!request.embeddedClientId && !hasExtraBrokerParams) {
18004
+ if (!embeddedClientId && !hasExtraBrokerParams) {
17799
18005
  return;
17800
18006
  }
17801
18007
  let child_client_id = "";
17802
18008
  const child_redirect_uri = request.redirectUri;
17803
- if (request.embeddedClientId) {
18009
+ if (embeddedClientId) {
17804
18010
  request.redirectUri = this.config.auth.redirectUri;
17805
- child_client_id = request.embeddedClientId;
18011
+ child_client_id = embeddedClientId;
17806
18012
  }
17807
18013
  else if (request.extraParameters) {
17808
18014
  request.redirectUri =
@@ -17810,7 +18016,15 @@
17810
18016
  child_client_id =
17811
18017
  request.extraParameters[CLIENT_ID];
17812
18018
  }
18019
+ const {
18020
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18021
+ [BROKER_CLIENT_ID]: _brkClientId,
18022
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18023
+ [BROKER_REDIRECT_URI]: _brkRedirectUri,
18024
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18025
+ [CLIENT_ID]: _clientId, ...remainingExtraParameters } = request.extraParameters || {};
17813
18026
  request.extraParameters = {
18027
+ ...remainingExtraParameters,
17814
18028
  child_client_id,
17815
18029
  child_redirect_uri,
17816
18030
  };
@@ -18235,6 +18449,8 @@
18235
18449
  * Copyright (c) Microsoft Corporation. All rights reserved.
18236
18450
  * Licensed under the MIT License.
18237
18451
  */
18452
+ const MAX_FETCH_POST_RETRIES = 1;
18453
+ const RETRY_DELAY_MS = 100;
18238
18454
  /**
18239
18455
  * 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
18240
18456
  */
@@ -18283,21 +18499,40 @@
18283
18499
  async sendPostRequestAsync(url, options) {
18284
18500
  const reqBody = (options && options.body) || "";
18285
18501
  const reqHeaders = getFetchHeaders(options);
18502
+ const correlationId = options?.correlationId;
18503
+ const performanceClient = options?.performanceClient;
18286
18504
  let response;
18287
- let responseStatus = 0;
18288
- let responseHeaders = {};
18289
- try {
18290
- response = await fetch(url, {
18291
- method: HTTP_REQUEST_TYPE.POST,
18292
- headers: reqHeaders,
18293
- body: reqBody,
18294
- });
18505
+ let lastError;
18506
+ for (let attempt = 1; attempt <= MAX_FETCH_POST_RETRIES + 1; attempt++) {
18507
+ try {
18508
+ response = await fetch(url, {
18509
+ method: HTTP_REQUEST_TYPE.POST,
18510
+ headers: reqHeaders,
18511
+ body: reqBody,
18512
+ });
18513
+ break;
18514
+ }
18515
+ catch (e) {
18516
+ lastError = e;
18517
+ if (!shouldRetryPostFetchError(lastError, attempt)) {
18518
+ throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
18519
+ ? postRequestFailed
18520
+ : noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
18521
+ }
18522
+ // Brief backoff before retry
18523
+ await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS));
18524
+ if (correlationId) {
18525
+ performanceClient?.incrementFields({ fetchRetryCount: 1 }, correlationId);
18526
+ }
18527
+ }
18295
18528
  }
18296
- catch (e) {
18297
- throw createNetworkError(createBrowserAuthError(window.navigator.onLine
18529
+ if (!response) {
18530
+ throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
18298
18531
  ? postRequestFailed
18299
- : noNetworkConnectivity, ""), undefined, undefined, e);
18532
+ : noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
18300
18533
  }
18534
+ let responseStatus = 0;
18535
+ let responseHeaders = {};
18301
18536
  responseHeaders = getHeaderDict(response.headers);
18302
18537
  try {
18303
18538
  responseStatus = response.status;
@@ -18308,10 +18543,15 @@
18308
18543
  };
18309
18544
  }
18310
18545
  catch (e) {
18311
- throw createNetworkError(createBrowserAuthError(failedToParseResponse, ""), responseStatus, responseHeaders, e);
18546
+ throw createNetworkError(createBrowserAuthError(failedToParseResponse, correlationId || ""), responseStatus, responseHeaders, e);
18312
18547
  }
18313
18548
  }
18314
18549
  }
18550
+ function shouldRetryPostFetchError(error, attempt) {
18551
+ return (attempt <= MAX_FETCH_POST_RETRIES &&
18552
+ window.navigator.onLine !== false &&
18553
+ error.name !== "AbortError");
18554
+ }
18315
18555
  /**
18316
18556
  * Get Fetch API Headers object from string map
18317
18557
  * @param inputHeaders
@@ -18797,7 +19037,7 @@
18797
19037
  }
18798
19038
  initializePlatformDOMRequest(request) {
18799
19039
  this.logger.trace(`'${this.platformAuthType}' - initializeNativeDOMRequest called`, request.correlationId);
18800
- const { accountId, clientId, authority, scope, redirectUri, correlationId, state, storeInCache, embeddedClientId, extraParameters, ...remainingProperties } = request;
19040
+ const { accountId, clientId, authority, scope, redirectUri, correlationId, state, extraParameters, ...remainingProperties } = request;
18801
19041
  const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
18802
19042
  const platformDOMRequest = {
18803
19043
  accountId: accountId,
@@ -18813,8 +19053,6 @@
18813
19053
  redirectUri: redirectUri,
18814
19054
  scope: scope,
18815
19055
  state: state,
18816
- storeInCache: storeInCache,
18817
- embeddedClientId: embeddedClientId,
18818
19056
  };
18819
19057
  return platformDOMRequest;
18820
19058
  }
@@ -20569,6 +20807,7 @@
20569
20807
  this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, correlationId, InteractionType.Redirect);
20570
20808
  rootMeasurement = this.performanceClient.startMeasurement(AcquireTokenRedirect, correlationId);
20571
20809
  this.logger.trace("handleRedirectPromise - acquiring token from native platform", correlationId);
20810
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
20572
20811
  rootMeasurement.add({
20573
20812
  isPlatformBrokerRequest: true,
20574
20813
  });
@@ -20605,6 +20844,7 @@
20605
20844
  }
20606
20845
  rootMeasurement.end({
20607
20846
  success: true,
20847
+ isNativeBroker: result.fromPlatformBroker ?? false,
20608
20848
  }, undefined, result.account);
20609
20849
  // Fire-and-forget SSO capability verification in background
20610
20850
  this.verifySsoCapability(cachedRedirectRequest, InteractionType.Redirect);
@@ -20614,8 +20854,8 @@
20614
20854
  * Instrument an event only if an error code is set. Otherwise, discard it when the redirect response
20615
20855
  * is empty and the error code is missing.
20616
20856
  */
20617
- if (rootMeasurement.event.errorCode) {
20618
- rootMeasurement.end({ success: false }, undefined);
20857
+ if (!!rootMeasurement.event.errorCode) {
20858
+ rootMeasurement.end({ success: false });
20619
20859
  }
20620
20860
  else {
20621
20861
  rootMeasurement.discard();
@@ -20674,10 +20914,6 @@
20674
20914
  this.canUsePlatformBroker(request)) {
20675
20915
  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);
20676
20916
  result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
20677
- atrMeasurement.add({
20678
- brokerErrorName: e.name,
20679
- brokerErrorCode: e.errorCode,
20680
- });
20681
20917
  if (e instanceof NativeAuthError &&
20682
20918
  isFatalNativeAuthError(e)) {
20683
20919
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -20746,6 +20982,7 @@
20746
20982
  let result;
20747
20983
  const pkce = this.getPreGeneratedPkceCodes(correlationId);
20748
20984
  if (this.canUsePlatformBroker(request)) {
20985
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
20749
20986
  atPopupMeasurement.add({
20750
20987
  isPlatformBrokerRequest: true,
20751
20988
  });
@@ -20756,15 +20993,11 @@
20756
20993
  .then((response) => {
20757
20994
  atPopupMeasurement.end({
20758
20995
  success: true,
20759
- isNativeBroker: true,
20996
+ isNativeBroker: response.fromPlatformBroker ?? false,
20760
20997
  }, undefined, response.account);
20761
20998
  return response;
20762
20999
  })
20763
21000
  .catch((e) => {
20764
- atPopupMeasurement.add({
20765
- brokerErrorName: e.name,
20766
- brokerErrorCode: e.errorCode,
20767
- });
20768
21001
  if (e instanceof NativeAuthError &&
20769
21002
  isFatalNativeAuthError(e)) {
20770
21003
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -20795,6 +21028,7 @@
20795
21028
  }
20796
21029
  atPopupMeasurement.end({
20797
21030
  success: true,
21031
+ isNativeBroker: result.fromPlatformBroker ?? false,
20798
21032
  accessTokenSize: result.accessToken.length,
20799
21033
  idTokenSize: result.idToken.length,
20800
21034
  }, undefined, result.account);
@@ -20988,14 +21222,11 @@
20988
21222
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, InteractionType.Silent, validRequest);
20989
21223
  let result;
20990
21224
  if (this.canUsePlatformBroker(validRequest)) {
21225
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
20991
21226
  this.ssoSilentMeasurement?.add({
20992
21227
  isPlatformBrokerRequest: true,
20993
21228
  });
20994
21229
  result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
20995
- this.ssoSilentMeasurement?.add({
20996
- brokerErrorName: e.name,
20997
- brokerErrorCode: e.errorCode,
20998
- });
20999
21230
  // If native token acquisition fails for availability reasons fallback to standard flow
21000
21231
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
21001
21232
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -21018,7 +21249,7 @@
21018
21249
  }
21019
21250
  this.ssoSilentMeasurement?.end({
21020
21251
  success: true,
21021
- isNativeBroker: response.fromPlatformBroker,
21252
+ isNativeBroker: response.fromPlatformBroker ?? false,
21022
21253
  accessTokenSize: response.accessToken.length,
21023
21254
  idTokenSize: response.idToken.length,
21024
21255
  }, undefined, response.account);
@@ -21071,6 +21302,7 @@
21071
21302
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
21072
21303
  atbcMeasurement.end({
21073
21304
  success: true,
21305
+ isNativeBroker: false,
21074
21306
  accessTokenSize: result.accessToken.length,
21075
21307
  idTokenSize: result.idToken.length,
21076
21308
  }, undefined, result.account);
@@ -21101,10 +21333,6 @@
21101
21333
  ...request,
21102
21334
  correlationId,
21103
21335
  }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
21104
- atbcMeasurement.add({
21105
- brokerErrorName: e.name,
21106
- brokerErrorCode: e.errorCode,
21107
- });
21108
21336
  // If native token acquisition fails for availability reasons fallback to standard flow
21109
21337
  if (e instanceof NativeAuthError &&
21110
21338
  isFatalNativeAuthError(e)) {
@@ -21114,6 +21342,7 @@
21114
21342
  });
21115
21343
  atbcMeasurement.end({
21116
21344
  success: true,
21345
+ isNativeBroker: result.fromPlatformBroker ?? false,
21117
21346
  }, undefined, result.account);
21118
21347
  return result;
21119
21348
  }
@@ -21154,6 +21383,7 @@
21154
21383
  .then((response) => {
21155
21384
  this.acquireTokenByCodeAsyncMeasurement?.end({
21156
21385
  success: true,
21386
+ isNativeBroker: false,
21157
21387
  fromCache: response.fromCache,
21158
21388
  });
21159
21389
  return response;
@@ -21307,21 +21537,32 @@
21307
21537
  // Create idToken entity and store in browser storage
21308
21538
  const idTokenEntity = createIdTokenEntity(result.account.homeAccountId, result.account.environment, result.idToken, this.config.auth.clientId, result.tenantId);
21309
21539
  // Create accessToken entity and store in native internal storage
21540
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
21541
+ const additionalCacheKeyComponents = attributeTokenPartition
21542
+ ? {
21543
+ attribute_tokens: attributeTokenPartition,
21544
+ }
21545
+ : undefined;
21310
21546
  const accessTokenEntity = createAccessTokenEntity(result.account.homeAccountId, result.account.environment, result.accessToken, this.config.auth.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn
21311
21547
  ? toSecondsFromDate(result.expiresOn)
21312
21548
  : 0, result.extExpiresOn
21313
21549
  ? toSecondsFromDate(result.extExpiresOn)
21314
21550
  : 0, base64Decode, request.correlationId || "", undefined, // refreshOn
21315
21551
  result.tokenType, undefined, // userAssertionHash
21316
- request.sshKid);
21552
+ request.sshKid, additionalCacheKeyComponents);
21317
21553
  if (request.resource) {
21318
21554
  accessTokenEntity.resource = request.resource;
21319
21555
  }
21556
+ // Get attribute token partition hash for cache key isolation
21557
+ const components = additionalCacheKeyComponents;
21558
+ const additionalCacheKeyHash = components
21559
+ ? await this.browserCrypto.hashString(JSON.stringify(components))
21560
+ : undefined;
21320
21561
  const kmsi = isKmsi(result.idTokenClaims);
21321
21562
  // Store idToken in browser storage
21322
21563
  await this.browserStorage.setIdTokenCredential(idTokenEntity, result.correlationId, kmsi);
21323
21564
  // Store accessToken in native internal storage
21324
- await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi);
21565
+ await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi, additionalCacheKeyHash);
21325
21566
  }
21326
21567
  else {
21327
21568
  return this.browserStorage.hydrateCache(result, request);
@@ -21331,8 +21572,16 @@
21331
21572
  /**
21332
21573
  * Acquire a token from native device (e.g. WAM)
21333
21574
  * @param request
21575
+ * @param apiId
21576
+ * @param accountId
21577
+ * @param cacheLookupPolicy
21334
21578
  */
21335
21579
  async acquireTokenNative(request, apiId, accountId, cacheLookupPolicy) {
21580
+ /*
21581
+ * Callers always normalize correlationId onto the request before delegating
21582
+ * here, so it is guaranteed defined and is the single id used to key this
21583
+ * flow's telemetry.
21584
+ */
21336
21585
  const correlationId = this.getRequestCorrelationId(request);
21337
21586
  this.logger.trace("acquireTokenNative called", correlationId);
21338
21587
  if (!this.platformAuthProvider) {
@@ -21586,6 +21835,7 @@
21586
21835
  .then((result) => {
21587
21836
  atsMeasurement.end({
21588
21837
  success: true,
21838
+ isNativeBroker: result.fromPlatformBroker ?? false,
21589
21839
  fromCache: result.fromCache,
21590
21840
  accessTokenSize: result.accessToken.length,
21591
21841
  idTokenSize: result.idToken.length,
@@ -21722,7 +21972,7 @@
21722
21972
  if (request.correlationId) {
21723
21973
  this.performanceClient.addFields({
21724
21974
  fromCache: response.fromCache,
21725
- isNativeBroker: response.fromPlatformBroker,
21975
+ isNativeBroker: response.fromPlatformBroker ?? false,
21726
21976
  }, request.correlationId);
21727
21977
  }
21728
21978
  return response;
@@ -21748,10 +21998,6 @@
21748
21998
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform", silentRequest.correlationId);
21749
21999
  this.performanceClient.addFields({ isPlatformBrokerRequest: true }, silentRequest.correlationId);
21750
22000
  return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow, silentRequest.account.nativeAccountId, cacheLookupPolicy).catch(async (e) => {
21751
- this.performanceClient.addFields({
21752
- brokerErrorName: e.name,
21753
- brokerErrorCode: e.errorCode,
21754
- }, silentRequest.correlationId);
21755
22001
  // If native token acquisition fails for availability reasons fallback to web flow
21756
22002
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
21757
22003
  this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow", silentRequest.correlationId);