@azure/msal-browser 5.28.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 (501) 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 +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  8. package/dist/cache/AccountManager.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +1 -1
  11. package/dist/cache/CacheHelpers.mjs +1 -1
  12. package/dist/cache/CacheKeys.mjs +1 -1
  13. package/dist/cache/CookieStorage.mjs +1 -1
  14. package/dist/cache/DatabaseStorage.mjs +1 -1
  15. package/dist/cache/EncryptedData.mjs +1 -1
  16. package/dist/cache/LocalStorage.mjs +1 -1
  17. package/dist/cache/MemoryStorage.mjs +1 -1
  18. package/dist/cache/SessionStorage.mjs +1 -1
  19. package/dist/cache/TokenCache.mjs +1 -1
  20. package/dist/config/Configuration.mjs +1 -1
  21. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  22. package/dist/controllers/StandardController.mjs +1 -1
  23. package/dist/crypto/BrowserCrypto.mjs +1 -1
  24. package/dist/crypto/CryptoOps.mjs +1 -1
  25. package/dist/crypto/PkceGenerator.mjs +1 -1
  26. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  27. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  28. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  29. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +6 -4
  30. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  31. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +58 -62
  32. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  33. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  34. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  35. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  36. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +3 -5
  51. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
  52. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +19 -13
  53. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
  54. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +8 -2
  55. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -1
  56. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +58 -69
  57. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +3 -3
  59. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +42 -15
  60. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
  61. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +17 -4
  62. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
  63. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +14 -18
  65. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
  66. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +2 -4
  67. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
  68. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +2 -3
  69. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
  70. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +17 -6
  71. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
  72. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +110 -0
  73. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
  74. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  75. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  76. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  77. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  78. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +2 -1
  79. package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +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 +256 -150
  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 +2 -6
  100. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -1
  101. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +10 -3
  102. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
  103. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  104. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  105. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  106. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  107. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  108. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  109. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  110. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  111. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  112. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -7
  113. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -1
  114. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  115. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +35 -19
  116. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
  117. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  118. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  119. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +20 -9
  120. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  122. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  123. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -2
  125. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
  126. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  127. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  128. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +5 -7
  129. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
  130. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +3 -2
  131. package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
  132. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +17 -2
  133. package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
  134. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  135. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  136. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  137. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  138. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  139. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  140. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  141. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  142. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  143. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  144. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  145. package/dist/custom_auth/index.mjs +4 -3
  146. package/dist/custom_auth/index.mjs.map +1 -1
  147. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  148. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  149. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  150. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  151. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  152. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  153. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  154. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  155. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  156. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  157. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  158. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +23 -7
  159. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
  160. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +24 -0
  161. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs.map +1 -0
  162. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  163. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  164. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  165. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  166. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  167. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  168. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  169. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  170. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  171. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  172. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  173. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  174. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  175. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +4 -7
  176. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
  177. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +2 -2
  178. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs.map +1 -1
  179. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  180. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  181. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  182. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  183. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  184. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  185. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  186. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  187. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  188. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  189. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  190. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  191. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  192. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  193. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +17 -8
  194. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
  195. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +78 -0
  196. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs.map +1 -0
  197. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +48 -0
  198. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs.map +1 -0
  199. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +49 -0
  200. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs.map +1 -0
  201. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +17 -24
  202. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -1
  203. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  204. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  205. package/dist/encode/Base64Decode.mjs +1 -1
  206. package/dist/encode/Base64Encode.mjs +1 -1
  207. package/dist/error/BrowserAuthError.mjs +1 -1
  208. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  209. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  210. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  211. package/dist/error/NativeAuthError.mjs +1 -1
  212. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  213. package/dist/error/NestedAppAuthError.mjs +1 -1
  214. package/dist/event/EventHandler.mjs +1 -1
  215. package/dist/event/EventMessage.mjs +1 -1
  216. package/dist/event/EventType.mjs +1 -1
  217. package/dist/index.mjs +1 -1
  218. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  219. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  220. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +38 -31
  221. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  222. package/dist/interaction_client/PopupClient.mjs +1 -1
  223. package/dist/interaction_client/RedirectClient.mjs +1 -1
  224. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  225. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  226. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  227. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  228. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  229. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  230. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  231. package/dist/log-strings-mapping.json +21 -9
  232. package/dist/naa/BridgeError.mjs +1 -1
  233. package/dist/naa/BridgeProxy.mjs +1 -1
  234. package/dist/naa/BridgeStatusCode.mjs +1 -1
  235. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  236. package/dist/navigation/NavigationClient.mjs +1 -1
  237. package/dist/network/FetchClient.mjs +1 -1
  238. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  239. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  240. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  241. package/dist/packageMetadata.mjs +2 -2
  242. package/dist/popup_relay/constants.mjs +1 -1
  243. package/dist/popup_relay/index.mjs +1 -1
  244. package/dist/popup_relay/relayClient.mjs +1 -1
  245. package/dist/protocol/Authorize.mjs +1 -1
  246. package/dist/redirect_bridge/index.mjs +1 -1
  247. package/dist/request/RequestHelpers.mjs +1 -1
  248. package/dist/request/SilentRequestHelpers.mjs +1 -1
  249. package/dist/response/ResponseHandler.mjs +1 -1
  250. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  251. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  252. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  253. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  254. package/dist/utils/BrowserConstants.mjs +1 -1
  255. package/dist/utils/BrowserDetection.mjs +1 -1
  256. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  257. package/dist/utils/BrowserUtils.mjs +1 -1
  258. package/dist/utils/Helpers.mjs +1 -1
  259. package/dist/utils/IframeMonitor.mjs +1 -1
  260. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  261. package/dist/utils/PopupMonitor.mjs +1 -1
  262. package/dist/utils/PopupOriginCheck.mjs +1 -1
  263. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  264. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  265. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  266. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  267. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  268. package/dist/webBrokerBridge/index.mjs +1 -1
  269. package/lib/custom-auth-path/log-strings-mapping.json +21 -9
  270. package/lib/custom-auth-path/msal-custom-auth.cjs +1100 -765
  271. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  272. package/lib/custom-auth-path/msal-custom-auth.js +1100 -765
  273. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  274. package/lib/log-strings-mapping.json +7 -3
  275. package/lib/msal-browser.cjs +117 -107
  276. package/lib/msal-browser.cjs.map +1 -1
  277. package/lib/msal-browser.js +117 -107
  278. package/lib/msal-browser.js.map +1 -1
  279. package/lib/msal-browser.min.js +2 -2
  280. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  281. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  282. package/lib/popup-relay/msal-popup-relay.js +2 -2
  283. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  284. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  285. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  286. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  287. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  288. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  289. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  290. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  291. package/package.json +2 -2
  292. package/src/custom_auth/CustomAuthActionInputs.ts +12 -5
  293. package/src/custom_auth/CustomAuthPublicClientApplication.ts +5 -3
  294. package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +5 -3
  295. package/src/custom_auth/controller/CustomAuthStandardController.ts +79 -110
  296. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +1 -2
  297. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +1 -4
  298. package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +5 -4
  299. package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +28 -16
  300. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +6 -0
  301. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +83 -72
  302. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +3 -3
  303. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +7 -5
  304. package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +10 -6
  305. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +9 -6
  306. package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +4 -6
  307. package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +36 -0
  308. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +6 -8
  309. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +2 -2
  310. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +61 -12
  311. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +21 -3
  312. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +30 -24
  313. package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +1 -3
  314. package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +11 -2
  315. package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +1 -2
  316. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +26 -7
  317. package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +179 -0
  318. package/src/custom_auth/core/error/InvalidArgumentError.ts +1 -1
  319. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +12 -12
  320. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +394 -238
  321. package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +2 -6
  322. package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +2 -15
  323. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +63 -26
  324. package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +0 -6
  325. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +74 -26
  326. package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +48 -9
  327. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +4 -6
  328. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +0 -6
  329. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +14 -53
  330. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +0 -18
  331. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +32 -13
  332. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +8 -9
  333. package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +4 -5
  334. package/src/custom_auth/core/telemetry/PublicApiId.ts +1 -0
  335. package/src/custom_auth/core/utils/ArgumentValidator.ts +26 -0
  336. package/src/custom_auth/index.ts +10 -11
  337. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +6 -7
  338. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +28 -5
  339. package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.ts +30 -0
  340. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +4 -8
  341. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +4 -7
  342. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +3 -6
  343. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +0 -3
  344. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.ts +2 -3
  345. package/src/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.ts +49 -0
  346. package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +8 -4
  347. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +16 -4
  348. package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +26 -5
  349. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.ts +101 -0
  350. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.ts +53 -0
  351. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.ts +97 -0
  352. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +0 -6
  353. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +25 -48
  354. package/src/interaction_client/PlatformAuthInteractionClient.ts +53 -38
  355. package/src/packageMetadata.ts +1 -1
  356. package/types/custom_auth/CustomAuthActionInputs.d.ts +12 -5
  357. package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  358. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  359. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +5 -3
  360. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
  361. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +5 -3
  362. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
  363. package/types/custom_auth/controller/CustomAuthStandardController.d.ts +2 -0
  364. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  365. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +1 -2
  366. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
  367. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +1 -4
  368. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
  369. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +5 -4
  370. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
  371. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +17 -8
  372. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
  373. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +6 -0
  374. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -1
  375. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +23 -44
  376. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
  377. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +3 -3
  378. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +7 -6
  379. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
  380. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +7 -6
  381. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
  382. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +8 -7
  383. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
  384. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +4 -6
  385. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
  386. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +20 -0
  387. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
  388. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +6 -8
  389. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
  390. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +2 -2
  391. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +3 -6
  392. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
  393. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +3 -3
  394. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
  395. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +6 -8
  396. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
  397. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +1 -3
  398. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
  399. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +9 -2
  400. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
  401. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +1 -2
  402. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
  403. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +5 -6
  404. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
  405. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +23 -0
  406. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
  407. package/types/custom_auth/core/error/InvalidArgumentError.d.ts +1 -0
  408. package/types/custom_auth/core/error/InvalidArgumentError.d.ts.map +1 -1
  409. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +8 -1
  410. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
  411. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +12 -10
  412. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
  413. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +1 -1
  414. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -1
  415. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +2 -5
  416. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
  417. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +22 -3
  418. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
  419. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
  420. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
  421. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +2 -1
  422. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
  423. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -1
  424. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
  425. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -1
  426. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +8 -8
  427. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
  428. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
  429. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +18 -6
  430. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
  431. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +6 -10
  432. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
  433. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +0 -4
  434. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
  435. package/types/custom_auth/core/telemetry/PublicApiId.d.ts +1 -0
  436. package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
  437. package/types/custom_auth/core/utils/ArgumentValidator.d.ts +3 -0
  438. package/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  439. package/types/custom_auth/index.d.ts +5 -5
  440. package/types/custom_auth/index.d.ts.map +1 -1
  441. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +6 -8
  442. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
  443. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +7 -5
  444. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
  445. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts +7 -0
  446. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts.map +1 -0
  447. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +4 -8
  448. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
  449. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +5 -6
  450. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
  451. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +3 -6
  452. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
  453. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +0 -1
  454. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -1
  455. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts +3 -2
  456. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts.map +1 -1
  457. package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts +27 -0
  458. package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts.map +1 -0
  459. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +6 -3
  460. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
  461. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +12 -3
  462. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
  463. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +8 -3
  464. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
  465. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts +24 -0
  466. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts.map +1 -0
  467. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts +18 -0
  468. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts.map +1 -0
  469. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts +7 -0
  470. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts.map +1 -0
  471. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +0 -4
  472. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -1
  473. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +5 -4
  474. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
  475. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +4 -3
  476. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  477. package/types/packageMetadata.d.ts +1 -1
  478. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +0 -82
  479. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +0 -1
  480. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +0 -25
  481. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +0 -1
  482. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +0 -45
  483. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +0 -1
  484. package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +0 -23
  485. package/src/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.ts +0 -19
  486. package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -22
  487. package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +0 -115
  488. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +0 -34
  489. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +0 -61
  490. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +0 -14
  491. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +0 -1
  492. package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts +0 -13
  493. package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts.map +0 -1
  494. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -9
  495. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +0 -1
  496. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -17
  497. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +0 -1
  498. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +0 -11
  499. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +0 -1
  500. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +0 -19
  501. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +0 -1
@@ -29,9 +29,7 @@ import { RequestContextV2 } from "../../network_client/custom_auth_api/v2/reques
29
29
  import { TokenResponseV2 } from "../../network_client/custom_auth_api/v2/response/ResponsesV2.js";
30
30
 
31
31
  /*
32
- * Shared base for Native Auth V2 interaction clients. It extends
33
- * `StandardInteractionClient` for common browser infrastructure while keeping
34
- * V1 and V2 token handling independent.
32
+ * Shared base for Native Auth V2 interaction clients.
35
33
  */
36
34
  export abstract class InteractionClientBaseV2 extends StandardInteractionClient {
37
35
  private readonly tokenResponseHandler: ResponseHandler;
@@ -68,7 +66,6 @@ export abstract class InteractionClientBaseV2 extends StandardInteractionClient
68
66
  );
69
67
  }
70
68
 
71
- // Required by the base contract. After sign-in, use CustomAuthAccountData.getAccessToken().
72
69
  acquireToken(
73
70
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
74
71
  request: RedirectRequest | PopupRequest | SsoSilentRequest
@@ -78,7 +75,6 @@ export abstract class InteractionClientBaseV2 extends StandardInteractionClient
78
75
  );
79
76
  }
80
77
 
81
- // Required by the base contract. After sign-in, use CustomAuthAccountData.signOut().
82
78
  logout(
83
79
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
84
80
  request: EndSessionRequest | ClearCacheRequest | undefined
@@ -86,7 +82,7 @@ export abstract class InteractionClientBaseV2 extends StandardInteractionClient
86
82
  throw new MethodNotImplementedError("InteractionClientBaseV2.logout");
87
83
  }
88
84
 
89
- protected getScopes(scopes: string[] | null | undefined): string[] {
85
+ protected getScopes(scopes: string[] | undefined): string[] {
90
86
  const requestedScopes = scopes?.filter((scope) => !!scope) ?? [];
91
87
  const seenScopes = new Set(
92
88
  requestedScopes.map((scope) => scope.toLowerCase())
@@ -11,45 +11,33 @@ import type {
11
11
  } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
12
12
  import type { AuthenticationMethodRegistrationV2 } from "../../../auth_flow/v2/AuthenticationMethodRegistrationV2.js";
13
13
 
14
- /*
15
- * Input parameters for V2 interaction-client actions. Continuing actions carry
16
- * the opaque state returned by the previous response.
17
- */
18
-
19
14
  interface FlowParamsBaseV2 {
20
15
  correlationId: string;
21
16
  }
22
17
 
23
- // Begin a reset for the given account.
24
18
  export interface FlowStartParamsV2 extends FlowParamsBaseV2 {
25
19
  username: string;
26
- scopes?: string[] | null;
20
+ scopes?: string[];
27
21
  claims?: string;
28
22
  }
29
23
 
30
- export interface FlowSignInStartParamsV2 extends FlowStartParamsV2 {
31
- password?: string;
32
- }
24
+ export type FlowSignInStartParamsV2 = FlowStartParamsV2;
33
25
 
34
26
  export interface FlowSignUpStartParamsV2 extends FlowStartParamsV2 {
35
- password?: string;
36
27
  attributes?: UserAccountAttributes;
37
28
  }
38
29
 
39
- // Request the challenge for the selected method, sending the one-time code to it.
40
30
  export interface FlowChallengeParamsV2 extends FlowParamsBaseV2 {
41
31
  continuationState: FlowContinuationStateV2;
42
32
  authenticationFactor?: AuthenticationFactorV2;
43
33
  }
44
34
 
45
- // Submit the one-time code the user received.
46
35
  export interface FlowSubmitCodeParamsV2 extends FlowParamsBaseV2 {
47
36
  continuationState: FlowContinuationStateV2;
48
37
  authenticationFactor?: AuthenticationFactorV2;
49
38
  code: string;
50
39
  }
51
40
 
52
- // Submit the new password once the code has been verified.
53
41
  export interface FlowSubmitNewPasswordParamsV2 extends FlowParamsBaseV2 {
54
42
  continuationState: FlowContinuationStateV2;
55
43
  newPassword: string;
@@ -65,7 +53,6 @@ export interface FlowSubmitSignUpAttributesParamsV2 extends FlowParamsBaseV2 {
65
53
  attributes: UserAccountAttributes;
66
54
  }
67
55
 
68
- // Sign the account in by redeeming a completed flow's continuation for tokens.
69
56
  export interface FlowSignInWithContinuationParamsV2 extends FlowParamsBaseV2 {
70
57
  continuationState: FlowContinuationStateV2;
71
58
  }
@@ -9,20 +9,11 @@ import { FlowContinuationStateV2 } from "../FlowContinuationStateV2.js";
9
9
  import { SignUpAttributeV2 } from "../../../network_client/custom_auth_api/v2/result/SignUpResultsV2.js";
10
10
  import { AuthenticationMethodRegistrationV2 } from "../../../auth_flow/v2/AuthenticationMethodRegistrationV2.js";
11
11
 
12
- /*
13
- * Unified outcome envelope returned by V2 interaction-client actions. The L1
14
- * state layer maps each outcome to its corresponding public state.
15
- */
16
-
17
12
  interface FlowActionResultBaseV2 {
18
13
  type: string;
19
14
  correlationId: string;
20
15
  }
21
16
 
22
- /*
23
- * Authentication methods available for user selection. The continuation state
24
- * is used when requesting a challenge for the selected method.
25
- */
26
17
  export interface FlowMethodSelectionRequiredResultV2
27
18
  extends FlowActionResultBaseV2 {
28
19
  type: typeof FLOW_METHOD_SELECTION_REQUIRED_V2;
@@ -30,10 +21,6 @@ export interface FlowMethodSelectionRequiredResultV2
30
21
  methods: AuthenticationMethodV2[];
31
22
  }
32
23
 
33
- /*
34
- * A one-time code was sent and must be submitted next. `continuationState` carries the token and
35
- * the `verify`/`resend` hrefs; the remaining fields are display metadata for the app's prompt.
36
- */
37
24
  export interface FlowCodeRequiredResultV2 extends FlowActionResultBaseV2 {
38
25
  type: typeof FLOW_CODE_REQUIRED_V2;
39
26
  continuationState: FlowContinuationStateV2;
@@ -47,34 +34,41 @@ export interface FlowSignInCodeRequiredResultV2
47
34
  method: AuthenticationMethodV2;
48
35
  }
49
36
 
37
+ export interface FlowExistingAccountCodeRequiredResultV2
38
+ extends Omit<FlowCodeRequiredResultV2, "type"> {
39
+ type: typeof FLOW_EXISTING_ACCOUNT_CODE_REQUIRED_V2;
40
+ method: AuthenticationMethodV2;
41
+ }
42
+
43
+ export interface FlowExistingAccountPasswordRequiredResultV2
44
+ extends FlowActionResultBaseV2 {
45
+ type: typeof FLOW_EXISTING_ACCOUNT_PASSWORD_REQUIRED_V2;
46
+ continuationState: FlowContinuationStateV2;
47
+ }
48
+
50
49
  export interface FlowResetPasswordCodeRequiredResultV2
51
50
  extends FlowCodeRequiredResultV2 {
52
51
  method: AuthenticationMethodV2;
53
52
  }
54
53
 
55
- // The user's existing password must be submitted next for sign-in.
56
54
  export interface FlowPasswordRequiredResultV2 extends FlowActionResultBaseV2 {
57
55
  type: typeof FLOW_PASSWORD_REQUIRED_V2;
58
56
  continuationState: FlowContinuationStateV2;
59
57
  }
60
58
 
61
- // Derived from a sign-up `collectAttributes` response containing a required password.
62
59
  export interface FlowSignUpPasswordRequiredResultV2
63
60
  extends FlowActionResultBaseV2 {
64
61
  type: typeof FLOW_SIGN_UP_PASSWORD_REQUIRED_V2;
65
62
  continuationState: FlowContinuationStateV2;
66
- attributes: SignUpAttributeV2[];
67
- requiredPasswordAttribute: SignUpAttributeV2;
63
+ requestedPasswordAttribute: SignUpAttributeV2;
68
64
  }
69
65
 
70
- // A registered MFA method must be selected to continue sign-in.
71
66
  export interface FlowMFARequiredResultV2 extends FlowActionResultBaseV2 {
72
67
  type: typeof FLOW_MFA_REQUIRED_V2;
73
68
  continuationState: FlowContinuationStateV2;
74
69
  methods: AuthenticationMethodV2[];
75
70
  }
76
71
 
77
- // A new password must be submitted next for password reset.
78
72
  export interface FlowNewPasswordRequiredResultV2
79
73
  extends FlowActionResultBaseV2 {
80
74
  type: typeof FLOW_NEW_PASSWORD_REQUIRED_V2;
@@ -87,17 +81,12 @@ export interface FlowAttributesRequiredResultV2 extends FlowActionResultBaseV2 {
87
81
  attributes: SignUpAttributeV2[];
88
82
  }
89
83
 
90
- /*
91
- * A flow completed without automatically signing the account in. `continuationState`
92
- * carries the token to redeem for tokens.
93
- */
94
84
  export interface FlowSignInContinuationRequiredResultV2
95
85
  extends FlowActionResultBaseV2 {
96
86
  type: typeof FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2;
97
87
  continuationState: FlowContinuationStateV2;
98
88
  }
99
89
 
100
- // The flow completed and the account is signed in.
101
90
  export interface FlowCompletedResultV2 extends FlowActionResultBaseV2 {
102
91
  type: typeof FLOW_COMPLETED_V2;
103
92
  authenticationResult: AuthenticationResult;
@@ -127,17 +116,53 @@ export type FlowSubmitCodeResultV2 =
127
116
  | FlowAuthMethodRegistrationRequiredResultV2
128
117
  | FlowCompletedResultV2;
129
118
 
130
- export type FlowSignUpActionResultV2 =
119
+ export type FlowSignInStartResultV2 =
120
+ | FlowMethodSelectionRequiredResultV2
121
+ | FlowPasswordRequiredResultV2
122
+ | FlowSignInCodeRequiredResultV2;
123
+
124
+ export type FlowExistingAccountChallengeResultV2 =
125
+ | FlowExistingAccountCodeRequiredResultV2
126
+ | FlowExistingAccountPasswordRequiredResultV2;
127
+
128
+ export type FlowSignUpStartResultV2 =
131
129
  | FlowCodeRequiredResultV2
130
+ | FlowExistingAccountChallengeResultV2
131
+ | FlowMethodSelectionRequiredResultV2;
132
+
133
+ export type FlowResetPasswordStartResultV2 =
134
+ | FlowMethodSelectionRequiredResultV2
135
+ | FlowResetPasswordCodeRequiredResultV2;
136
+
137
+ export type FlowRequestChallengeResultV2 =
138
+ | FlowCodeRequiredResultV2
139
+ | FlowPasswordRequiredResultV2;
140
+
141
+ export type FlowSubmitNewPasswordResultV2 =
142
+ | FlowSignInContinuationRequiredResultV2
143
+ | FlowAuthMethodRegistrationRequiredResultV2
144
+ | FlowMFARequiredResultV2;
145
+
146
+ export type FlowSubmitSignInPasswordResultV2 =
147
+ | FlowMFARequiredResultV2
148
+ | FlowAuthMethodRegistrationRequiredResultV2
149
+ | FlowCompletedResultV2;
150
+
151
+ export type FlowSignUpSubmitAttributesResultV2 =
132
152
  | FlowSignUpPasswordRequiredResultV2
133
153
  | FlowAttributesRequiredResultV2
134
154
  | FlowAuthMethodRegistrationRequiredResultV2
135
155
  | FlowSignInContinuationRequiredResultV2;
136
156
 
137
- // Result type discriminators.
157
+ export type FlowSignUpVerificationResultV2 = FlowSignUpSubmitAttributesResultV2;
158
+
138
159
  export const FLOW_METHOD_SELECTION_REQUIRED_V2 =
139
160
  "FlowMethodSelectionRequiredResultV2";
140
161
  export const FLOW_CODE_REQUIRED_V2 = "FlowCodeRequiredResultV2";
162
+ export const FLOW_EXISTING_ACCOUNT_CODE_REQUIRED_V2 =
163
+ "FlowExistingAccountCodeRequiredResultV2";
164
+ export const FLOW_EXISTING_ACCOUNT_PASSWORD_REQUIRED_V2 =
165
+ "FlowExistingAccountPasswordRequiredResultV2";
141
166
  export const FLOW_PASSWORD_REQUIRED_V2 = "FlowPasswordRequiredResultV2";
142
167
  export const FLOW_SIGN_UP_PASSWORD_REQUIRED_V2 =
143
168
  "FlowSignUpPasswordRequiredResultV2";
@@ -164,6 +189,18 @@ export function createFlowCodeRequiredResultV2(
164
189
  return { type: FLOW_CODE_REQUIRED_V2, ...input };
165
190
  }
166
191
 
192
+ export function createFlowExistingAccountCodeRequiredResultV2(
193
+ input: Omit<FlowExistingAccountCodeRequiredResultV2, "type">
194
+ ): FlowExistingAccountCodeRequiredResultV2 {
195
+ return { type: FLOW_EXISTING_ACCOUNT_CODE_REQUIRED_V2, ...input };
196
+ }
197
+
198
+ export function createFlowExistingAccountPasswordRequiredResultV2(
199
+ input: Omit<FlowExistingAccountPasswordRequiredResultV2, "type">
200
+ ): FlowExistingAccountPasswordRequiredResultV2 {
201
+ return { type: FLOW_EXISTING_ACCOUNT_PASSWORD_REQUIRED_V2, ...input };
202
+ }
203
+
167
204
  export function createFlowPasswordRequiredResultV2(
168
205
  input: Omit<FlowPasswordRequiredResultV2, "type">
169
206
  ): FlowPasswordRequiredResultV2 {
@@ -3,10 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- // Content type used by V2 JSON `/api` requests.
7
6
  export const JSON_CONTENT_TYPE = "application/json";
8
7
 
9
- // Server action returned after successful credential verification.
10
8
  export const UPDATE_RELATION = "update";
11
9
  export const CHALLENGE_RELATION = "challenge";
12
10
  export const VERIFY_RELATION = "verify";
@@ -28,10 +26,6 @@ export const PhoneRegistrationChannelV2 = {
28
26
  SMS: "sms",
29
27
  } as const;
30
28
 
31
- /*
32
- * Known `state` values on a HAL response. Kept open (the body field is typed as string) because
33
- * the server may introduce new values; response parsing and flow logic branch on these constants.
34
- */
35
29
  export const ResponseStateV2 = {
36
30
  INTERACTION_REQUIRED: "interactionRequired",
37
31
  CONTINUE: "continue",
@@ -80,7 +80,6 @@ import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
80
80
 
81
81
  /*
82
82
  * Native Auth V2 network client that follows server-provided HAL links.
83
- * Flow-specific entry methods reuse shared challenge, verification, and token operations.
84
83
  */
85
84
  export class CustomAuthApiClientV2 extends BaseApiClientV2 {
86
85
  /*
@@ -127,23 +126,55 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
127
126
  context
128
127
  );
129
128
 
130
- return {
131
- continuationToken: this.handler.requireContinuationToken(
132
- parsedResponse.continuationToken,
133
- parsedResponse.correlationId
134
- ),
135
- submitAttributesHref: this.handler.requireHref(
136
- parsedResponse.body._links?.submitAttributes?.href,
137
- "submitAttributes",
138
- parsedResponse.correlationId
139
- ),
140
- attributes: parsedResponse.body.attributes,
141
- };
129
+ const challengeType =
130
+ parsedResponse.body.action === VERIFY_RELATION
131
+ ? parsedResponse.body.type
132
+ : undefined;
133
+ const isEmailChallenge =
134
+ typeof challengeType === "string" &&
135
+ challengeType.toLowerCase() === AuthenticationMethodTypeV2.EMAIL;
136
+
137
+ if (
138
+ parsedResponse.body.action === VERIFY_RELATION &&
139
+ isEmailChallenge
140
+ ) {
141
+ return this.toChallengeVerificationResult(parsedResponse);
142
+ }
143
+
144
+ if (parsedResponse.body.action === CHALLENGE_RELATION) {
145
+ return {
146
+ nextAction: CHALLENGE_RELATION,
147
+ continuationToken: this.handler.requireContinuationToken(
148
+ parsedResponse.continuationToken,
149
+ parsedResponse.correlationId
150
+ ),
151
+ methods: this.resolveMethods(
152
+ this.handler.requireMethods(
153
+ parsedResponse.body._embedded?.methods,
154
+ parsedResponse.correlationId
155
+ ),
156
+ parsedResponse.correlationId
157
+ ),
158
+ authenticationFactor: this.resolveAuthenticationFactor(
159
+ parsedResponse.body.challengeContext?.authenticationFactor,
160
+ parsedResponse.correlationId
161
+ ),
162
+ scenario: parsedResponse.body.scenario,
163
+ };
164
+ }
165
+
166
+ const message =
167
+ "Invalid HAL response: sign-up start did not return an email verification or authentication challenge";
168
+ this.logger?.error(message, parsedResponse.correlationId);
169
+ throw new CustomAuthApiError(
170
+ INVALID_HAL_RESPONSE,
171
+ message,
172
+ parsedResponse.correlationId
173
+ );
142
174
  }
143
175
 
144
176
  /*
145
- * Submits the initial sign-up attributes. A successful response has already
146
- * sent the email code and supplies the links needed to verify or resend it.
177
+ * Submits the initial sign-up attributes.
147
178
  */
148
179
  async submitSignUpAttributes(
149
180
  submitAttributesHref: string,
@@ -176,7 +207,10 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
176
207
  nextAction:
177
208
  SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES,
178
209
  continuationToken,
179
- attributes: parsedResponse.body.attributes ?? [],
210
+ attributes: this.handler.resolveSignUpAttributes(
211
+ parsedResponse.body.attributes,
212
+ correlationId
213
+ ),
180
214
  submitAttributesHref: this.handler.requireHref(
181
215
  parsedResponse.body._links?.submitAttributes?.href,
182
216
  "submitAttributes",
@@ -185,13 +219,6 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
185
219
  };
186
220
  }
187
221
 
188
- if (parsedResponse.body.action === VERIFY_RELATION) {
189
- return {
190
- ...this.toChallengeVerificationResult(parsedResponse),
191
- attributes: parsedResponse.body.attributes,
192
- };
193
- }
194
-
195
222
  if (parsedResponse.body.action === ENROLL_RELATION) {
196
223
  return {
197
224
  nextAction: ENROLL_RELATION,
@@ -441,11 +468,29 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
441
468
  return {
442
469
  nextAction,
443
470
  continuationToken,
444
- enrollmentMethods: this.resolveEnrollmentMethods(
471
+ methods: this.resolveEnrollmentMethods(
445
472
  this.handler.requireMethods(
446
473
  parsedResponse.body._embedded?.methods,
447
474
  correlationId
448
- ),
475
+ ) as EmbeddedEnrollmentMethodV2[],
476
+ correlationId
477
+ ),
478
+ };
479
+ }
480
+
481
+ if (nextAction === CHALLENGE_RELATION) {
482
+ return {
483
+ nextAction,
484
+ continuationToken,
485
+ authenticationFactor: this.resolveAuthenticationFactor(
486
+ parsedResponse.body.challengeContext?.authenticationFactor,
487
+ correlationId
488
+ ),
489
+ methods: this.resolveMethods(
490
+ this.handler.requireMethods(
491
+ parsedResponse.body._embedded?.methods,
492
+ correlationId
493
+ ) as EmbeddedMethodV2[],
449
494
  correlationId
450
495
  ),
451
496
  };
@@ -530,7 +575,10 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
530
575
  return {
531
576
  nextAction: COLLECT_ATTRIBUTES_RELATION,
532
577
  continuationToken,
533
- attributes: parsedResponse.body.attributes ?? [],
578
+ attributes: this.handler.resolveSignUpAttributes(
579
+ parsedResponse.body.attributes,
580
+ correlationId
581
+ ),
534
582
  submitAttributesHref: this.handler.requireHref(
535
583
  parsedResponse.body._links?.submitAttributes?.href,
536
584
  "submitAttributes",
@@ -7,7 +7,10 @@ import { Logger } from "@azure/msal-common/browser";
7
7
  import { HttpHeaderKeys } from "../../../../CustomAuthConstants.js";
8
8
  import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
9
9
  import { normalizeServerErrorV2 } from "./response/ErrorNormalizerV2.js";
10
- import { ParsedResponseV2 } from "./response/ResponsesV2.js";
10
+ import {
11
+ ParsedResponseV2,
12
+ SignUpAttributeResponseV2,
13
+ } from "./response/ResponsesV2.js";
11
14
  import {
12
15
  CONTINUATION_TOKEN_MISSING,
13
16
  INVALID_HAL_RESPONSE,
@@ -17,12 +20,7 @@ import {
17
20
  } from "./ErrorCodesV2.js";
18
21
 
19
22
  /*
20
- * Turns a raw HTTP response from a V2 endpoint into a typed, checked envelope, and validates HAL
21
- * relations. Raw-preserving: the body keeps its HAL `_links`/`_embedded` shape so the api-client
22
- * navigates typed hrefs directly. Parsing never throws on a non-200 status - every V2 response
23
- * (including the entry response) carries a meaningful body, so only a non-object body is a hard
24
- * failure; the wire error is normalized onto the envelope (`error`). Required response values use
25
- * shared guards after callers read their strongly typed response properties directly.
23
+ * Parses V2 HTTP responses and validates required response values.
26
24
  */
27
25
  export class ResponseHandlerV2 {
28
26
  constructor(private readonly logger?: Logger) {}
@@ -49,7 +47,6 @@ export class ResponseHandlerV2 {
49
47
 
50
48
  const isWebFallbackRequired = error?.subError === WEB_REDIRECT_REQUIRED;
51
49
 
52
- // Surface the header correlation id on the body (HalResponseBaseV2.correlationId).
53
50
  json.correlationId = correlationId;
54
51
 
55
52
  return {
@@ -108,6 +105,49 @@ export class ResponseHandlerV2 {
108
105
  return continuationToken;
109
106
  }
110
107
 
108
+ resolveSignUpAttributes(
109
+ attributes: SignUpAttributeResponseV2[] | undefined,
110
+ correlationId: string
111
+ ): SignUpAttributeResponseV2[] {
112
+ const resolved = attributes === undefined ? [] : attributes;
113
+ if (
114
+ !Array.isArray(resolved) ||
115
+ resolved.some(
116
+ (attribute) =>
117
+ typeof attribute !== "object" ||
118
+ attribute === null ||
119
+ typeof attribute.attributeId !== "string" ||
120
+ !attribute.attributeId.trim()
121
+ )
122
+ ) {
123
+ const message =
124
+ "Invalid HAL response: sign-up attributes must be an array of objects with nonempty string attributeId values";
125
+ this.logger?.error(message, correlationId);
126
+ throw new CustomAuthApiError(
127
+ INVALID_HAL_RESPONSE,
128
+ message,
129
+ correlationId
130
+ );
131
+ }
132
+
133
+ if (
134
+ resolved.some(
135
+ (attribute) => attribute.attributeId.toLowerCase() === "email"
136
+ )
137
+ ) {
138
+ const message =
139
+ "Invalid HAL response: email cannot be collected as a sign-up attribute";
140
+ this.logger?.error(message, correlationId);
141
+ throw new CustomAuthApiError(
142
+ INVALID_HAL_RESPONSE,
143
+ message,
144
+ correlationId
145
+ );
146
+ }
147
+
148
+ return resolved;
149
+ }
150
+
111
151
  // Required embedded auth methods; throws when `_embedded.methods` is absent or empty.
112
152
  requireMethods<T>(methods: T[] | undefined, correlationId: string): T[] {
113
153
  if (!methods?.length) {
@@ -147,7 +187,6 @@ export class ResponseHandlerV2 {
147
187
  );
148
188
  }
149
189
 
150
- // response.json() accepts primitives/arrays; every V2 body must be a JSON object.
151
190
  if (typeof json !== "object" || json === null || Array.isArray(json)) {
152
191
  this.logger?.error(
153
192
  "V2 response serialization failed: body is not a JSON object",
@@ -25,7 +25,7 @@ export interface OAuthFormRequestV2 {
25
25
 
26
26
  /*
27
27
  * Entry (POST /oauth2/v2.0/authorize-challenge): the flow's front door. OAuth form-encoded
28
- * and carries only `client_id` (via OAuthFormRequestV2). The response
28
+ * and carries `client_id` (via OAuthFormRequestV2), with optional scope and claims. The response
29
29
  * (`AuthorizeChallengeEntryResponseV2`) returns the seed `continuation_token` and the flat
30
30
  * `reset_password`/`sign_in`/`sign_up` hrefs.
31
31
  */
@@ -81,7 +81,7 @@ export type PasswordResetStartRequestV2 = StartRequestV2;
81
81
 
82
82
  export type SignInStartRequestV2 = StartRequestV2;
83
83
 
84
- export type SignUpStartRequestV2 = ActionRequestBaseV2;
84
+ export type SignUpStartRequestV2 = StartRequestV2;
85
85
 
86
86
  export interface SignUpSubmitAttributesRequestV2 extends ActionRequestBaseV2 {
87
87
  attributes: UserAccountAttributes & {
@@ -116,10 +116,8 @@ export interface AuthMethodRegistrationVerificationRequestV2
116
116
  // Submit a single credential to `/methods/{type}/{id}/verify`.
117
117
  /*
118
118
  * The credential is a distinct top-level key per method type (never overloaded onto one field):
119
- * email OTP sends `otp`. This is modelled as a discriminated union so the compiler enforces
120
- * that exactly one credential is present. Password-based verify is a future extension point:
121
- * add a `VerifyPasswordRequestV2` member (`password: string`) and include it in the union
122
- * without touching the OTP member.
119
+ * OTP verification sends `otp`, and password verification sends `password`.
120
+ * The union represents the supported credential request shapes.
123
121
  */
124
122
  type VerifyRequestBaseV2 = ActionRequestBaseV2;
125
123
 
@@ -3,7 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- // Nested error shape returned by the HAL `/api` resource endpoints.
7
6
  export interface AttributeValidationDetailV2 {
8
7
  attributeIds?: string[];
9
8
  code?: string;
@@ -24,7 +23,6 @@ export interface HalErrorResponseV2 {
24
23
  };
25
24
  }
26
25
 
27
- // Flat error shape returned by the OAuth endpoints (authorize-challenge entry and token).
28
26
  export interface OAuthErrorResponseV2 {
29
27
  error?: string;
30
28
  error_description?: string;
@@ -35,10 +33,6 @@ export interface OAuthErrorResponseV2 {
35
33
  correlation_id?: string;
36
34
  }
37
35
 
38
- /*
39
- * Normalized server error folded from either wire shape (flat OAuth or nested HAL) into one
40
- * struct. Response parsing adds it to the envelope so the api-client stays shape-agnostic.
41
- */
42
36
  export interface ServerErrorV2 {
43
37
  code: string;
44
38
  message?: string;