@azure/msal-browser 5.27.0 → 5.29.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 (567) 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 +9 -1
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +7 -6
  7. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
  8. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +4 -2
  9. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  10. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +21 -7
  11. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs.map +1 -1
  12. package/dist/cache/AccountManager.mjs +1 -1
  13. package/dist/cache/AsyncMemoryStorage.mjs +14 -1
  14. package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
  15. package/dist/cache/BrowserCacheManager.mjs +9 -2
  16. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  17. package/dist/cache/CacheHelpers.mjs +1 -1
  18. package/dist/cache/CacheKeys.mjs +1 -1
  19. package/dist/cache/CookieStorage.mjs +1 -1
  20. package/dist/cache/DatabaseStorage.mjs +1 -1
  21. package/dist/cache/EncryptedData.mjs +1 -1
  22. package/dist/cache/LocalStorage.mjs +1 -1
  23. package/dist/cache/MemoryStorage.mjs +1 -1
  24. package/dist/cache/SessionStorage.mjs +1 -1
  25. package/dist/cache/TokenCache.mjs +1 -1
  26. package/dist/config/Configuration.mjs +1 -1
  27. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  28. package/dist/controllers/StandardController.mjs +65 -7
  29. package/dist/controllers/StandardController.mjs.map +1 -1
  30. package/dist/crypto/BrowserCrypto.mjs +1 -1
  31. package/dist/crypto/CryptoOps.mjs +1 -1
  32. package/dist/crypto/PkceGenerator.mjs +1 -1
  33. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  34. package/dist/crypto/TokenBindingKeyManager.mjs +14 -1
  35. package/dist/crypto/TokenBindingKeyManager.mjs.map +1 -1
  36. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  37. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +6 -4
  38. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  39. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +58 -50
  40. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  41. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  57. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +3 -5
  59. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
  60. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +19 -13
  61. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
  62. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +8 -2
  63. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -1
  64. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +58 -69
  65. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
  66. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +68 -0
  67. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -0
  68. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +44 -16
  69. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
  70. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +100 -0
  71. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -0
  72. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +5 -3
  73. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -1
  74. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +27 -19
  75. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
  76. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +2 -4
  77. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
  78. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +2 -3
  79. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
  80. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +20 -8
  81. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
  82. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +110 -0
  83. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
  84. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  85. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  86. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  87. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  88. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +2 -1
  89. package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +1 -1
  90. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  91. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  92. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  93. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  94. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  95. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  96. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  97. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  98. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  99. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  100. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  101. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  102. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  103. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  104. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  105. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  106. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  107. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +465 -186
  108. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
  109. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +2 -6
  110. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -1
  111. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +18 -3
  112. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
  113. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  114. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  115. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  116. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  117. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  118. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  119. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  120. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  122. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +10 -8
  123. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  125. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +147 -38
  126. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
  127. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  128. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  129. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +21 -10
  130. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
  131. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  132. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +2 -12
  133. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
  134. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +2 -2
  135. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
  136. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  137. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  138. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +15 -3
  139. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
  140. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +10 -3
  141. package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
  142. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +17 -2
  143. package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
  144. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  145. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  146. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  147. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  148. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  149. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  150. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  151. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  152. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  153. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  154. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  155. package/dist/custom_auth/index.mjs +6 -3
  156. package/dist/custom_auth/index.mjs.map +1 -1
  157. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  158. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  159. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  160. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  161. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  162. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  163. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  164. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  165. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  166. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  167. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  168. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +49 -14
  169. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
  170. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +24 -0
  171. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs.map +1 -0
  172. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  173. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  174. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  175. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  176. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  177. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  178. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  179. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  180. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  181. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  182. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  183. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  184. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  185. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +4 -7
  186. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
  187. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +2 -2
  188. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs.map +1 -1
  189. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  190. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  191. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  192. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  193. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  194. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  195. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  196. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  197. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  198. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  199. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  200. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  201. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  202. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  203. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +17 -8
  204. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
  205. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +78 -0
  206. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs.map +1 -0
  207. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +48 -0
  208. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs.map +1 -0
  209. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +49 -0
  210. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs.map +1 -0
  211. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +21 -21
  212. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -1
  213. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  214. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  215. package/dist/encode/Base64Decode.mjs +1 -1
  216. package/dist/encode/Base64Encode.mjs +1 -1
  217. package/dist/error/BrowserAuthError.mjs +1 -1
  218. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  219. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  220. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  221. package/dist/error/NativeAuthError.mjs +1 -1
  222. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  223. package/dist/error/NestedAppAuthError.mjs +1 -1
  224. package/dist/event/EventHandler.mjs +1 -1
  225. package/dist/event/EventMessage.mjs +1 -1
  226. package/dist/event/EventType.mjs +1 -1
  227. package/dist/index.mjs +1 -1
  228. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  229. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  230. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +526 -90
  231. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  232. package/dist/interaction_client/PopupClient.mjs +27 -20
  233. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  234. package/dist/interaction_client/RedirectClient.mjs +29 -14
  235. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  236. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  237. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  238. package/dist/interaction_client/SilentIframeClient.mjs +44 -32
  239. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  240. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  241. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  242. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  243. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  244. package/dist/log-strings-mapping.json +77 -25
  245. package/dist/naa/BridgeError.mjs +1 -1
  246. package/dist/naa/BridgeProxy.mjs +1 -1
  247. package/dist/naa/BridgeStatusCode.mjs +1 -1
  248. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  249. package/dist/navigation/NavigationClient.mjs +1 -1
  250. package/dist/network/FetchClient.mjs +1 -1
  251. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  252. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  253. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  254. package/dist/packageMetadata.mjs +2 -2
  255. package/dist/popup_relay/constants.mjs +1 -1
  256. package/dist/popup_relay/index.mjs +1 -1
  257. package/dist/popup_relay/relayClient.mjs +1 -1
  258. package/dist/protocol/Authorize.mjs +21 -13
  259. package/dist/protocol/Authorize.mjs.map +1 -1
  260. package/dist/redirect_bridge/index.mjs +1 -1
  261. package/dist/request/RequestHelpers.mjs +35 -11
  262. package/dist/request/RequestHelpers.mjs.map +1 -1
  263. package/dist/request/SilentRequestHelpers.mjs +6 -6
  264. package/dist/request/SilentRequestHelpers.mjs.map +1 -1
  265. package/dist/response/ResponseHandler.mjs +1 -1
  266. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  267. package/dist/telemetry/BrowserPerformanceEvents.mjs +3 -2
  268. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  269. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  270. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  271. package/dist/utils/BrowserConstants.mjs +1 -1
  272. package/dist/utils/BrowserDetection.mjs +1 -1
  273. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  274. package/dist/utils/BrowserUtils.mjs +1 -1
  275. package/dist/utils/Helpers.mjs +1 -1
  276. package/dist/utils/IframeMonitor.mjs +1 -1
  277. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  278. package/dist/utils/PopupMonitor.mjs +1 -1
  279. package/dist/utils/PopupOriginCheck.mjs +1 -1
  280. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  281. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  282. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  283. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  284. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  285. package/dist/webBrokerBridge/index.mjs +1 -1
  286. package/lib/custom-auth-path/log-strings-mapping.json +69 -17
  287. package/lib/custom-auth-path/msal-custom-auth.cjs +2394 -920
  288. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  289. package/lib/custom-auth-path/msal-custom-auth.js +2394 -920
  290. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  291. package/lib/log-strings-mapping.json +23 -11
  292. package/lib/msal-browser.cjs +943 -278
  293. package/lib/msal-browser.cjs.map +1 -1
  294. package/lib/msal-browser.js +943 -278
  295. package/lib/msal-browser.js.map +1 -1
  296. package/lib/msal-browser.min.js +2 -2
  297. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  298. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  299. package/lib/popup-relay/msal-popup-relay.js +2 -2
  300. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  301. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  302. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  303. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  304. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  305. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  306. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  307. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  308. package/package.json +2 -2
  309. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +15 -0
  310. package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +6 -21
  311. package/src/broker/nativeBroker/PlatformAuthProvider.ts +3 -1
  312. package/src/broker/nativeBroker/PlatformAuthRequest.ts +12 -8
  313. package/src/broker/nativeBroker/PlatformAuthResponse.ts +31 -0
  314. package/src/cache/AsyncMemoryStorage.ts +16 -0
  315. package/src/cache/BrowserCacheManager.ts +19 -1
  316. package/src/controllers/StandardController.ts +107 -11
  317. package/src/crypto/TokenBindingKeyManager.ts +21 -0
  318. package/src/custom_auth/CustomAuthActionInputs.ts +12 -5
  319. package/src/custom_auth/CustomAuthPublicClientApplication.ts +5 -3
  320. package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +5 -3
  321. package/src/custom_auth/controller/CustomAuthStandardController.ts +79 -92
  322. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +14 -0
  323. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +1 -4
  324. package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +5 -4
  325. package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +28 -16
  326. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +6 -0
  327. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +83 -72
  328. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +23 -0
  329. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +28 -0
  330. package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +10 -6
  331. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +9 -6
  332. package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +4 -6
  333. package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +36 -0
  334. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +8 -8
  335. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +94 -0
  336. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +68 -14
  337. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +150 -0
  338. package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +8 -2
  339. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +48 -24
  340. package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +1 -3
  341. package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +24 -2
  342. package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +1 -2
  343. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +34 -9
  344. package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +179 -0
  345. package/src/custom_auth/core/error/InvalidArgumentError.ts +1 -1
  346. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +13 -12
  347. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +771 -261
  348. package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +2 -6
  349. package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +27 -15
  350. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +97 -26
  351. package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +9 -6
  352. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +330 -63
  353. package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +51 -15
  354. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +25 -6
  355. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +0 -6
  356. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +48 -48
  357. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +44 -37
  358. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +32 -15
  359. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +14 -10
  360. package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +24 -1
  361. package/src/custom_auth/core/telemetry/PublicApiId.ts +7 -0
  362. package/src/custom_auth/core/utils/ArgumentValidator.ts +26 -0
  363. package/src/custom_auth/index.ts +21 -11
  364. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +8 -10
  365. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +71 -16
  366. package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.ts +30 -0
  367. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +4 -8
  368. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +4 -5
  369. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +3 -6
  370. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +0 -3
  371. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.ts +2 -3
  372. package/src/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.ts +49 -0
  373. package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +8 -4
  374. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +18 -4
  375. package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +26 -5
  376. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.ts +101 -0
  377. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.ts +53 -0
  378. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.ts +97 -0
  379. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +0 -6
  380. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +33 -43
  381. package/src/interaction_client/PlatformAuthInteractionClient.ts +886 -148
  382. package/src/interaction_client/PopupClient.ts +104 -83
  383. package/src/interaction_client/RedirectClient.ts +88 -34
  384. package/src/interaction_client/SilentIframeClient.ts +121 -95
  385. package/src/packageMetadata.ts +1 -1
  386. package/src/protocol/Authorize.ts +46 -18
  387. package/src/request/RequestHelpers.ts +64 -11
  388. package/src/request/SilentRequestHelpers.ts +8 -9
  389. package/src/telemetry/BrowserPerformanceEvents.ts +1 -0
  390. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  391. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
  392. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  393. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +6 -1
  394. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
  395. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +21 -0
  396. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
  397. package/types/cache/AsyncMemoryStorage.d.ts +5 -0
  398. package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
  399. package/types/cache/BrowserCacheManager.d.ts +4 -0
  400. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  401. package/types/controllers/StandardController.d.ts +5 -0
  402. package/types/controllers/StandardController.d.ts.map +1 -1
  403. package/types/crypto/TokenBindingKeyManager.d.ts +9 -0
  404. package/types/crypto/TokenBindingKeyManager.d.ts.map +1 -1
  405. package/types/custom_auth/CustomAuthActionInputs.d.ts +12 -5
  406. package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  407. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  408. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +5 -3
  409. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
  410. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +5 -3
  411. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
  412. package/types/custom_auth/controller/CustomAuthStandardController.d.ts +2 -0
  413. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  414. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +10 -0
  415. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -0
  416. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +1 -4
  417. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
  418. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +5 -4
  419. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
  420. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +17 -8
  421. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
  422. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +6 -0
  423. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -1
  424. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +23 -44
  425. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
  426. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +14 -0
  427. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -0
  428. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +16 -0
  429. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -0
  430. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +7 -6
  431. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
  432. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +8 -7
  433. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
  434. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +4 -6
  435. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
  436. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +20 -0
  437. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
  438. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +7 -8
  439. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
  440. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +22 -0
  441. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -0
  442. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +3 -6
  443. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
  444. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +28 -0
  445. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -0
  446. package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts +3 -2
  447. package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts.map +1 -1
  448. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +6 -8
  449. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
  450. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +1 -3
  451. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
  452. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +18 -2
  453. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
  454. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +1 -2
  455. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
  456. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +5 -6
  457. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
  458. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +23 -0
  459. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
  460. package/types/custom_auth/core/error/InvalidArgumentError.d.ts +1 -0
  461. package/types/custom_auth/core/error/InvalidArgumentError.d.ts.map +1 -1
  462. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +9 -1
  463. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
  464. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +19 -10
  465. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
  466. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +1 -1
  467. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -1
  468. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +19 -5
  469. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
  470. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +39 -4
  471. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
  472. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts +8 -0
  473. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
  474. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts +8 -2
  475. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
  476. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +4 -3
  477. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
  478. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +13 -1
  479. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
  480. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -1
  481. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +36 -9
  482. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
  483. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +30 -17
  484. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
  485. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +18 -4
  486. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
  487. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +8 -11
  488. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
  489. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +2 -1
  490. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
  491. package/types/custom_auth/core/telemetry/PublicApiId.d.ts +7 -0
  492. package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
  493. package/types/custom_auth/core/utils/ArgumentValidator.d.ts +3 -0
  494. package/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  495. package/types/custom_auth/index.d.ts +10 -5
  496. package/types/custom_auth/index.d.ts.map +1 -1
  497. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +7 -11
  498. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
  499. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +7 -5
  500. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
  501. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts +7 -0
  502. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts.map +1 -0
  503. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +4 -8
  504. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
  505. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +5 -5
  506. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
  507. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +3 -6
  508. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
  509. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +0 -1
  510. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -1
  511. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts +3 -2
  512. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts.map +1 -1
  513. package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts +27 -0
  514. package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts.map +1 -0
  515. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +6 -3
  516. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
  517. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +13 -3
  518. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
  519. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +8 -3
  520. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
  521. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts +24 -0
  522. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts.map +1 -0
  523. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts +18 -0
  524. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts.map +1 -0
  525. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts +7 -0
  526. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts.map +1 -0
  527. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +0 -4
  528. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -1
  529. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +5 -4
  530. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
  531. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +110 -8
  532. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  533. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  534. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  535. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  536. package/types/packageMetadata.d.ts +1 -1
  537. package/types/protocol/Authorize.d.ts +4 -4
  538. package/types/protocol/Authorize.d.ts.map +1 -1
  539. package/types/request/RequestHelpers.d.ts +21 -3
  540. package/types/request/RequestHelpers.d.ts.map +1 -1
  541. package/types/request/SilentRequestHelpers.d.ts.map +1 -1
  542. package/types/telemetry/BrowserPerformanceEvents.d.ts +1 -0
  543. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
  544. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +0 -70
  545. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +0 -1
  546. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +0 -25
  547. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +0 -1
  548. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +0 -45
  549. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +0 -1
  550. package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +0 -23
  551. package/src/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.ts +0 -19
  552. package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -20
  553. package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +0 -97
  554. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +0 -34
  555. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +0 -61
  556. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +0 -14
  557. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +0 -1
  558. package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts +0 -13
  559. package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts.map +0 -1
  560. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -8
  561. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +0 -1
  562. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -17
  563. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +0 -1
  564. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +0 -11
  565. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +0 -1
  566. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +0 -19
  567. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +0 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v5.27.0 2026-10-27 */
1
+ /*! @azure/msal-browser v5.29.0 2026-11-06 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -62,7 +62,7 @@ const ATTRIBUTE_TOKENS = "attribute_tokens";
62
62
  */
63
63
  const POPUP_ORIGIN_CHECK_DONE = "pocd";
64
64
 
65
- /*! @azure/msal-common v16.15.0 2026-10-27 */
65
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
66
66
  /*
67
67
  * Copyright (c) Microsoft Corporation. All rights reserved.
68
68
  * Licensed under the MIT License.
@@ -301,7 +301,7 @@ const JsonWebTokenTypes$1 = {
301
301
  // Token renewal offset default in seconds
302
302
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
303
303
 
304
- /*! @azure/msal-common v16.15.0 2026-10-27 */
304
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
305
305
  /*
306
306
  * Copyright (c) Microsoft Corporation. All rights reserved.
307
307
  * Licensed under the MIT License.
@@ -330,7 +330,7 @@ function createAuthError(code, correlationId, additionalMessage) {
330
330
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
331
331
  }
332
332
 
333
- /*! @azure/msal-common v16.15.0 2026-10-27 */
333
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
334
334
 
335
335
  /*
336
336
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -353,7 +353,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
353
353
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
354
354
  }
355
355
 
356
- /*! @azure/msal-common v16.15.0 2026-10-27 */
356
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
357
357
  /*
358
358
  * Copyright (c) Microsoft Corporation. All rights reserved.
359
359
  * Licensed under the MIT License.
@@ -439,7 +439,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
439
439
  userCanceled: userCanceled
440
440
  });
441
441
 
442
- /*! @azure/msal-common v16.15.0 2026-10-27 */
442
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
443
443
 
444
444
  /*
445
445
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -477,7 +477,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
477
477
  };
478
478
  }
479
479
 
480
- /*! @azure/msal-common v16.15.0 2026-10-27 */
480
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
481
481
 
482
482
  /*
483
483
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -543,7 +543,7 @@ function getJWSPayload(authToken, correlationId) {
543
543
  return matches[2];
544
544
  }
545
545
 
546
- /*! @azure/msal-common v16.15.0 2026-10-27 */
546
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
547
547
 
548
548
  /*
549
549
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -631,7 +631,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
631
631
  return updatedAccountInfo;
632
632
  }
633
633
 
634
- /*! @azure/msal-common v16.15.0 2026-10-27 */
634
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
635
635
  /*
636
636
  * Copyright (c) Microsoft Corporation. All rights reserved.
637
637
  * Licensed under the MIT License.
@@ -645,7 +645,7 @@ const AuthorityType = {
645
645
  Ciam: 3,
646
646
  };
647
647
 
648
- /*! @azure/msal-common v16.15.0 2026-10-27 */
648
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
649
649
  /*
650
650
  * Copyright (c) Microsoft Corporation. All rights reserved.
651
651
  * Licensed under the MIT License.
@@ -667,7 +667,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
667
667
  return null;
668
668
  }
669
669
 
670
- /*! @azure/msal-common v16.15.0 2026-10-27 */
670
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
671
671
  /*
672
672
  * Copyright (c) Microsoft Corporation. All rights reserved.
673
673
  * Licensed under the MIT License.
@@ -691,7 +691,7 @@ const ProtocolMode = {
691
691
  EAR: "EAR",
692
692
  };
693
693
 
694
- /*! @azure/msal-common v16.15.0 2026-10-27 */
694
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
695
695
  /**
696
696
  * Returns the AccountInfo interface for this account.
697
697
  * @internal
@@ -880,7 +880,7 @@ function isAccountEntity(entity) {
880
880
  entity.hasOwnProperty("authorityType"));
881
881
  }
882
882
 
883
- /*! @azure/msal-common v16.15.0 2026-10-27 */
883
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
884
884
  /*
885
885
  * Copyright (c) Microsoft Corporation. All rights reserved.
886
886
  * Licensed under the MIT License.
@@ -897,7 +897,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
897
897
  unexpectedError: unexpectedError
898
898
  });
899
899
 
900
- /*! @azure/msal-common v16.15.0 2026-10-27 */
900
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
901
901
 
902
902
  /*
903
903
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -917,7 +917,7 @@ function createClientConfigurationError(errorCode, correlationId) {
917
917
  return new ClientConfigurationError(errorCode, correlationId);
918
918
  }
919
919
 
920
- /*! @azure/msal-common v16.15.0 2026-10-27 */
920
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
921
921
  /*
922
922
  * Copyright (c) Microsoft Corporation. All rights reserved.
923
923
  * Licensed under the MIT License.
@@ -957,7 +957,7 @@ function getResponseHeader(headers, name) {
957
957
  return headerName === undefined ? undefined : headers[headerName];
958
958
  }
959
959
 
960
- /*! @azure/msal-common v16.15.0 2026-10-27 */
960
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
961
961
  /*
962
962
  * Copyright (c) Microsoft Corporation. All rights reserved.
963
963
  * Licensed under the MIT License.
@@ -1027,7 +1027,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1027
1027
  urlParseError: urlParseError
1028
1028
  });
1029
1029
 
1030
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1030
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1031
1031
 
1032
1032
  /*
1033
1033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1086,7 +1086,7 @@ class AuthenticationHeaderParser {
1086
1086
  }
1087
1087
  }
1088
1088
 
1089
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1089
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1090
1090
  /*
1091
1091
  * Copyright (c) Microsoft Corporation. All rights reserved.
1092
1092
  * Licensed under the MIT License.
@@ -1098,7 +1098,7 @@ function isOpenIdConfigResponse(response) {
1098
1098
  response.hasOwnProperty("jwks_uri"));
1099
1099
  }
1100
1100
 
1101
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1101
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1102
1102
  /*
1103
1103
  * Copyright (c) Microsoft Corporation. All rights reserved.
1104
1104
  * Licensed under the MIT License.
@@ -1178,7 +1178,7 @@ class StringUtils {
1178
1178
  }
1179
1179
  }
1180
1180
 
1181
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1181
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1182
1182
 
1183
1183
  /*
1184
1184
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1336,7 +1336,7 @@ class UrlString {
1336
1336
  }
1337
1337
  }
1338
1338
 
1339
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1339
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1340
1340
 
1341
1341
  /*
1342
1342
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1490,7 +1490,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1490
1490
  return null;
1491
1491
  }
1492
1492
 
1493
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1493
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1494
1494
  /*
1495
1495
  * Copyright (c) Microsoft Corporation. All rights reserved.
1496
1496
  * Licensed under the MIT License.
@@ -1508,7 +1508,7 @@ const AzureCloudInstance = {
1508
1508
  AzureUsGovernment: "https://login.microsoftonline.us",
1509
1509
  };
1510
1510
 
1511
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1511
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1512
1512
  /*
1513
1513
  * Copyright (c) Microsoft Corporation. All rights reserved.
1514
1514
  * Licensed under the MIT License.
@@ -1518,7 +1518,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1518
1518
  response.hasOwnProperty("metadata"));
1519
1519
  }
1520
1520
 
1521
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1521
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1522
1522
  /*
1523
1523
  * Copyright (c) Microsoft Corporation. All rights reserved.
1524
1524
  * Licensed under the MIT License.
@@ -1528,7 +1528,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1528
1528
  response.hasOwnProperty("error_description"));
1529
1529
  }
1530
1530
 
1531
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1531
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1532
1532
  /*
1533
1533
  * Copyright (c) Microsoft Corporation. All rights reserved.
1534
1534
  * Licensed under the MIT License.
@@ -1599,7 +1599,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1599
1599
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1600
1600
  const SetUserData = "setUserData";
1601
1601
 
1602
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1602
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1603
1603
  /*
1604
1604
  * Copyright (c) Microsoft Corporation. All rights reserved.
1605
1605
  * Licensed under the MIT License.
@@ -1692,7 +1692,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1692
1692
  };
1693
1693
  };
1694
1694
 
1695
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1695
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1696
1696
 
1697
1697
  /*
1698
1698
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1803,7 +1803,7 @@ RegionDiscovery.IMDS_OPTIONS = {
1803
1803
  },
1804
1804
  };
1805
1805
 
1806
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1806
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1807
1807
  /*
1808
1808
  * Copyright (c) Microsoft Corporation. All rights reserved.
1809
1809
  * Licensed under the MIT License.
@@ -1868,7 +1868,7 @@ function wasClockTurnedBack(cachedAt) {
1868
1868
  return cachedAtSec > nowSeconds();
1869
1869
  }
1870
1870
 
1871
- /*! @azure/msal-common v16.15.0 2026-10-27 */
1871
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
1872
1872
 
1873
1873
  /*
1874
1874
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2155,7 +2155,7 @@ function serializeAttributeTokens(attributeTokens) {
2155
2155
  return [...attributeTokens].sort().join(" ");
2156
2156
  }
2157
2157
 
2158
- /*! @azure/msal-common v16.15.0 2026-10-27 */
2158
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
2159
2159
 
2160
2160
  /*
2161
2161
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3123,7 +3123,7 @@ function buildStaticAuthorityOptions(authOptions) {
3123
3123
  };
3124
3124
  }
3125
3125
 
3126
- /*! @azure/msal-common v16.15.0 2026-10-27 */
3126
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
3127
3127
 
3128
3128
  /*
3129
3129
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3157,7 +3157,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3157
3157
  }
3158
3158
  }
3159
3159
 
3160
- /*! @azure/msal-common v16.15.0 2026-10-27 */
3160
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
3161
3161
 
3162
3162
  /*
3163
3163
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3353,7 +3353,7 @@ class ScopeSet {
3353
3353
  }
3354
3354
  }
3355
3355
 
3356
- /*! @azure/msal-common v16.15.0 2026-10-27 */
3356
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
3357
3357
 
3358
3358
  /*
3359
3359
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3853,7 +3853,7 @@ function addAttributeTokens(parameters, attributeTokens) {
3853
3853
  }
3854
3854
  }
3855
3855
 
3856
- /*! @azure/msal-common v16.15.0 2026-10-27 */
3856
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
3857
3857
 
3858
3858
  /*
3859
3859
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3984,7 +3984,7 @@ function validateUrl(url, logger, correlationId) {
3984
3984
  }
3985
3985
  }
3986
3986
 
3987
- /*! @azure/msal-common v16.15.0 2026-10-27 */
3987
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
3988
3988
 
3989
3989
  /*
3990
3990
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4032,7 +4032,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
4032
4032
  },
4033
4033
  };
4034
4034
 
4035
- /*! @azure/msal-common v16.15.0 2026-10-27 */
4035
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
4036
4036
 
4037
4037
  /*
4038
4038
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4055,7 +4055,7 @@ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
4055
4055
  },
4056
4056
  };
4057
4057
 
4058
- /*! @azure/msal-common v16.15.0 2026-10-27 */
4058
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
4059
4059
  /*
4060
4060
  * Copyright (c) Microsoft Corporation. All rights reserved.
4061
4061
  * Licensed under the MIT License.
@@ -4344,12 +4344,12 @@ class Logger {
4344
4344
  }
4345
4345
  }
4346
4346
 
4347
- /*! @azure/msal-common v16.15.0 2026-10-27 */
4347
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
4348
4348
  /* eslint-disable header/header */
4349
4349
  const name$1 = "@azure/msal-common";
4350
- const version$1 = "16.15.0";
4350
+ const version$1 = "16.16.1";
4351
4351
 
4352
- /*! @azure/msal-common v16.15.0 2026-10-27 */
4352
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
4353
4353
  /*
4354
4354
  * Copyright (c) Microsoft Corporation. All rights reserved.
4355
4355
  * Licensed under the MIT License.
@@ -4357,7 +4357,7 @@ const version$1 = "16.15.0";
4357
4357
  const cacheQuotaExceeded = "cache_quota_exceeded";
4358
4358
  const cacheErrorUnknown = "cache_error_unknown";
4359
4359
 
4360
- /*! @azure/msal-common v16.15.0 2026-10-27 */
4360
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
4361
4361
 
4362
4362
  /*
4363
4363
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4395,7 +4395,7 @@ function createCacheError(e) {
4395
4395
  }
4396
4396
  }
4397
4397
 
4398
- /*! @azure/msal-common v16.15.0 2026-10-27 */
4398
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
4399
4399
 
4400
4400
  /*
4401
4401
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4644,6 +4644,7 @@ class CacheManager {
4644
4644
  };
4645
4645
  const tokenKeys = this.getTokenKeys();
4646
4646
  const currentScopes = ScopeSet.fromString(credential.target, correlationId);
4647
+ const accessTokenKeysToRemove = [];
4647
4648
  tokenKeys.accessToken.forEach((key) => {
4648
4649
  if (!this.accessTokenKeyMatchesFilter(key, accessTokenFilter, false)) {
4649
4650
  return;
@@ -4653,10 +4654,13 @@ class CacheManager {
4653
4654
  this.credentialMatchesFilter(tokenEntity, accessTokenFilter, correlationId)) {
4654
4655
  const tokenScopeSet = ScopeSet.fromString(tokenEntity.target, correlationId);
4655
4656
  if (tokenScopeSet.intersectingScopeSets(currentScopes)) {
4656
- this.removeAccessToken(key, correlationId);
4657
+ accessTokenKeysToRemove.push(key);
4657
4658
  }
4658
4659
  }
4659
4660
  });
4661
+ for (const key of accessTokenKeysToRemove) {
4662
+ await this.removeAccessTokenAndTokenBindingKey(key, correlationId, credential.keyId);
4663
+ }
4660
4664
  await this.setAccessTokenCredential(credential, correlationId, kmsi, additionalCacheKeyHash);
4661
4665
  }
4662
4666
  /**
@@ -4855,19 +4859,25 @@ class CacheManager {
4855
4859
  * @param account
4856
4860
  */
4857
4861
  removeAccount(account, correlationId) {
4858
- this.removeAccountContext(account, correlationId);
4859
4862
  const accountKeys = this.getAccountKeys();
4860
4863
  const keyFilter = (key) => {
4861
4864
  return (key.includes(account.homeAccountId) &&
4862
4865
  key.includes(account.environment));
4863
4866
  };
4867
+ this.getTokenKeys()
4868
+ .idToken.filter(keyFilter)
4869
+ .forEach((key) => {
4870
+ this.removeIdToken(key, correlationId);
4871
+ });
4872
+ this.removeAccountContext(account, correlationId);
4864
4873
  accountKeys.filter(keyFilter).forEach((key) => {
4865
4874
  this.removeItem(key, correlationId);
4866
4875
  this.performanceClient.incrementFields({ accountsRemoved: 1 }, correlationId);
4867
4876
  });
4868
4877
  }
4869
4878
  /**
4870
- * Removes credentials associated with the provided account
4879
+ * Removes access and refresh tokens associated with the provided account,
4880
+ * preserving the account and its ID tokens.
4871
4881
  * @param account
4872
4882
  */
4873
4883
  removeAccountContext(account, correlationId) {
@@ -4876,9 +4886,6 @@ class CacheManager {
4876
4886
  return (key.includes(account.homeAccountId) &&
4877
4887
  key.includes(account.environment));
4878
4888
  };
4879
- allTokenKeys.idToken.filter(keyFilter).forEach((key) => {
4880
- this.removeIdToken(key, correlationId);
4881
- });
4882
4889
  allTokenKeys.accessToken.filter(keyFilter).forEach((key) => {
4883
4890
  this.removeAccessToken(key, correlationId);
4884
4891
  });
@@ -4892,12 +4899,32 @@ class CacheManager {
4892
4899
  * @param correlationId
4893
4900
  */
4894
4901
  removeAccessToken(key, correlationId) {
4902
+ const credential = this.removeAccessTokenCredential(key, correlationId);
4903
+ if (credential) {
4904
+ void this.removeTokenBindingKeyForCredential(credential, correlationId);
4905
+ }
4906
+ }
4907
+ /**
4908
+ * Removes an access token and waits for any unreferenced token-binding key
4909
+ * cleanup. Internal callers that require deterministic cleanup should use
4910
+ * this method instead of the synchronous public cache contract.
4911
+ */
4912
+ async removeAccessTokenAndTokenBindingKey(key, correlationId, preservedKeyId) {
4913
+ const credential = this.removeAccessTokenCredential(key, correlationId);
4914
+ if (credential) {
4915
+ await this.removeTokenBindingKeyForCredential(credential, correlationId, preservedKeyId);
4916
+ }
4917
+ }
4918
+ removeAccessTokenCredential(key, correlationId) {
4895
4919
  const credential = this.getAccessTokenCredential(key, correlationId);
4896
4920
  if (!credential) {
4897
- return;
4921
+ return null;
4898
4922
  }
4899
4923
  this.removeItem(key, correlationId);
4900
4924
  this.performanceClient.incrementFields({ accessTokensRemoved: 1 }, correlationId);
4925
+ return credential;
4926
+ }
4927
+ async removeTokenBindingKeyForCredential(credential, correlationId, preservedKeyId) {
4901
4928
  // Remove Token Binding Key from key store for token-bound access token credentials
4902
4929
  if (credential.credentialType.toLowerCase() ===
4903
4930
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {
@@ -4907,19 +4934,28 @@ class CacheManager {
4907
4934
  case AuthenticationScheme$1.DPOP.toLowerCase(): {
4908
4935
  const accessTokenWithAuthSchemeEntity = credential;
4909
4936
  const kid = accessTokenWithAuthSchemeEntity.keyId;
4910
- if (kid) {
4911
- void this.tokenBindingKeyManager
4912
- .removeTokenBindingKey(kid, correlationId)
4913
- .catch(() => {
4937
+ if (kid &&
4938
+ kid !== preservedKeyId &&
4939
+ !this.isTokenBindingKeyReferenced(kid, correlationId)) {
4940
+ try {
4941
+ await this.tokenBindingKeyManager.removeTokenBindingKey(kid, correlationId);
4942
+ }
4943
+ catch {
4914
4944
  this.commonLogger.error("0id34f", correlationId);
4915
4945
  this.performanceClient?.incrementFields({ removeTokenBindingKeyFailure: 1 }, correlationId);
4916
- });
4946
+ }
4917
4947
  }
4918
4948
  break;
4919
4949
  }
4920
4950
  }
4921
4951
  }
4922
4952
  }
4953
+ isTokenBindingKeyReferenced(keyId, correlationId) {
4954
+ return this.getTokenKeys().accessToken.some((accessTokenKey) => {
4955
+ const accessToken = this.getAccessTokenCredential(accessTokenKey, correlationId);
4956
+ return accessToken?.keyId === keyId;
4957
+ });
4958
+ }
4923
4959
  /**
4924
4960
  * Removes all app metadata objects from cache.
4925
4961
  */
@@ -5058,6 +5094,7 @@ class CacheManager {
5058
5094
  const scopes = ScopeSet.createSearchScopes(request.scopes, correlationId);
5059
5095
  const authScheme = request.authenticationScheme ||
5060
5096
  AuthenticationScheme$1.BEARER;
5097
+ const normalizedAuthScheme = authScheme.toLowerCase();
5061
5098
  /*
5062
5099
  * Distinguish between Bearer and PoP/SSH token cache types
5063
5100
  * Cast to lowercase to handle "bearer" from ADFS
@@ -5083,7 +5120,10 @@ class CacheManager {
5083
5120
  tokenType: authScheme,
5084
5121
  keyId: authScheme === AuthenticationScheme$1.SSH
5085
5122
  ? request.sshKid
5086
- : undefined,
5123
+ : normalizedAuthScheme ===
5124
+ AuthenticationScheme$1.DPOP.toLowerCase()
5125
+ ? request.popKid || request.dpopJkt
5126
+ : undefined,
5087
5127
  additionalCacheKeyComponents: additionalCacheKeyComponents,
5088
5128
  };
5089
5129
  const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
@@ -5583,7 +5623,7 @@ class DefaultStorageClass extends CacheManager {
5583
5623
  }
5584
5624
  }
5585
5625
 
5586
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5626
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5587
5627
  /*
5588
5628
  * Copyright (c) Microsoft Corporation. All rights reserved.
5589
5629
  * Licensed under the MIT License.
@@ -5648,7 +5688,7 @@ const IntFields = new Set([
5648
5688
  "fetchRetryCount",
5649
5689
  ]);
5650
5690
 
5651
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5691
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5652
5692
 
5653
5693
  /*
5654
5694
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5706,7 +5746,7 @@ class StubPerformanceClient {
5706
5746
  }
5707
5747
  }
5708
5748
 
5709
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5749
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5710
5750
 
5711
5751
  /*
5712
5752
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5804,7 +5844,7 @@ function isOidcProtocolMode(config) {
5804
5844
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5805
5845
  }
5806
5846
 
5807
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5847
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5808
5848
  /*
5809
5849
  * Copyright (c) Microsoft Corporation. All rights reserved.
5810
5850
  * Licensed under the MIT License.
@@ -5831,7 +5871,7 @@ function isOidcProtocolMode(config) {
5831
5871
  }
5832
5872
  }
5833
5873
 
5834
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5874
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5835
5875
 
5836
5876
  /*
5837
5877
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5852,7 +5892,7 @@ function createJoseHeaderError(code, correlationId) {
5852
5892
  return new JoseHeaderError(code, correlationId);
5853
5893
  }
5854
5894
 
5855
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5895
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5856
5896
  /*
5857
5897
  * Copyright (c) Microsoft Corporation. All rights reserved.
5858
5898
  * Licensed under the MIT License.
@@ -5877,7 +5917,7 @@ function isPlainObject(value) {
5877
5917
  return Object.getPrototypeOf(value) === proto;
5878
5918
  }
5879
5919
 
5880
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5920
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5881
5921
  /*
5882
5922
  * Copyright (c) Microsoft Corporation. All rights reserved.
5883
5923
  * Licensed under the MIT License.
@@ -5887,7 +5927,7 @@ const missingAlgError = "missing_alg_error";
5887
5927
  const missingJwkError = "missing_jwk_error";
5888
5928
  const invalidJwkError = "invalid_jwk_error";
5889
5929
 
5890
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5930
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5891
5931
 
5892
5932
  /*
5893
5933
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5953,7 +5993,7 @@ class JoseHeader {
5953
5993
  }
5954
5994
  }
5955
5995
 
5956
- /*! @azure/msal-common v16.15.0 2026-10-27 */
5996
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
5957
5997
 
5958
5998
  /*
5959
5999
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6054,7 +6094,7 @@ class PopTokenGenerator {
6054
6094
  }
6055
6095
  }
6056
6096
 
6057
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6097
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6058
6098
 
6059
6099
  /*
6060
6100
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6104,13 +6144,22 @@ function validateDpopNonce(nonce, correlationId) {
6104
6144
  throw createClientConfigurationError(invalidDpopNonce, correlationId);
6105
6145
  }
6106
6146
  }
6147
+ /**
6148
+ * Validates and normalizes the HTTP resource context for a DPoP-bound request.
6149
+ * @internal
6150
+ */
6151
+ function normalizeDpopResourceRequestContext(context, correlationId = "") {
6152
+ return {
6153
+ htm: normalizeHtm(context.htm, correlationId),
6154
+ htu: normalizeHtu(context.htu, correlationId),
6155
+ };
6156
+ }
6107
6157
  /**
6108
6158
  * Builds RFC 9449 DPoP proof JWT payloads for token-endpoint and
6109
6159
  * resource-endpoint proof bindings.
6110
6160
  *
6111
- * Not exported from any public package entry point.
6112
- * This helper is internal-only until DPoP is wired into acquisition flows
6113
- * in a subsequent work item.
6161
+ * Exported from package entry points for use by MSAL Browser.
6162
+ * This helper remains an unsupported internal API for direct consumers.
6114
6163
  *
6115
6164
  * DPoP proofs do not contain SHR fields (at, ts, m, u, p, q).
6116
6165
  * @internal
@@ -6165,10 +6214,11 @@ class DpopProofGenerator {
6165
6214
  */
6166
6215
  buildResourceProofClaims(params, correlationId = "") {
6167
6216
  validateDpopNonce(params.nonce, correlationId);
6217
+ const resourceContext = normalizeDpopResourceRequestContext(params, correlationId);
6168
6218
  const claims = {
6169
6219
  jti: this.cryptoUtils.createNewGuid(),
6170
- htm: normalizeHtm(params.htm, correlationId),
6171
- htu: normalizeHtu(params.htu, correlationId),
6220
+ htm: resourceContext.htm,
6221
+ htu: resourceContext.htu,
6172
6222
  ath: params.ath,
6173
6223
  iat: nowSeconds(),
6174
6224
  };
@@ -6199,7 +6249,7 @@ class DpopProofGenerator {
6199
6249
  }
6200
6250
  }
6201
6251
 
6202
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6252
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6203
6253
  /*
6204
6254
  * Copyright (c) Microsoft Corporation. All rights reserved.
6205
6255
  * Licensed under the MIT License.
@@ -6263,7 +6313,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6263
6313
  uiNotAllowed: uiNotAllowed
6264
6314
  });
6265
6315
 
6266
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6316
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6267
6317
 
6268
6318
  /*
6269
6319
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6330,7 +6380,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
6330
6380
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6331
6381
  }
6332
6382
 
6333
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6383
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6334
6384
 
6335
6385
  /*
6336
6386
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6349,7 +6399,7 @@ class ServerError extends AuthError {
6349
6399
  }
6350
6400
  }
6351
6401
 
6352
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6402
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6353
6403
 
6354
6404
  /*
6355
6405
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6420,7 +6470,7 @@ function parseRequestState(base64Decode, state, correlationId) {
6420
6470
  }
6421
6471
  }
6422
6472
 
6423
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6473
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6424
6474
 
6425
6475
  /*
6426
6476
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6848,7 +6898,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6848
6898
  return baseAccount;
6849
6899
  }
6850
6900
 
6851
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6901
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6852
6902
  /*
6853
6903
  * Copyright (c) Microsoft Corporation. All rights reserved.
6854
6904
  * Licensed under the MIT License.
@@ -6858,7 +6908,7 @@ const CcsCredentialType = {
6858
6908
  UPN: "UPN",
6859
6909
  };
6860
6910
 
6861
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6911
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6862
6912
  /*
6863
6913
  * Copyright (c) Microsoft Corporation. All rights reserved.
6864
6914
  * Licensed under the MIT License.
@@ -6877,7 +6927,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
6877
6927
  }
6878
6928
  }
6879
6929
 
6880
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6930
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6881
6931
 
6882
6932
  /*
6883
6933
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6901,7 +6951,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
6901
6951
  };
6902
6952
  }
6903
6953
 
6904
- /*! @azure/msal-common v16.15.0 2026-10-27 */
6954
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6905
6955
 
6906
6956
  /*
6907
6957
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6991,7 +7041,7 @@ function getRetryAfterHeader(response) {
6991
7041
  return undefined;
6992
7042
  }
6993
7043
 
6994
- /*! @azure/msal-common v16.15.0 2026-10-27 */
7044
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
6995
7045
 
6996
7046
  /*
6997
7047
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7022,7 +7072,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
7022
7072
  return new NetworkError(error, httpStatus, responseHeaders);
7023
7073
  }
7024
7074
 
7025
- /*! @azure/msal-common v16.15.0 2026-10-27 */
7075
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
7026
7076
 
7027
7077
  /*
7028
7078
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7156,7 +7206,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
7156
7206
  return response;
7157
7207
  }
7158
7208
 
7159
- /*! @azure/msal-common v16.15.0 2026-10-27 */
7209
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
7160
7210
 
7161
7211
  /*
7162
7212
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7423,7 +7473,7 @@ class AuthorizationCodeClient {
7423
7473
  }
7424
7474
  }
7425
7475
 
7426
- /*! @azure/msal-common v16.15.0 2026-10-27 */
7476
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
7427
7477
 
7428
7478
  /*
7429
7479
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7653,7 +7703,7 @@ function extractLoginHint(account) {
7653
7703
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7654
7704
  }
7655
7705
 
7656
- /*! @azure/msal-common v16.15.0 2026-10-27 */
7706
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
7657
7707
 
7658
7708
  /*
7659
7709
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8202,7 +8252,7 @@ class PerformanceClient {
8202
8252
  }
8203
8253
  }
8204
8254
 
8205
- /*! @azure/msal-common v16.15.0 2026-10-27 */
8255
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
8206
8256
 
8207
8257
  /*
8208
8258
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8437,7 +8487,7 @@ class RefreshTokenClient {
8437
8487
  }
8438
8488
  }
8439
8489
 
8440
- /*! @azure/msal-common v16.15.0 2026-10-27 */
8490
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
8441
8491
 
8442
8492
  /*
8443
8493
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8730,7 +8780,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
8730
8780
  clearNativeBrokerErrorCode() { }
8731
8781
  }
8732
8782
 
8733
- /*! @azure/msal-common v16.15.0 2026-10-27 */
8783
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
8734
8784
 
8735
8785
  /*
8736
8786
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8857,7 +8907,7 @@ class SilentFlowClient {
8857
8907
  }
8858
8908
  }
8859
8909
 
8860
- /*! @azure/msal-common v16.15.0 2026-10-27 */
8910
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
8861
8911
 
8862
8912
  /*
8863
8913
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8873,7 +8923,7 @@ const StubbedNetworkModule = {
8873
8923
  },
8874
8924
  };
8875
8925
 
8876
- /*! @azure/msal-common v16.15.0 2026-10-27 */
8926
+ /*! @azure/msal-common v16.16.1 2026-11-06 */
8877
8927
 
8878
8928
  /*
8879
8929
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9022,6 +9072,7 @@ const PlatformAuthInteractionClientInitializeRequest = "platformAuthInteractionC
9022
9072
  const PlatformAuthHandleNativeResponse = "platformAuthHandleNativeResponse";
9023
9073
  const PlatformAuthCacheAccount = "platformAuthCacheAccount";
9024
9074
  const PlatformAuthCacheNativeTokens = "platformAuthCacheNativeTokens";
9075
+ const PlatformAuthDpopKeyCleanup = "platformAuthDpopKeyCleanup";
9025
9076
  const RemoveHiddenIframe = "removeHiddenIframe";
9026
9077
  const ImportExistingCache = "importExistingCache";
9027
9078
  /**
@@ -10582,6 +10633,19 @@ class AsyncMemoryStorage {
10582
10633
  return cacheKeys;
10583
10634
  }
10584
10635
  }
10636
+ /**
10637
+ * Returns whether a key is available in persistent storage. Unlike
10638
+ * containsKey, this does not consult the in-memory fallback.
10639
+ */
10640
+ async containsKeyInPersistentStorage(key, correlationId) {
10641
+ try {
10642
+ return await this.indexedDBCache.containsKey(key);
10643
+ }
10644
+ catch (e) {
10645
+ this.handleDatabaseAccessError(e, correlationId);
10646
+ return false;
10647
+ }
10648
+ }
10585
10649
  /**
10586
10650
  * Returns true or false if the given key is present in the cache.
10587
10651
  * @param key
@@ -10687,6 +10751,12 @@ class TokenBindingKeyManager {
10687
10751
  throw createClientAuthError(bindingKeyNotRemoved, correlationId);
10688
10752
  }
10689
10753
  }
10754
+ /**
10755
+ * Returns whether a browser token-binding key is available.
10756
+ */
10757
+ async hasTokenBindingKey(keyId, correlationId) {
10758
+ return this.cache.containsKey(keyId, correlationId);
10759
+ }
10690
10760
  /**
10691
10761
  * Clears browser token-binding keys from memory and persistent storage.
10692
10762
  * @param correlationId - Request correlation identifier.
@@ -10748,6 +10818,13 @@ class TokenBindingKeyManager {
10748
10818
  }
10749
10819
  return cachedKeyPair;
10750
10820
  }
10821
+ /**
10822
+ * Returns whether a browser token-binding key survived in persistent
10823
+ * storage and can be restored after a redirect navigation.
10824
+ */
10825
+ async isTokenBindingKeyPersisted(keyId, correlationId) {
10826
+ return this.cache.containsKeyInPersistentStorage(keyId, correlationId);
10827
+ }
10751
10828
  /** @internal */
10752
10829
  getTokenBindingKeyTelemetry(cachedKeyPair, fallbackAlgorithm) {
10753
10830
  return {
@@ -11581,7 +11658,7 @@ const EventType = {
11581
11658
 
11582
11659
  /* eslint-disable header/header */
11583
11660
  const name = "@azure/msal-browser";
11584
- const version = "5.27.0";
11661
+ const version = "5.29.0";
11585
11662
 
11586
11663
  /*
11587
11664
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -12213,7 +12290,7 @@ class BrowserCacheManager extends CacheManager {
12213
12290
  throw cacheError;
12214
12291
  }
12215
12292
  // When cache quota is exceeded, start removing access tokens until we can successfully set the item
12216
- this.removeAccessToken(accessTokenKeys[i], correlationId, false // Don't save token keys yet, do it at the end
12293
+ await this.removeAccessTokenAndTokenBindingKey(accessTokenKeys[i], correlationId, undefined, false // Don't save token keys yet, do it at the end
12217
12294
  );
12218
12295
  }
12219
12296
  else {
@@ -12355,6 +12432,13 @@ class BrowserCacheManager extends CacheManager {
12355
12432
  super.removeAccessToken(key, correlationId);
12356
12433
  updateTokenKeys && this.removeAccessTokenKeys([key], correlationId);
12357
12434
  }
12435
+ /**
12436
+ * Removes an access token and awaits token-binding key cleanup.
12437
+ */
12438
+ async removeAccessTokenAndTokenBindingKey(key, correlationId, preservedKeyId, updateTokenKeys = true) {
12439
+ await super.removeAccessTokenAndTokenBindingKey(key, correlationId, preservedKeyId);
12440
+ updateTokenKeys && this.removeAccessTokenKeys([key], correlationId);
12441
+ }
12358
12442
  /**
12359
12443
  * Remove access token key from the key map
12360
12444
  * @param key
@@ -13468,19 +13552,13 @@ function validateDpopRequest(request, correlationId) {
13468
13552
  }
13469
13553
  /**
13470
13554
  * Resolves the token-binding parameters needed before building authorize or token requests.
13471
- * Public PCA DPoP requests use a dpopJkt thumbprint, while platform broker PoP requests use
13472
- * a reqCnf confirmation claim. Requests that do not require request-time token binding return
13473
- * no additional parameters.
13555
+ * DPoP requests provision a browser key for token endpoint redemption. Platform broker
13556
+ * authorization requests retain the key for auth-code fallback but suppress dpop_jkt on
13557
+ * /authorize. Platform broker PoP requests use a reqCnf confirmation claim.
13474
13558
  */
13475
13559
  async function getTokenBindingRequestParams(request, tokenBindingKeyManager, logger, performanceClient) {
13476
13560
  switch (request.authenticationScheme) {
13477
13561
  case AuthenticationScheme$1.DPOP:
13478
- if (request.platformBroker) {
13479
- return {};
13480
- }
13481
- if (request.dpopJkt) {
13482
- return { dpopJkt: request.dpopJkt };
13483
- }
13484
13562
  return {
13485
13563
  dpopJkt: await tokenBindingKeyManager.provisionTokenBindingKey({
13486
13564
  tokenBindingKeyType: AuthenticationScheme$1.DPOP.toLowerCase(),
@@ -13503,6 +13581,36 @@ async function getTokenBindingRequestParams(request, tokenBindingKeyManager, log
13503
13581
  return {};
13504
13582
  }
13505
13583
  }
13584
+ /**
13585
+ * Removes a DPoP key that was provisioned for an authorization attempt which
13586
+ * did not complete. Cleanup failures are recorded without replacing the
13587
+ * original authorization error.
13588
+ */
13589
+ async function removeTokenBindingKeyOnFailure(request, tokenBindingKeyManager, logger, performanceClient) {
13590
+ if (request.authenticationScheme !== AuthenticationScheme$1.DPOP ||
13591
+ !request.dpopJkt) {
13592
+ return;
13593
+ }
13594
+ try {
13595
+ await tokenBindingKeyManager.removeTokenBindingKey(request.dpopJkt, request.correlationId);
13596
+ }
13597
+ catch {
13598
+ logger.error("1su7ne", request.correlationId);
13599
+ performanceClient.incrementFields({ removeTokenBindingKeyFailure: 1 }, request.correlationId);
13600
+ }
13601
+ }
13602
+ /**
13603
+ * Returns whether an MSAL-owned DPoP key is available in persistent storage
13604
+ * before a redirect navigation. Custom managers without a persistence probe
13605
+ * retain their existing behavior.
13606
+ */
13607
+ async function isTokenBindingKeyPersistedForRedirect(request, tokenBindingKeyManager) {
13608
+ const keyId = request.dpopJkt ?? request.keyId;
13609
+ if (!keyId || !tokenBindingKeyManager.isTokenBindingKeyPersisted) {
13610
+ return true;
13611
+ }
13612
+ return tokenBindingKeyManager.isTokenBindingKeyPersisted(keyId, request.correlationId);
13613
+ }
13506
13614
  /**
13507
13615
  * Initializer function for all request APIs
13508
13616
  * @param request
@@ -14190,12 +14298,26 @@ class InteractionHandler {
14190
14298
  * Copyright (c) Microsoft Corporation. All rights reserved.
14191
14299
  * Licensed under the MIT License.
14192
14300
  */
14301
+ /**
14302
+ * Key storage enclaves supported by the platform broker.
14303
+ */
14304
+ const PlatformAuthEnclave = {
14305
+ /**
14306
+ * Persisted software key using MS_KEY_STORAGE_PROVIDER.
14307
+ */
14308
+ SOFTWARE: "sw"};
14193
14309
  /**
14194
14310
  * Token types supported by the platform broker request contract.
14195
14311
  */
14196
14312
  const PlatformAuthTokenType = {
14197
14313
  DPOP_WITH_PROOF: "dpop+proof",
14198
14314
  };
14315
+ /**
14316
+ * Token binding preferences supported by the platform broker.
14317
+ */
14318
+ const PlatformAuthBindingPreference = {
14319
+ ATTESTED: "attested",
14320
+ };
14199
14321
  const PROOF_OF_POSSESSION_TOKEN_TYPES = [
14200
14322
  AuthenticationScheme$1.POP,
14201
14323
  AuthenticationScheme$1.DPOP,
@@ -14211,19 +14333,19 @@ function isProofOfPossessionTokenType(tokenType) {
14211
14333
  /**
14212
14334
  * Adds canonical proof request fields to the broker no-cache property bag.
14213
14335
  */
14214
- function createPlatformAuthExtraParametersNoCache(extraParametersNoCache, isProofOfPossessionRequest, resourceRequestMethod, resourceRequestUri, dpopNonce) {
14215
- if (!isProofOfPossessionRequest) {
14216
- return extraParametersNoCache;
14336
+ function createPlatformAuthExtraParametersNoCache(tokenType, resourceRequestMethod, resourceRequestUri, dpopNonce) {
14337
+ if (!isProofOfPossessionTokenType(tokenType)) {
14338
+ return undefined;
14217
14339
  }
14218
14340
  return {
14219
- ...extraParametersNoCache,
14220
14341
  ...(resourceRequestMethod && {
14221
14342
  pop_method: resourceRequestMethod,
14222
14343
  }),
14223
14344
  ...(resourceRequestUri && {
14224
14345
  pop_url: resourceRequestUri,
14225
14346
  }),
14226
- ...(dpopNonce && {
14347
+ ...(tokenType === PlatformAuthTokenType.DPOP_WITH_PROOF &&
14348
+ dpopNonce && {
14227
14349
  pop_nonce: dpopNonce,
14228
14350
  }),
14229
14351
  };
@@ -14371,6 +14493,7 @@ class SilentCacheClient extends StandardInteractionClient {
14371
14493
  * Copyright (c) Microsoft Corporation. All rights reserved.
14372
14494
  * Licensed under the MIT License.
14373
14495
  */
14496
+ const DPOP_POP_KID_NOT_SUPPORTED = "dpop_pop_kid_not_supported";
14374
14497
  class PlatformAuthInteractionClient extends BaseInteractionClient {
14375
14498
  constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId, tokenBindingKeyManager) {
14376
14499
  super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, tokenBindingKeyManager);
@@ -14428,35 +14551,43 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14428
14551
  }, e);
14429
14552
  throw e;
14430
14553
  }
14431
- // check if the tokens can be retrieved from internal cache
14432
- try {
14433
- const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
14434
- // Served from the native internal cache; token did not come directly from the broker
14435
- nativeATMeasurement.add({
14436
- isNativeBroker: false,
14437
- });
14438
- nativeATMeasurement.end({
14439
- success: true,
14440
- fromCache: true,
14441
- });
14442
- return result;
14443
- }
14444
- catch (e) {
14445
- if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
14446
- this.logger.info("0eitbc", this.correlationId);
14554
+ if (this.apiId === ApiId.acquireTokenSilent_silentFlow) {
14555
+ let cachedResult;
14556
+ try {
14557
+ cachedResult = await this.acquireTokensFromCache(this.accountId, nativeRequest, cacheLookupPolicy);
14558
+ }
14559
+ catch (e) {
14560
+ if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
14561
+ this.logger.info("0eitbc", this.correlationId);
14562
+ nativeATMeasurement.add({
14563
+ isNativeBroker: false,
14564
+ });
14565
+ nativeATMeasurement.end({
14566
+ success: false,
14567
+ });
14568
+ await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
14569
+ throw e;
14570
+ }
14571
+ // continue with a native call for any and all errors
14572
+ this.logger.info("0957j1", this.correlationId);
14573
+ }
14574
+ if (cachedResult) {
14575
+ // Served from the native internal cache; token did not come directly from the broker
14447
14576
  nativeATMeasurement.add({
14448
14577
  isNativeBroker: false,
14449
14578
  });
14450
14579
  nativeATMeasurement.end({
14451
- success: false,
14580
+ success: true,
14581
+ fromCache: true,
14452
14582
  });
14453
- throw e;
14583
+ await this.resetGeneratedDpopRequestKey(nativeRequest);
14584
+ return cachedResult;
14454
14585
  }
14455
- // continue with a native call for any and all errors
14456
- this.logger.info("0957j1", this.correlationId);
14457
14586
  }
14458
14587
  // dispatch the request to the broker
14459
14588
  try {
14589
+ await this.prepareDpopBrokerRequest(nativeRequest);
14590
+ this.addDpopBrokerAttemptTelemetry(nativeRequest);
14460
14591
  const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
14461
14592
  const result = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
14462
14593
  nativeATMeasurement.end({
@@ -14474,6 +14605,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14474
14605
  success: false,
14475
14606
  }, e);
14476
14607
  this.setBrokerErrorTelemetry(e);
14608
+ await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
14477
14609
  throw e;
14478
14610
  }
14479
14611
  }
@@ -14508,6 +14640,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14508
14640
  scopes: ScopeSet.fromString(request.scope, this.correlationId).asArray(),
14509
14641
  account: cachedAccount,
14510
14642
  forceRefresh: false,
14643
+ ...this.createSilentCacheTokenBindingParameters(request),
14511
14644
  resource: request.extraParameters?.resource,
14512
14645
  };
14513
14646
  // Preserve FMI partition semantics for silent cache filtering.
@@ -14517,12 +14650,41 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14517
14650
  return silentRequest;
14518
14651
  }
14519
14652
  /**
14520
- * Fetches the tokens from the cache if un-expired
14653
+ * Maps platform-broker token-binding state to silent-cache request fields.
14654
+ * @param request
14655
+ */
14656
+ createSilentCacheTokenBindingParameters(request) {
14657
+ const authenticationScheme = this.isDpopBrokerRequest(request)
14658
+ ? AuthenticationScheme$1.DPOP
14659
+ : request.tokenType;
14660
+ if (authenticationScheme !== AuthenticationScheme$1.DPOP &&
14661
+ authenticationScheme !== AuthenticationScheme$1.POP) {
14662
+ return { authenticationScheme };
14663
+ }
14664
+ return {
14665
+ authenticationScheme,
14666
+ ...(authenticationScheme === AuthenticationScheme$1.DPOP &&
14667
+ request.keyId && { dpopJkt: request.keyId }),
14668
+ ...(authenticationScheme === AuthenticationScheme$1.POP &&
14669
+ request.signPopToken === false &&
14670
+ request.keyId && { popKid: request.keyId }),
14671
+ resourceRequestMethod: request.resourceRequestMethod,
14672
+ resourceRequestUri: request.resourceRequestUri,
14673
+ };
14674
+ }
14675
+ /**
14676
+ * Fetches unexpired tokens when allowed by cache policy.
14521
14677
  * @param nativeAccountId
14522
14678
  * @param request
14523
- * @returns authenticationResult
14679
+ * @param cacheLookupPolicy
14680
+ * @returns Cached result, or undefined when cache policy bypasses lookup.
14524
14681
  */
14525
- async acquireTokensFromCache(nativeAccountId, request) {
14682
+ async acquireTokensFromCache(nativeAccountId, request, cacheLookupPolicy = CacheLookupPolicy.Default) {
14683
+ if (cacheLookupPolicy === CacheLookupPolicy.RefreshTokenAndNetwork ||
14684
+ cacheLookupPolicy === CacheLookupPolicy.Skip) {
14685
+ this.logger.verbose("03uwyk", this.correlationId);
14686
+ return undefined;
14687
+ }
14526
14688
  if (!nativeAccountId) {
14527
14689
  this.logger.warning("1ndf3e", this.correlationId);
14528
14690
  throw createClientAuthError(noAccountFound, this.correlationId);
@@ -14564,10 +14726,22 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14564
14726
  const nativeRequest = await invokeAsync(this.initializePlatformRequest.bind(this), PlatformAuthInteractionClientInitializeRequest, this.logger, this.performanceClient, this.correlationId)(request);
14565
14727
  const navigateToLoginRequestUrl = options?.navigateToLoginRequestUrl ?? true;
14566
14728
  try {
14567
- await this.platformAuthProvider.sendMessage(nativeRequest);
14729
+ await this.prepareDpopBrokerRequest(nativeRequest);
14730
+ this.addDpopBrokerAttemptTelemetry(nativeRequest);
14731
+ const response = await this.platformAuthProvider.sendMessage(nativeRequest);
14732
+ const dpopBrokerOutcome = this.validateDpopBrokerOutcome(response, nativeRequest);
14733
+ if (dpopBrokerOutcome === "L3") {
14734
+ await this.resetGeneratedDpopRequestKey(nativeRequest);
14735
+ }
14568
14736
  }
14569
14737
  catch (e) {
14570
- // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
14738
+ /*
14739
+ * Raw persistent/transient broker errors are retrieved again in
14740
+ * phase two. Availability errors are thrown for controller-managed
14741
+ * web fallback, while translated cancellation, network, and
14742
+ * interaction-required errors are surfaced without being swallowed.
14743
+ */
14744
+ await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
14571
14745
  if (e instanceof NativeAuthError) {
14572
14746
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
14573
14747
  serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
@@ -14582,6 +14756,16 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14582
14756
  throw e;
14583
14757
  }
14584
14758
  }
14759
+ else if (this.isDpopBrokerRequest(nativeRequest)) {
14760
+ throw e;
14761
+ }
14762
+ }
14763
+ try {
14764
+ await this.ensureRedirectDpopKeyIsPersisted(nativeRequest);
14765
+ }
14766
+ catch (e) {
14767
+ await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
14768
+ throw e;
14585
14769
  }
14586
14770
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify({
14587
14771
  ...nativeRequest,
@@ -14596,7 +14780,14 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14596
14780
  ? UrlString.getAbsoluteUrl(request.redirectStartPage || window.location.href, getCurrentUri(), this.correlationId)
14597
14781
  : getRedirectUri(request.redirectUri, this.config.auth.redirectUri, this.logger, this.correlationId);
14598
14782
  rootMeasurement.end({ success: true });
14599
- await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again
14783
+ try {
14784
+ await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again
14785
+ }
14786
+ catch (e) {
14787
+ this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
14788
+ await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
14789
+ throw e;
14790
+ }
14600
14791
  }
14601
14792
  /**
14602
14793
  * If the previous page called native platform for a token using redirect APIs, send the same request again and return the response
@@ -14629,6 +14820,8 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14629
14820
  this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
14630
14821
  const reqTimestamp = nowSeconds();
14631
14822
  try {
14823
+ await this.prepareDpopBrokerRequest(request, true);
14824
+ this.addDpopBrokerAttemptTelemetry(request);
14632
14825
  this.logger.verbose("003x5a", this.correlationId);
14633
14826
  const response = await this.platformAuthProvider.sendMessage(request);
14634
14827
  const authResult = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(response, request, reqTimestamp, storeInCache);
@@ -14637,7 +14830,12 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14637
14830
  return authResult;
14638
14831
  }
14639
14832
  catch (e) {
14833
+ if (e instanceof NativeAuthError) {
14834
+ const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
14835
+ serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
14836
+ }
14640
14837
  this.setBrokerErrorTelemetry(e);
14838
+ await this.resetGeneratedDpopRequestKeyBestEffort(request);
14641
14839
  throw e;
14642
14840
  }
14643
14841
  }
@@ -14657,6 +14855,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14657
14855
  */
14658
14856
  async handleNativeResponse(response, request, reqTimestamp, storeInCache) {
14659
14857
  this.logger.trace("1bojln", this.correlationId);
14858
+ const dpopBrokerOutcome = this.validateDpopBrokerOutcome(response, request);
14660
14859
  // generate identifiers
14661
14860
  const idTokenClaims = extractTokenClaims(response.id_token, base64Decode, this.correlationId);
14662
14861
  const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);
@@ -14682,10 +14881,17 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14682
14881
  response.expires_in = Number(response.expires_in);
14683
14882
  // generate authenticationResult
14684
14883
  const result = await invokeAsync(this.generateAuthenticationResult.bind(this), NativeGenerateAuthResult, this.logger, this.performanceClient, this.correlationId)(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
14884
+ const isL3DpopResponse = dpopBrokerOutcome === "L3";
14685
14885
  // cache accounts and tokens in the appropriate storage
14686
- await invokeAsync(this.cacheAccount.bind(this), PlatformAuthCacheAccount, this.logger, this.performanceClient, this.correlationId)(baseAccount, isKmsi(idTokenClaims));
14886
+ const shouldRemoveGeneratedDpopKey = isL3DpopResponse ||
14887
+ (this.isDpopBrokerRequest(request) &&
14888
+ storeInCache?.accessToken === false);
14889
+ if (shouldRemoveGeneratedDpopKey) {
14890
+ await this.resetGeneratedDpopRequestKey(request);
14891
+ }
14892
+ await invokeAsync(this.cacheAccount.bind(this), PlatformAuthCacheAccount, this.logger, this.performanceClient, this.correlationId)(baseAccount, isKmsi(idTokenClaims), !isL3DpopResponse);
14687
14893
  await invokeAsync(this.cacheNativeTokens.bind(this), PlatformAuthCacheNativeTokens, this.logger, this.performanceClient, this.correlationId)(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
14688
- storeInCache);
14894
+ storeInCache, dpopBrokerOutcome);
14689
14895
  return result;
14690
14896
  }
14691
14897
  /**
@@ -14761,7 +14967,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14761
14967
  */
14762
14968
  async generateAuthenticationResult(response, request, idTokenClaims, accountEntity, authority, reqTimestamp) {
14763
14969
  // Add Native Broker fields to Telemetry
14764
- const mats = this.addTelemetryFromNativeResponse(response.properties.MATS);
14970
+ const mats = this.addTelemetryFromNativeResponse(response.properties?.MATS);
14765
14971
  // If scopes not returned in server response, use request scopes
14766
14972
  const responseScopes = this.generateScopes(request.scope, response.scope);
14767
14973
  const accountProperties = response.account.properties || {};
@@ -14787,9 +14993,17 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14787
14993
  }
14788
14994
  // generate PoP token as needed
14789
14995
  const responseAccessToken = await this.generatePopAccessToken(response, request);
14790
- const tokenType = request.tokenType === AuthenticationScheme$1.POP
14791
- ? AuthenticationScheme$1.POP
14792
- : AuthenticationScheme$1.BEARER;
14996
+ const isDpopRequest = this.isDpopBrokerRequest(request);
14997
+ let tokenType = AuthenticationScheme$1.BEARER;
14998
+ if (isDpopRequest) {
14999
+ tokenType = AuthenticationScheme$1.DPOP;
15000
+ }
15001
+ else if (request.tokenType === AuthenticationScheme$1.POP) {
15002
+ tokenType = AuthenticationScheme$1.POP;
15003
+ }
15004
+ const dpopProof = isDpopRequest
15005
+ ? await this.generateDpopProof(response, request)
15006
+ : undefined;
14793
15007
  const result = {
14794
15008
  authority: authority,
14795
15009
  uniqueId: uid,
@@ -14803,6 +15017,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14803
15017
  // Request timestamp and NativeResponse expires_in are in seconds, converting to Date for AuthenticationResult
14804
15018
  expiresOn: toDateFromSeconds(reqTimestamp + response.expires_in),
14805
15019
  tokenType: tokenType,
15020
+ dpopProof,
14806
15021
  correlationId: this.correlationId,
14807
15022
  state: response.state,
14808
15023
  fromPlatformBroker: true,
@@ -14816,11 +15031,13 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14816
15031
  * cache the account entity in browser storage
14817
15032
  * @param accountEntity
14818
15033
  */
14819
- async cacheAccount(accountEntity, kmsi) {
15034
+ async cacheAccount(accountEntity, kmsi, clearExistingTokens = true) {
14820
15035
  // Store the account info and hence `nativeAccountId` in browser cache
14821
15036
  await this.browserStorage.setAccount(accountEntity, this.correlationId, kmsi, this.apiId);
14822
- // Remove any existing cached tokens for this account in browser storage
14823
- this.browserStorage.removeAccountContext(getAccountInfo(accountEntity), this.correlationId);
15037
+ // Remove cached web access and refresh tokens, preserving ID tokens.
15038
+ if (clearExistingTokens) {
15039
+ this.browserStorage.removeAccountContext(getAccountInfo(accountEntity), this.correlationId);
15040
+ }
14824
15041
  }
14825
15042
  /**
14826
15043
  * Stores the access_token and id_token in inmemory storage
@@ -14832,8 +15049,18 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14832
15049
  * @param tenantId
14833
15050
  * @param reqTimestamp
14834
15051
  */
14835
- async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache) {
15052
+ async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache, dpopBrokerOutcome = "none") {
14836
15053
  const cachedIdToken = createIdTokenEntity(homeAccountIdentifier, environment, response.id_token || "", request.clientId, idTokenClaims.tid || "");
15054
+ // save idtoken credential in configured browser storage
15055
+ if (!!cachedIdToken && storeInCache?.idToken !== false) {
15056
+ await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, isKmsi(idTokenClaims));
15057
+ }
15058
+ if (dpopBrokerOutcome === "L3") {
15059
+ return;
15060
+ }
15061
+ if (storeInCache?.accessToken === false) {
15062
+ return;
15063
+ }
14837
15064
  // cache accessToken in inmemory storage
14838
15065
  const expiresIn = request.tokenType === AuthenticationScheme$1.POP
14839
15066
  ? SHR_NONCE_VALIDITY
@@ -14843,18 +15070,14 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14843
15070
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
14844
15071
  const responseScopes = this.generateScopes(response.scope, request.scope);
14845
15072
  const additionalCacheKeyComponents = request.attributeTokens
14846
- ? {
14847
- attribute_tokens: request.attributeTokens,
14848
- }
15073
+ ? { attribute_tokens: request.attributeTokens }
14849
15074
  : undefined;
14850
- 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);
15075
+ const cachedAccessToken = createAccessTokenEntity(homeAccountIdentifier, environment, response.access_token, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, request.correlationId, undefined, this.isDpopBrokerRequest(request)
15076
+ ? AuthenticationScheme$1.DPOP
15077
+ : request.tokenType, undefined, request.keyId, additionalCacheKeyComponents);
14851
15078
  if (request.extraParameters?.resource) {
14852
15079
  cachedAccessToken.resource = request.extraParameters.resource;
14853
15080
  }
14854
- // save idtoken credential in configured browser storage
14855
- if (!!cachedIdToken && storeInCache?.idToken !== false) {
14856
- await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, isKmsi(idTokenClaims));
14857
- }
14858
15081
  // save access token credential in memory storage
14859
15082
  const nativeCacheRecord = {
14860
15083
  accessToken: cachedAccessToken,
@@ -14931,11 +15154,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14931
15154
  const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
14932
15155
  ? undefined
14933
15156
  : this.config.auth.clientCapabilities;
14934
- /*
14935
- * 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.
14936
- * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
14937
- */
14938
- const { scopes, claims, extraParametersNoCache, dpopNonce } = request;
15157
+ const { scopes, claims, dpopNonce } = request;
14939
15158
  const scopeSet = new ScopeSet([...(scopes || []), ...OIDC_DEFAULT_SCOPES$1], this.correlationId);
14940
15159
  const mergedClaims = buildMergedClaims$1(claims, configClaims?.length ? configClaims : undefined);
14941
15160
  const hasAttributeTokens = !!request.attributeTokens?.length;
@@ -14959,57 +15178,391 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14959
15178
  loginHint: request.loginHint,
14960
15179
  extraParameters: {
14961
15180
  ...request.extraParameters,
14962
- ...(request.resource && { resource: request.resource }), // resource is set for MCP scenarios
15181
+ // Native broker resource is set for MCP scenarios.
15182
+ ...(request.resource && { resource: request.resource }),
14963
15183
  },
14964
15184
  extendedExpiryToken: false,
14965
15185
  keyId: request.popKid,
14966
- resourceRequestMethod: request.resourceRequestMethod,
14967
- resourceRequestUri: request.resourceRequestUri,
14968
- shrClaims: request.shrClaims,
14969
- shrNonce: request.shrNonce,
14970
- extraParametersNoCache: createPlatformAuthExtraParametersNoCache(extraParametersNoCache, isProofOfPossessionTokenType(request.authenticationScheme), request.resourceRequestMethod, request.resourceRequestUri, dpopNonce),
14971
15186
  };
14972
15187
  if (hasAttributeTokens) {
14973
15188
  validatedRequest.attributeTokens =
14974
15189
  serializeAttributeTokens(request.attributeTokens);
14975
15190
  }
14976
- // Check for PoP token requests: signPopToken should only be set to true if popKid is not set
14977
- if (validatedRequest.signPopToken && !!request.popKid) {
14978
- throw createBrowserAuthError(invalidPopTokenRequest, this.correlationId);
14979
- }
14980
15191
  this.handleExtraBrokerParams(validatedRequest, request.embeddedClientId);
14981
15192
  validatedRequest.extraParameters =
14982
15193
  validatedRequest.extraParameters || {};
14983
15194
  validatedRequest.extraParameters.telemetry =
14984
15195
  PlatformAuthConstants.MATS_TELEMETRY;
14985
15196
  if (request.authenticationScheme === AuthenticationScheme$1.POP) {
14986
- // add POP request type
14987
15197
  const shrParameters = {
14988
- resourceRequestUri: request.resourceRequestUri,
14989
15198
  resourceRequestMethod: request.resourceRequestMethod,
15199
+ resourceRequestUri: request.resourceRequestUri,
14990
15200
  shrClaims: request.shrClaims,
14991
15201
  shrNonce: request.shrNonce,
14992
15202
  correlationId: this.correlationId,
14993
15203
  };
14994
15204
  const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.tokenBindingKeyManager, this.performanceClient);
14995
- // generate reqCnf if not provided in the request
14996
- let reqCnfData;
14997
15205
  if (!validatedRequest.keyId) {
14998
15206
  const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, this.correlationId)(shrParameters, this.logger);
14999
- reqCnfData = generatedReqCnfData.reqCnfString;
15207
+ validatedRequest.reqCnf = generatedReqCnfData.reqCnfString;
15000
15208
  validatedRequest.keyId = generatedReqCnfData.kid;
15001
15209
  validatedRequest.signPopToken = true;
15002
15210
  }
15003
15211
  else {
15004
- reqCnfData = this.browserCrypto.base64UrlEncode(JSON.stringify({ kid: validatedRequest.keyId }));
15212
+ validatedRequest.reqCnf = this.browserCrypto.base64UrlEncode(JSON.stringify({ kid: validatedRequest.keyId }));
15005
15213
  validatedRequest.signPopToken = false;
15006
15214
  }
15007
- // SPAs require whole string to be passed to broker
15008
- validatedRequest.reqCnf = reqCnfData;
15215
+ validatedRequest.resourceRequestMethod =
15216
+ request.resourceRequestMethod;
15217
+ validatedRequest.resourceRequestUri = request.resourceRequestUri;
15218
+ validatedRequest.shrClaims = request.shrClaims;
15219
+ validatedRequest.shrNonce = request.shrNonce;
15220
+ }
15221
+ else if (request.authenticationScheme === AuthenticationScheme$1.DPOP) {
15222
+ Object.assign(validatedRequest, this.createDpopRequestParameters(request));
15009
15223
  }
15224
+ validatedRequest.extraParametersNoCache =
15225
+ createPlatformAuthExtraParametersNoCache(validatedRequest.tokenType, validatedRequest.resourceRequestMethod, validatedRequest.resourceRequestUri, dpopNonce);
15010
15226
  this.addRequestSKUs(validatedRequest);
15011
15227
  return validatedRequest;
15012
15228
  }
15229
+ /**
15230
+ * Creates and validates the broker-specific parameters for a DPoP request.
15231
+ * @param request - Developer-provided token request.
15232
+ * @returns Broker parameters for a DPoP token and resource proof.
15233
+ */
15234
+ createDpopRequestParameters(request) {
15235
+ if (request.popKid) {
15236
+ throw createBrowserAuthError(DPOP_POP_KID_NOT_SUPPORTED, this.correlationId);
15237
+ }
15238
+ if (!request.resourceRequestMethod?.trim() ||
15239
+ !request.resourceRequestUri?.trim()) {
15240
+ throw createClientConfigurationError(dpopMissingResourceContext, this.correlationId);
15241
+ }
15242
+ const resourceContext = normalizeDpopResourceRequestContext({
15243
+ htm: request.resourceRequestMethod,
15244
+ htu: request.resourceRequestUri,
15245
+ }, this.correlationId);
15246
+ return {
15247
+ tokenType: PlatformAuthTokenType.DPOP_WITH_PROOF,
15248
+ preferBinding: PlatformAuthBindingPreference.ATTESTED,
15249
+ keyId: request.dpopJkt,
15250
+ resourceRequestMethod: resourceContext.htm,
15251
+ resourceRequestUri: resourceContext.htu,
15252
+ };
15253
+ }
15254
+ /**
15255
+ * Provisions the local key and confirmation data for a DPoP broker request.
15256
+ * @param request - Broker request to prepare.
15257
+ * @param reuseExistingKey - Whether a complete existing key binding may be reused.
15258
+ */
15259
+ async prepareDpopBrokerRequest(request, reuseExistingKey = false) {
15260
+ if (request.tokenType !== PlatformAuthTokenType.DPOP_WITH_PROOF) {
15261
+ return;
15262
+ }
15263
+ /*
15264
+ * Phase one clears both fields after an L3 response or non-fatal broker
15265
+ * error. In that case phase two must provision a replacement. If either
15266
+ * field remains, treat it as a retained binding and validate it fully.
15267
+ */
15268
+ if (reuseExistingKey && (request.keyId || request.reqCnf)) {
15269
+ if (!request.keyId || !request.reqCnf) {
15270
+ throw createAuthError(unexpectedError, this.correlationId, "DPoP request key binding is incomplete after redirect.");
15271
+ }
15272
+ const expectedReqCnf = this.createDpopBrokerReqCnf(request.keyId);
15273
+ if (request.reqCnf !== expectedReqCnf) {
15274
+ throw createAuthError(unexpectedError, this.correlationId, "DPoP request key binding is invalid after redirect.");
15275
+ }
15276
+ const hasKey = this.tokenBindingKeyManager.hasTokenBindingKey !== undefined
15277
+ ? await this.tokenBindingKeyManager.hasTokenBindingKey(request.keyId, this.correlationId)
15278
+ : await this.tokenBindingKeyManager
15279
+ .getTokenBindingPublicKeyJwk(request.keyId, this.correlationId)
15280
+ .then(() => true, () => false);
15281
+ if (!hasKey) {
15282
+ throw createAuthError(unexpectedError, this.correlationId, "DPoP request key is unavailable after redirect.");
15283
+ }
15284
+ return;
15285
+ }
15286
+ if (request.reqCnf) {
15287
+ throw createAuthError(unexpectedError, this.correlationId, "Unexpected preexisting DPoP request key.");
15288
+ }
15289
+ if (!request.keyId) {
15290
+ request.keyId =
15291
+ await this.tokenBindingKeyManager.provisionTokenBindingKey({
15292
+ tokenBindingKeyType: AuthenticationScheme$1.DPOP.toLowerCase(),
15293
+ tokenBindingKeyAlgorithm: JsonWebTokenAlgorithms.ES256,
15294
+ correlationId: this.correlationId,
15295
+ });
15296
+ }
15297
+ request.reqCnf = this.createDpopBrokerReqCnf(request.keyId);
15298
+ }
15299
+ /**
15300
+ * Creates the confirmation claim for an MSAL-owned broker DPoP key.
15301
+ * @param keyId - Browser-managed DPoP key identifier.
15302
+ * @returns Encoded broker confirmation claim.
15303
+ */
15304
+ createDpopBrokerReqCnf(keyId) {
15305
+ return this.browserCrypto.base64UrlEncode(JSON.stringify({
15306
+ kid: keyId,
15307
+ xms_ksl: PlatformAuthInteractionClient.MSAL_DPOP_KEY_STORAGE_LOCATION,
15308
+ }));
15309
+ }
15310
+ /**
15311
+ * Ensures an owned DPoP key can survive redirect navigation before the
15312
+ * request metadata is persisted for phase two.
15313
+ */
15314
+ async ensureRedirectDpopKeyIsPersisted(request) {
15315
+ if (!this.isDpopBrokerRequest(request) || !request.keyId) {
15316
+ return;
15317
+ }
15318
+ if (!(await isTokenBindingKeyPersistedForRedirect(request, this.tokenBindingKeyManager))) {
15319
+ throw createAuthError(unexpectedError, this.correlationId, "DPoP request key could not be persisted for redirect.");
15320
+ }
15321
+ }
15322
+ /**
15323
+ * Validates and normalizes the DPoP binding outcome returned by the broker.
15324
+ * @param response - Broker response to validate.
15325
+ * @param request - Broker request associated with the response.
15326
+ * @returns The validated DPoP binding level, or `none` for non-DPoP requests.
15327
+ */
15328
+ validateDpopBrokerOutcome(response, request) {
15329
+ const isDpopRequest = this.isDpopBrokerRequest(request);
15330
+ const normalizedResponse = this.normalizeDpopBrokerResponse(response);
15331
+ const normalizedRequestTokenType = request.tokenType
15332
+ ?.trim()
15333
+ .toLowerCase();
15334
+ const bindingPreferenceSent = request.bindingPreferenceSent ??
15335
+ request.preferBinding !== undefined;
15336
+ const hasDpopResponse = this.isDpopBrokerTokenType(normalizedResponse.tokenType) ||
15337
+ normalizedResponse.proof !== undefined ||
15338
+ normalizedResponse.hasBindingAttested;
15339
+ if (!isDpopRequest) {
15340
+ if (hasDpopResponse) {
15341
+ this.throwInvalidDpopResponse("unexpected_response", "Unexpected DPoP broker response.");
15342
+ }
15343
+ return "none";
15344
+ }
15345
+ if (!this.isDpopBrokerTokenType(normalizedResponse.tokenType)) {
15346
+ this.throwInvalidDpopResponse("unknown_token_type", "Unknown DPoP broker response.");
15347
+ }
15348
+ this.validateNormalizedDpopBrokerResponse(normalizedResponse, bindingPreferenceSent);
15349
+ if (normalizedResponse.tokenType ===
15350
+ PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase()) {
15351
+ return this.validateDpopBrokerL3Outcome(normalizedRequestTokenType, normalizedResponse);
15352
+ }
15353
+ return this.validateDpopBrokerL1Outcome(request, normalizedRequestTokenType, normalizedResponse, bindingPreferenceSent);
15354
+ }
15355
+ /**
15356
+ * Normalizes the canonical DPoP fields returned under response properties.
15357
+ */
15358
+ normalizeDpopBrokerResponse(response) {
15359
+ const responseProperties = response.properties;
15360
+ const rawTokenType = responseProperties?.token_type;
15361
+ const tokenType = typeof rawTokenType === "string"
15362
+ ? rawTokenType.trim().toLowerCase()
15363
+ : undefined;
15364
+ const rawBindingAttested = responseProperties?.binding_attested;
15365
+ let bindingAttested;
15366
+ if (typeof rawBindingAttested === "string") {
15367
+ const normalizedBindingAttested = rawBindingAttested
15368
+ .trim()
15369
+ .toLowerCase();
15370
+ if (normalizedBindingAttested === "true") {
15371
+ bindingAttested = true;
15372
+ }
15373
+ else if (normalizedBindingAttested === "false") {
15374
+ bindingAttested = false;
15375
+ }
15376
+ }
15377
+ return {
15378
+ tokenType,
15379
+ proof: responseProperties?.DPoP,
15380
+ bindingAttested,
15381
+ hasBindingAttested: rawBindingAttested !== undefined,
15382
+ hasMalformedBindingAttested: rawBindingAttested !== undefined &&
15383
+ bindingAttested === undefined,
15384
+ };
15385
+ }
15386
+ /**
15387
+ * Validates normalized fields shared by L1 and L3 broker DPoP responses.
15388
+ */
15389
+ validateNormalizedDpopBrokerResponse(normalizedResponse, bindingPreferenceSent) {
15390
+ if (normalizedResponse.hasMalformedBindingAttested) {
15391
+ this.throwInvalidDpopResponse("invalid_attestation", "Conflicting DPoP broker response.");
15392
+ }
15393
+ if (bindingPreferenceSent &&
15394
+ normalizedResponse.bindingAttested === undefined) {
15395
+ this.throwInvalidDpopResponse("missing_attestation", "Conflicting DPoP broker response.");
15396
+ }
15397
+ }
15398
+ /**
15399
+ * Validates a broker-returned L3 DPoP proof outcome.
15400
+ */
15401
+ validateDpopBrokerL3Outcome(normalizedRequestTokenType, normalizedResponse) {
15402
+ const dpopWithProofTokenType = PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase();
15403
+ if (typeof normalizedResponse.proof !== "string" ||
15404
+ normalizedResponse.proof.trim().length === 0) {
15405
+ this.throwInvalidDpopResponse("missing_proof", "Malformed DPoP broker response.");
15406
+ }
15407
+ if (normalizedResponse.bindingAttested !== true) {
15408
+ this.throwInvalidDpopResponse("invalid_attestation", "Malformed DPoP broker response.");
15409
+ }
15410
+ if (normalizedRequestTokenType !== dpopWithProofTokenType ||
15411
+ normalizedResponse.tokenType !== dpopWithProofTokenType) {
15412
+ this.throwInvalidDpopResponse("conflicting_fields", "Malformed DPoP broker response.");
15413
+ }
15414
+ this.performanceClient.addFields({
15415
+ "ext.brokerDpopOutcome": "l3",
15416
+ "ext.brokerDpopBindingLevel": "L3",
15417
+ }, this.correlationId);
15418
+ return "L3";
15419
+ }
15420
+ /**
15421
+ * Validates an L1 DPoP outcome that MSAL will sign with its local key.
15422
+ */
15423
+ validateDpopBrokerL1Outcome(request, normalizedRequestTokenType, normalizedResponse, bindingPreferenceSent) {
15424
+ if (normalizedResponse.proof !== undefined) {
15425
+ this.throwInvalidDpopResponse("conflicting_fields", "Malformed DPoP broker L1 response.");
15426
+ }
15427
+ if (normalizedRequestTokenType !==
15428
+ PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase()) {
15429
+ this.throwInvalidDpopResponse("conflicting_fields", "Malformed DPoP broker L1 response.");
15430
+ }
15431
+ if (normalizedResponse.bindingAttested !== false &&
15432
+ !(!bindingPreferenceSent &&
15433
+ normalizedResponse.bindingAttested === undefined)) {
15434
+ this.throwInvalidDpopResponse("invalid_attestation", "Malformed DPoP broker L1 response.");
15435
+ }
15436
+ if (!request.reqCnf || !request.keyId) {
15437
+ this.throwInvalidDpopResponse("missing_l1_binding", "Malformed DPoP broker L1 response.");
15438
+ }
15439
+ this.performanceClient.addFields({
15440
+ "ext.brokerDpopOutcome": "l1",
15441
+ "ext.brokerDpopBindingLevel": "L1",
15442
+ }, this.correlationId);
15443
+ return "L1";
15444
+ }
15445
+ /**
15446
+ * Emits bounded failure telemetry and rejects an invalid DPoP response.
15447
+ */
15448
+ throwInvalidDpopResponse(failureReason, message) {
15449
+ this.performanceClient.addFields({
15450
+ "ext.brokerDpopOutcome": "invalid_response",
15451
+ "ext.brokerDpopFailureReason": failureReason,
15452
+ }, this.correlationId);
15453
+ throw createAuthError(unexpectedError, this.correlationId, message);
15454
+ }
15455
+ /**
15456
+ * Returns the broker proof or signs an L1 resource proof with the local key.
15457
+ * @param response - Broker response containing the access token and optional proof.
15458
+ * @param request - Broker request containing the proof context and local key.
15459
+ * @returns The resource proof for the broker access token.
15460
+ */
15461
+ async generateDpopProof(response, request) {
15462
+ const brokerProof = response.properties?.DPoP;
15463
+ if (brokerProof !== undefined) {
15464
+ return brokerProof;
15465
+ }
15466
+ const dpopProofGenerator = new DpopProofGenerator(this.browserCrypto, this.tokenBindingKeyManager);
15467
+ return dpopProofGenerator.generateResourceProof({
15468
+ htu: request.resourceRequestUri,
15469
+ htm: request.resourceRequestMethod,
15470
+ accessToken: response.access_token,
15471
+ nonce: request.extraParametersNoCache?.pop_nonce,
15472
+ }, request.keyId, this.correlationId);
15473
+ }
15474
+ /**
15475
+ * Removes a generated DPoP request key and clears its request metadata.
15476
+ * @param request - Broker request whose generated key should be removed.
15477
+ */
15478
+ async resetGeneratedDpopRequestKey(request) {
15479
+ if (!this.isDpopBrokerRequest(request) || !request.keyId) {
15480
+ return;
15481
+ }
15482
+ const cleanupMeasurement = this.performanceClient.startMeasurement(PlatformAuthDpopKeyCleanup, this.correlationId);
15483
+ this.performanceClient.incrementFields({ "ext.brokerDpopKeyCleanupAttemptCount": 1 }, this.correlationId);
15484
+ try {
15485
+ if (request.keyId && !(await this.removeDpopKey(request.keyId))) {
15486
+ throw createAuthError(unexpectedError, this.correlationId, "Failed to remove generated DPoP request key.");
15487
+ }
15488
+ this.performanceClient.addFields({
15489
+ "ext.brokerDpopKeyCleanupOutcome": "succeeded",
15490
+ }, this.correlationId);
15491
+ cleanupMeasurement.end({ success: true });
15492
+ request.keyId = undefined;
15493
+ request.reqCnf = undefined;
15494
+ }
15495
+ catch (error) {
15496
+ this.performanceClient.addFields({
15497
+ "ext.brokerDpopKeyCleanupOutcome": "failed",
15498
+ }, this.correlationId);
15499
+ this.performanceClient.incrementFields({ "ext.brokerDpopKeyCleanupFailureCount": 1 }, this.correlationId);
15500
+ cleanupMeasurement.end({ success: false }, error);
15501
+ throw error;
15502
+ }
15503
+ }
15504
+ /**
15505
+ * Attempts to remove a generated DPoP request key without replacing an
15506
+ * existing operation error with a cleanup failure.
15507
+ * @param request - Broker request whose generated key should be removed.
15508
+ */
15509
+ async resetGeneratedDpopRequestKeyBestEffort(request) {
15510
+ try {
15511
+ await this.resetGeneratedDpopRequestKey(request);
15512
+ }
15513
+ catch {
15514
+ this.logger.error("1kxxak", this.correlationId);
15515
+ this.performanceClient.incrementFields({ removeTokenBindingKeyFailure: 1 }, this.correlationId);
15516
+ request.keyId = undefined;
15517
+ request.reqCnf = undefined;
15518
+ }
15519
+ }
15520
+ /**
15521
+ * Records that a DPoP request is about to be dispatched to the platform broker.
15522
+ * @param request - Broker request about to cross the provider boundary.
15523
+ */
15524
+ addDpopBrokerAttemptTelemetry(request) {
15525
+ if (!this.isDpopBrokerRequest(request)) {
15526
+ return;
15527
+ }
15528
+ this.performanceClient.addFields({
15529
+ "ext.brokerDpopAttempted": 1,
15530
+ }, this.correlationId);
15531
+ }
15532
+ /**
15533
+ * Determines whether a request uses the DPoP broker protocol.
15534
+ * @param request - Broker request to inspect.
15535
+ * @returns Whether the request uses a DPoP token type.
15536
+ */
15537
+ isDpopBrokerRequest(request) {
15538
+ return this.isDpopBrokerTokenType(request.tokenType);
15539
+ }
15540
+ /**
15541
+ * Determines whether a token type represents a DPoP broker request.
15542
+ * @param tokenType - Token type to inspect.
15543
+ * @returns Whether the token type is a supported DPoP broker token type.
15544
+ */
15545
+ isDpopBrokerTokenType(tokenType) {
15546
+ const normalizedTokenType = tokenType?.trim().toLowerCase();
15547
+ return (normalizedTokenType === PlatformAuthTokenType.DPOP_WITH_PROOF ||
15548
+ normalizedTokenType ===
15549
+ AuthenticationScheme$1.DPOP.toLowerCase());
15550
+ }
15551
+ /**
15552
+ * Removes a DPoP key while reporting cleanup failures.
15553
+ * @param keyId - Identifier of the DPoP key to remove.
15554
+ * @returns Whether the key was removed successfully.
15555
+ */
15556
+ async removeDpopKey(keyId) {
15557
+ try {
15558
+ await this.tokenBindingKeyManager.removeTokenBindingKey(keyId, this.correlationId);
15559
+ return true;
15560
+ }
15561
+ catch {
15562
+ this.logger.error("1w60e4", this.correlationId);
15563
+ return false;
15564
+ }
15565
+ }
15013
15566
  async getCanonicalAuthority(request) {
15014
15567
  const requestAuthority = request.authority || this.config.auth.authority;
15015
15568
  const { azureCloudOptions, account } = request;
@@ -15048,29 +15601,28 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
15048
15601
  }
15049
15602
  }
15050
15603
  /**
15051
- * Handles extra broker request parameters
15052
- * @param request {PlatformAuthRequest}
15053
- * @private
15604
+ * Handles extra broker request parameters.
15605
+ * @param request - Platform broker request.
15606
+ * @param embeddedClientId - Embedded application client identifier.
15054
15607
  */
15055
15608
  handleExtraBrokerParams(request, embeddedClientId) {
15056
- const hasExtraBrokerParams = request.extraParameters &&
15057
- request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
15058
- request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
15059
- request.extraParameters.hasOwnProperty(CLIENT_ID);
15609
+ const hasOwnParameter = (parameter) => Object.prototype.hasOwnProperty.call(request.extraParameters, parameter);
15610
+ const hasExtraBrokerParams = hasOwnParameter(BROKER_CLIENT_ID) &&
15611
+ hasOwnParameter(BROKER_REDIRECT_URI) &&
15612
+ hasOwnParameter(CLIENT_ID);
15060
15613
  if (!embeddedClientId && !hasExtraBrokerParams) {
15061
15614
  return;
15062
15615
  }
15063
- let child_client_id = "";
15064
- const child_redirect_uri = request.redirectUri;
15616
+ const childRedirectUri = request.redirectUri;
15617
+ const childClientId = embeddedClientId ||
15618
+ request.extraParameters?.[CLIENT_ID] ||
15619
+ "";
15065
15620
  if (embeddedClientId) {
15066
15621
  request.redirectUri = this.config.auth.redirectUri;
15067
- child_client_id = embeddedClientId;
15068
15622
  }
15069
15623
  else if (request.extraParameters) {
15070
15624
  request.redirectUri =
15071
15625
  request.extraParameters[BROKER_REDIRECT_URI];
15072
- child_client_id =
15073
- request.extraParameters[CLIENT_ID];
15074
15626
  }
15075
15627
  const {
15076
15628
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -15081,15 +15633,20 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
15081
15633
  [CLIENT_ID]: _clientId, ...remainingExtraParameters } = request.extraParameters || {};
15082
15634
  request.extraParameters = {
15083
15635
  ...remainingExtraParameters,
15084
- child_client_id,
15085
- child_redirect_uri,
15636
+ child_client_id: childClientId,
15637
+ child_redirect_uri: childRedirectUri,
15086
15638
  };
15087
15639
  this.performanceClient?.addFields({
15088
- embeddedClientId: child_client_id,
15089
- embeddedRedirectUri: child_redirect_uri,
15640
+ embeddedClientId: childClientId,
15641
+ embeddedRedirectUri: childRedirectUri,
15090
15642
  }, this.correlationId);
15091
15643
  }
15092
- }
15644
+ }
15645
+ /**
15646
+ * Storage location reported for MSAL-owned browser DPoP keys in reqCnf.
15647
+ * This does not constrain the binding selected by the platform broker.
15648
+ */
15649
+ PlatformAuthInteractionClient.MSAL_DPOP_KEY_STORAGE_LOCATION = PlatformAuthEnclave.SOFTWARE;
15093
15650
 
15094
15651
  /*
15095
15652
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -15195,6 +15752,7 @@ async function getStandardParameters(config, authority, request, logger, perform
15195
15752
  }
15196
15753
  }
15197
15754
  if (request.authenticationScheme === AuthenticationScheme$1.DPOP &&
15755
+ !request.platformBroker &&
15198
15756
  request.dpopJkt) {
15199
15757
  parameters.set(DPOP_JKT, request.dpopJkt);
15200
15758
  }
@@ -15318,19 +15876,25 @@ function createForm(frame, action, fields) {
15318
15876
  * @param nativeMessageHandler
15319
15877
  * @returns
15320
15878
  */
15321
- async function handleResponsePlatformBroker(request, accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider) {
15879
+ async function handleResponsePlatformBroker(request, accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager = new TokenBindingKeyManager(logger, performanceClient)) {
15322
15880
  logger.verbose("11qcow", request.correlationId);
15323
15881
  if (!platformAuthProvider) {
15324
15882
  throw createBrowserAuthError(nativeConnectionNotEstablished, request.correlationId);
15325
15883
  }
15326
15884
  const browserCrypto = new CryptoOps(logger, performanceClient);
15327
- const nativeInteractionClient = new PlatformAuthInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, config.system.navigationClient, apiId, performanceClient, platformAuthProvider, accountId, nativeStorage, request.correlationId);
15885
+ const nativeInteractionClient = new PlatformAuthInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, config.system.navigationClient, apiId, performanceClient, platformAuthProvider, accountId, nativeStorage, request.correlationId, tokenBindingKeyManager);
15328
15886
  const { userRequestState } = parseRequestState(browserCrypto.base64Decode, request.state, request.correlationId);
15329
- return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)({
15330
- ...request,
15331
- state: userRequestState,
15332
- prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
15333
- });
15887
+ try {
15888
+ return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)({
15889
+ ...request,
15890
+ state: userRequestState,
15891
+ prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
15892
+ });
15893
+ }
15894
+ catch (e) {
15895
+ await removeTokenBindingKeyOnFailure(request, tokenBindingKeyManager, logger, performanceClient);
15896
+ throw e;
15897
+ }
15334
15898
  }
15335
15899
  /**
15336
15900
  * Response handler when server returns code on the /authorize request
@@ -15343,13 +15907,13 @@ async function handleResponsePlatformBroker(request, accountId, apiId, config, b
15343
15907
  * @param performanceClient
15344
15908
  * @returns
15345
15909
  */
15346
- async function handleResponseCode(request, response, codeVerifier, apiId, config, authClient, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider) {
15910
+ async function handleResponseCode(request, response, codeVerifier, apiId, config, authClient, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager = new TokenBindingKeyManager(logger, performanceClient)) {
15347
15911
  // Remove throttle if it exists
15348
15912
  ThrottlingUtils.removeThrottle(browserStorage, config.auth.clientId, request);
15349
15913
  // Instrument clientdata telemetry fields from the authorize response
15350
15914
  instrumentClientData(response, request.correlationId, performanceClient);
15351
15915
  if (response.accountId) {
15352
- return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, response.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider);
15916
+ return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, response.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
15353
15917
  }
15354
15918
  const authCodeRequest = {
15355
15919
  ...request,
@@ -15377,7 +15941,7 @@ async function handleResponseCode(request, response, codeVerifier, apiId, config
15377
15941
  * @param nativeMessageHandler
15378
15942
  * @returns
15379
15943
  */
15380
- async function handleResponseEAR(request, response, apiId, config, authority, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider) {
15944
+ async function handleResponseEAR(request, response, apiId, config, authority, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager = new TokenBindingKeyManager(logger, performanceClient)) {
15381
15945
  // Remove throttle if it exists
15382
15946
  ThrottlingUtils.removeThrottle(browserStorage, config.auth.clientId, request);
15383
15947
  // Instrument clientdata telemetry fields from the authorize response
@@ -15392,9 +15956,9 @@ async function handleResponseEAR(request, response, apiId, config, authority, br
15392
15956
  }
15393
15957
  const decryptedData = JSON.parse(await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe));
15394
15958
  if (decryptedData.accountId) {
15395
- return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider);
15959
+ return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
15396
15960
  }
15397
- const responseHandler = new ResponseHandler(config.auth.clientId, browserStorage, new CryptoOps(logger, performanceClient), logger, performanceClient, null, null, new TokenBindingKeyManager(logger, performanceClient));
15961
+ const responseHandler = new ResponseHandler(config.auth.clientId, browserStorage, new CryptoOps(logger, performanceClient), logger, performanceClient, null, null, tokenBindingKeyManager);
15398
15962
  // Validate response. This function throws a server error if an error is returned by the server.
15399
15963
  responseHandler.validateTokenResponse(decryptedData, request.correlationId);
15400
15964
  // Temporary until response handler is refactored to be more flow agnostic.
@@ -15841,6 +16405,7 @@ class PlatformAuthExtensionHandler {
15841
16405
  const extensionRequest = { ...request };
15842
16406
  delete extensionRequest.resourceRequestMethod;
15843
16407
  delete extensionRequest.resourceRequestUri;
16408
+ delete extensionRequest.bindingPreferenceSent;
15844
16409
  const messageBody = {
15845
16410
  method: NativeExtensionMethod.GetToken,
15846
16411
  request: extensionRequest,
@@ -15852,8 +16417,9 @@ class PlatformAuthExtensionHandler {
15852
16417
  body: messageBody,
15853
16418
  };
15854
16419
  this.logger.trace(`1qadfi ${this.platformAuthType}`, correlationId);
15855
- this.logger.tracePii(`1xm533 ${this.platformAuthType} ${JSON.stringify(req)}`, correlationId);
15856
16420
  this.messageChannel.port1.postMessage(req);
16421
+ request.bindingPreferenceSent =
16422
+ extensionRequest.preferBinding !== undefined;
15857
16423
  const response = await new Promise((resolve, reject) => {
15858
16424
  this.resolvers.set(req.responseId, {
15859
16425
  resolve,
@@ -16050,13 +16616,11 @@ class PlatformAuthExtensionHandler {
16050
16616
  try {
16051
16617
  const response = request.body.response;
16052
16618
  this.logger.trace(`19hpgm ${this.platformAuthType}`, correlationId);
16053
- this.logger.tracePii(`179a24 ${this.platformAuthType} ${JSON.stringify(response)}`, correlationId);
16054
16619
  if (response.status !== "Success") {
16055
16620
  resolver.reject(createNativeAuthError(response.code, correlationId, response.description, response.ext));
16056
16621
  }
16057
16622
  else if (response.result) {
16058
- if (response.result["code"] &&
16059
- response.result["description"]) {
16623
+ if (response.result["code"]) {
16060
16624
  resolver.reject(createNativeAuthError(response.result["code"], correlationId, response.result["description"], response.result["ext"]));
16061
16625
  }
16062
16626
  else {
@@ -16137,11 +16701,12 @@ class PlatformAuthExtensionHandler {
16137
16701
  Object.prototype.hasOwnProperty.call(response, "account") &&
16138
16702
  Object.prototype.hasOwnProperty.call(response, "scope") &&
16139
16703
  Object.prototype.hasOwnProperty.call(response, "expires_in")) {
16704
+ const validatedResponse = response;
16140
16705
  validationMeasurement.end({
16141
16706
  success: true,
16142
16707
  platformAuthProviderType: this.platformAuthType,
16143
16708
  });
16144
- return response;
16709
+ return validatedResponse;
16145
16710
  }
16146
16711
  else {
16147
16712
  const error = createAuthError(unexpectedError, responseCorrelationId, "Response missing expected properties.");
@@ -16183,6 +16748,7 @@ class PlatformAuthExtensionHandler {
16183
16748
  * Copyright (c) Microsoft Corporation. All rights reserved.
16184
16749
  * Licensed under the MIT License.
16185
16750
  */
16751
+ const PLATFORM_AUTH_DOM_DPOP_NOT_SUPPORTED = "platform_auth_dom_dpop_not_supported";
16186
16752
  class PlatformAuthDOMHandler {
16187
16753
  constructor(logger, performanceClient, correlationId) {
16188
16754
  this.logger = logger;
@@ -16262,6 +16828,10 @@ class PlatformAuthDOMHandler {
16262
16828
  });
16263
16829
  this.logger.trace(`02bcil ${this.platformAuthType}`, correlationId);
16264
16830
  try {
16831
+ if (request.tokenType?.trim().toLowerCase() ===
16832
+ PlatformAuthTokenType.DPOP_WITH_PROOF) {
16833
+ throw createBrowserAuthError(PLATFORM_AUTH_DOM_DPOP_NOT_SUPPORTED, correlationId);
16834
+ }
16265
16835
  const platformDOMRequest = invoke(this.initializePlatformDOMRequest.bind(this), PlatformAuthDOMInitializeRequest, this.logger, this.performanceClient, correlationId)(request);
16266
16836
  const response =
16267
16837
  // @ts-ignore
@@ -16288,6 +16858,7 @@ class PlatformAuthDOMHandler {
16288
16858
  this.logger.trace(`15d6yv ${this.platformAuthType}`, requestCorrelationId);
16289
16859
  delete remainingProperties.resourceRequestMethod;
16290
16860
  delete remainingProperties.resourceRequestUri;
16861
+ delete remainingProperties.bindingPreferenceSent;
16291
16862
  const validExtraParameters = this.getDOMExtraParams(remainingProperties, requestCorrelationId);
16292
16863
  const platformDOMRequest = {
16293
16864
  accountId: accountId,
@@ -16515,7 +17086,9 @@ function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvid
16515
17086
  logger.trace("0uko3r", correlationId);
16516
17087
  const schemeSupported = !authenticationScheme ||
16517
17088
  authenticationScheme === AuthenticationScheme$1.BEARER ||
16518
- authenticationScheme === AuthenticationScheme$1.POP;
17089
+ authenticationScheme === AuthenticationScheme$1.POP ||
17090
+ (authenticationScheme === AuthenticationScheme$1.DPOP &&
17091
+ !(platformAuthProvider instanceof PlatformAuthDOMHandler));
16519
17092
  const fields = {
16520
17093
  allowPlatformBroker: config.system.allowPlatformBroker,
16521
17094
  ...(config.system.allowPlatformBroker && {
@@ -16712,12 +17285,13 @@ class PopupClient extends StandardInteractionClient {
16712
17285
  // Wait for the redirect bridge response
16713
17286
  const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent);
16714
17287
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
16715
- return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
17288
+ return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
16716
17289
  }
16717
17290
  }
16718
17291
  catch (e) {
16719
17292
  // Close the synchronous popup if an error is thrown before the window unload event is registered
16720
17293
  popupParams.popup?.close();
17294
+ await removeTokenBindingKeyOnFailure(popupRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
16721
17295
  if (e instanceof AuthError) {
16722
17296
  e.correlationId = this.correlationId;
16723
17297
  serverTelemetryManager.cacheFailedRequest(e);
@@ -16744,23 +17318,29 @@ class PopupClient extends StandardInteractionClient {
16744
17318
  ...tokenBindingParams,
16745
17319
  popupOriginCheckDone: this.getPopupOriginCheckDone(popupParams.popupWindowParent),
16746
17320
  };
16747
- const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
16748
- // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
16749
- const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent);
16750
- const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
16751
- if (!serverParams.ear_jwe && serverParams.code) {
16752
- const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, correlationId)({
16753
- serverTelemetryManager: initializeServerTelemetryManager(ApiId.acquireTokenPopup, this.config.auth.clientId, correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled),
16754
- requestAuthority: request.authority,
16755
- requestAzureCloudOptions: request.azureCloudOptions,
16756
- requestExtraQueryParameters: request.extraQueryParameters,
16757
- account: request.account,
16758
- authority: discoveredAuthority,
16759
- });
16760
- return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
17321
+ try {
17322
+ const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
17323
+ // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
17324
+ const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent);
17325
+ const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17326
+ if (!serverParams.ear_jwe && serverParams.code) {
17327
+ const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, correlationId)({
17328
+ serverTelemetryManager: initializeServerTelemetryManager(ApiId.acquireTokenPopup, this.config.auth.clientId, correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled),
17329
+ requestAuthority: request.authority,
17330
+ requestAzureCloudOptions: request.azureCloudOptions,
17331
+ requestExtraQueryParameters: request.extraQueryParameters,
17332
+ account: request.account,
17333
+ authority: discoveredAuthority,
17334
+ });
17335
+ return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17336
+ }
17337
+ else {
17338
+ return await invokeAsync(handleResponseEAR, HandleResponseEar, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, ApiId.acquireTokenPopup, this.config, discoveredAuthority, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17339
+ }
16761
17340
  }
16762
- else {
16763
- return invokeAsync(handleResponseEAR, HandleResponseEar, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, ApiId.acquireTokenPopup, this.config, discoveredAuthority, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
17341
+ catch (e) {
17342
+ await removeTokenBindingKeyOnFailure(popupRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17343
+ throw e;
16764
17344
  }
16765
17345
  }
16766
17346
  async executeCodeFlowWithPost(request, popupParams, authClient, pkceVerifier) {
@@ -16771,7 +17351,7 @@ class PopupClient extends StandardInteractionClient {
16771
17351
  // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
16772
17352
  const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(request, popupWindow, popupParams.popupWindowParent);
16773
17353
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
16774
- return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(request, serverParams, pkceVerifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
17354
+ return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(request, serverParams, pkceVerifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
16775
17355
  }
16776
17356
  /**
16777
17357
  *
@@ -17159,8 +17739,11 @@ class RedirectClient extends StandardInteractionClient {
17159
17739
  codeChallenge: pkceCodes.challenge,
17160
17740
  ...tokenBindingParams,
17161
17741
  };
17162
- this.browserStorage.cacheAuthorizeRequest(redirectRequest, this.correlationId, pkceCodes.verifier);
17163
17742
  try {
17743
+ if (!(await isTokenBindingKeyPersistedForRedirect(redirectRequest, this.tokenBindingKeyManager))) {
17744
+ throw createBrowserAuthError(cryptoKeyNotFound, this.correlationId);
17745
+ }
17746
+ this.browserStorage.cacheAuthorizeRequest(redirectRequest, this.correlationId, pkceCodes.verifier);
17164
17747
  if (redirectRequest.httpMethod === HttpMethod.POST) {
17165
17748
  return await this.executeCodeFlowWithPost(redirectRequest);
17166
17749
  }
@@ -17180,6 +17763,7 @@ class RedirectClient extends StandardInteractionClient {
17180
17763
  }
17181
17764
  }
17182
17765
  catch (e) {
17766
+ await removeTokenBindingKeyOnFailure(redirectRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17183
17767
  if (e instanceof AuthError) {
17184
17768
  e.correlationId = this.correlationId;
17185
17769
  serverTelemetryManager.cacheFailedRequest(e);
@@ -17204,14 +17788,23 @@ class RedirectClient extends StandardInteractionClient {
17204
17788
  codeChallenge: pkceCodes.challenge,
17205
17789
  ...tokenBindingParams,
17206
17790
  };
17207
- this.browserStorage.cacheAuthorizeRequest(redirectRequest, this.correlationId, pkceCodes.verifier);
17208
- const form = await getEARForm(document, this.config, discoveredAuthority, redirectRequest, this.logger, this.performanceClient);
17209
- form.submit();
17210
- return new Promise((resolve, reject) => {
17211
- setTimeout(() => {
17212
- reject(createBrowserAuthError(timedOut, "", "failed_to_redirect"));
17213
- }, this.config.system.redirectNavigationTimeout);
17214
- });
17791
+ try {
17792
+ if (!(await isTokenBindingKeyPersistedForRedirect(redirectRequest, this.tokenBindingKeyManager))) {
17793
+ throw createBrowserAuthError(cryptoKeyNotFound, this.correlationId);
17794
+ }
17795
+ this.browserStorage.cacheAuthorizeRequest(redirectRequest, this.correlationId, pkceCodes.verifier);
17796
+ const form = await getEARForm(document, this.config, discoveredAuthority, redirectRequest, this.logger, this.performanceClient);
17797
+ form.submit();
17798
+ return await new Promise((resolve, reject) => {
17799
+ setTimeout(() => {
17800
+ reject(createBrowserAuthError(timedOut, "", "failed_to_redirect"));
17801
+ }, this.config.system.redirectNavigationTimeout);
17802
+ });
17803
+ }
17804
+ catch (e) {
17805
+ await removeTokenBindingKeyOnFailure(redirectRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17806
+ throw e;
17807
+ }
17215
17808
  }
17216
17809
  /**
17217
17810
  * Executes classic Authorization Code flow with a POST request.
@@ -17250,6 +17843,7 @@ class RedirectClient extends StandardInteractionClient {
17250
17843
  if (!serverParams) {
17251
17844
  // Not a recognized server response hash or hash not associated with a redirect request
17252
17845
  this.logger.info("1qmv0q", this.correlationId);
17846
+ await removeTokenBindingKeyOnFailure(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17253
17847
  this.browserStorage.resetRequestCache(this.correlationId);
17254
17848
  // Do not instrument "no_server_response" if user clicked back button
17255
17849
  if (getNavigationType() !== "back_forward") {
@@ -17319,6 +17913,7 @@ class RedirectClient extends StandardInteractionClient {
17319
17913
  return null;
17320
17914
  }
17321
17915
  catch (e) {
17916
+ await removeTokenBindingKeyOnFailure(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17322
17917
  if (e instanceof AuthError) {
17323
17918
  e.correlationId = this.correlationId;
17324
17919
  serverTelemetryManager.cacheFailedRequest(e);
@@ -17385,10 +17980,10 @@ class RedirectClient extends StandardInteractionClient {
17385
17980
  const { authority, azureCloudOptions, extraQueryParameters, account } = request;
17386
17981
  if (serverParams.ear_jwe) {
17387
17982
  const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, request.correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
17388
- return invokeAsync(handleResponseEAR, HandleResponseEar, this.logger, this.performanceClient, request.correlationId)(request, serverParams, ApiId.acquireTokenRedirect, this.config, discoveredAuthority, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
17983
+ return invokeAsync(handleResponseEAR, HandleResponseEar, this.logger, this.performanceClient, request.correlationId)(request, serverParams, ApiId.acquireTokenRedirect, this.config, discoveredAuthority, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17389
17984
  }
17390
17985
  const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)({ serverTelemetryManager, requestAuthority: request.authority });
17391
- return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, request.correlationId)(request, serverParams, codeVerifier, ApiId.acquireTokenRedirect, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
17986
+ return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, request.correlationId)(request, serverParams, codeVerifier, ApiId.acquireTokenRedirect, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17392
17987
  }
17393
17988
  /**
17394
17989
  * Redirects window to given URL.
@@ -17719,10 +18314,10 @@ class SilentIframeClient extends StandardInteractionClient {
17719
18314
  account: request.account,
17720
18315
  authority: discoveredAuthority,
17721
18316
  });
17722
- return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(silentRequest, serverParams, pkceCodes.verifier, this.apiId, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
18317
+ return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(silentRequest, serverParams, pkceCodes.verifier, this.apiId, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17723
18318
  }
17724
18319
  else {
17725
- return invokeAsync(handleResponseEAR, HandleResponseEar, this.logger, this.performanceClient, correlationId)(silentRequest, serverParams, this.apiId, this.config, discoveredAuthority, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
18320
+ return invokeAsync(handleResponseEAR, HandleResponseEar, this.logger, this.performanceClient, correlationId)(silentRequest, serverParams, this.apiId, this.config, discoveredAuthority, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17726
18321
  }
17727
18322
  }
17728
18323
  /**
@@ -17772,7 +18367,13 @@ class SilentIframeClient extends StandardInteractionClient {
17772
18367
  */
17773
18368
  async silentTokenHelper(authClient, request) {
17774
18369
  const { serverParams, pkceCodes, silentRequest } = await this.silentAuthorizeHelper(authClient, request);
17775
- return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, request.correlationId)(silentRequest, serverParams, pkceCodes.verifier, this.apiId, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
18370
+ try {
18371
+ return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, request.correlationId)(silentRequest, serverParams, pkceCodes.verifier, this.apiId, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
18372
+ }
18373
+ catch (e) {
18374
+ await removeTokenBindingKeyOnFailure(silentRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
18375
+ throw e;
18376
+ }
17776
18377
  }
17777
18378
  /**
17778
18379
  * Shared helper that generates PKCE codes, builds the /authorize URL,
@@ -17789,38 +18390,44 @@ class SilentIframeClient extends StandardInteractionClient {
17789
18390
  codeChallenge: pkceCodes.challenge,
17790
18391
  ...tokenBindingParams,
17791
18392
  };
17792
- // Create the iframe, register the response listener, then navigate, so the listener is active before the iframe can respond.
17793
- const iframe = createHiddenIframe();
17794
- const responseType = this.config.auth.OIDCOptions.responseMode;
17795
- // Wait for response from the redirect bridge.
17796
- let responseString;
17797
18393
  try {
17798
- const responsePromise = invokeAsync(this.waitForIframeResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(iframe, request);
17799
- responsePromise.catch(() => {
17800
- /*
17801
- * If URL creation or navigation below throws before
17802
- * responsePromise is awaited, the listener still rejects on
17803
- * timeout. Swallow it here so it does not surface as an
17804
- * unhandled rejection; the navigation error is propagated
17805
- * instead.
17806
- */
17807
- });
17808
- if (request.httpMethod === HttpMethod.POST) {
17809
- await invokeAsync(initiateCodeFlowWithPost, SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(iframe, this.config, authClient.authority, silentRequest, this.logger, this.performanceClient);
18394
+ // Create the iframe, register the response listener, then navigate, so the listener is active before the iframe can respond.
18395
+ const iframe = createHiddenIframe();
18396
+ const responseType = this.config.auth.OIDCOptions.responseMode;
18397
+ // Wait for response from the redirect bridge.
18398
+ let responseString;
18399
+ try {
18400
+ const responsePromise = invokeAsync(this.waitForIframeResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(iframe, request);
18401
+ responsePromise.catch(() => {
18402
+ /*
18403
+ * If URL creation or navigation below throws before
18404
+ * responsePromise is awaited, the listener still rejects on
18405
+ * timeout. Swallow it here so it does not surface as an
18406
+ * unhandled rejection; the navigation error is propagated
18407
+ * instead.
18408
+ */
18409
+ });
18410
+ if (request.httpMethod === HttpMethod.POST) {
18411
+ await invokeAsync(initiateCodeFlowWithPost, SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(iframe, this.config, authClient.authority, silentRequest, this.logger, this.performanceClient);
18412
+ }
18413
+ else {
18414
+ // Create authorize request url
18415
+ const navigateUrl = await invokeAsync(getAuthCodeRequestUrl, GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)(this.config, authClient.authority, silentRequest, this.logger, this.performanceClient);
18416
+ // Navigate the iframe to the authorize request url
18417
+ await invokeAsync(initiateCodeRequest, SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(iframe, navigateUrl, this.logger, correlationId);
18418
+ }
18419
+ responseString = await responsePromise;
17810
18420
  }
17811
- else {
17812
- // Create authorize request url
17813
- const navigateUrl = await invokeAsync(getAuthCodeRequestUrl, GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)(this.config, authClient.authority, silentRequest, this.logger, this.performanceClient);
17814
- // Navigate the iframe to the authorize request url
17815
- await invokeAsync(initiateCodeRequest, SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(iframe, navigateUrl, this.logger, correlationId);
18421
+ finally {
18422
+ invoke(removeHiddenIframe, RemoveHiddenIframe, this.logger, this.performanceClient, correlationId)(iframe);
17816
18423
  }
17817
- responseString = await responsePromise;
18424
+ const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, correlationId)(responseString, responseType, this.logger, this.correlationId);
18425
+ return { serverParams, pkceCodes, silentRequest };
17818
18426
  }
17819
- finally {
17820
- invoke(removeHiddenIframe, RemoveHiddenIframe, this.logger, this.performanceClient, correlationId)(iframe);
18427
+ catch (e) {
18428
+ await removeTokenBindingKeyOnFailure(silentRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
18429
+ throw e;
17821
18430
  }
17822
- const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, correlationId)(responseString, responseType, this.logger, this.correlationId);
17823
- return { serverParams, pkceCodes, silentRequest };
17824
18431
  }
17825
18432
  async waitForIframeResponse(iframe, request) {
17826
18433
  if (this.waitForIframeResponseHook) {
@@ -18093,7 +18700,6 @@ function getPlatformSilentRequestKey(request, config) {
18093
18700
  : undefined,
18094
18701
  extraParameters: canonicalizeStringDict(request.extraParameters),
18095
18702
  extraQueryParameters: canonicalizeStringDict(request.extraQueryParameters),
18096
- extraParametersNoCache: canonicalizeStringDict(request.extraParametersNoCache),
18097
18703
  forceRefresh: !!request.forceRefresh,
18098
18704
  cacheLookupPolicy: request.cacheLookupPolicy ?? CacheLookupPolicy.Default,
18099
18705
  });
@@ -18102,8 +18708,12 @@ function getPlatformSilentRequestKey(request, config) {
18102
18708
  * Copies caller-owned mutable inputs before asynchronous broker initialization.
18103
18709
  */
18104
18710
  function snapshotPlatformSilentRequest(request) {
18105
- return {
18711
+ const snapshot = {
18106
18712
  ...request,
18713
+ };
18714
+ delete snapshot.extraParametersNoCache;
18715
+ return {
18716
+ ...snapshot,
18107
18717
  scopes: [...(request.scopes || [])],
18108
18718
  account: { ...request.account },
18109
18719
  azureCloudOptions: request.azureCloudOptions
@@ -18115,9 +18725,6 @@ function snapshotPlatformSilentRequest(request) {
18115
18725
  extraQueryParameters: request.extraQueryParameters
18116
18726
  ? { ...request.extraQueryParameters }
18117
18727
  : undefined,
18118
- extraParametersNoCache: request.extraParametersNoCache
18119
- ? { ...request.extraParametersNoCache }
18120
- : undefined,
18121
18728
  attributeTokens: request.attributeTokens
18122
18729
  ? [...request.attributeTokens]
18123
18730
  : undefined,
@@ -18482,8 +19089,9 @@ class StandardController {
18482
19089
  let result;
18483
19090
  const platformAuthProvider = this.platformAuthProvider;
18484
19091
  if (this.canUsePlatformBroker(request) && platformAuthProvider) {
19092
+ const nativeRequest = this.sanitizeNativeBrokerRequest(request, correlationId);
18485
19093
  const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
18486
- result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
19094
+ result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(nativeRequest, atrMeasurement).catch((e) => {
18487
19095
  if (e instanceof NativeAuthError &&
18488
19096
  isFatalNativeAuthError(e)) {
18489
19097
  this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
@@ -19028,6 +19636,13 @@ class StandardController {
19028
19636
  const correlationId = this.getRequestCorrelationId(logoutRequest);
19029
19637
  redirectPreflightCheck(this.initialized, this.config);
19030
19638
  this.browserStorage.setInteractionInProgress(true, INTERACTION_TYPE.SIGNOUT);
19639
+ try {
19640
+ await this.clearNativeCache(logoutRequest?.account, correlationId);
19641
+ }
19642
+ catch (error) {
19643
+ this.browserStorage.setInteractionInProgress(false);
19644
+ throw error;
19645
+ }
19031
19646
  const redirectClient = this.createRedirectClient(correlationId);
19032
19647
  return redirectClient.logout(logoutRequest);
19033
19648
  }
@@ -19041,7 +19656,11 @@ class StandardController {
19041
19656
  preflightCheck$1(this.initialized);
19042
19657
  this.browserStorage.setInteractionInProgress(true, INTERACTION_TYPE.SIGNOUT);
19043
19658
  const popupClient = this.createPopupClient(correlationId);
19044
- return popupClient.logout(logoutRequest).finally(() => {
19659
+ const nativeCacheClear = this.clearNativeCache(logoutRequest?.account, correlationId);
19660
+ const popupLogout = popupClient.logout(logoutRequest);
19661
+ return Promise.all([nativeCacheClear, popupLogout])
19662
+ .then(() => undefined)
19663
+ .finally(() => {
19045
19664
  this.browserStorage.setInteractionInProgress(false);
19046
19665
  });
19047
19666
  }
@@ -19060,7 +19679,30 @@ class StandardController {
19060
19679
  }
19061
19680
  const correlationId = this.getRequestCorrelationId(logoutRequest);
19062
19681
  const cacheClient = this.createSilentCacheClient(correlationId);
19063
- return cacheClient.logout(logoutRequest);
19682
+ const nativeCacheClear = this.clearNativeCache(logoutRequest?.account, correlationId);
19683
+ const browserCacheClear = cacheClient.logout(logoutRequest);
19684
+ await Promise.all([nativeCacheClear, browserCacheClear]);
19685
+ }
19686
+ async clearNativeCache(account, correlationId) {
19687
+ const homeAccountId = account?.homeAccountId.toLowerCase();
19688
+ const environment = account?.environment.toLowerCase();
19689
+ const accessTokenKeys = this.nativeInternalStorage
19690
+ .getTokenKeys()
19691
+ .accessToken.filter((key) => {
19692
+ if (!account) {
19693
+ return true;
19694
+ }
19695
+ const accessToken = this.nativeInternalStorage.getAccessTokenCredential(key, correlationId);
19696
+ if (!accessToken) {
19697
+ return false;
19698
+ }
19699
+ return (accessToken.homeAccountId.toLowerCase() === homeAccountId &&
19700
+ accessToken.environment.toLowerCase() === environment);
19701
+ });
19702
+ await Promise.all(accessTokenKeys.map((key) => this.nativeInternalStorage.removeAccessTokenAndTokenBindingKey(key, correlationId)));
19703
+ if (!account) {
19704
+ this.nativeInternalStorage.clear(correlationId);
19705
+ }
19064
19706
  }
19065
19707
  // #endregion
19066
19708
  // #region Account APIs
@@ -19142,6 +19784,19 @@ class StandardController {
19142
19784
  }
19143
19785
  }
19144
19786
  // #region Helpers
19787
+ /**
19788
+ * Removes internal DPoP key state from application-originated broker requests.
19789
+ */
19790
+ sanitizeNativeBrokerRequest(request, correlationId) {
19791
+ if (!request.dpopJkt) {
19792
+ return request;
19793
+ }
19794
+ this.logger.warning("0rh2us", correlationId);
19795
+ return {
19796
+ ...request,
19797
+ dpopJkt: undefined,
19798
+ };
19799
+ }
19145
19800
  /**
19146
19801
  * Acquire a token from native device (e.g. WAM)
19147
19802
  * @param request
@@ -19161,7 +19816,8 @@ class StandardController {
19161
19816
  throw createBrowserAuthError(nativeConnectionNotEstablished, correlationId);
19162
19817
  }
19163
19818
  const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.platformAuthProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
19164
- return invokeAsync(nativeClient.acquireToken.bind(nativeClient), NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)(request, cacheLookupPolicy);
19819
+ const nativeRequest = this.sanitizeNativeBrokerRequest(request, correlationId);
19820
+ return invokeAsync(nativeClient.acquireToken.bind(nativeClient), NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)(nativeRequest, cacheLookupPolicy);
19165
19821
  }
19166
19822
  /**
19167
19823
  * Returns boolean indicating if this request can use the platform broker
@@ -19441,14 +20097,23 @@ class StandardController {
19441
20097
  correlationId,
19442
20098
  config: this.config,
19443
20099
  }, this.platformAuthProvider, this.logger, this.performanceClient);
19444
- const inProgressRequest = this.activeSilentTokenRequests.get(preparedRequest.key);
20100
+ const shouldDeduplicate = preparedRequest.request.authenticationScheme !==
20101
+ AuthenticationScheme$1.DPOP;
20102
+ const inProgressRequest = shouldDeduplicate
20103
+ ? this.activeSilentTokenRequests.get(preparedRequest.key)
20104
+ : undefined;
19445
20105
  if (typeof inProgressRequest === "undefined") {
19446
- this.logger.verbose("0fcjbk", correlationId);
20106
+ this.logger.verbose(shouldDeduplicate
20107
+ ? "0fcjbk"
20108
+ : "acquireTokenSilent called for DPoP request, starting an independent operation", correlationId);
19447
20109
  this.performanceClient.addFields({ deduped: false }, correlationId);
19448
20110
  const activeRequest = invokeAsync(this.acquireTokenSilentAsync.bind(this), AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)({
19449
20111
  ...preparedRequest.request,
19450
20112
  correlationId,
19451
20113
  }, preparedRequest.account);
20114
+ if (!shouldDeduplicate) {
20115
+ return activeRequest;
20116
+ }
19452
20117
  this.activeSilentTokenRequests.set(preparedRequest.key, activeRequest);
19453
20118
  return activeRequest.finally(() => {
19454
20119
  this.activeSilentTokenRequests.delete(preparedRequest.key);