@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
@@ -19,6 +19,9 @@ import {
19
19
  FlowSubmitSignInPasswordParamsV2,
20
20
  FlowSubmitSignUpAttributesParamsV2,
21
21
  FlowSignInWithContinuationParamsV2,
22
+ FlowAuthMethodRegistrationRequiredParamsV2,
23
+ FlowRegisterAuthMethodParamsV2,
24
+ FlowVerifyAuthMethodRegistrationParamsV2,
22
25
  } from "./parameter/FlowParamsV2.js";
23
26
  import {
24
27
  createFlowMethodSelectionRequiredResultV2,
@@ -30,8 +33,11 @@ import {
30
33
  createFlowAttributesRequiredResultV2,
31
34
  createFlowSignInContinuationRequiredResultV2,
32
35
  createFlowCompletedResultV2,
36
+ createFlowAuthMethodRegistrationRequiredResultV2,
37
+ createFlowAuthMethodVerificationRequiredResultV2,
33
38
  FLOW_CODE_REQUIRED_V2,
34
39
  FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2,
40
+ FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
35
41
  } from "./result/FlowActionResultV2.js";
36
42
  import type {
37
43
  FlowMethodSelectionRequiredResultV2,
@@ -46,6 +52,8 @@ import type {
46
52
  FlowCompletedResultV2,
47
53
  FlowSignUpActionResultV2,
48
54
  FlowSubmitCodeResultV2,
55
+ FlowAuthMethodRegistrationRequiredResultV2,
56
+ FlowAuthMethodVerificationRequiredResultV2,
49
57
  } from "./result/FlowActionResultV2.js";
50
58
  import { BrowserConfiguration } from "../../../../config/Configuration.js";
51
59
  import { BrowserCacheManager } from "../../../../cache/BrowserCacheManager.js";
@@ -71,18 +79,32 @@ import {
71
79
  } from "../../telemetry/FlowApiIdHelperV2.js";
72
80
  import {
73
81
  AuthenticationFactorV2,
74
- ChallengeNextActionV2,
75
82
  type ChallengeVerificationResultV2,
76
- VerifyNextActionV2,
83
+ type EnrollmentResultV2,
77
84
  type VerifyResultV2,
78
85
  } from "../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
79
- import { AuthenticationMethodTypeV2 } from "../../network_client/custom_auth_api/v2/ApiClientConstantsV2.js";
86
+ import {
87
+ AuthenticationMethodTypeV2,
88
+ CHALLENGE_RELATION,
89
+ COLLECT_ATTRIBUTES_RELATION,
90
+ ENROLL_RELATION,
91
+ POLL_RELATION,
92
+ PhoneRegistrationChannelV2,
93
+ RISK_VERIFY_RELATION,
94
+ UPDATE_RELATION,
95
+ VERIFY_RELATION,
96
+ ResponseStateV2,
97
+ } from "../../network_client/custom_auth_api/v2/ApiClientConstantsV2.js";
80
98
  import type { FlowContinuationStateV2 } from "./FlowContinuationStateV2.js";
81
99
  import type { AuthenticationMethodV2 } from "../../auth_flow/v2/AuthenticationMethodV2.js";
100
+ import type { AuthenticationMethodRegistrationV2 } from "../../auth_flow/v2/AuthenticationMethodRegistrationV2.js";
82
101
  import {
83
102
  SignUpSubmitAttributesNextActionV2,
84
103
  type SignUpSubmitAttributesApiResultV2,
85
104
  } from "../../network_client/custom_auth_api/v2/result/SignUpResultsV2.js";
105
+ import type { AuthMethodRegistrationRequestV2 } from "../../network_client/custom_auth_api/v2/request/RequestsV2.js";
106
+ import { InvalidArgumentError } from "../../error/InvalidArgumentError.js";
107
+ import type { ResetPasswordPollResultV2 } from "../../network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.js";
86
108
 
87
109
  /*
88
110
  * Polls up to five times for password-update completion, waiting 1.5 seconds
@@ -134,6 +156,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
134
156
  | FlowPasswordRequiredResultV2
135
157
  | FlowSignInCodeRequiredResultV2
136
158
  | FlowMFARequiredResultV2
159
+ | FlowAuthMethodRegistrationRequiredResultV2
137
160
  | FlowCompletedResultV2
138
161
  > {
139
162
  const correlationId = parameters.correlationId;
@@ -295,9 +318,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
295
318
  correlationId
296
319
  );
297
320
 
298
- if (result.type === FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2) {
299
- const message =
300
- "Initial sign-up attribute submission cannot complete without code verification or additional attributes.";
321
+ if (
322
+ result.type === FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2 ||
323
+ result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2
324
+ ) {
325
+ const message = `Initial sign-up attribute submission returned unsupported next action '${submitResult.nextAction}'.`;
301
326
  this.logger.error(message, correlationId);
302
327
  throw new CustomAuthError(
303
328
  UNSUPPORTED_FLOW_TRANSITION,
@@ -477,6 +502,113 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
477
502
  );
478
503
  }
479
504
 
505
+ /*
506
+ * Registers the selected offered method and returns activation metadata.
507
+ */
508
+ async registerAuthMethod(
509
+ parameters: FlowRegisterAuthMethodParamsV2
510
+ ): Promise<FlowAuthMethodVerificationRequiredResultV2> {
511
+ const { continuationState, correlationId } = parameters;
512
+ if (!parameters.verificationContact?.trim()) {
513
+ throw new InvalidArgumentError(
514
+ "verificationContact",
515
+ correlationId
516
+ );
517
+ }
518
+
519
+ const registrationRequest = this.createRegistrationRequest(
520
+ parameters.method,
521
+ parameters.verificationContact,
522
+ continuationState.continuationToken,
523
+ correlationId
524
+ );
525
+ const context = this.createRequestContext(
526
+ PublicApiId.JIT_V2_ENROLL_AUTH_METHOD,
527
+ correlationId
528
+ );
529
+
530
+ this.logger.verbose(
531
+ "Registering a V2 authentication method.",
532
+ correlationId
533
+ );
534
+ const result = await this.apiClient.enrollAuthMethod(
535
+ this.requireLink(correlationId, parameters.method.enrollHref),
536
+ registrationRequest,
537
+ context
538
+ );
539
+
540
+ return this.createAuthMethodVerificationRequiredResult(
541
+ continuationState,
542
+ result,
543
+ correlationId
544
+ );
545
+ }
546
+
547
+ /*
548
+ * Activates the registered method and redeems the resulting continuation
549
+ * for tokens.
550
+ */
551
+ async verifyAuthMethodRegistration(
552
+ parameters: FlowVerifyAuthMethodRegistrationParamsV2
553
+ ): Promise<FlowCompletedResultV2> {
554
+ const { continuationState, correlationId } = parameters;
555
+
556
+ const context = this.createRequestContext(
557
+ PublicApiId.JIT_V2_SUBMIT_CHALLENGE,
558
+ correlationId
559
+ );
560
+ this.logger.verbose(
561
+ "Activating a V2 authentication method.",
562
+ correlationId
563
+ );
564
+ const result = await this.apiClient.activateAuthMethod(
565
+ this.requireLink(correlationId, continuationState.links.activate),
566
+ {
567
+ continuationToken: continuationState.continuationToken,
568
+ otp: parameters.code,
569
+ },
570
+ context
571
+ );
572
+
573
+ return this.completeSignInAfterVerification(
574
+ continuationState,
575
+ result.continuationToken,
576
+ correlationId
577
+ );
578
+ }
579
+
580
+ /*
581
+ * Requests a replacement activation challenge through the server-provided
582
+ * resend link using the latest continuation token.
583
+ */
584
+ async resendAuthMethodRegistrationChallenge(
585
+ parameters: FlowChallengeParamsV2
586
+ ): Promise<FlowAuthMethodVerificationRequiredResultV2> {
587
+ const { continuationState, correlationId } = parameters;
588
+ const context = this.createRequestContext(
589
+ PublicApiId.JIT_V2_RESEND_CHALLENGE,
590
+ correlationId
591
+ );
592
+ this.logger.verbose(
593
+ "Resending a V2 authentication-method activation challenge.",
594
+ correlationId
595
+ );
596
+ const result =
597
+ await this.apiClient.resendAuthMethodRegistrationChallenge(
598
+ this.requireLink(correlationId, continuationState.links.resend),
599
+ {
600
+ continuationToken: continuationState.continuationToken,
601
+ },
602
+ context
603
+ );
604
+
605
+ return this.createAuthMethodVerificationRequiredResult(
606
+ continuationState,
607
+ result,
608
+ correlationId
609
+ );
610
+ }
611
+
480
612
  /*
481
613
  * Verifies the submitted one-time code using the server-provided link. The
482
614
  * response determines the next required action.
@@ -490,7 +622,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
490
622
  this.resolveStepApiId(
491
623
  continuationState.scenario,
492
624
  "submitCode",
493
- correlationId
625
+ correlationId,
626
+ parameters.authenticationFactor
494
627
  ),
495
628
  correlationId
496
629
  );
@@ -514,7 +647,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
514
647
  if (
515
648
  continuationState.scenario ===
516
649
  CustomAuthFlowScenarioV2.PasswordReset &&
517
- verifyResult.nextAction === VerifyNextActionV2.UPDATE
650
+ verifyResult.nextAction === UPDATE_RELATION
518
651
  ) {
519
652
  return createFlowNewPasswordRequiredResultV2({
520
653
  correlationId,
@@ -535,61 +668,12 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
535
668
  );
536
669
  }
537
670
 
538
- if (
539
- continuationState.scenario === CustomAuthFlowScenarioV2.SignUp &&
540
- verifyResult.nextAction === VerifyNextActionV2.COLLECT_ATTRIBUTES
541
- ) {
542
- const requiredPasswordAttribute = verifyResult.attributes.find(
543
- (attribute) =>
544
- attribute.attributeId.toLowerCase() === "password" &&
545
- attribute.required === true
546
- );
547
- const nextContinuationState: FlowContinuationStateV2 = {
548
- continuationToken: verifyResult.continuationToken,
549
- scenario: continuationState.scenario,
550
- scopes: continuationState.scopes,
551
- links: {
552
- submitAttributes: verifyResult.submitAttributesHref,
553
- },
554
- signUp: continuationState.signUp,
555
- };
556
- const attributes = verifyResult.attributes.filter(
557
- (attribute) =>
558
- attribute.attributeId.toLowerCase() !== "password"
671
+ if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp) {
672
+ return this.handleSignUpVerification(
673
+ continuationState,
674
+ verifyResult,
675
+ correlationId
559
676
  );
560
-
561
- if (
562
- requiredPasswordAttribute &&
563
- continuationState.signUp?.passwordWasSupplied !== true
564
- ) {
565
- return createFlowSignUpPasswordRequiredResultV2({
566
- correlationId,
567
- continuationState: nextContinuationState,
568
- attributes,
569
- requiredPasswordAttribute,
570
- });
571
- }
572
-
573
- return createFlowAttributesRequiredResultV2({
574
- correlationId,
575
- continuationState: nextContinuationState,
576
- attributes,
577
- });
578
- }
579
-
580
- if (
581
- continuationState.scenario === CustomAuthFlowScenarioV2.SignUp &&
582
- verifyResult.nextAction === VerifyNextActionV2.CONTINUE
583
- ) {
584
- return createFlowSignInContinuationRequiredResultV2({
585
- correlationId,
586
- continuationState: {
587
- continuationToken: verifyResult.continuationToken,
588
- scenario: continuationState.scenario,
589
- scopes: continuationState.scopes,
590
- links: {},
591
- },
592
- });
593
677
  }
594
678
 
595
679
  const message = `Verification next action '${verifyResult.nextAction}' is not supported for the '${continuationState.scenario}' flow.`;
@@ -676,7 +760,10 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
676
760
  */
677
761
  async submitNewPassword(
678
762
  parameters: FlowSubmitNewPasswordParamsV2
679
- ): Promise<FlowSignInContinuationRequiredResultV2> {
763
+ ): Promise<
764
+ | FlowSignInContinuationRequiredResultV2
765
+ | FlowAuthMethodRegistrationRequiredResultV2
766
+ > {
680
767
  const continuationState = parameters.continuationState;
681
768
  const correlationId = parameters.correlationId;
682
769
  const context = this.createRequestContext(
@@ -701,29 +788,30 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
701
788
 
702
789
  let pollToken = updateResult.continuationToken;
703
790
  let pollHref = updateResult.pollHref;
704
- let completionToken: string | undefined;
791
+ let pollResult: ResetPasswordPollResultV2 | undefined;
792
+ let isPolling = false;
705
793
 
706
794
  for (let attempt = 1; attempt <= POLL_MAX_ATTEMPTS; attempt++) {
707
- const pollResult = await this.apiClient.poll(
795
+ pollResult = await this.apiClient.poll(
708
796
  pollHref,
709
797
  { continuationToken: pollToken },
710
798
  context
711
799
  );
712
800
 
713
- if (pollResult.isCompleted) {
714
- completionToken = pollResult.continuationToken;
801
+ isPolling = pollResult.nextAction === POLL_RELATION;
802
+ if (!isPolling) {
715
803
  break;
716
804
  }
717
805
 
718
806
  pollToken = pollResult.continuationToken;
719
- pollHref = pollResult.pollHref ?? pollHref;
807
+ pollHref = this.requireLink(correlationId, pollResult.pollHref);
720
808
 
721
809
  if (attempt < POLL_MAX_ATTEMPTS) {
722
810
  await delay(POLL_INTERVAL_MS);
723
811
  }
724
812
  }
725
813
 
726
- if (!completionToken) {
814
+ if (!pollResult || isPolling) {
727
815
  const message =
728
816
  "The password reset did not complete within the allotted number of polling attempts.";
729
817
  this.logger.error(message, correlationId);
@@ -735,20 +823,45 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
735
823
  );
736
824
  }
737
825
 
738
- this.logger.verbose(
739
- "V2 password reset applied; sign-in required.",
826
+ if (
827
+ pollResult.nextAction === ENROLL_RELATION &&
828
+ pollResult.enrollmentMethods
829
+ ) {
830
+ return this.createAuthMethodRegistrationRequiredResult({
831
+ correlationId,
832
+ continuationState: {
833
+ ...continuationState,
834
+ continuationToken: pollResult.continuationToken,
835
+ links: {},
836
+ },
837
+ methods: pollResult.enrollmentMethods,
838
+ });
839
+ }
840
+
841
+ if (pollResult.nextAction === ResponseStateV2.CONTINUE) {
842
+ this.logger.verbose(
843
+ "V2 password reset applied; sign-in required.",
844
+ correlationId
845
+ );
846
+
847
+ return createFlowSignInContinuationRequiredResultV2({
848
+ correlationId,
849
+ continuationState: {
850
+ continuationToken: pollResult.continuationToken,
851
+ scenario: continuationState.scenario,
852
+ scopes: continuationState.scopes,
853
+ links: {},
854
+ },
855
+ });
856
+ }
857
+
858
+ const message = `Password reset poll next action '${pollResult.nextAction}' is not supported.`;
859
+ this.logger.error(message, correlationId);
860
+ throw new CustomAuthError(
861
+ UNSUPPORTED_FLOW_TRANSITION,
862
+ message,
740
863
  correlationId
741
864
  );
742
-
743
- return createFlowSignInContinuationRequiredResultV2({
744
- correlationId,
745
- continuationState: {
746
- continuationToken: completionToken,
747
- scenario: continuationState.scenario,
748
- scopes: continuationState.scopes,
749
- links: {},
750
- },
751
- });
752
865
  }
753
866
 
754
867
  /*
@@ -756,7 +869,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
756
869
  */
757
870
  async submitSignInPassword(
758
871
  parameters: FlowSubmitSignInPasswordParamsV2
759
- ): Promise<FlowMFARequiredResultV2 | FlowCompletedResultV2> {
872
+ ): Promise<
873
+ | FlowMFARequiredResultV2
874
+ | FlowAuthMethodRegistrationRequiredResultV2
875
+ | FlowCompletedResultV2
876
+ > {
760
877
  const verifyResult = await this.verifySignInPassword(parameters);
761
878
 
762
879
  return this.handleSignInVerification(
@@ -816,8 +933,24 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
816
933
  continuationState: FlowContinuationStateV2,
817
934
  verifyResult: VerifyResultV2,
818
935
  correlationId: string
819
- ): Promise<FlowMFARequiredResultV2 | FlowCompletedResultV2> {
820
- if (verifyResult.nextAction === VerifyNextActionV2.CHALLENGE) {
936
+ ): Promise<
937
+ | FlowMFARequiredResultV2
938
+ | FlowAuthMethodRegistrationRequiredResultV2
939
+ | FlowCompletedResultV2
940
+ > {
941
+ if (verifyResult.nextAction === ENROLL_RELATION) {
942
+ return this.createAuthMethodRegistrationRequiredResult({
943
+ correlationId,
944
+ continuationState: {
945
+ ...continuationState,
946
+ continuationToken: verifyResult.continuationToken,
947
+ links: {},
948
+ },
949
+ methods: verifyResult.methods,
950
+ });
951
+ }
952
+
953
+ if (verifyResult.nextAction === CHALLENGE_RELATION) {
821
954
  this.ensureAuthenticationFactor(
822
955
  verifyResult.authenticationFactor,
823
956
  AuthenticationFactorV2.MULTI_FACTOR,
@@ -842,7 +975,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
842
975
  });
843
976
  }
844
977
 
845
- if (verifyResult.nextAction === VerifyNextActionV2.CONTINUE) {
978
+ if (verifyResult.nextAction === ResponseStateV2.CONTINUE) {
846
979
  return this.completeSignInAfterVerification(
847
980
  continuationState,
848
981
  verifyResult.continuationToken,
@@ -859,6 +992,87 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
859
992
  );
860
993
  }
861
994
 
995
+ private handleSignUpVerification(
996
+ continuationState: FlowContinuationStateV2,
997
+ verifyResult: VerifyResultV2,
998
+ correlationId: string
999
+ ):
1000
+ | FlowAuthMethodRegistrationRequiredResultV2
1001
+ | FlowSignUpPasswordRequiredResultV2
1002
+ | FlowAttributesRequiredResultV2
1003
+ | FlowSignInContinuationRequiredResultV2 {
1004
+ if (verifyResult.nextAction === COLLECT_ATTRIBUTES_RELATION) {
1005
+ const requiredPasswordAttribute = verifyResult.attributes.find(
1006
+ (attribute) =>
1007
+ attribute.attributeId.toLowerCase() === "password" &&
1008
+ attribute.required === true
1009
+ );
1010
+ const nextContinuationState: FlowContinuationStateV2 = {
1011
+ continuationToken: verifyResult.continuationToken,
1012
+ scenario: continuationState.scenario,
1013
+ scopes: continuationState.scopes,
1014
+ links: {
1015
+ submitAttributes: verifyResult.submitAttributesHref,
1016
+ },
1017
+ signUp: continuationState.signUp,
1018
+ };
1019
+ const attributes = verifyResult.attributes.filter(
1020
+ (attribute) =>
1021
+ attribute.attributeId.toLowerCase() !== "password"
1022
+ );
1023
+
1024
+ if (
1025
+ requiredPasswordAttribute &&
1026
+ continuationState.signUp?.passwordWasSupplied !== true
1027
+ ) {
1028
+ return createFlowSignUpPasswordRequiredResultV2({
1029
+ correlationId,
1030
+ continuationState: nextContinuationState,
1031
+ attributes,
1032
+ requiredPasswordAttribute,
1033
+ });
1034
+ }
1035
+
1036
+ return createFlowAttributesRequiredResultV2({
1037
+ correlationId,
1038
+ continuationState: nextContinuationState,
1039
+ attributes,
1040
+ });
1041
+ }
1042
+
1043
+ if (verifyResult.nextAction === ENROLL_RELATION) {
1044
+ return this.createAuthMethodRegistrationRequiredResult({
1045
+ correlationId,
1046
+ continuationState: {
1047
+ ...continuationState,
1048
+ continuationToken: verifyResult.continuationToken,
1049
+ links: {},
1050
+ },
1051
+ methods: verifyResult.methods,
1052
+ });
1053
+ }
1054
+
1055
+ if (verifyResult.nextAction === ResponseStateV2.CONTINUE) {
1056
+ return createFlowSignInContinuationRequiredResultV2({
1057
+ correlationId,
1058
+ continuationState: {
1059
+ continuationToken: verifyResult.continuationToken,
1060
+ scenario: continuationState.scenario,
1061
+ scopes: continuationState.scopes,
1062
+ links: {},
1063
+ },
1064
+ });
1065
+ }
1066
+
1067
+ const message = `Verification next action '${verifyResult.nextAction}' is not supported for the '${continuationState.scenario}' flow.`;
1068
+ this.logger.error(message, correlationId);
1069
+ throw new CustomAuthError(
1070
+ UNSUPPORTED_FLOW_TRANSITION,
1071
+ message,
1072
+ correlationId
1073
+ );
1074
+ }
1075
+
862
1076
  private getSupportedSignInMethods(
863
1077
  methods: AuthenticationMethodV2[],
864
1078
  correlationId: string
@@ -886,6 +1100,132 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
886
1100
  );
887
1101
  }
888
1102
 
1103
+ private createRegistrationRequest(
1104
+ method: AuthenticationMethodRegistrationV2,
1105
+ verificationContact: string,
1106
+ continuationToken: string,
1107
+ correlationId: string
1108
+ ): AuthMethodRegistrationRequestV2 {
1109
+ if (method.type === AuthenticationMethodTypeV2.EMAIL) {
1110
+ return {
1111
+ continuationToken,
1112
+ email: verificationContact,
1113
+ };
1114
+ }
1115
+
1116
+ const [channel] = method.channels ?? [];
1117
+ if (
1118
+ method.type === AuthenticationMethodTypeV2.PHONE &&
1119
+ channel === PhoneRegistrationChannelV2.SMS
1120
+ ) {
1121
+ return {
1122
+ continuationToken,
1123
+ phoneNumber: verificationContact,
1124
+ channel,
1125
+ };
1126
+ }
1127
+
1128
+ throw new CustomAuthError(
1129
+ UNSUPPORTED_FLOW_TRANSITION,
1130
+ "The selected authentication method is not supported for registration.",
1131
+ correlationId
1132
+ );
1133
+ }
1134
+
1135
+ private createAuthMethodRegistrationRequiredResult(
1136
+ parameters: FlowAuthMethodRegistrationRequiredParamsV2
1137
+ ): FlowAuthMethodRegistrationRequiredResultV2 {
1138
+ const { correlationId, continuationState } = parameters;
1139
+ const supportedMethods = parameters.methods.filter((method) => {
1140
+ const methodType = method.type.trim().toLowerCase();
1141
+ return (
1142
+ methodType === AuthenticationMethodTypeV2.EMAIL ||
1143
+ (methodType === AuthenticationMethodTypeV2.PHONE &&
1144
+ method.channels?.includes(PhoneRegistrationChannelV2.SMS))
1145
+ );
1146
+ });
1147
+
1148
+ if (supportedMethods.length === 0) {
1149
+ const message =
1150
+ "The enrollment response did not include a supported registration method.";
1151
+ this.logger.error(message, correlationId);
1152
+ throw new CustomAuthError(
1153
+ UNSUPPORTED_FLOW_TRANSITION,
1154
+ message,
1155
+ correlationId
1156
+ );
1157
+ }
1158
+
1159
+ const methods = supportedMethods.map((method) => {
1160
+ const methodType = method.type.trim().toLowerCase();
1161
+ const channel = method.channels?.find(
1162
+ (candidate) => candidate === PhoneRegistrationChannelV2.SMS
1163
+ );
1164
+
1165
+ if (methodType === AuthenticationMethodTypeV2.EMAIL) {
1166
+ return {
1167
+ type: AuthenticationMethodTypeV2.EMAIL,
1168
+ enrollHref: this.requireLink(
1169
+ correlationId,
1170
+ method.enrollHref
1171
+ ),
1172
+ };
1173
+ }
1174
+
1175
+ if (
1176
+ methodType === AuthenticationMethodTypeV2.PHONE &&
1177
+ channel === PhoneRegistrationChannelV2.SMS
1178
+ ) {
1179
+ return {
1180
+ type: AuthenticationMethodTypeV2.PHONE,
1181
+ channels: [channel],
1182
+ enrollHref: this.requireLink(
1183
+ correlationId,
1184
+ method.enrollHref
1185
+ ),
1186
+ };
1187
+ }
1188
+
1189
+ const message =
1190
+ "The enrollment response included an unsupported registration method.";
1191
+ this.logger.error(message, correlationId);
1192
+ throw new CustomAuthError(
1193
+ UNSUPPORTED_FLOW_TRANSITION,
1194
+ message,
1195
+ correlationId
1196
+ );
1197
+ });
1198
+
1199
+ return createFlowAuthMethodRegistrationRequiredResultV2({
1200
+ correlationId,
1201
+ continuationState,
1202
+ methods,
1203
+ });
1204
+ }
1205
+
1206
+ private createAuthMethodVerificationRequiredResult(
1207
+ continuationState: FlowContinuationStateV2,
1208
+ result: EnrollmentResultV2,
1209
+ correlationId: string
1210
+ ): FlowAuthMethodVerificationRequiredResultV2 {
1211
+ return createFlowAuthMethodVerificationRequiredResultV2({
1212
+ correlationId,
1213
+ continuationState: {
1214
+ ...continuationState,
1215
+ continuationToken: result.continuationToken,
1216
+ links: {
1217
+ activate: this.requireLink(
1218
+ correlationId,
1219
+ result.activateHref
1220
+ ),
1221
+ resend: result.resendHref,
1222
+ },
1223
+ },
1224
+ sentTo: result.hint,
1225
+ codeLength: result.codeLength,
1226
+ });
1227
+ }
1228
+
889
1229
  private toSignUpActionResult(
890
1230
  result: SignUpSubmitAttributesApiResultV2,
891
1231
  continuationState: FlowContinuationStateV2,
@@ -912,6 +1252,18 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
912
1252
  });
913
1253
  }
914
1254
 
1255
+ if (result.nextAction === SignUpSubmitAttributesNextActionV2.ENROLL) {
1256
+ return this.createAuthMethodRegistrationRequiredResult({
1257
+ correlationId,
1258
+ continuationState: {
1259
+ ...continuationState,
1260
+ continuationToken: result.continuationToken,
1261
+ links: {},
1262
+ },
1263
+ methods: result.methods,
1264
+ });
1265
+ }
1266
+
915
1267
  if (
916
1268
  result.nextAction ===
917
1269
  SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES
@@ -1049,7 +1401,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
1049
1401
  this.resolveStepApiId(
1050
1402
  continuationState.scenario,
1051
1403
  step,
1052
- correlationId
1404
+ correlationId,
1405
+ parameters.authenticationFactor
1053
1406
  ),
1054
1407
  correlationId
1055
1408
  );
@@ -1068,11 +1421,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
1068
1421
  );
1069
1422
  const nextAction: string = challengeResult.nextAction;
1070
1423
 
1071
- if (challengeResult.nextAction === ChallengeNextActionV2.VERIFY) {
1424
+ if (challengeResult.nextAction === VERIFY_RELATION) {
1072
1425
  return challengeResult;
1073
1426
  }
1074
1427
 
1075
- if (challengeResult.nextAction === ChallengeNextActionV2.RISK_VERIFY) {
1428
+ if (challengeResult.nextAction === RISK_VERIFY_RELATION) {
1076
1429
  return this.apiClient.verifyRisk(
1077
1430
  challengeResult.riskVerifyHref,
1078
1431
  { continuationToken: challengeResult.continuationToken },
@@ -1113,9 +1466,10 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
1113
1466
  private resolveStepApiId(
1114
1467
  scenario: CustomAuthFlowScenarioV2,
1115
1468
  step: FlowStepV2,
1116
- correlationId: string
1469
+ correlationId: string,
1470
+ authenticationFactor?: AuthenticationFactorV2
1117
1471
  ): number {
1118
- const apiId = getPublicApiIdV2(scenario, step);
1472
+ const apiId = getPublicApiIdV2(scenario, step, authenticationFactor);
1119
1473
 
1120
1474
  if (apiId === undefined) {
1121
1475
  const message = `No telemetry API id is registered for step '${step}' of the '${scenario}' flow.`;
@@ -1136,7 +1490,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
1136
1490
  href: string | undefined,
1137
1491
  missingLinkError?: { code: string; message: string }
1138
1492
  ): string {
1139
- if (!href) {
1493
+ if (typeof href !== "string" || !href.trim()) {
1140
1494
  const errorCode =
1141
1495
  missingLinkError?.code ?? CONTINUATION_LINK_MISSING;
1142
1496
  const message =