@azure/msal-browser 5.27.0 → 5.28.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 (434) 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 +1 -1
  38. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +14 -2
  39. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  40. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  57. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -1
  59. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
  60. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -1
  61. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +68 -0
  62. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -0
  63. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +3 -2
  64. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
  65. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +87 -0
  66. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -0
  67. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +5 -3
  68. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -1
  69. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +14 -2
  70. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
  71. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -1
  72. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -1
  73. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +4 -3
  74. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
  75. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  76. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  77. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  78. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  79. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  80. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  81. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  82. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  83. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  84. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  85. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  86. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  87. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  88. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  89. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  90. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  91. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  92. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  93. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  94. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  95. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  96. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  97. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +246 -73
  98. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
  99. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
  100. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +10 -2
  101. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
  102. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  103. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  104. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  105. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  106. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  107. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  108. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  109. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  110. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  111. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +10 -2
  112. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -1
  113. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  114. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +118 -25
  115. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
  116. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  117. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  118. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +2 -2
  119. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
  120. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +2 -12
  122. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
  123. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +2 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
  125. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  126. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  127. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +17 -3
  128. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
  129. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +9 -3
  130. package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
  131. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  132. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  133. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  134. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  135. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  136. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  137. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  138. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  139. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  140. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  141. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  142. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  143. package/dist/custom_auth/index.mjs +3 -1
  144. package/dist/custom_auth/index.mjs.map +1 -1
  145. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  146. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  147. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  148. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  149. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  150. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  151. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  152. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  153. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  154. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  155. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  156. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +32 -13
  157. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
  158. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  159. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  160. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  161. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  162. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  163. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  164. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  165. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  166. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  167. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  168. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  169. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  170. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  171. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +14 -2
  172. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -1
  173. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -1
  174. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
  175. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  176. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  177. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  178. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  179. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  180. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  181. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  182. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  183. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  184. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  185. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  186. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  187. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  188. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  189. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -1
  190. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +1 -1
  191. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +1 -1
  192. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +9 -2
  193. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -1
  194. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  195. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  196. package/dist/encode/Base64Decode.mjs +1 -1
  197. package/dist/encode/Base64Encode.mjs +1 -1
  198. package/dist/error/BrowserAuthError.mjs +1 -1
  199. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  200. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  201. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  202. package/dist/error/NativeAuthError.mjs +1 -1
  203. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  204. package/dist/error/NestedAppAuthError.mjs +1 -1
  205. package/dist/event/EventHandler.mjs +1 -1
  206. package/dist/event/EventMessage.mjs +1 -1
  207. package/dist/event/EventType.mjs +1 -1
  208. package/dist/index.mjs +1 -1
  209. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  210. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  211. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +504 -75
  212. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  213. package/dist/interaction_client/PopupClient.mjs +27 -20
  214. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  215. package/dist/interaction_client/RedirectClient.mjs +29 -14
  216. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  217. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  218. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  219. package/dist/interaction_client/SilentIframeClient.mjs +44 -32
  220. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  221. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  222. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  223. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  224. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  225. package/dist/log-strings-mapping.json +59 -19
  226. package/dist/naa/BridgeError.mjs +1 -1
  227. package/dist/naa/BridgeProxy.mjs +1 -1
  228. package/dist/naa/BridgeStatusCode.mjs +1 -1
  229. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  230. package/dist/navigation/NavigationClient.mjs +1 -1
  231. package/dist/network/FetchClient.mjs +1 -1
  232. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  233. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  234. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  235. package/dist/packageMetadata.mjs +2 -2
  236. package/dist/popup_relay/constants.mjs +1 -1
  237. package/dist/popup_relay/index.mjs +1 -1
  238. package/dist/popup_relay/relayClient.mjs +1 -1
  239. package/dist/protocol/Authorize.mjs +21 -13
  240. package/dist/protocol/Authorize.mjs.map +1 -1
  241. package/dist/redirect_bridge/index.mjs +1 -1
  242. package/dist/request/RequestHelpers.mjs +35 -11
  243. package/dist/request/RequestHelpers.mjs.map +1 -1
  244. package/dist/request/SilentRequestHelpers.mjs +6 -6
  245. package/dist/request/SilentRequestHelpers.mjs.map +1 -1
  246. package/dist/response/ResponseHandler.mjs +1 -1
  247. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  248. package/dist/telemetry/BrowserPerformanceEvents.mjs +3 -2
  249. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  250. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  251. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  252. package/dist/utils/BrowserConstants.mjs +1 -1
  253. package/dist/utils/BrowserDetection.mjs +1 -1
  254. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  255. package/dist/utils/BrowserUtils.mjs +1 -1
  256. package/dist/utils/Helpers.mjs +1 -1
  257. package/dist/utils/IframeMonitor.mjs +1 -1
  258. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  259. package/dist/utils/PopupMonitor.mjs +1 -1
  260. package/dist/utils/PopupOriginCheck.mjs +1 -1
  261. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  262. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  263. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  264. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  265. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  266. package/dist/webBrokerBridge/index.mjs +1 -1
  267. package/lib/custom-auth-path/log-strings-mapping.json +51 -11
  268. package/lib/custom-auth-path/msal-custom-auth.cjs +1563 -424
  269. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  270. package/lib/custom-auth-path/msal-custom-auth.js +1563 -424
  271. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  272. package/lib/log-strings-mapping.json +19 -11
  273. package/lib/msal-browser.cjs +914 -259
  274. package/lib/msal-browser.cjs.map +1 -1
  275. package/lib/msal-browser.js +914 -259
  276. package/lib/msal-browser.js.map +1 -1
  277. package/lib/msal-browser.min.js +2 -2
  278. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  279. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  280. package/lib/popup-relay/msal-popup-relay.js +2 -2
  281. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  282. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  283. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  284. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  285. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  286. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  287. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  288. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  289. package/package.json +2 -2
  290. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +15 -0
  291. package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +6 -21
  292. package/src/broker/nativeBroker/PlatformAuthProvider.ts +3 -1
  293. package/src/broker/nativeBroker/PlatformAuthRequest.ts +12 -8
  294. package/src/broker/nativeBroker/PlatformAuthResponse.ts +31 -0
  295. package/src/cache/AsyncMemoryStorage.ts +16 -0
  296. package/src/cache/BrowserCacheManager.ts +19 -1
  297. package/src/controllers/StandardController.ts +107 -11
  298. package/src/crypto/TokenBindingKeyManager.ts +21 -0
  299. package/src/custom_auth/controller/CustomAuthStandardController.ts +18 -0
  300. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +15 -0
  301. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +23 -0
  302. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +26 -0
  303. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +1 -1
  304. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +2 -0
  305. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +94 -0
  306. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +7 -2
  307. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +132 -0
  308. package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +8 -2
  309. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +18 -0
  310. package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +13 -0
  311. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +8 -2
  312. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +1 -0
  313. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +445 -91
  314. package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +25 -0
  315. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +34 -0
  316. package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +9 -0
  317. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +262 -43
  318. package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +4 -7
  319. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +21 -0
  320. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +41 -2
  321. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +44 -19
  322. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +4 -6
  323. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +6 -1
  324. package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +25 -1
  325. package/src/custom_auth/core/telemetry/PublicApiId.ts +6 -0
  326. package/src/custom_auth/index.ts +11 -0
  327. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +6 -7
  328. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +47 -15
  329. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +2 -0
  330. package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +2 -0
  331. package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +18 -0
  332. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +2 -0
  333. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +13 -0
  334. package/src/interaction_client/PlatformAuthInteractionClient.ts +851 -128
  335. package/src/interaction_client/PopupClient.ts +104 -83
  336. package/src/interaction_client/RedirectClient.ts +88 -34
  337. package/src/interaction_client/SilentIframeClient.ts +121 -95
  338. package/src/packageMetadata.ts +1 -1
  339. package/src/protocol/Authorize.ts +46 -18
  340. package/src/request/RequestHelpers.ts +64 -11
  341. package/src/request/SilentRequestHelpers.ts +8 -9
  342. package/src/telemetry/BrowserPerformanceEvents.ts +1 -0
  343. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  344. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
  345. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  346. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +6 -1
  347. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
  348. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +21 -0
  349. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
  350. package/types/cache/AsyncMemoryStorage.d.ts +5 -0
  351. package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
  352. package/types/cache/BrowserCacheManager.d.ts +4 -0
  353. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  354. package/types/controllers/StandardController.d.ts +5 -0
  355. package/types/controllers/StandardController.d.ts.map +1 -1
  356. package/types/crypto/TokenBindingKeyManager.d.ts +9 -0
  357. package/types/crypto/TokenBindingKeyManager.d.ts.map +1 -1
  358. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  359. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  360. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +11 -0
  361. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -0
  362. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +14 -0
  363. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -0
  364. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +15 -0
  365. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -0
  366. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +1 -1
  367. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +2 -1
  368. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
  369. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +22 -0
  370. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -0
  371. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
  372. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +28 -0
  373. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -0
  374. package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts +3 -2
  375. package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts.map +1 -1
  376. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
  377. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +9 -0
  378. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
  379. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
  380. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +1 -0
  381. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
  382. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +12 -5
  383. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
  384. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +17 -0
  385. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
  386. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +18 -2
  387. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
  388. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts +8 -0
  389. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
  390. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts +8 -2
  391. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
  392. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +3 -3
  393. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
  394. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +12 -0
  395. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
  396. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +29 -2
  397. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
  398. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +30 -17
  399. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
  400. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +3 -1
  401. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
  402. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +3 -2
  403. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
  404. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +6 -1
  405. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
  406. package/types/custom_auth/core/telemetry/PublicApiId.d.ts +6 -0
  407. package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
  408. package/types/custom_auth/index.d.ts +5 -0
  409. package/types/custom_auth/index.d.ts.map +1 -1
  410. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +6 -8
  411. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
  412. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +4 -4
  413. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
  414. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +2 -1
  415. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
  416. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +2 -1
  417. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -1
  418. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -1
  419. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +2 -1
  420. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
  421. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
  422. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +106 -5
  423. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  424. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  425. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  426. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  427. package/types/packageMetadata.d.ts +1 -1
  428. package/types/protocol/Authorize.d.ts +4 -4
  429. package/types/protocol/Authorize.d.ts.map +1 -1
  430. package/types/request/RequestHelpers.d.ts +21 -3
  431. package/types/request/RequestHelpers.d.ts.map +1 -1
  432. package/types/request/SilentRequestHelpers.d.ts.map +1 -1
  433. package/types/telemetry/BrowserPerformanceEvents.d.ts +1 -0
  434. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
@@ -246,7 +246,6 @@ export class StandardController implements IController {
246
246
  this.browserCrypto = DEFAULT_CRYPTO_IMPLEMENTATION;
247
247
  this.tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER;
248
248
  }
249
-
250
249
  this.eventHandler = new EventHandler(this.logger);
251
250
 
252
251
  // Initialize the browser storage class.
@@ -769,6 +768,10 @@ export class StandardController implements IController {
769
768
  const platformAuthProvider = this.platformAuthProvider;
770
769
 
771
770
  if (this.canUsePlatformBroker(request) && platformAuthProvider) {
771
+ const nativeRequest = this.sanitizeNativeBrokerRequest(
772
+ request,
773
+ correlationId
774
+ );
772
775
  const nativeClient = new PlatformAuthInteractionClient(
773
776
  this.config,
774
777
  this.browserStorage,
@@ -790,7 +793,7 @@ export class StandardController implements IController {
790
793
  this.logger,
791
794
  this.performanceClient,
792
795
  correlationId
793
- )(request, atrMeasurement).catch((e: AuthError) => {
796
+ )(nativeRequest, atrMeasurement).catch((e: AuthError) => {
794
797
  if (
795
798
  e instanceof NativeAuthError &&
796
799
  isFatalNativeAuthError(e)
@@ -1646,6 +1649,12 @@ export class StandardController implements IController {
1646
1649
  INTERACTION_TYPE.SIGNOUT
1647
1650
  );
1648
1651
 
1652
+ try {
1653
+ await this.clearNativeCache(logoutRequest?.account, correlationId);
1654
+ } catch (error) {
1655
+ this.browserStorage.setInteractionInProgress(false);
1656
+ throw error;
1657
+ }
1649
1658
  const redirectClient = this.createRedirectClient(correlationId);
1650
1659
  return redirectClient.logout(logoutRequest);
1651
1660
  }
@@ -1664,9 +1673,16 @@ export class StandardController implements IController {
1664
1673
  );
1665
1674
 
1666
1675
  const popupClient = this.createPopupClient(correlationId);
1667
- return popupClient.logout(logoutRequest).finally(() => {
1668
- this.browserStorage.setInteractionInProgress(false);
1669
- });
1676
+ const nativeCacheClear = this.clearNativeCache(
1677
+ logoutRequest?.account,
1678
+ correlationId
1679
+ );
1680
+ const popupLogout = popupClient.logout(logoutRequest);
1681
+ return Promise.all([nativeCacheClear, popupLogout])
1682
+ .then(() => undefined)
1683
+ .finally(() => {
1684
+ this.browserStorage.setInteractionInProgress(false);
1685
+ });
1670
1686
  } catch (e) {
1671
1687
  // Since this function is syncronous we need to reject
1672
1688
  return Promise.reject(e);
@@ -1683,7 +1699,53 @@ export class StandardController implements IController {
1683
1699
  }
1684
1700
  const correlationId = this.getRequestCorrelationId(logoutRequest);
1685
1701
  const cacheClient = this.createSilentCacheClient(correlationId);
1686
- return cacheClient.logout(logoutRequest);
1702
+ const nativeCacheClear = this.clearNativeCache(
1703
+ logoutRequest?.account,
1704
+ correlationId
1705
+ );
1706
+ const browserCacheClear = cacheClient.logout(logoutRequest);
1707
+ await Promise.all([nativeCacheClear, browserCacheClear]);
1708
+ }
1709
+
1710
+ private async clearNativeCache(
1711
+ account: AccountInfo | null | undefined,
1712
+ correlationId: string
1713
+ ): Promise<void> {
1714
+ const homeAccountId = account?.homeAccountId.toLowerCase();
1715
+ const environment = account?.environment.toLowerCase();
1716
+ const accessTokenKeys = this.nativeInternalStorage
1717
+ .getTokenKeys()
1718
+ .accessToken.filter((key) => {
1719
+ if (!account) {
1720
+ return true;
1721
+ }
1722
+
1723
+ const accessToken =
1724
+ this.nativeInternalStorage.getAccessTokenCredential(
1725
+ key,
1726
+ correlationId
1727
+ );
1728
+ if (!accessToken) {
1729
+ return false;
1730
+ }
1731
+ return (
1732
+ accessToken.homeAccountId.toLowerCase() === homeAccountId &&
1733
+ accessToken.environment.toLowerCase() === environment
1734
+ );
1735
+ });
1736
+
1737
+ await Promise.all(
1738
+ accessTokenKeys.map((key) =>
1739
+ this.nativeInternalStorage.removeAccessTokenAndTokenBindingKey(
1740
+ key,
1741
+ correlationId
1742
+ )
1743
+ )
1744
+ );
1745
+
1746
+ if (!account) {
1747
+ this.nativeInternalStorage.clear(correlationId);
1748
+ }
1687
1749
  }
1688
1750
 
1689
1751
  // #endregion
@@ -1854,6 +1916,27 @@ export class StandardController implements IController {
1854
1916
 
1855
1917
  // #region Helpers
1856
1918
 
1919
+ /**
1920
+ * Removes internal DPoP key state from application-originated broker requests.
1921
+ */
1922
+ private sanitizeNativeBrokerRequest<T extends { dpopJkt?: string }>(
1923
+ request: T,
1924
+ correlationId: string
1925
+ ): T {
1926
+ if (!request.dpopJkt) {
1927
+ return request;
1928
+ }
1929
+
1930
+ this.logger.warning(
1931
+ "Ignoring caller-provided dpopJkt for a direct platform broker request.",
1932
+ correlationId
1933
+ );
1934
+ return {
1935
+ ...request,
1936
+ dpopJkt: undefined,
1937
+ };
1938
+ }
1939
+
1857
1940
  /**
1858
1941
  * Acquire a token from native device (e.g. WAM)
1859
1942
  * @param request
@@ -1896,6 +1979,10 @@ export class StandardController implements IController {
1896
1979
  correlationId,
1897
1980
  this.tokenBindingKeyManager
1898
1981
  );
1982
+ const nativeRequest = this.sanitizeNativeBrokerRequest(
1983
+ request,
1984
+ correlationId
1985
+ );
1899
1986
 
1900
1987
  return invokeAsync(
1901
1988
  nativeClient.acquireToken.bind(nativeClient),
@@ -1903,7 +1990,7 @@ export class StandardController implements IController {
1903
1990
  this.logger,
1904
1991
  this.performanceClient,
1905
1992
  correlationId
1906
- )(request, cacheLookupPolicy);
1993
+ )(nativeRequest, cacheLookupPolicy);
1907
1994
  }
1908
1995
 
1909
1996
  /**
@@ -2353,13 +2440,18 @@ export class StandardController implements IController {
2353
2440
  this.performanceClient
2354
2441
  );
2355
2442
 
2356
- const inProgressRequest = this.activeSilentTokenRequests.get(
2357
- preparedRequest.key
2358
- );
2443
+ const shouldDeduplicate =
2444
+ preparedRequest.request.authenticationScheme !==
2445
+ Constants.AuthenticationScheme.DPOP;
2446
+ const inProgressRequest = shouldDeduplicate
2447
+ ? this.activeSilentTokenRequests.get(preparedRequest.key)
2448
+ : undefined;
2359
2449
 
2360
2450
  if (typeof inProgressRequest === "undefined") {
2361
2451
  this.logger.verbose(
2362
- "acquireTokenSilent called for the first time, storing active request",
2452
+ shouldDeduplicate
2453
+ ? "acquireTokenSilent called for the first time, storing active request"
2454
+ : "acquireTokenSilent called for DPoP request, starting an independent operation",
2363
2455
  correlationId
2364
2456
  );
2365
2457
  this.performanceClient.addFields({ deduped: false }, correlationId);
@@ -2377,6 +2469,10 @@ export class StandardController implements IController {
2377
2469
  },
2378
2470
  preparedRequest.account
2379
2471
  );
2472
+ if (!shouldDeduplicate) {
2473
+ return activeRequest;
2474
+ }
2475
+
2380
2476
  this.activeSilentTokenRequests.set(
2381
2477
  preparedRequest.key,
2382
2478
  activeRequest
@@ -147,6 +147,16 @@ export class TokenBindingKeyManager implements ITokenBindingKeyManager {
147
147
  }
148
148
  }
149
149
 
150
+ /**
151
+ * Returns whether a browser token-binding key is available.
152
+ */
153
+ async hasTokenBindingKey(
154
+ keyId: string,
155
+ correlationId: string
156
+ ): Promise<boolean> {
157
+ return this.cache.containsKey(keyId, correlationId);
158
+ }
159
+
150
160
  /**
151
161
  * Clears browser token-binding keys from memory and persistent storage.
152
162
  * @param correlationId - Request correlation identifier.
@@ -260,6 +270,17 @@ export class TokenBindingKeyManager implements ITokenBindingKeyManager {
260
270
  return cachedKeyPair;
261
271
  }
262
272
 
273
+ /**
274
+ * Returns whether a browser token-binding key survived in persistent
275
+ * storage and can be restored after a redirect navigation.
276
+ */
277
+ async isTokenBindingKeyPersisted(
278
+ keyId: string,
279
+ correlationId: string
280
+ ): Promise<boolean> {
281
+ return this.cache.containsKeyInPersistentStorage(keyId, correlationId);
282
+ }
283
+
263
284
  /** @internal */
264
285
  getTokenBindingKeyTelemetry(
265
286
  cachedKeyPair: CachedKeyPair,
@@ -36,6 +36,7 @@ import { SignInStartResultV2 } from "../sign_in/auth_flow/v2/result/SignInStartR
36
36
  import { SignUpStartResultV2 } from "../sign_up/auth_flow/v2/result/SignUpStartResultV2.js";
37
37
  import {
38
38
  FLOW_COMPLETED_V2,
39
+ FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
39
40
  FLOW_ATTRIBUTES_REQUIRED_V2,
40
41
  FLOW_CODE_REQUIRED_V2,
41
42
  FLOW_METHOD_SELECTION_REQUIRED_V2,
@@ -52,6 +53,7 @@ import { PasswordRequiredStateV2 } from "../sign_in/auth_flow/v2/state/PasswordR
52
53
  import { SignUpStateTransitionHandlerV2 } from "../sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.js";
53
54
  import { SignUpPasswordRequiredStateV2 } from "../sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.js";
54
55
  import { AttributesRequiredStateV2 } from "../sign_up/auth_flow/v2/state/AttributesRequiredStateV2.js";
56
+ import { AuthMethodRegistrationRequiredStateV2 } from "../core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.js";
55
57
  import { CustomAuthAuthority } from "../core/CustomAuthAuthority.js";
56
58
  import { DefaultPackageInfo } from "../CustomAuthConstants.js";
57
59
  import {
@@ -804,6 +806,22 @@ export class CustomAuthStandardController
804
806
  );
805
807
  }
806
808
 
809
+ if (result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2) {
810
+ return new CustomAuthResultV2(
811
+ new AuthMethodRegistrationRequiredStateV2({
812
+ correlationId: result.correlationId,
813
+ logger: this.logger,
814
+ config: this.customAuthConfig,
815
+ flowClient: this.flowClientV2,
816
+ continuationState: result.continuationState,
817
+ cacheClient: this.cacheClient,
818
+ methods: result.methods,
819
+ }),
820
+ undefined,
821
+ result.continuationState.scenario
822
+ );
823
+ }
824
+
807
825
  if (result.type === FLOW_CODE_REQUIRED_V2) {
808
826
  return new CustomAuthResultV2(
809
827
  new CodeRequiredStateV2({
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * An authentication method that can be registered for the current account.
8
+ * The enrollment link is supplied by the server and is used when the app
9
+ * selects this method.
10
+ */
11
+ export interface AuthenticationMethodRegistrationV2 {
12
+ type: string;
13
+ channels?: readonly string[];
14
+ enrollHref: string;
15
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
7
+ import type { FailedStateV2 } from "../state/FailedStateV2.js";
8
+ import type { AuthMethodVerificationRequiredStateV2 } from "../state/AuthMethodVerificationRequiredStateV2.js";
9
+
10
+ /**
11
+ * The states a registration challenge action can resolve to. Successful
12
+ * registration requires verification before the flow can complete.
13
+ */
14
+ export type AuthMethodRegistrationChallengeResultStateV2 =
15
+ | AuthMethodVerificationRequiredStateV2
16
+ | FailedStateV2;
17
+
18
+ /**
19
+ * Result of challenging a selected authentication method for registration.
20
+ * It wraps the verification-required or failed state.
21
+ */
22
+ export type AuthMethodRegistrationChallengeResultV2 =
23
+ CustomAuthResultV2<AuthMethodRegistrationChallengeResultStateV2>;
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
7
+ import type { CompletedStateV2 } from "../state/CompletedStateV2.js";
8
+ import type { FailedStateV2 } from "../state/FailedStateV2.js";
9
+ import type { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
10
+
11
+ /**
12
+ * The states an authentication-method verification submission can resolve to.
13
+ * A successful submission completes the authentication flow.
14
+ */
15
+ export type AuthMethodVerificationSubmitChallengeResultStateV2 =
16
+ | CompletedStateV2
17
+ | FailedStateV2;
18
+
19
+ /**
20
+ * Result of submitting the authentication-method verification challenge. It
21
+ * includes account data when verification and token completion succeed.
22
+ */
23
+ export type AuthMethodVerificationSubmitChallengeResultV2 = CustomAuthResultV2<
24
+ AuthMethodVerificationSubmitChallengeResultStateV2,
25
+ CustomAuthAccountData
26
+ >;
@@ -20,7 +20,7 @@ export type RequestChallengeResultStateV2 =
20
20
  | FailedStateV2;
21
21
 
22
22
  /**
23
- * Result of requesting (or resending) a challenge. It wraps one of
23
+ * Result of requesting a challenge. It wraps one of
24
24
  * {@link RequestChallengeResultStateV2} plus, on failure, the unified V2 flow
25
25
  * error.
26
26
  */
@@ -12,6 +12,7 @@ import type { AttributesRequiredStateV2 } from "../../../../sign_up/auth_flow/v2
12
12
  import type { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
13
13
  import type { SignUpPasswordRequiredStateV2 } from "../../../../sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.js";
14
14
  import type { AuthMethodSelectionRequiredStateV2 } from "../state/AuthMethodSelectionRequiredStateV2.js";
15
+ import type { AuthMethodRegistrationRequiredStateV2 } from "../state/AuthMethodRegistrationRequiredStateV2.js";
15
16
 
16
17
  /**
17
18
  * The states a verify-challenge action can resolve to. Verifying the one-time
@@ -24,6 +25,7 @@ export type VerifyChallengeResultStateV2 =
24
25
  | AttributesRequiredStateV2
25
26
  | SignInContinuationStateV2
26
27
  | AuthMethodSelectionRequiredStateV2
28
+ | AuthMethodRegistrationRequiredStateV2
27
29
  | CompletedStateV2
28
30
  | FailedStateV2;
29
31
 
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { AuthFlowActionRequiredStateBase } from "../../AuthFlowState.js";
7
+ import type { AuthenticationMethodRegistrationV2 } from "../AuthenticationMethodRegistrationV2.js";
8
+ import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
9
+ import type { AuthMethodRegistrationChallengeResultV2 } from "../result/AuthMethodRegistrationChallengeResultV2.js";
10
+ import type { AuthMethodRegistrationRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
11
+ import { AuthMethodVerificationRequiredStateV2 } from "./AuthMethodVerificationRequiredStateV2.js";
12
+ import { InvalidArgumentError } from "../../../error/InvalidArgumentError.js";
13
+ import { ensureArgumentIsNotEmptyString } from "../../../utils/ArgumentValidator.js";
14
+
15
+ /**
16
+ * State returned when an authentication method must be registered. Applications
17
+ * select one of the sanitized offered methods and provide its contact value.
18
+ */
19
+ export class AuthMethodRegistrationRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodRegistrationRequiredStateParametersV2> {
20
+ readonly stateType = "authMethodRegistrationRequired";
21
+ readonly methods: readonly AuthenticationMethodRegistrationV2[];
22
+
23
+ constructor(
24
+ stateParameters: AuthMethodRegistrationRequiredStateParametersV2
25
+ ) {
26
+ super(stateParameters);
27
+ this.methods = stateParameters.methods;
28
+ }
29
+
30
+ /**
31
+ * Selects an authentication method for strong-auth registration and requests
32
+ * its activation challenge.
33
+ * @param method - A method from {@link methods}.
34
+ * @param verificationContact - The email address or phone number to register.
35
+ * @returns The registration activation result.
36
+ */
37
+ async selectAuthMethod(
38
+ method: AuthenticationMethodRegistrationV2,
39
+ verificationContact: string
40
+ ): Promise<AuthMethodRegistrationChallengeResultV2> {
41
+ const { correlationId, continuationState, flowClient, logger } =
42
+ this.stateParameters;
43
+
44
+ try {
45
+ const selectedMethod = this.methods.find(
46
+ (candidate) => candidate.type === method.type
47
+ );
48
+ if (!selectedMethod) {
49
+ throw new InvalidArgumentError("method", correlationId);
50
+ }
51
+ ensureArgumentIsNotEmptyString(
52
+ "verificationContact",
53
+ verificationContact,
54
+ correlationId
55
+ );
56
+
57
+ logger.verbose(
58
+ "Registering the selected V2 authentication method.",
59
+ correlationId
60
+ );
61
+ const result = await flowClient.registerAuthMethod({
62
+ correlationId,
63
+ continuationState,
64
+ method: selectedMethod,
65
+ verificationContact,
66
+ });
67
+
68
+ return new CustomAuthResultV2(
69
+ new AuthMethodVerificationRequiredStateV2({
70
+ correlationId: result.correlationId,
71
+ logger,
72
+ config: this.stateParameters.config,
73
+ flowClient,
74
+ cacheClient: this.stateParameters.cacheClient,
75
+ continuationState: result.continuationState,
76
+ type: selectedMethod.type,
77
+ sentTo: result.sentTo,
78
+ codeLength: result.codeLength,
79
+ }),
80
+ undefined,
81
+ result.continuationState.scenario
82
+ );
83
+ } catch (error) {
84
+ logger.errorPii(
85
+ `Failed to register the selected V2 authentication method. Error: '${error}'.`,
86
+ correlationId
87
+ );
88
+ return CustomAuthResultV2.createWithError(error, {
89
+ scenario: continuationState.scenario,
90
+ correlationId,
91
+ });
92
+ }
93
+ }
94
+ }
@@ -171,8 +171,12 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
171
171
  result: FlowCodeRequiredResultV2 | FlowPasswordRequiredResultV2;
172
172
  selectedMethod: AuthenticationMethodV2;
173
173
  }> {
174
- const { correlationId, continuationState, flowClient } =
175
- this.stateParameters;
174
+ const {
175
+ correlationId,
176
+ continuationState,
177
+ flowClient,
178
+ authenticationFactor,
179
+ } = this.stateParameters;
176
180
  const selectedMethod = this.methods.find(
177
181
  (candidate) => candidate.id === method.id
178
182
  );
@@ -183,6 +187,7 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
183
187
 
184
188
  const result = await flowClient.requestChallenge({
185
189
  correlationId,
190
+ authenticationFactor,
186
191
  continuationState: {
187
192
  ...continuationState,
188
193
  links: {
@@ -0,0 +1,132 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { AuthFlowActionRequiredStateBase } from "../../AuthFlowState.js";
7
+ import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
8
+ import type { AuthMethodRegistrationChallengeResultV2 } from "../result/AuthMethodRegistrationChallengeResultV2.js";
9
+ import type { AuthMethodVerificationSubmitChallengeResultV2 } from "../result/AuthMethodVerificationSubmitChallengeResultV2.js";
10
+ import type { AuthMethodVerificationRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
11
+ import { CompletedStateV2 } from "./CompletedStateV2.js";
12
+ import { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
13
+ import { ensureArgumentIsNotNullOrUndefined } from "../../../utils/ArgumentValidator.js";
14
+
15
+ /**
16
+ * State returned when a newly registered authentication method must be
17
+ * activated with the challenge sent by the service.
18
+ */
19
+ export class AuthMethodVerificationRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodVerificationRequiredStateParametersV2> {
20
+ readonly stateType = "authMethodVerificationRequired";
21
+ readonly type: string;
22
+ readonly sentTo?: string;
23
+ readonly codeLength: number;
24
+
25
+ constructor(
26
+ stateParameters: AuthMethodVerificationRequiredStateParametersV2
27
+ ) {
28
+ super(stateParameters);
29
+ this.type = stateParameters.type;
30
+ this.sentTo = stateParameters.sentTo;
31
+ this.codeLength = stateParameters.codeLength;
32
+ }
33
+
34
+ /**
35
+ * Submits the activation challenge for the registered method.
36
+ * @param challenge - The activation challenge to submit.
37
+ * @returns The completed authentication result or a failed state.
38
+ */
39
+ async submitChallenge(
40
+ challenge: string
41
+ ): Promise<AuthMethodVerificationSubmitChallengeResultV2> {
42
+ const { correlationId, continuationState, flowClient, logger } =
43
+ this.stateParameters;
44
+
45
+ try {
46
+ ensureArgumentIsNotNullOrUndefined(
47
+ "challenge",
48
+ challenge,
49
+ correlationId
50
+ );
51
+ logger.verbose(
52
+ "Submitting a V2 authentication-method activation challenge.",
53
+ correlationId
54
+ );
55
+ const result = await flowClient.verifyAuthMethodRegistration({
56
+ correlationId,
57
+ continuationState,
58
+ code: challenge,
59
+ });
60
+
61
+ const account = new CustomAuthAccountData(
62
+ result.authenticationResult.account,
63
+ this.stateParameters.config,
64
+ this.stateParameters.cacheClient,
65
+ logger,
66
+ correlationId
67
+ );
68
+
69
+ return new CustomAuthResultV2(
70
+ new CompletedStateV2(),
71
+ account,
72
+ continuationState.scenario
73
+ );
74
+ } catch (error) {
75
+ logger.errorPii(
76
+ `Failed to submit the V2 authentication-method activation challenge. Error: '${error}'.`,
77
+ correlationId
78
+ );
79
+ return CustomAuthResultV2.createWithError(error, {
80
+ scenario: continuationState.scenario,
81
+ correlationId,
82
+ });
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Requests a replacement activation challenge using the retained server
88
+ * resend link.
89
+ * @returns Refreshed activation metadata or a failed state.
90
+ */
91
+ async resendChallenge(): Promise<AuthMethodRegistrationChallengeResultV2> {
92
+ const { correlationId, continuationState, flowClient, logger } =
93
+ this.stateParameters;
94
+
95
+ try {
96
+ logger.verbose(
97
+ "Resending a V2 authentication-method activation challenge.",
98
+ correlationId
99
+ );
100
+ const result =
101
+ await flowClient.resendAuthMethodRegistrationChallenge({
102
+ correlationId,
103
+ continuationState,
104
+ });
105
+
106
+ return new CustomAuthResultV2(
107
+ new AuthMethodVerificationRequiredStateV2({
108
+ correlationId: result.correlationId,
109
+ logger,
110
+ config: this.stateParameters.config,
111
+ flowClient,
112
+ cacheClient: this.stateParameters.cacheClient,
113
+ continuationState: result.continuationState,
114
+ type: this.type,
115
+ sentTo: result.sentTo ?? this.sentTo,
116
+ codeLength: result.codeLength,
117
+ }),
118
+ undefined,
119
+ result.continuationState.scenario
120
+ );
121
+ } catch (error) {
122
+ logger.errorPii(
123
+ `Failed to resend the V2 authentication-method activation challenge. Error: '${error}'.`,
124
+ correlationId
125
+ );
126
+ return CustomAuthResultV2.createWithError(error, {
127
+ scenario: continuationState.scenario,
128
+ correlationId,
129
+ });
130
+ }
131
+ }
132
+ }
@@ -11,6 +11,7 @@ import type {
11
11
  FlowSubmitCodeResultV2,
12
12
  } from "../../../interaction_client/v2/result/FlowActionResultV2.js";
13
13
  import { ensureArgumentIsNotNullOrUndefined } from "../../../utils/ArgumentValidator.js";
14
+ import type { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
14
15
 
15
16
  export abstract class ChallengeVerificationStateBaseV2<
16
17
  TParameters extends CodeVerificationStateParametersV2 = CodeVerificationStateParametersV2
@@ -32,7 +33,8 @@ export abstract class ChallengeVerificationStateBaseV2<
32
33
  }
33
34
 
34
35
  protected async submitCodeCore(
35
- code: string
36
+ code: string,
37
+ authenticationFactor?: AuthenticationFactorV2
36
38
  ): Promise<FlowSubmitCodeResultV2> {
37
39
  ensureArgumentIsNotNullOrUndefined(
38
40
  "code",
@@ -43,14 +45,18 @@ export abstract class ChallengeVerificationStateBaseV2<
43
45
  return this.stateParameters.flowClient.submitCode({
44
46
  correlationId: this.stateParameters.correlationId,
45
47
  continuationState: this.stateParameters.continuationState,
48
+ authenticationFactor,
46
49
  code,
47
50
  });
48
51
  }
49
52
 
50
- protected async resendCodeCore(): Promise<FlowCodeRequiredResultV2> {
53
+ protected async resendCodeCore(
54
+ authenticationFactor?: AuthenticationFactorV2
55
+ ): Promise<FlowCodeRequiredResultV2> {
51
56
  return this.stateParameters.flowClient.resendCode({
52
57
  correlationId: this.stateParameters.correlationId,
53
58
  continuationState: this.stateParameters.continuationState,
59
+ authenticationFactor,
54
60
  });
55
61
  }
56
62
  }