@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,8 +1,8 @@
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
  'use strict';
4
4
 
5
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -52,9 +52,10 @@ const INSTANCE_AWARE = "instance_aware";
52
52
  const EAR_JWK = "ear_jwk";
53
53
  const EAR_JWE_CRYPTO = "ear_jwe_crypto";
54
54
  const RESOURCE = "resource";
55
- const CLI_DATA = "clidata";
55
+ const CLI_DATA = "clidata";
56
+ const ATTRIBUTE_TOKENS = "attribute_tokens";
56
57
 
57
- /*! @azure/msal-common v16.11.2 2026-07-15 */
58
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
58
59
  /*
59
60
  * Copyright (c) Microsoft Corporation. All rights reserved.
60
61
  * Licensed under the MIT License.
@@ -290,7 +291,7 @@ const JsonWebTokenTypes$1 = {
290
291
  // Token renewal offset default in seconds
291
292
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
292
293
 
293
- /*! @azure/msal-common v16.11.2 2026-07-15 */
294
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
294
295
  /*
295
296
  * Copyright (c) Microsoft Corporation. All rights reserved.
296
297
  * Licensed under the MIT License.
@@ -319,7 +320,7 @@ function createAuthError(code, correlationId, additionalMessage) {
319
320
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
320
321
  }
321
322
 
322
- /*! @azure/msal-common v16.11.2 2026-07-15 */
323
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
323
324
 
324
325
  /*
325
326
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -342,7 +343,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
342
343
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
343
344
  }
344
345
 
345
- /*! @azure/msal-common v16.11.2 2026-07-15 */
346
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
346
347
  /*
347
348
  * Copyright (c) Microsoft Corporation. All rights reserved.
348
349
  * Licensed under the MIT License.
@@ -426,7 +427,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
426
427
  userCanceled: userCanceled
427
428
  });
428
429
 
429
- /*! @azure/msal-common v16.11.2 2026-07-15 */
430
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
430
431
 
431
432
  /*
432
433
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -464,7 +465,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
464
465
  };
465
466
  }
466
467
 
467
- /*! @azure/msal-common v16.11.2 2026-07-15 */
468
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
468
469
 
469
470
  /*
470
471
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -530,7 +531,7 @@ function getJWSPayload(authToken, correlationId) {
530
531
  return matches[2];
531
532
  }
532
533
 
533
- /*! @azure/msal-common v16.11.2 2026-07-15 */
534
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
534
535
 
535
536
  /*
536
537
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -618,7 +619,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
618
619
  return updatedAccountInfo;
619
620
  }
620
621
 
621
- /*! @azure/msal-common v16.11.2 2026-07-15 */
622
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
622
623
  /*
623
624
  * Copyright (c) Microsoft Corporation. All rights reserved.
624
625
  * Licensed under the MIT License.
@@ -633,7 +634,7 @@ const AuthorityType = {
633
634
  Ciam: 3,
634
635
  };
635
636
 
636
- /*! @azure/msal-common v16.11.2 2026-07-15 */
637
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
637
638
  /*
638
639
  * Copyright (c) Microsoft Corporation. All rights reserved.
639
640
  * Licensed under the MIT License.
@@ -655,7 +656,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
655
656
  return null;
656
657
  }
657
658
 
658
- /*! @azure/msal-common v16.11.2 2026-07-15 */
659
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
659
660
  /*
660
661
  * Copyright (c) Microsoft Corporation. All rights reserved.
661
662
  * Licensed under the MIT License.
@@ -679,7 +680,7 @@ const ProtocolMode = {
679
680
  EAR: "EAR",
680
681
  };
681
682
 
682
- /*! @azure/msal-common v16.11.2 2026-07-15 */
683
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
683
684
  /**
684
685
  * Returns the AccountInfo interface for this account.
685
686
  * @internal
@@ -868,7 +869,7 @@ function isAccountEntity(entity) {
868
869
  entity.hasOwnProperty("authorityType"));
869
870
  }
870
871
 
871
- /*! @azure/msal-common v16.11.2 2026-07-15 */
872
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
872
873
  /*
873
874
  * Copyright (c) Microsoft Corporation. All rights reserved.
874
875
  * Licensed under the MIT License.
@@ -885,7 +886,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
885
886
  unexpectedError: unexpectedError
886
887
  });
887
888
 
888
- /*! @azure/msal-common v16.11.2 2026-07-15 */
889
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
889
890
 
890
891
  /*
891
892
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -905,7 +906,7 @@ function createClientConfigurationError(errorCode, correlationId) {
905
906
  return new ClientConfigurationError(errorCode, correlationId);
906
907
  }
907
908
 
908
- /*! @azure/msal-common v16.11.2 2026-07-15 */
909
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
909
910
  /*
910
911
  * Copyright (c) Microsoft Corporation. All rights reserved.
911
912
  * Licensed under the MIT License.
@@ -969,7 +970,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
969
970
  urlParseError: urlParseError
970
971
  });
971
972
 
972
- /*! @azure/msal-common v16.11.2 2026-07-15 */
973
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
973
974
 
974
975
  /*
975
976
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1027,7 +1028,7 @@ class AuthenticationHeaderParser {
1027
1028
  }
1028
1029
  }
1029
1030
 
1030
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1031
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1031
1032
  /*
1032
1033
  * Copyright (c) Microsoft Corporation. All rights reserved.
1033
1034
  * Licensed under the MIT License.
@@ -1039,7 +1040,7 @@ function isOpenIdConfigResponse(response) {
1039
1040
  response.hasOwnProperty("jwks_uri"));
1040
1041
  }
1041
1042
 
1042
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1043
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1043
1044
  /*
1044
1045
  * Copyright (c) Microsoft Corporation. All rights reserved.
1045
1046
  * Licensed under the MIT License.
@@ -1119,7 +1120,7 @@ class StringUtils {
1119
1120
  }
1120
1121
  }
1121
1122
 
1122
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1123
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1123
1124
 
1124
1125
  /*
1125
1126
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1277,7 +1278,7 @@ class UrlString {
1277
1278
  }
1278
1279
  }
1279
1280
 
1280
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1281
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1281
1282
 
1282
1283
  /*
1283
1284
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1443,7 +1444,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1443
1444
  return null;
1444
1445
  }
1445
1446
 
1446
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1447
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1447
1448
  /*
1448
1449
  * Copyright (c) Microsoft Corporation. All rights reserved.
1449
1450
  * Licensed under the MIT License.
@@ -1463,7 +1464,7 @@ const AzureCloudInstance = {
1463
1464
  AzureUsGovernment: "https://login.microsoftonline.us",
1464
1465
  };
1465
1466
 
1466
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1467
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1467
1468
  /*
1468
1469
  * Copyright (c) Microsoft Corporation. All rights reserved.
1469
1470
  * Licensed under the MIT License.
@@ -1473,7 +1474,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1473
1474
  response.hasOwnProperty("metadata"));
1474
1475
  }
1475
1476
 
1476
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1477
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1477
1478
  /*
1478
1479
  * Copyright (c) Microsoft Corporation. All rights reserved.
1479
1480
  * Licensed under the MIT License.
@@ -1483,7 +1484,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1483
1484
  response.hasOwnProperty("error_description"));
1484
1485
  }
1485
1486
 
1486
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1487
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1487
1488
  /*
1488
1489
  * Copyright (c) Microsoft Corporation. All rights reserved.
1489
1490
  * Licensed under the MIT License.
@@ -1554,7 +1555,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1554
1555
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1555
1556
  const SetUserData = "setUserData";
1556
1557
 
1557
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1558
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1558
1559
  /*
1559
1560
  * Copyright (c) Microsoft Corporation. All rights reserved.
1560
1561
  * Licensed under the MIT License.
@@ -1647,7 +1648,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1647
1648
  };
1648
1649
  };
1649
1650
 
1650
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1651
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1651
1652
 
1652
1653
  /*
1653
1654
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1758,7 +1759,7 @@ RegionDiscovery.IMDS_OPTIONS = {
1758
1759
  },
1759
1760
  };
1760
1761
 
1761
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1762
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1762
1763
  /*
1763
1764
  * Copyright (c) Microsoft Corporation. All rights reserved.
1764
1765
  * Licensed under the MIT License.
@@ -1823,7 +1824,7 @@ function wasClockTurnedBack(cachedAt) {
1823
1824
  return cachedAtSec > nowSeconds();
1824
1825
  }
1825
1826
 
1826
- /*! @azure/msal-common v16.11.2 2026-07-15 */
1827
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
1827
1828
 
1828
1829
  /*
1829
1830
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2088,9 +2089,22 @@ function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetw
2088
2089
  */
2089
2090
  function isAuthorityMetadataExpired(metadata) {
2090
2091
  return metadata.expiresAt <= nowSeconds();
2092
+ }
2093
+ /**
2094
+ * Serialize attribute tokens synchronously (sort and join).
2095
+ * This is a sync-only operation for use at request construction time.
2096
+ * @param attributeTokens - array of tokens
2097
+ * @returns serialized partition string or undefined if no tokens
2098
+ */
2099
+ function serializeAttributeTokens(attributeTokens) {
2100
+ if (!attributeTokens || attributeTokens.length === 0) {
2101
+ return undefined;
2102
+ }
2103
+ // Serialize: sort and join tokens
2104
+ return [...attributeTokens].sort().join(" ");
2091
2105
  }
2092
2106
 
2093
- /*! @azure/msal-common v16.11.2 2026-07-15 */
2107
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
2094
2108
 
2095
2109
  /*
2096
2110
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3060,7 +3074,7 @@ function buildStaticAuthorityOptions(authOptions) {
3060
3074
  };
3061
3075
  }
3062
3076
 
3063
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3077
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3064
3078
 
3065
3079
  /*
3066
3080
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3094,7 +3108,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3094
3108
  }
3095
3109
  }
3096
3110
 
3097
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3111
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3098
3112
 
3099
3113
  /*
3100
3114
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3290,7 +3304,7 @@ class ScopeSet {
3290
3304
  }
3291
3305
  }
3292
3306
 
3293
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3307
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3294
3308
 
3295
3309
  /*
3296
3310
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3418,13 +3432,14 @@ function addSid(parameters, sid) {
3418
3432
  * @param claims - The claims string from the request
3419
3433
  * @param clientCapabilities - The client capabilities from configuration
3420
3434
  * @param skipBrokerClaims - When true and BROKER_CLIENT_ID is present, excludes clientCapabilities from claims
3435
+ * @param claimsToMerge - Optional client-originated claims JSON string (e.g. `claimsFromClient`) deep-merged into `claims` with precedence on conflicts
3421
3436
  */
3422
- function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims) {
3437
+ function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims, claimsToMerge) {
3423
3438
  // Skip clientCapabilities if skipBrokerClaims is set to true and this is a brokered authentication flow
3424
3439
  const configClaims = skipBrokerClaims && parameters.has(BROKER_CLIENT_ID)
3425
3440
  ? undefined
3426
3441
  : clientCapabilities;
3427
- const mergedClaims = buildMergedClaims$1(claims, configClaims, correlationId);
3442
+ const mergedClaims = buildMergedClaims$1(claims, configClaims, correlationId, claimsToMerge);
3428
3443
  parameters.set(CLAIMS, mergedClaims);
3429
3444
  }
3430
3445
  /**
@@ -3590,32 +3605,79 @@ const DEFAULT_ID_TOKEN_CLAIMS = {
3590
3605
  [ClaimsRequestKeys.LOGIN_HINT]: { essential: false },
3591
3606
  };
3592
3607
  /**
3593
- * Parses claims JSON, merges default optional idToken claims (signin_state, login_hint),
3594
- * and appends client capabilities (xms_cc) to the access_token section.
3608
+ * Parses a claims JSON string into an object, throwing a ClientConfigurationError
3609
+ * (error code `invalid_claims`) if the value is not a valid JSON object. The raw
3610
+ * claims value is never included in the error - it may contain sensitive data.
3611
+ * @param claims - Claims JSON string. Must be valid JSON representing an object.
3612
+ * @param correlationId - The request correlation id
3613
+ * @returns The parsed claims object
3614
+ */
3615
+ function parseClaims(claims, correlationId = "") {
3616
+ let parsed;
3617
+ try {
3618
+ parsed = JSON.parse(claims);
3619
+ }
3620
+ catch (e) {
3621
+ // Malformed JSON
3622
+ throw createClientConfigurationError(invalidClaims, correlationId);
3623
+ }
3624
+ if (!isPlainObject(parsed)) {
3625
+ // Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
3626
+ throw createClientConfigurationError(invalidClaims, correlationId);
3627
+ }
3628
+ return parsed;
3629
+ }
3630
+ /**
3631
+ * Type guard for a non-null, non-array object (a JSON "object" value).
3632
+ * @param value - The value to test
3633
+ * @returns True when value is a plain object that can be deep-merged
3634
+ */
3635
+ function isPlainObject(value) {
3636
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3637
+ }
3638
+ /**
3639
+ * Recursively deep-merges two parsed claims objects. Nested objects are merged key-by-key;
3640
+ * for any other value type (arrays, scalars, null) the value from `claimsToMerge` replaces
3641
+ * the base. This mirrors the deep merge used by msal-dotnet so that, for example, a server
3642
+ * `access_token` challenge and a client-originated `access_token` claim are combined rather
3643
+ * than one clobbering the other.
3644
+ * @param baseClaims - The parsed base claims object
3645
+ * @param claimsToMerge - The parsed claims object merged in with precedence
3646
+ * @returns The deep-merged claims object
3647
+ */
3648
+ function deepMergeClaims(baseClaims, claimsToMerge) {
3649
+ const merged = { ...baseClaims };
3650
+ for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
3651
+ const baseValue = merged[key];
3652
+ if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
3653
+ merged[key] = deepMergeClaims(baseValue, mergeInValue);
3654
+ }
3655
+ else {
3656
+ merged[key] = mergeInValue;
3657
+ }
3658
+ }
3659
+ return merged;
3660
+ }
3661
+ /**
3662
+ * Parses claims JSON, optionally deep-merges a second client-originated claims string
3663
+ * (`claimsToMerge`, e.g. `claimsFromClient`) with precedence on conflicting keys, merges
3664
+ * default optional idToken claims (signin_state, login_hint), and appends client
3665
+ * capabilities (xms_cc) to the access_token section.
3595
3666
  * Does not overwrite idToken claims already specified by the caller.
3596
3667
  * @param claims - Existing claims JSON string from the request (may be undefined)
3597
3668
  * @param clientCapabilities - Client capabilities array from configuration
3669
+ * @param correlationId - The request correlation id
3670
+ * @param claimsToMerge - Optional second claims JSON string (e.g. client-originated `claimsFromClient`)
3671
+ * deep-merged into `claims` with precedence on conflicts; parsed and validated when present. Nested
3672
+ * objects are merged recursively; arrays and scalar values are replaced.
3598
3673
  * @returns Merged claims JSON string
3599
3674
  */
3600
- function buildMergedClaims$1(claims, clientCapabilities, correlationId = "") {
3601
- let mergedClaims;
3675
+ function buildMergedClaims$1(claims, clientCapabilities, correlationId = "", claimsToMerge) {
3602
3676
  // Parse provided claims into JSON object or initialize empty object
3603
- if (!claims) {
3604
- mergedClaims = {};
3605
- }
3606
- else {
3607
- try {
3608
- const parsed = JSON.parse(claims);
3609
- if (typeof parsed !== "object" ||
3610
- parsed === null ||
3611
- Array.isArray(parsed)) {
3612
- throw new Error("Claims must be a JSON object");
3613
- }
3614
- mergedClaims = parsed;
3615
- }
3616
- catch (e) {
3617
- throw createClientConfigurationError(invalidClaims, correlationId);
3618
- }
3677
+ let mergedClaims = claims ? parseClaims(claims, correlationId) : {};
3678
+ // Deep-merge client-originated claims (e.g. `claimsFromClient`) with precedence on conflicts
3679
+ if (claimsToMerge?.trim()) {
3680
+ mergedClaims = deepMergeClaims(mergedClaims, parseClaims(claimsToMerge, correlationId));
3619
3681
  }
3620
3682
  // Add default optional idToken claims
3621
3683
  if (!Object.prototype.hasOwnProperty.call(mergedClaims, ClaimsRequestKeys.ID_TOKEN)) {
@@ -3703,9 +3765,28 @@ function addResource(parameters, resource) {
3703
3765
  if (resource) {
3704
3766
  parameters.set(RESOURCE, resource);
3705
3767
  }
3768
+ }
3769
+ /**
3770
+ * Add the `attribute_tokens` parameter to a /token request body.
3771
+ *
3772
+ * When `attributeTokens` is a non-empty array the values are sorted lexicographically and joined
3773
+ * with a single space, then written to the request body. When `attributeTokens` is an empty array
3774
+ * the parameter is deleted from the request body.
3775
+ *
3776
+ * @param parameters - request parameter map that will be serialized into the /token body
3777
+ * @param attributeTokens - caller-provided attribute token strings
3778
+ */
3779
+ function addAttributeTokens(parameters, attributeTokens) {
3780
+ const serialized = serializeAttributeTokens(attributeTokens);
3781
+ if (serialized) {
3782
+ parameters.set(ATTRIBUTE_TOKENS, serialized);
3783
+ }
3784
+ else {
3785
+ parameters.delete(ATTRIBUTE_TOKENS);
3786
+ }
3706
3787
  }
3707
3788
 
3708
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3789
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3709
3790
 
3710
3791
  /*
3711
3792
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3827,7 +3908,7 @@ function validateUrl(url, logger, correlationId) {
3827
3908
  }
3828
3909
  }
3829
3910
 
3830
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3911
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3831
3912
 
3832
3913
  /*
3833
3914
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3870,7 +3951,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
3870
3951
  },
3871
3952
  };
3872
3953
 
3873
- /*! @azure/msal-common v16.11.2 2026-07-15 */
3954
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
3874
3955
  /*
3875
3956
  * Copyright (c) Microsoft Corporation. All rights reserved.
3876
3957
  * Licensed under the MIT License.
@@ -4159,12 +4240,12 @@ class Logger {
4159
4240
  }
4160
4241
  }
4161
4242
 
4162
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4243
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4163
4244
  /* eslint-disable header/header */
4164
4245
  const name$1 = "@azure/msal-common";
4165
- const version$1 = "16.11.2";
4246
+ const version$1 = "16.12.0";
4166
4247
 
4167
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4248
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4168
4249
  /*
4169
4250
  * Copyright (c) Microsoft Corporation. All rights reserved.
4170
4251
  * Licensed under the MIT License.
@@ -4172,7 +4253,7 @@ const version$1 = "16.11.2";
4172
4253
  const cacheQuotaExceeded = "cache_quota_exceeded";
4173
4254
  const cacheErrorUnknown = "cache_error_unknown";
4174
4255
 
4175
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4256
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4176
4257
 
4177
4258
  /*
4178
4259
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4210,7 +4291,7 @@ function createCacheError(e) {
4210
4291
  }
4211
4292
  }
4212
4293
 
4213
- /*! @azure/msal-common v16.11.2 2026-07-15 */
4294
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
4214
4295
 
4215
4296
  /*
4216
4297
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4437,9 +4518,17 @@ class CacheManager {
4437
4518
  }
4438
4519
  /**
4439
4520
  * saves access token credential
4440
- * @param credential
4521
+ * @param credential - the access token entity to save
4522
+ * @param correlationId - unique identifier for the request
4523
+ * @param kmsi - keep me signed in flag
4441
4524
  */
4442
4525
  async saveAccessToken(credential, correlationId, kmsi) {
4526
+ // Compute hash from components on the entity itself — no need to thread externally.
4527
+ let additionalCacheKeyHash;
4528
+ if (credential.additionalCacheKeyComponents &&
4529
+ Object.keys(credential.additionalCacheKeyComponents).length > 0) {
4530
+ additionalCacheKeyHash = await this.cryptoImpl.hashString(JSON.stringify(credential.additionalCacheKeyComponents));
4531
+ }
4443
4532
  const accessTokenFilter = {
4444
4533
  clientId: credential.clientId,
4445
4534
  credentialType: credential.credentialType,
@@ -4463,7 +4552,7 @@ class CacheManager {
4463
4552
  }
4464
4553
  }
4465
4554
  });
4466
- await this.setAccessTokenCredential(credential, correlationId, kmsi);
4555
+ await this.setAccessTokenCredential(credential, correlationId, kmsi, additionalCacheKeyHash);
4467
4556
  }
4468
4557
  /**
4469
4558
  * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
@@ -4875,6 +4964,12 @@ class CacheManager {
4875
4964
  AuthenticationScheme$1.BEARER.toLowerCase()
4876
4965
  ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
4877
4966
  : CredentialType.ACCESS_TOKEN;
4967
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
4968
+ const additionalCacheKeyComponents = attributeTokenPartition
4969
+ ? {
4970
+ attribute_tokens: attributeTokenPartition,
4971
+ }
4972
+ : undefined;
4878
4973
  const accessTokenFilter = {
4879
4974
  homeAccountId: account.homeAccountId,
4880
4975
  environment: account.environment,
@@ -4884,10 +4979,12 @@ class CacheManager {
4884
4979
  target: scopes,
4885
4980
  tokenType: authScheme,
4886
4981
  keyId: request.sshKid,
4982
+ additionalCacheKeyComponents: additionalCacheKeyComponents,
4887
4983
  };
4888
4984
  const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
4889
4985
  this.getTokenKeys().accessToken;
4890
4986
  const accessTokens = [];
4987
+ const matchedKeys = [];
4891
4988
  accessTokenKeys.forEach((key) => {
4892
4989
  // Validate key
4893
4990
  if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
@@ -4896,18 +4993,18 @@ class CacheManager {
4896
4993
  if (accessToken &&
4897
4994
  this.credentialMatchesFilter(accessToken, accessTokenFilter, correlationId)) {
4898
4995
  accessTokens.push(accessToken);
4996
+ matchedKeys.push(key);
4899
4997
  }
4900
4998
  }
4901
4999
  });
4902
- const numAccessTokens = accessTokens.length;
4903
- if (numAccessTokens < 1) {
5000
+ if (accessTokens.length < 1) {
4904
5001
  this.commonLogger.info("1nckna", correlationId);
4905
5002
  return null;
4906
5003
  }
4907
- else if (numAccessTokens > 1) {
5004
+ else if (accessTokens.length > 1) {
4908
5005
  this.commonLogger.info("1wkfwp", correlationId);
4909
- accessTokens.forEach((accessToken) => {
4910
- this.removeAccessToken(this.generateCredentialKey(accessToken), correlationId);
5006
+ matchedKeys.forEach((key) => {
5007
+ this.removeAccessToken(key, correlationId);
4911
5008
  });
4912
5009
  this.performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
4913
5010
  return null;
@@ -5350,7 +5447,9 @@ class DefaultStorageClass extends CacheManager {
5350
5447
  getTokenKeys() {
5351
5448
  throw createClientAuthError(methodNotImplemented, "");
5352
5449
  }
5353
- generateCredentialKey() {
5450
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5451
+ generateCredentialKey(_credential, _hash) {
5452
+ /* eslint-enable @typescript-eslint/no-unused-vars */
5354
5453
  throw createClientAuthError(methodNotImplemented, "");
5355
5454
  }
5356
5455
  generateAccountKey() {
@@ -5358,7 +5457,7 @@ class DefaultStorageClass extends CacheManager {
5358
5457
  }
5359
5458
  }
5360
5459
 
5361
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5460
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5362
5461
  /*
5363
5462
  * Copyright (c) Microsoft Corporation. All rights reserved.
5364
5463
  * Licensed under the MIT License.
@@ -5420,9 +5519,10 @@ const IntFields = new Set([
5420
5519
  "networkRtt",
5421
5520
  "redirectBridgeTimeoutMs",
5422
5521
  "redirectBridgeMessageVersion",
5522
+ "fetchRetryCount",
5423
5523
  ]);
5424
5524
 
5425
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5525
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5426
5526
 
5427
5527
  /*
5428
5528
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5480,7 +5580,7 @@ class StubPerformanceClient {
5480
5580
  }
5481
5581
  }
5482
5582
 
5483
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5583
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5484
5584
 
5485
5585
  /*
5486
5586
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5576,7 +5676,7 @@ function isOidcProtocolMode(config) {
5576
5676
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5577
5677
  }
5578
5678
 
5579
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5679
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5580
5680
  /*
5581
5681
  * Copyright (c) Microsoft Corporation. All rights reserved.
5582
5682
  * Licensed under the MIT License.
@@ -5603,7 +5703,7 @@ function isOidcProtocolMode(config) {
5603
5703
  }
5604
5704
  }
5605
5705
 
5606
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5706
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5607
5707
 
5608
5708
  /*
5609
5709
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5683,7 +5783,7 @@ class PopTokenGenerator {
5683
5783
  }
5684
5784
  }
5685
5785
 
5686
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5786
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5687
5787
  /*
5688
5788
  * Copyright (c) Microsoft Corporation. All rights reserved.
5689
5789
  * Licensed under the MIT License.
@@ -5747,7 +5847,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
5747
5847
  uiNotAllowed: uiNotAllowed
5748
5848
  });
5749
5849
 
5750
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5850
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5751
5851
 
5752
5852
  /*
5753
5853
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5814,7 +5914,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
5814
5914
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
5815
5915
  }
5816
5916
 
5817
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5917
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5818
5918
 
5819
5919
  /*
5820
5920
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5833,7 +5933,7 @@ class ServerError extends AuthError {
5833
5933
  }
5834
5934
  }
5835
5935
 
5836
- /*! @azure/msal-common v16.11.2 2026-07-15 */
5936
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5837
5937
 
5838
5938
  /*
5839
5939
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5904,7 +6004,7 @@ function parseRequestState(base64Decode, state, correlationId) {
5904
6004
  }
5905
6005
  }
5906
6006
 
5907
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6007
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
5908
6008
 
5909
6009
  /*
5910
6010
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5993,7 +6093,15 @@ class ResponseHandler {
5993
6093
  // Add keyId from request to serverTokenResponse if defined
5994
6094
  serverTokenResponse.key_id =
5995
6095
  serverTokenResponse.key_id || request.sshKid || undefined;
5996
- const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, additionalCacheKeyComponents);
6096
+ // Compute components once for entity storage (fallback if hash not provided by client)
6097
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
6098
+ const cacheKeyComponents = additionalCacheKeyComponents ??
6099
+ (attributeTokenPartition
6100
+ ? {
6101
+ attribute_tokens: attributeTokenPartition,
6102
+ }
6103
+ : undefined);
6104
+ const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, cacheKeyComponents);
5997
6105
  let cacheContext;
5998
6106
  try {
5999
6107
  if (this.persistencePlugin && this.serializableCache) {
@@ -6255,7 +6363,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6255
6363
  return baseAccount;
6256
6364
  }
6257
6365
 
6258
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6366
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6259
6367
  /*
6260
6368
  * Copyright (c) Microsoft Corporation. All rights reserved.
6261
6369
  * Licensed under the MIT License.
@@ -6265,7 +6373,7 @@ const CcsCredentialType = {
6265
6373
  UPN: "UPN",
6266
6374
  };
6267
6375
 
6268
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6376
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6269
6377
  /*
6270
6378
  * Copyright (c) Microsoft Corporation. All rights reserved.
6271
6379
  * Licensed under the MIT License.
@@ -6284,7 +6392,8 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
6284
6392
  }
6285
6393
  }
6286
6394
 
6287
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6395
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6396
+
6288
6397
  /*
6289
6398
  * Copyright (c) Microsoft Corporation. All rights reserved.
6290
6399
  * Licensed under the MIT License.
@@ -6303,10 +6412,11 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
6303
6412
  sshKid: request.sshKid,
6304
6413
  embeddedClientId: request.embeddedClientId || request.extraParameters?.clientId,
6305
6414
  resource: request.resource,
6415
+ attributeTokens: serializeAttributeTokens(request.attributeTokens),
6306
6416
  };
6307
6417
  }
6308
6418
 
6309
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6419
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6310
6420
 
6311
6421
  /*
6312
6422
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6392,7 +6502,7 @@ class ThrottlingUtils {
6392
6502
  }
6393
6503
  }
6394
6504
 
6395
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6505
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6396
6506
 
6397
6507
  /*
6398
6508
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6423,7 +6533,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
6423
6533
  return new NetworkError(error, httpStatus, responseHeaders);
6424
6534
  }
6425
6535
 
6426
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6536
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6427
6537
 
6428
6538
  /*
6429
6539
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6503,7 +6613,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
6503
6613
  ThrottlingUtils.preProcess(cacheManager, thumbprint, correlationId);
6504
6614
  let response;
6505
6615
  try {
6506
- response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, options);
6616
+ response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
6507
6617
  const responseHeaders = response.headers || {};
6508
6618
  performanceClient?.addFields({
6509
6619
  refreshTokenSize: response.body.refresh_token?.length || 0,
@@ -6539,7 +6649,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
6539
6649
  return response;
6540
6650
  }
6541
6651
 
6542
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6652
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6543
6653
 
6544
6654
  /*
6545
6655
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6660,6 +6770,12 @@ class AuthorizationCodeClient {
6660
6770
  // Add scope array, parameter builder will add default scopes and dedupe
6661
6771
  addScopes(parameters, request.scopes, request.correlationId, true, this.oidcDefaultScopes);
6662
6772
  addResource(parameters, request.resource);
6773
+ if (request.attributeTokens) {
6774
+ addAttributeTokens(parameters, request.attributeTokens);
6775
+ }
6776
+ this.performanceClient?.addFields({
6777
+ hasAttributeTokens: !!request.attributeTokens?.length,
6778
+ }, request.correlationId);
6663
6779
  // add code: user set, not validated
6664
6780
  addAuthorizationCode(parameters, request.code);
6665
6781
  // Add library metadata
@@ -6796,7 +6912,7 @@ class AuthorizationCodeClient {
6796
6912
  }
6797
6913
  }
6798
6914
 
6799
- /*! @azure/msal-common v16.11.2 2026-07-15 */
6915
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
6800
6916
 
6801
6917
  /*
6802
6918
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7023,7 +7139,7 @@ function extractLoginHint(account) {
7023
7139
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7024
7140
  }
7025
7141
 
7026
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7142
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7027
7143
 
7028
7144
  /*
7029
7145
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7044,7 +7160,7 @@ function createJoseHeaderError(code, correlationId) {
7044
7160
  return new JoseHeaderError(code, correlationId);
7045
7161
  }
7046
7162
 
7047
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7163
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7048
7164
  /*
7049
7165
  * Copyright (c) Microsoft Corporation. All rights reserved.
7050
7166
  * Licensed under the MIT License.
@@ -7052,7 +7168,7 @@ function createJoseHeaderError(code, correlationId) {
7052
7168
  const missingKidError = "missing_kid_error";
7053
7169
  const missingAlgError = "missing_alg_error";
7054
7170
 
7055
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7171
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7056
7172
 
7057
7173
  /*
7058
7174
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7092,7 +7208,7 @@ class JoseHeader {
7092
7208
  }
7093
7209
  }
7094
7210
 
7095
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7211
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7096
7212
 
7097
7213
  /*
7098
7214
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7641,7 +7757,7 @@ class PerformanceClient {
7641
7757
  }
7642
7758
  }
7643
7759
 
7644
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7760
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7645
7761
 
7646
7762
  /*
7647
7763
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7802,6 +7918,12 @@ class RefreshTokenClient {
7802
7918
  addServerTelemetry(parameters, this.serverTelemetryManager);
7803
7919
  }
7804
7920
  addRefreshToken(parameters, request.refreshToken);
7921
+ if (request.attributeTokens) {
7922
+ addAttributeTokens(parameters, request.attributeTokens);
7923
+ }
7924
+ this.performanceClient?.addFields({
7925
+ hasAttributeTokens: !!request.attributeTokens?.length,
7926
+ }, request.correlationId);
7805
7927
  if (this.config.clientCredentials.clientSecret) {
7806
7928
  addClientSecret(parameters, this.config.clientCredentials.clientSecret);
7807
7929
  }
@@ -7862,7 +7984,7 @@ class RefreshTokenClient {
7862
7984
  }
7863
7985
  }
7864
7986
 
7865
- /*! @azure/msal-common v16.11.2 2026-07-15 */
7987
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
7866
7988
 
7867
7989
  /*
7868
7990
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8155,7 +8277,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
8155
8277
  clearNativeBrokerErrorCode() { }
8156
8278
  }
8157
8279
 
8158
- /*! @azure/msal-common v16.11.2 2026-07-15 */
8280
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
8159
8281
 
8160
8282
  /*
8161
8283
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8263,7 +8385,7 @@ class SilentFlowClient {
8263
8385
  }
8264
8386
  }
8265
8387
 
8266
- /*! @azure/msal-common v16.11.2 2026-07-15 */
8388
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
8267
8389
 
8268
8390
  /*
8269
8391
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8279,7 +8401,7 @@ const StubbedNetworkModule = {
8279
8401
  },
8280
8402
  };
8281
8403
 
8282
- /*! @azure/msal-common v16.11.2 2026-07-15 */
8404
+ /*! @azure/msal-common v16.12.0 2026-08-04 */
8283
8405
 
8284
8406
  /*
8285
8407
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10782,7 +10904,7 @@ const EventType = {
10782
10904
 
10783
10905
  /* eslint-disable header/header */
10784
10906
  const name = "@azure/msal-browser";
10785
- const version = "5.17.1";
10907
+ const version = "5.18.0";
10786
10908
 
10787
10909
  /*
10788
10910
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11675,12 +11797,12 @@ class BrowserCacheManager extends CacheManager {
11675
11797
  return parsedAccessToken;
11676
11798
  }
11677
11799
  /**
11678
- * set accessToken credential to the platform cache
11679
- * @param accessToken
11800
+ * Set accessToken credential to the platform cache
11801
+ * @param accessToken - the access token entity to cache
11680
11802
  */
11681
- async setAccessTokenCredential(accessToken, correlationId, kmsi) {
11803
+ async setAccessTokenCredential(accessToken, correlationId, kmsi, additionalCacheKeyHash) {
11682
11804
  this.logger.trace("1pondb", correlationId);
11683
- const accessTokenKey = this.generateCredentialKey(accessToken);
11805
+ const accessTokenKey = this.generateCredentialKey(accessToken, additionalCacheKeyHash);
11684
11806
  const timestamp = Date.now().toString();
11685
11807
  accessToken.lastUpdatedAt = timestamp;
11686
11808
  await this.setUserData(accessTokenKey, JSON.stringify(accessToken), correlationId, timestamp, kmsi);
@@ -11990,11 +12112,13 @@ class BrowserCacheManager extends CacheManager {
11990
12112
  }
11991
12113
  /**
11992
12114
  * Generate Credential Key. All changes to the key REQUIRE a schema version update.
11993
- * Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>
12115
+ * Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>|<additional_cache_key_components_hash>
12116
+ *
11994
12117
  * @param credentialEntity
12118
+ * @param hash - optional precomputed hash of additionalCacheKeyComponents
11995
12119
  * @returns
11996
12120
  */
11997
- generateCredentialKey(credential) {
12121
+ generateCredentialKey(credential, additionalCacheKeyHash) {
11998
12122
  const familyId = (credential.credentialType ===
11999
12123
  CredentialType.REFRESH_TOKEN &&
12000
12124
  credential.familyId) ||
@@ -12014,6 +12138,12 @@ class BrowserCacheManager extends CacheManager {
12014
12138
  credential.target || "",
12015
12139
  scheme,
12016
12140
  ];
12141
+ // Append precomputed component-hash segment.
12142
+ if (credential.additionalCacheKeyComponents &&
12143
+ Object.keys(credential.additionalCacheKeyComponents).length > 0 &&
12144
+ additionalCacheKeyHash) {
12145
+ credentialKey.push(additionalCacheKeyHash);
12146
+ }
12017
12147
  return credentialKey.join(CACHE_KEY_SEPARATOR).toLowerCase();
12018
12148
  }
12019
12149
  /**
@@ -13248,50 +13378,63 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13248
13378
  const nativeATMeasurement = this.performanceClient.startMeasurement(NativeInteractionClientAcquireToken, this.correlationId);
13249
13379
  const reqTimestamp = nowSeconds();
13250
13380
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
13381
+ // initialize native request (statically builds the request; does not contact the broker)
13382
+ let nativeRequest;
13251
13383
  try {
13252
- // initialize native request
13253
- const nativeRequest = await this.initializePlatformRequest(request);
13254
- // check if the tokens can be retrieved from internal cache
13255
- try {
13256
- const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
13257
- nativeATMeasurement.end({
13258
- success: true,
13384
+ nativeRequest = await this.initializePlatformRequest(request);
13385
+ }
13386
+ catch (e) {
13387
+ /*
13388
+ * Request initialization (e.g. PoP token generation or authority
13389
+ * resolution) failed before the broker was contacted, so end the
13390
+ * measurement here to avoid an orphaned sub-measurement.
13391
+ * Broker was never engaged, so this was not a native broker outcome.
13392
+ */
13393
+ nativeATMeasurement.add({
13394
+ isNativeBroker: false,
13395
+ });
13396
+ nativeATMeasurement.end({
13397
+ success: false,
13398
+ }, e);
13399
+ throw e;
13400
+ }
13401
+ // check if the tokens can be retrieved from internal cache
13402
+ try {
13403
+ const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
13404
+ // Served from the native internal cache; token did not come directly from the broker
13405
+ nativeATMeasurement.add({
13406
+ isNativeBroker: false,
13407
+ });
13408
+ nativeATMeasurement.end({
13409
+ success: true,
13410
+ fromCache: true,
13411
+ });
13412
+ return result;
13413
+ }
13414
+ catch (e) {
13415
+ if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
13416
+ this.logger.info("0eitbc", this.correlationId);
13417
+ nativeATMeasurement.add({
13259
13418
  isNativeBroker: false,
13260
- fromCache: true,
13261
- });
13262
- return result;
13263
- }
13264
- catch (e) {
13265
- if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
13266
- this.logger.info("0eitbc", this.correlationId);
13267
- nativeATMeasurement.end({
13268
- success: false,
13269
- brokerErrorCode: "cache_request_failed",
13270
- });
13271
- throw e;
13272
- }
13273
- // continue with a native call for any and all errors
13274
- this.logger.info("0957j1", this.correlationId);
13275
- }
13276
- const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
13277
- return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
13278
- .then((result) => {
13279
- nativeATMeasurement.end({
13280
- success: true,
13281
- isNativeBroker: true,
13282
- requestId: result.requestId,
13283
13419
  });
13284
- serverTelemetryManager.clearNativeBrokerErrorCode();
13285
- return result;
13286
- })
13287
- .catch((error) => {
13288
13420
  nativeATMeasurement.end({
13289
13421
  success: false,
13290
- errorCode: error.errorCode,
13291
- subErrorCode: error.subError,
13292
13422
  });
13293
- throw error;
13423
+ throw e;
13424
+ }
13425
+ // continue with a native call for any and all errors
13426
+ this.logger.info("0957j1", this.correlationId);
13427
+ }
13428
+ // dispatch the request to the broker
13429
+ try {
13430
+ const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
13431
+ const result = await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
13432
+ nativeATMeasurement.end({
13433
+ success: true,
13434
+ requestId: result.requestId,
13294
13435
  });
13436
+ serverTelemetryManager.clearNativeBrokerErrorCode();
13437
+ return result;
13295
13438
  }
13296
13439
  catch (e) {
13297
13440
  if (e instanceof NativeAuthError) {
@@ -13299,10 +13442,29 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13299
13442
  }
13300
13443
  nativeATMeasurement.end({
13301
13444
  success: false,
13302
- });
13445
+ }, e);
13446
+ this.setBrokerErrorTelemetry(e);
13303
13447
  throw e;
13304
13448
  }
13305
13449
  }
13450
+ /**
13451
+ * Records platform-broker error telemetry on the root event for the current
13452
+ * correlationId. `isNativeBroker` is set optimistically to true because the
13453
+ * broker was engaged; when the caller subsequently falls back to a web flow
13454
+ * that succeeds, the root success measurement overrides it to false via
13455
+ * `result.fromPlatformBroker`. Terminal broker errors (no fallback) retain
13456
+ * true. `brokerErrorName`/`brokerErrorCode` are recorded when the error is an `AuthError`.
13457
+ * @param error error thrown by the broker interaction
13458
+ */
13459
+ setBrokerErrorTelemetry(error) {
13460
+ if (error instanceof AuthError) {
13461
+ this.performanceClient.addFields({
13462
+ isNativeBroker: true,
13463
+ brokerErrorName: error.name,
13464
+ brokerErrorCode: error.errorCode,
13465
+ }, this.correlationId);
13466
+ }
13467
+ }
13306
13468
  /**
13307
13469
  * Creates silent flow request
13308
13470
  * @param request
@@ -13310,13 +13472,18 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13310
13472
  * @returns CommonSilentFlowRequest
13311
13473
  */
13312
13474
  createSilentCacheRequest(request, cachedAccount) {
13313
- return {
13475
+ const silentRequest = {
13314
13476
  authority: request.authority,
13315
13477
  correlationId: this.correlationId,
13316
13478
  scopes: ScopeSet.fromString(request.scope, this.correlationId).asArray(),
13317
13479
  account: cachedAccount,
13318
13480
  forceRefresh: false,
13319
13481
  };
13482
+ // Preserve FMI partition semantics for silent cache filtering.
13483
+ if (request.attributeTokens) {
13484
+ silentRequest.attributeTokens = request.attributeTokens.split(" ");
13485
+ }
13486
+ return silentRequest;
13320
13487
  }
13321
13488
  /**
13322
13489
  * Fetches the tokens from the cache if un-expired
@@ -13374,11 +13541,21 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13374
13541
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
13375
13542
  serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
13376
13543
  if (isFatalNativeAuthError(e)) {
13544
+ /*
13545
+ * Fatal error on redirect initiate always falls back to a
13546
+ * regular web redirect, so this request did not complete
13547
+ * natively. Token telemetry for the eventual outcome lands
13548
+ * in handleRedirectPromise (phase 2).
13549
+ */
13550
+ this.setBrokerErrorTelemetry(e);
13377
13551
  throw e;
13378
13552
  }
13379
13553
  }
13380
13554
  }
13381
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
13555
+ this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify({
13556
+ ...nativeRequest,
13557
+ storeInCache: request.storeInCache,
13558
+ }), true);
13382
13559
  const navigationOptions = {
13383
13560
  apiId: ApiId.acquireTokenRedirect,
13384
13561
  timeout: this.config.system.redirectNavigationTimeout,
@@ -13408,7 +13585,11 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13408
13585
  this.performanceClient?.addFields({ errorCode: "no_cached_request" }, this.correlationId);
13409
13586
  return null;
13410
13587
  }
13411
- const { prompt, ...request } = cachedRequest;
13588
+ /*
13589
+ * storeInCache is a client-side cache directive persisted alongside the cached
13590
+ * request (not a broker-contract parameter), so extract it here before resending.
13591
+ */
13592
+ const { prompt, storeInCache, ...request } = cachedRequest;
13412
13593
  if (prompt) {
13413
13594
  this.logger.verbose("0ac34v", this.correlationId);
13414
13595
  }
@@ -13417,13 +13598,13 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13417
13598
  try {
13418
13599
  this.logger.verbose("003x5a", this.correlationId);
13419
13600
  const response = await this.platformAuthProvider.sendMessage(request);
13420
- const authResult = await this.handleNativeResponse(response, request, reqTimestamp);
13601
+ const authResult = await this.handleNativeResponse(response, request, reqTimestamp, storeInCache);
13421
13602
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
13422
13603
  serverTelemetryManager.clearNativeBrokerErrorCode();
13423
- this.performanceClient?.addFields({ isNativeBroker: true }, this.correlationId);
13424
13604
  return authResult;
13425
13605
  }
13426
13606
  catch (e) {
13607
+ this.setBrokerErrorTelemetry(e);
13427
13608
  throw e;
13428
13609
  }
13429
13610
  }
@@ -13441,7 +13622,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13441
13622
  * @param request
13442
13623
  * @param reqTimestamp
13443
13624
  */
13444
- async handleNativeResponse(response, request, reqTimestamp) {
13625
+ async handleNativeResponse(response, request, reqTimestamp, storeInCache) {
13445
13626
  this.logger.trace("1bojln", this.correlationId);
13446
13627
  // generate identifiers
13447
13628
  const idTokenClaims = extractTokenClaims(response.id_token, base64Decode, this.correlationId);
@@ -13470,8 +13651,8 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13470
13651
  const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
13471
13652
  // cache accounts and tokens in the appropriate storage
13472
13653
  await this.cacheAccount(baseAccount, isKmsi(idTokenClaims));
13473
- await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache() // environment
13474
- );
13654
+ await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
13655
+ storeInCache);
13475
13656
  return result;
13476
13657
  }
13477
13658
  /**
@@ -13592,7 +13773,9 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13592
13773
  correlationId: this.correlationId,
13593
13774
  state: response.state,
13594
13775
  fromPlatformBroker: true,
13595
- ...(request.resource && { resource: request.resource }),
13776
+ ...(request.extraParameters?.resource && {
13777
+ resource: request.extraParameters.resource,
13778
+ }),
13596
13779
  };
13597
13780
  return result;
13598
13781
  }
@@ -13616,7 +13799,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13616
13799
  * @param tenantId
13617
13800
  * @param reqTimestamp
13618
13801
  */
13619
- async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment) {
13802
+ async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache) {
13620
13803
  const cachedIdToken = createIdTokenEntity(homeAccountIdentifier, environment, response.id_token || "", request.clientId, idTokenClaims.tid || "");
13621
13804
  // cache accessToken in inmemory storage
13622
13805
  const expiresIn = request.tokenType === AuthenticationScheme$1.POP
@@ -13626,16 +13809,21 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13626
13809
  : response.expires_in) || 0;
13627
13810
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
13628
13811
  const responseScopes = this.generateScopes(response.scope, request.scope);
13629
- 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);
13812
+ const additionalCacheKeyComponents = request.attributeTokens
13813
+ ? {
13814
+ attribute_tokens: request.attributeTokens,
13815
+ }
13816
+ : undefined;
13817
+ 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);
13630
13818
  // save idtoken credential in configured browser storage
13631
- if (!!cachedIdToken && request.storeInCache?.idToken !== false) {
13819
+ if (!!cachedIdToken && storeInCache?.idToken !== false) {
13632
13820
  await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, isKmsi(idTokenClaims));
13633
13821
  }
13634
13822
  // save access token credential in memory storage
13635
13823
  const nativeCacheRecord = {
13636
13824
  accessToken: cachedAccessToken,
13637
13825
  };
13638
- return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, request.storeInCache);
13826
+ return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, storeInCache);
13639
13827
  }
13640
13828
  getExpiresInValue(tokenType, expiresIn) {
13641
13829
  return tokenType === AuthenticationScheme$1.POP
@@ -13707,13 +13895,19 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13707
13895
  const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
13708
13896
  ? undefined
13709
13897
  : this.config.auth.clientCapabilities;
13710
- // 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.
13711
- const { scopes, claims, ...remainingProperties } = request;
13898
+ /*
13899
+ * 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.
13900
+ * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
13901
+ */
13902
+ const { scopes, claims } = request;
13712
13903
  const scopeSet = new ScopeSet(scopes || [], this.correlationId);
13713
13904
  scopeSet.appendScopes(OIDC_DEFAULT_SCOPES$1);
13714
13905
  const mergedClaims = buildMergedClaims$1(claims, configClaims?.length ? configClaims : undefined);
13906
+ const hasAttributeTokens = !!request.attributeTokens?.length;
13907
+ this.performanceClient?.addFields({
13908
+ hasAttributeTokens,
13909
+ }, this.correlationId);
13715
13910
  const validatedRequest = {
13716
- ...remainingProperties,
13717
13911
  claims: mergedClaims,
13718
13912
  accountId: this.accountId,
13719
13913
  clientId: this.config.auth.clientId,
@@ -13722,19 +13916,32 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13722
13916
  redirectUri: getRedirectUri(request.redirectUri, this.config.auth.redirectUri, this.logger, this.correlationId),
13723
13917
  prompt: this.getPrompt(request.prompt),
13724
13918
  correlationId: this.correlationId,
13919
+ isSts: false,
13725
13920
  tokenType: request.authenticationScheme,
13726
13921
  windowTitleSubstring: document.title,
13922
+ nonce: request.nonce,
13923
+ state: request.state,
13924
+ loginHint: request.loginHint,
13727
13925
  extraParameters: {
13728
13926
  ...request.extraParameters,
13927
+ ...(request.resource && { resource: request.resource }), // resource is set for MCP scenarios
13729
13928
  },
13730
13929
  extendedExpiryToken: false,
13731
13930
  keyId: request.popKid,
13931
+ resourceRequestMethod: request.resourceRequestMethod,
13932
+ resourceRequestUri: request.resourceRequestUri,
13933
+ shrClaims: request.shrClaims,
13934
+ shrNonce: request.shrNonce,
13732
13935
  };
13936
+ if (hasAttributeTokens) {
13937
+ validatedRequest.attributeTokens =
13938
+ serializeAttributeTokens(request.attributeTokens);
13939
+ }
13733
13940
  // Check for PoP token requests: signPopToken should only be set to true if popKid is not set
13734
13941
  if (validatedRequest.signPopToken && !!request.popKid) {
13735
13942
  throw createBrowserAuthError(invalidPopTokenRequest, this.correlationId);
13736
13943
  }
13737
- this.handleExtraBrokerParams(validatedRequest);
13944
+ this.handleExtraBrokerParams(validatedRequest, request.embeddedClientId);
13738
13945
  validatedRequest.extraParameters =
13739
13946
  validatedRequest.extraParameters || {};
13740
13947
  validatedRequest.extraParameters.telemetry =
@@ -13809,19 +14016,19 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13809
14016
  * @param request {PlatformAuthRequest}
13810
14017
  * @private
13811
14018
  */
13812
- handleExtraBrokerParams(request) {
14019
+ handleExtraBrokerParams(request, embeddedClientId) {
13813
14020
  const hasExtraBrokerParams = request.extraParameters &&
13814
14021
  request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
13815
14022
  request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
13816
14023
  request.extraParameters.hasOwnProperty(CLIENT_ID);
13817
- if (!request.embeddedClientId && !hasExtraBrokerParams) {
14024
+ if (!embeddedClientId && !hasExtraBrokerParams) {
13818
14025
  return;
13819
14026
  }
13820
14027
  let child_client_id = "";
13821
14028
  const child_redirect_uri = request.redirectUri;
13822
- if (request.embeddedClientId) {
14029
+ if (embeddedClientId) {
13823
14030
  request.redirectUri = this.config.auth.redirectUri;
13824
- child_client_id = request.embeddedClientId;
14031
+ child_client_id = embeddedClientId;
13825
14032
  }
13826
14033
  else if (request.extraParameters) {
13827
14034
  request.redirectUri =
@@ -13829,7 +14036,15 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
13829
14036
  child_client_id =
13830
14037
  request.extraParameters[CLIENT_ID];
13831
14038
  }
14039
+ const {
14040
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14041
+ [BROKER_CLIENT_ID]: _brkClientId,
14042
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14043
+ [BROKER_REDIRECT_URI]: _brkRedirectUri,
14044
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14045
+ [CLIENT_ID]: _clientId, ...remainingExtraParameters } = request.extraParameters || {};
13832
14046
  request.extraParameters = {
14047
+ ...remainingExtraParameters,
13833
14048
  child_client_id,
13834
14049
  child_redirect_uri,
13835
14050
  };
@@ -14254,6 +14469,8 @@ class NavigationClient {
14254
14469
  * Copyright (c) Microsoft Corporation. All rights reserved.
14255
14470
  * Licensed under the MIT License.
14256
14471
  */
14472
+ const MAX_FETCH_POST_RETRIES = 1;
14473
+ const RETRY_DELAY_MS = 100;
14257
14474
  /**
14258
14475
  * 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
14259
14476
  */
@@ -14302,21 +14519,40 @@ class FetchClient {
14302
14519
  async sendPostRequestAsync(url, options) {
14303
14520
  const reqBody = (options && options.body) || "";
14304
14521
  const reqHeaders = getFetchHeaders(options);
14522
+ const correlationId = options?.correlationId;
14523
+ const performanceClient = options?.performanceClient;
14305
14524
  let response;
14306
- let responseStatus = 0;
14307
- let responseHeaders = {};
14308
- try {
14309
- response = await fetch(url, {
14310
- method: HTTP_REQUEST_TYPE.POST,
14311
- headers: reqHeaders,
14312
- body: reqBody,
14313
- });
14525
+ let lastError;
14526
+ for (let attempt = 1; attempt <= MAX_FETCH_POST_RETRIES + 1; attempt++) {
14527
+ try {
14528
+ response = await fetch(url, {
14529
+ method: HTTP_REQUEST_TYPE.POST,
14530
+ headers: reqHeaders,
14531
+ body: reqBody,
14532
+ });
14533
+ break;
14534
+ }
14535
+ catch (e) {
14536
+ lastError = e;
14537
+ if (!shouldRetryPostFetchError(lastError, attempt)) {
14538
+ throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
14539
+ ? postRequestFailed
14540
+ : noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
14541
+ }
14542
+ // Brief backoff before retry
14543
+ await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS));
14544
+ if (correlationId) {
14545
+ performanceClient?.incrementFields({ fetchRetryCount: 1 }, correlationId);
14546
+ }
14547
+ }
14314
14548
  }
14315
- catch (e) {
14316
- throw createNetworkError(createBrowserAuthError(window.navigator.onLine
14549
+ if (!response) {
14550
+ throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
14317
14551
  ? postRequestFailed
14318
- : noNetworkConnectivity, ""), undefined, undefined, e);
14552
+ : noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
14319
14553
  }
14554
+ let responseStatus = 0;
14555
+ let responseHeaders = {};
14320
14556
  responseHeaders = getHeaderDict(response.headers);
14321
14557
  try {
14322
14558
  responseStatus = response.status;
@@ -14327,10 +14563,15 @@ class FetchClient {
14327
14563
  };
14328
14564
  }
14329
14565
  catch (e) {
14330
- throw createNetworkError(createBrowserAuthError(failedToParseResponse, ""), responseStatus, responseHeaders, e);
14566
+ throw createNetworkError(createBrowserAuthError(failedToParseResponse, correlationId || ""), responseStatus, responseHeaders, e);
14331
14567
  }
14332
14568
  }
14333
14569
  }
14570
+ function shouldRetryPostFetchError(error, attempt) {
14571
+ return (attempt <= MAX_FETCH_POST_RETRIES &&
14572
+ window.navigator.onLine !== false &&
14573
+ error.name !== "AbortError");
14574
+ }
14334
14575
  /**
14335
14576
  * Get Fetch API Headers object from string map
14336
14577
  * @param inputHeaders
@@ -14816,7 +15057,7 @@ class PlatformAuthDOMHandler {
14816
15057
  }
14817
15058
  initializePlatformDOMRequest(request) {
14818
15059
  this.logger.trace(`15d6yv ${this.platformAuthType}`, request.correlationId);
14819
- const { accountId, clientId, authority, scope, redirectUri, correlationId, state, storeInCache, embeddedClientId, extraParameters, ...remainingProperties } = request;
15060
+ const { accountId, clientId, authority, scope, redirectUri, correlationId, state, extraParameters, ...remainingProperties } = request;
14820
15061
  const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
14821
15062
  const platformDOMRequest = {
14822
15063
  accountId: accountId,
@@ -14832,8 +15073,6 @@ class PlatformAuthDOMHandler {
14832
15073
  redirectUri: redirectUri,
14833
15074
  scope: scope,
14834
15075
  state: state,
14835
- storeInCache: storeInCache,
14836
- embeddedClientId: embeddedClientId,
14837
15076
  };
14838
15077
  return platformDOMRequest;
14839
15078
  }
@@ -16617,6 +16856,7 @@ class StandardController {
16617
16856
  this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, correlationId, exports.InteractionType.Redirect);
16618
16857
  rootMeasurement = this.performanceClient.startMeasurement(AcquireTokenRedirect, correlationId);
16619
16858
  this.logger.trace("12v7is", correlationId);
16859
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
16620
16860
  rootMeasurement.add({
16621
16861
  isPlatformBrokerRequest: true,
16622
16862
  });
@@ -16653,6 +16893,7 @@ class StandardController {
16653
16893
  }
16654
16894
  rootMeasurement.end({
16655
16895
  success: true,
16896
+ isNativeBroker: result.fromPlatformBroker ?? false,
16656
16897
  }, undefined, result.account);
16657
16898
  // Fire-and-forget SSO capability verification in background
16658
16899
  this.verifySsoCapability(cachedRedirectRequest, exports.InteractionType.Redirect);
@@ -16662,8 +16903,8 @@ class StandardController {
16662
16903
  * Instrument an event only if an error code is set. Otherwise, discard it when the redirect response
16663
16904
  * is empty and the error code is missing.
16664
16905
  */
16665
- if (rootMeasurement.event.errorCode) {
16666
- rootMeasurement.end({ success: false }, undefined);
16906
+ if (!!rootMeasurement.event.errorCode) {
16907
+ rootMeasurement.end({ success: false });
16667
16908
  }
16668
16909
  else {
16669
16910
  rootMeasurement.discard();
@@ -16722,10 +16963,6 @@ class StandardController {
16722
16963
  this.canUsePlatformBroker(request)) {
16723
16964
  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);
16724
16965
  result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
16725
- atrMeasurement.add({
16726
- brokerErrorName: e.name,
16727
- brokerErrorCode: e.errorCode,
16728
- });
16729
16966
  if (e instanceof NativeAuthError &&
16730
16967
  isFatalNativeAuthError(e)) {
16731
16968
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -16794,6 +17031,7 @@ class StandardController {
16794
17031
  let result;
16795
17032
  const pkce = this.getPreGeneratedPkceCodes(correlationId);
16796
17033
  if (this.canUsePlatformBroker(request)) {
17034
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
16797
17035
  atPopupMeasurement.add({
16798
17036
  isPlatformBrokerRequest: true,
16799
17037
  });
@@ -16804,15 +17042,11 @@ class StandardController {
16804
17042
  .then((response) => {
16805
17043
  atPopupMeasurement.end({
16806
17044
  success: true,
16807
- isNativeBroker: true,
17045
+ isNativeBroker: response.fromPlatformBroker ?? false,
16808
17046
  }, undefined, response.account);
16809
17047
  return response;
16810
17048
  })
16811
17049
  .catch((e) => {
16812
- atPopupMeasurement.add({
16813
- brokerErrorName: e.name,
16814
- brokerErrorCode: e.errorCode,
16815
- });
16816
17050
  if (e instanceof NativeAuthError &&
16817
17051
  isFatalNativeAuthError(e)) {
16818
17052
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -16843,6 +17077,7 @@ class StandardController {
16843
17077
  }
16844
17078
  atPopupMeasurement.end({
16845
17079
  success: true,
17080
+ isNativeBroker: result.fromPlatformBroker ?? false,
16846
17081
  accessTokenSize: result.accessToken.length,
16847
17082
  idTokenSize: result.idToken.length,
16848
17083
  }, undefined, result.account);
@@ -17036,14 +17271,11 @@ class StandardController {
17036
17271
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, exports.InteractionType.Silent, validRequest);
17037
17272
  let result;
17038
17273
  if (this.canUsePlatformBroker(validRequest)) {
17274
+ // Cached nativeAccountId routes directly to the broker (no /authorize call)
17039
17275
  this.ssoSilentMeasurement?.add({
17040
17276
  isPlatformBrokerRequest: true,
17041
17277
  });
17042
17278
  result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
17043
- this.ssoSilentMeasurement?.add({
17044
- brokerErrorName: e.name,
17045
- brokerErrorCode: e.errorCode,
17046
- });
17047
17279
  // If native token acquisition fails for availability reasons fallback to standard flow
17048
17280
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
17049
17281
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -17066,7 +17298,7 @@ class StandardController {
17066
17298
  }
17067
17299
  this.ssoSilentMeasurement?.end({
17068
17300
  success: true,
17069
- isNativeBroker: response.fromPlatformBroker,
17301
+ isNativeBroker: response.fromPlatformBroker ?? false,
17070
17302
  accessTokenSize: response.accessToken.length,
17071
17303
  idTokenSize: response.idToken.length,
17072
17304
  }, undefined, response.account);
@@ -17119,6 +17351,7 @@ class StandardController {
17119
17351
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
17120
17352
  atbcMeasurement.end({
17121
17353
  success: true,
17354
+ isNativeBroker: false,
17122
17355
  accessTokenSize: result.accessToken.length,
17123
17356
  idTokenSize: result.idToken.length,
17124
17357
  }, undefined, result.account);
@@ -17149,10 +17382,6 @@ class StandardController {
17149
17382
  ...request,
17150
17383
  correlationId,
17151
17384
  }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
17152
- atbcMeasurement.add({
17153
- brokerErrorName: e.name,
17154
- brokerErrorCode: e.errorCode,
17155
- });
17156
17385
  // If native token acquisition fails for availability reasons fallback to standard flow
17157
17386
  if (e instanceof NativeAuthError &&
17158
17387
  isFatalNativeAuthError(e)) {
@@ -17162,6 +17391,7 @@ class StandardController {
17162
17391
  });
17163
17392
  atbcMeasurement.end({
17164
17393
  success: true,
17394
+ isNativeBroker: result.fromPlatformBroker ?? false,
17165
17395
  }, undefined, result.account);
17166
17396
  return result;
17167
17397
  }
@@ -17202,6 +17432,7 @@ class StandardController {
17202
17432
  .then((response) => {
17203
17433
  this.acquireTokenByCodeAsyncMeasurement?.end({
17204
17434
  success: true,
17435
+ isNativeBroker: false,
17205
17436
  fromCache: response.fromCache,
17206
17437
  });
17207
17438
  return response;
@@ -17355,21 +17586,32 @@ class StandardController {
17355
17586
  // Create idToken entity and store in browser storage
17356
17587
  const idTokenEntity = createIdTokenEntity(result.account.homeAccountId, result.account.environment, result.idToken, this.config.auth.clientId, result.tenantId);
17357
17588
  // Create accessToken entity and store in native internal storage
17589
+ const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
17590
+ const additionalCacheKeyComponents = attributeTokenPartition
17591
+ ? {
17592
+ attribute_tokens: attributeTokenPartition,
17593
+ }
17594
+ : undefined;
17358
17595
  const accessTokenEntity = createAccessTokenEntity(result.account.homeAccountId, result.account.environment, result.accessToken, this.config.auth.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn
17359
17596
  ? toSecondsFromDate(result.expiresOn)
17360
17597
  : 0, result.extExpiresOn
17361
17598
  ? toSecondsFromDate(result.extExpiresOn)
17362
17599
  : 0, base64Decode, request.correlationId || "", undefined, // refreshOn
17363
17600
  result.tokenType, undefined, // userAssertionHash
17364
- request.sshKid);
17601
+ request.sshKid, additionalCacheKeyComponents);
17365
17602
  if (request.resource) {
17366
17603
  accessTokenEntity.resource = request.resource;
17367
17604
  }
17605
+ // Get attribute token partition hash for cache key isolation
17606
+ const components = additionalCacheKeyComponents;
17607
+ const additionalCacheKeyHash = components
17608
+ ? await this.browserCrypto.hashString(JSON.stringify(components))
17609
+ : undefined;
17368
17610
  const kmsi = isKmsi(result.idTokenClaims);
17369
17611
  // Store idToken in browser storage
17370
17612
  await this.browserStorage.setIdTokenCredential(idTokenEntity, result.correlationId, kmsi);
17371
17613
  // Store accessToken in native internal storage
17372
- await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi);
17614
+ await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi, additionalCacheKeyHash);
17373
17615
  }
17374
17616
  else {
17375
17617
  return this.browserStorage.hydrateCache(result, request);
@@ -17379,8 +17621,16 @@ class StandardController {
17379
17621
  /**
17380
17622
  * Acquire a token from native device (e.g. WAM)
17381
17623
  * @param request
17624
+ * @param apiId
17625
+ * @param accountId
17626
+ * @param cacheLookupPolicy
17382
17627
  */
17383
17628
  async acquireTokenNative(request, apiId, accountId, cacheLookupPolicy) {
17629
+ /*
17630
+ * Callers always normalize correlationId onto the request before delegating
17631
+ * here, so it is guaranteed defined and is the single id used to key this
17632
+ * flow's telemetry.
17633
+ */
17384
17634
  const correlationId = this.getRequestCorrelationId(request);
17385
17635
  this.logger.trace("0b9y3p", correlationId);
17386
17636
  if (!this.platformAuthProvider) {
@@ -17634,6 +17884,7 @@ class StandardController {
17634
17884
  .then((result) => {
17635
17885
  atsMeasurement.end({
17636
17886
  success: true,
17887
+ isNativeBroker: result.fromPlatformBroker ?? false,
17637
17888
  fromCache: result.fromCache,
17638
17889
  accessTokenSize: result.accessToken.length,
17639
17890
  idTokenSize: result.idToken.length,
@@ -17770,7 +18021,7 @@ class StandardController {
17770
18021
  if (request.correlationId) {
17771
18022
  this.performanceClient.addFields({
17772
18023
  fromCache: response.fromCache,
17773
- isNativeBroker: response.fromPlatformBroker,
18024
+ isNativeBroker: response.fromPlatformBroker ?? false,
17774
18025
  }, request.correlationId);
17775
18026
  }
17776
18027
  return response;
@@ -17796,10 +18047,6 @@ class StandardController {
17796
18047
  this.logger.verbose("0sczo4", silentRequest.correlationId);
17797
18048
  this.performanceClient.addFields({ isPlatformBrokerRequest: true }, silentRequest.correlationId);
17798
18049
  return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow, silentRequest.account.nativeAccountId, cacheLookupPolicy).catch(async (e) => {
17799
- this.performanceClient.addFields({
17800
- brokerErrorName: e.name,
17801
- brokerErrorCode: e.errorCode,
17802
- }, silentRequest.correlationId);
17803
18050
  // If native token acquisition fails for availability reasons fallback to web flow
17804
18051
  if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
17805
18052
  this.logger.verbose("07rkmb", silentRequest.correlationId);
@@ -18088,6 +18335,7 @@ class NestedAppAuthAdapter {
18088
18335
  const correlationId = request.correlationId || this.crypto.createNewGuid();
18089
18336
  const claims = buildMergedClaims$1(request.claims, this.clientCapabilities);
18090
18337
  const scopes = request.scopes || OIDC_DEFAULT_SCOPES$1;
18338
+ const attributeTokens = serializeAttributeTokens(request.attributeTokens);
18091
18339
  const tokenRequest = {
18092
18340
  platformBrokerId: request.account?.homeAccountId,
18093
18341
  clientId: this.clientId,
@@ -18100,6 +18348,7 @@ class NestedAppAuthAdapter {
18100
18348
  authenticationScheme: request.authenticationScheme ||
18101
18349
  AuthenticationScheme$1.BEARER,
18102
18350
  extraParameters: extraParams,
18351
+ attributeTokens,
18103
18352
  };
18104
18353
  return tokenRequest;
18105
18354
  }