@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
@@ -5,6 +5,11 @@
5
5
 
6
6
  import { FlowContinuationStateV2 } from "../FlowContinuationStateV2.js";
7
7
  import { UserAccountAttributes } from "../../../../UserAccountAttributes.js";
8
+ import type {
9
+ AuthenticationFactorV2,
10
+ EnrollmentMethodV2,
11
+ } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
12
+ import type { AuthenticationMethodRegistrationV2 } from "../../../auth_flow/v2/AuthenticationMethodRegistrationV2.js";
8
13
 
9
14
  /*
10
15
  * Input parameters for V2 interaction-client actions. Continuing actions carry
@@ -34,11 +39,13 @@ export interface FlowSignUpStartParamsV2 extends FlowStartParamsV2 {
34
39
  // Request the challenge for the selected method, sending the one-time code to it.
35
40
  export interface FlowChallengeParamsV2 extends FlowParamsBaseV2 {
36
41
  continuationState: FlowContinuationStateV2;
42
+ authenticationFactor?: AuthenticationFactorV2;
37
43
  }
38
44
 
39
45
  // Submit the one-time code the user received.
40
46
  export interface FlowSubmitCodeParamsV2 extends FlowParamsBaseV2 {
41
47
  continuationState: FlowContinuationStateV2;
48
+ authenticationFactor?: AuthenticationFactorV2;
42
49
  code: string;
43
50
  }
44
51
 
@@ -62,3 +69,21 @@ export interface FlowSubmitSignUpAttributesParamsV2 extends FlowParamsBaseV2 {
62
69
  export interface FlowSignInWithContinuationParamsV2 extends FlowParamsBaseV2 {
63
70
  continuationState: FlowContinuationStateV2;
64
71
  }
72
+
73
+ export interface FlowAuthMethodRegistrationRequiredParamsV2
74
+ extends FlowParamsBaseV2 {
75
+ continuationState: FlowContinuationStateV2;
76
+ methods: EnrollmentMethodV2[];
77
+ }
78
+
79
+ export interface FlowRegisterAuthMethodParamsV2 extends FlowParamsBaseV2 {
80
+ continuationState: FlowContinuationStateV2;
81
+ method: AuthenticationMethodRegistrationV2;
82
+ verificationContact: string;
83
+ }
84
+
85
+ export interface FlowVerifyAuthMethodRegistrationParamsV2
86
+ extends FlowParamsBaseV2 {
87
+ continuationState: FlowContinuationStateV2;
88
+ code: string;
89
+ }
@@ -7,6 +7,7 @@ import { AuthenticationResult } from "../../../../../response/AuthenticationResu
7
7
  import { AuthenticationMethodV2 } from "../../../auth_flow/v2/AuthenticationMethodV2.js";
8
8
  import { FlowContinuationStateV2 } from "../FlowContinuationStateV2.js";
9
9
  import { SignUpAttributeV2 } from "../../../network_client/custom_auth_api/v2/result/SignUpResultsV2.js";
10
+ import { AuthenticationMethodRegistrationV2 } from "../../../auth_flow/v2/AuthenticationMethodRegistrationV2.js";
10
11
 
11
12
  /*
12
13
  * Unified outcome envelope returned by V2 interaction-client actions. The L1
@@ -102,18 +103,35 @@ export interface FlowCompletedResultV2 extends FlowActionResultBaseV2 {
102
103
  authenticationResult: AuthenticationResult;
103
104
  }
104
105
 
106
+ export interface FlowAuthMethodRegistrationRequiredResultV2
107
+ extends FlowActionResultBaseV2 {
108
+ type: typeof FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2;
109
+ continuationState: FlowContinuationStateV2;
110
+ methods: AuthenticationMethodRegistrationV2[];
111
+ }
112
+
113
+ export interface FlowAuthMethodVerificationRequiredResultV2
114
+ extends FlowActionResultBaseV2 {
115
+ type: typeof FLOW_AUTH_METHOD_VERIFICATION_REQUIRED_V2;
116
+ continuationState: FlowContinuationStateV2;
117
+ sentTo?: string;
118
+ codeLength: number;
119
+ }
120
+
105
121
  export type FlowSubmitCodeResultV2 =
106
122
  | FlowNewPasswordRequiredResultV2
107
123
  | FlowSignUpPasswordRequiredResultV2
108
124
  | FlowAttributesRequiredResultV2
109
125
  | FlowSignInContinuationRequiredResultV2
110
126
  | FlowMFARequiredResultV2
127
+ | FlowAuthMethodRegistrationRequiredResultV2
111
128
  | FlowCompletedResultV2;
112
129
 
113
130
  export type FlowSignUpActionResultV2 =
114
131
  | FlowCodeRequiredResultV2
115
132
  | FlowSignUpPasswordRequiredResultV2
116
133
  | FlowAttributesRequiredResultV2
134
+ | FlowAuthMethodRegistrationRequiredResultV2
117
135
  | FlowSignInContinuationRequiredResultV2;
118
136
 
119
137
  // Result type discriminators.
@@ -129,6 +147,10 @@ export const FLOW_ATTRIBUTES_REQUIRED_V2 = "FlowAttributesRequiredResultV2";
129
147
  export const FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2 =
130
148
  "FlowSignInContinuationRequiredResultV2";
131
149
  export const FLOW_COMPLETED_V2 = "FlowCompletedResultV2";
150
+ export const FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2 =
151
+ "FlowAuthMethodRegistrationRequiredResultV2";
152
+ export const FLOW_AUTH_METHOD_VERIFICATION_REQUIRED_V2 =
153
+ "FlowAuthMethodVerificationRequiredResultV2";
132
154
 
133
155
  export function createFlowMethodSelectionRequiredResultV2(
134
156
  input: Omit<FlowMethodSelectionRequiredResultV2, "type">
@@ -183,3 +205,15 @@ export function createFlowCompletedResultV2(
183
205
  ): FlowCompletedResultV2 {
184
206
  return { type: FLOW_COMPLETED_V2, ...input };
185
207
  }
208
+
209
+ export function createFlowAuthMethodRegistrationRequiredResultV2(
210
+ input: Omit<FlowAuthMethodRegistrationRequiredResultV2, "type">
211
+ ): FlowAuthMethodRegistrationRequiredResultV2 {
212
+ return { type: FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2, ...input };
213
+ }
214
+
215
+ export function createFlowAuthMethodVerificationRequiredResultV2(
216
+ input: Omit<FlowAuthMethodVerificationRequiredResultV2, "type">
217
+ ): FlowAuthMethodVerificationRequiredResultV2 {
218
+ return { type: FLOW_AUTH_METHOD_VERIFICATION_REQUIRED_V2, ...input };
219
+ }
@@ -12,10 +12,19 @@ export const CHALLENGE_RELATION = "challenge";
12
12
  export const VERIFY_RELATION = "verify";
13
13
  export const RISK_VERIFY_RELATION = "riskverify";
14
14
  export const COLLECT_ATTRIBUTES_RELATION = "collectAttributes";
15
+ export const ENROLL_RELATION = "enroll";
16
+ export const ACTIVATE_RELATION = "activate";
17
+ export const RESEND_RELATION = "resend";
18
+ export const POLL_RELATION = "poll";
15
19
 
16
20
  export const AuthenticationMethodTypeV2 = {
17
21
  EMAIL: "email",
18
22
  PASSWORD: "password",
23
+ PHONE: "phone",
24
+ SMS: "sms",
25
+ } as const;
26
+
27
+ export const PhoneRegistrationChannelV2 = {
19
28
  SMS: "sms",
20
29
  } as const;
21
30
 
@@ -15,11 +15,12 @@ import {
15
15
  StartResultV2,
16
16
  StartMethodV2,
17
17
  ChallengeResultV2,
18
- ChallengeNextActionV2,
19
18
  ChallengeVerificationResultV2,
20
19
  VerifyResultV2,
21
- VerifyNextActionV2,
22
20
  AuthenticationFactorV2,
21
+ ActivationResultV2,
22
+ EnrollmentResultV2,
23
+ EnrollmentMethodV2,
23
24
  } from "./result/BaseResultsV2.js";
24
25
  import {
25
26
  SignUpStartApiResultV2,
@@ -40,6 +41,9 @@ import {
40
41
  PollResponseV2,
41
42
  ParsedResponseV2,
42
43
  EmbeddedMethodV2,
44
+ EmbeddedEnrollmentMethodV2,
45
+ EnrollmentResponseV2,
46
+ HalResponseBaseV2,
43
47
  } from "./response/ResponsesV2.js";
44
48
  import {
45
49
  RequestContextV2,
@@ -51,6 +55,8 @@ import {
51
55
  VerifyRequestV2,
52
56
  UpdatePasswordRequestV2,
53
57
  PollRequestV2,
58
+ AuthMethodRegistrationRequestV2,
59
+ AuthMethodRegistrationVerificationRequestV2,
54
60
  } from "./request/RequestsV2.js";
55
61
  import {
56
62
  CHALLENGE_RELATION,
@@ -60,6 +66,10 @@ import {
60
66
  RISK_VERIFY_RELATION,
61
67
  AuthenticationMethodTypeV2,
62
68
  ResponseStateV2,
69
+ ACTIVATE_RELATION,
70
+ ENROLL_RELATION,
71
+ RESEND_RELATION,
72
+ POLL_RELATION,
63
73
  } from "./ApiClientConstantsV2.js";
64
74
  import {
65
75
  INVALID_HAL_RESPONSE,
@@ -182,6 +192,20 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
182
192
  };
183
193
  }
184
194
 
195
+ if (parsedResponse.body.action === ENROLL_RELATION) {
196
+ return {
197
+ nextAction: ENROLL_RELATION,
198
+ continuationToken,
199
+ methods: this.resolveEnrollmentMethods(
200
+ this.handler.requireMethods(
201
+ parsedResponse.body._embedded?.methods,
202
+ correlationId
203
+ ),
204
+ correlationId
205
+ ),
206
+ };
207
+ }
208
+
185
209
  const message =
186
210
  "Invalid HAL response: sign-up attribute submission returned no known next action";
187
211
  this.logger?.error(message, correlationId);
@@ -265,6 +289,100 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
265
289
  return this.toVerifyResult(parsedResponse);
266
290
  }
267
291
 
292
+ async enrollAuthMethod(
293
+ enrollHref: string,
294
+ request: AuthMethodRegistrationRequestV2,
295
+ context: RequestContextV2
296
+ ): Promise<EnrollmentResultV2> {
297
+ return this.sendEnrollmentRequest(enrollHref, request, context);
298
+ }
299
+
300
+ async resendAuthMethodRegistrationChallenge(
301
+ resendHref: string,
302
+ request: ChallengeRequestV2,
303
+ context: RequestContextV2
304
+ ): Promise<EnrollmentResultV2> {
305
+ return this.sendEnrollmentRequest(resendHref, request, context);
306
+ }
307
+
308
+ private async sendEnrollmentRequest(
309
+ href: string,
310
+ request: ChallengeRequestV2,
311
+ context: RequestContextV2
312
+ ): Promise<EnrollmentResultV2> {
313
+ const parsedResponse =
314
+ await this.sendActionRequest<EnrollmentResponseV2>(
315
+ href,
316
+ HttpMethod.POST,
317
+ request,
318
+ context
319
+ );
320
+
321
+ if (parsedResponse.body.action !== ACTIVATE_RELATION) {
322
+ throw new CustomAuthApiError(
323
+ INVALID_HAL_RESPONSE,
324
+ "Invalid HAL response: enrollment returned no activation action",
325
+ parsedResponse.correlationId
326
+ );
327
+ }
328
+
329
+ const links = parsedResponse.body._links;
330
+
331
+ return {
332
+ nextAction: ACTIVATE_RELATION,
333
+ continuationToken: this.handler.requireContinuationToken(
334
+ parsedResponse.continuationToken,
335
+ parsedResponse.correlationId
336
+ ),
337
+ hint: parsedResponse.body.hint,
338
+ codeLength: this.normalizeCodeLength(
339
+ parsedResponse.body.codeLength
340
+ ),
341
+ activateHref: this.handler.requireHref(
342
+ links?.activate?.href,
343
+ ACTIVATE_RELATION,
344
+ parsedResponse.correlationId
345
+ ),
346
+ resendHref:
347
+ links && "resend" in links
348
+ ? this.handler.requireHref(
349
+ links.resend?.href,
350
+ RESEND_RELATION,
351
+ parsedResponse.correlationId
352
+ )
353
+ : undefined,
354
+ };
355
+ }
356
+
357
+ async activateAuthMethod(
358
+ activateHref: string,
359
+ request: AuthMethodRegistrationVerificationRequestV2,
360
+ context: RequestContextV2
361
+ ): Promise<ActivationResultV2> {
362
+ const parsedResponse = await this.sendActionRequest<HalResponseBaseV2>(
363
+ activateHref,
364
+ HttpMethod.POST,
365
+ request,
366
+ context
367
+ );
368
+
369
+ if (parsedResponse.body.state !== ResponseStateV2.CONTINUE) {
370
+ throw new CustomAuthApiError(
371
+ INVALID_HAL_RESPONSE,
372
+ "Invalid HAL response: activation returned no continuation state",
373
+ parsedResponse.correlationId
374
+ );
375
+ }
376
+
377
+ return {
378
+ nextAction: ResponseStateV2.CONTINUE,
379
+ continuationToken: this.handler.requireContinuationToken(
380
+ parsedResponse.continuationToken,
381
+ parsedResponse.correlationId
382
+ ),
383
+ };
384
+ }
385
+
268
386
  /*
269
387
  * Submits the new password and returns the link used to poll for completion.
270
388
  */
@@ -297,7 +415,7 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
297
415
  }
298
416
 
299
417
  /*
300
- * Polls once for reset completion and returns the next server-provided link.
418
+ * Sends a poll request and validates the data needed for the next flow step.
301
419
  */
302
420
  async poll(
303
421
  pollHref: string,
@@ -311,21 +429,54 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
311
429
  context
312
430
  );
313
431
 
314
- const isCompleted =
315
- parsedResponse.body.state === ResponseStateV2.CONTINUE;
432
+ const correlationId = parsedResponse.correlationId;
433
+ const continuationToken = this.handler.requireContinuationToken(
434
+ parsedResponse.continuationToken,
435
+ correlationId
436
+ );
437
+ const nextAction =
438
+ parsedResponse.body.action ?? parsedResponse.body.state;
316
439
 
317
- return {
318
- continuationToken:
319
- parsedResponse.continuationToken ?? request.continuationToken,
320
- isCompleted,
321
- pollHref: isCompleted
322
- ? undefined
323
- : this.handler.requireHref(
324
- parsedResponse.body._links?.poll?.href,
325
- "poll",
326
- parsedResponse.correlationId
327
- ),
328
- };
440
+ if (nextAction === ENROLL_RELATION) {
441
+ return {
442
+ nextAction,
443
+ continuationToken,
444
+ enrollmentMethods: this.resolveEnrollmentMethods(
445
+ this.handler.requireMethods(
446
+ parsedResponse.body._embedded?.methods,
447
+ correlationId
448
+ ),
449
+ correlationId
450
+ ),
451
+ };
452
+ }
453
+
454
+ if (nextAction === POLL_RELATION) {
455
+ return {
456
+ nextAction: POLL_RELATION,
457
+ continuationToken,
458
+ pollHref: this.handler.requireHref(
459
+ parsedResponse.body._links?.poll?.href,
460
+ POLL_RELATION,
461
+ correlationId
462
+ ),
463
+ };
464
+ }
465
+
466
+ if (nextAction === ResponseStateV2.CONTINUE) {
467
+ return {
468
+ nextAction,
469
+ continuationToken,
470
+ };
471
+ }
472
+
473
+ const message = `Password reset poll next action '${nextAction}' is not supported.`;
474
+ this.logger?.error(message, correlationId);
475
+ throw new CustomAuthApiError(
476
+ INVALID_HAL_RESPONSE,
477
+ message,
478
+ correlationId
479
+ );
329
480
  }
330
481
 
331
482
  private async sendStartRequest(
@@ -345,7 +496,10 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
345
496
  return {
346
497
  continuationToken,
347
498
  methods: this.resolveMethods(
348
- parsedResponse.body,
499
+ this.handler.requireMethods(
500
+ parsedResponse.body._embedded?.methods,
501
+ parsedResponse.correlationId
502
+ ),
349
503
  parsedResponse.correlationId
350
504
  ),
351
505
  authenticationFactor: this.resolveAuthenticationFactor(
@@ -367,14 +521,14 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
367
521
 
368
522
  if (parsedResponse.body.state === ResponseStateV2.CONTINUE) {
369
523
  return {
370
- nextAction: VerifyNextActionV2.CONTINUE,
524
+ nextAction: ResponseStateV2.CONTINUE,
371
525
  continuationToken,
372
526
  };
373
527
  }
374
528
 
375
529
  if (parsedResponse.body.action === COLLECT_ATTRIBUTES_RELATION) {
376
530
  return {
377
- nextAction: VerifyNextActionV2.COLLECT_ATTRIBUTES,
531
+ nextAction: COLLECT_ATTRIBUTES_RELATION,
378
532
  continuationToken,
379
533
  attributes: parsedResponse.body.attributes ?? [],
380
534
  submitAttributesHref: this.handler.requireHref(
@@ -387,7 +541,7 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
387
541
 
388
542
  if (parsedResponse.body.action === UPDATE_RELATION) {
389
543
  return {
390
- nextAction: VerifyNextActionV2.UPDATE,
544
+ nextAction: UPDATE_RELATION,
391
545
  continuationToken,
392
546
  updateHref: this.handler.requireHref(
393
547
  parsedResponse.body._links?.update?.href,
@@ -399,14 +553,31 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
399
553
 
400
554
  if (parsedResponse.body.action === CHALLENGE_RELATION) {
401
555
  return {
402
- nextAction: VerifyNextActionV2.CHALLENGE,
556
+ nextAction: CHALLENGE_RELATION,
403
557
  continuationToken,
404
558
  authenticationFactor: this.resolveAuthenticationFactor(
405
559
  parsedResponse.body.challengeContext?.authenticationFactor,
406
560
  correlationId
407
561
  ),
408
562
  methods: this.resolveMethods(
409
- parsedResponse.body,
563
+ this.handler.requireMethods(
564
+ parsedResponse.body._embedded?.methods,
565
+ correlationId
566
+ ) as EmbeddedMethodV2[],
567
+ correlationId
568
+ ),
569
+ };
570
+ }
571
+
572
+ if (parsedResponse.body.action === ENROLL_RELATION) {
573
+ return {
574
+ nextAction: ENROLL_RELATION,
575
+ continuationToken,
576
+ methods: this.resolveEnrollmentMethods(
577
+ this.handler.requireMethods(
578
+ parsedResponse.body._embedded?.methods,
579
+ correlationId
580
+ ) as EmbeddedEnrollmentMethodV2[],
410
581
  correlationId
411
582
  ),
412
583
  };
@@ -419,6 +590,43 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
419
590
  );
420
591
  }
421
592
 
593
+ private resolveEnrollmentMethods(
594
+ methods: EmbeddedEnrollmentMethodV2[],
595
+ correlationId: string
596
+ ): EnrollmentMethodV2[] {
597
+ return methods.map((method) => {
598
+ if (typeof method.type !== "string" || !method.type.trim()) {
599
+ throw new CustomAuthApiError(
600
+ INVALID_HAL_RESPONSE,
601
+ "Invalid HAL response: enrollment method type is malformed",
602
+ correlationId
603
+ );
604
+ }
605
+
606
+ if (
607
+ method.channels !== undefined &&
608
+ (!Array.isArray(method.channels) ||
609
+ method.channels.length === 0)
610
+ ) {
611
+ throw new CustomAuthApiError(
612
+ INVALID_HAL_RESPONSE,
613
+ "Invalid HAL response: enrollment method channels are malformed",
614
+ correlationId
615
+ );
616
+ }
617
+
618
+ return {
619
+ type: method.type,
620
+ channels: method.channels,
621
+ enrollHref: this.handler.requireHref(
622
+ method._links?.enroll?.href,
623
+ ENROLL_RELATION,
624
+ correlationId
625
+ ),
626
+ };
627
+ });
628
+ }
629
+
422
630
  private resolveAuthenticationFactor(
423
631
  authenticationFactor: string | undefined,
424
632
  correlationId: string
@@ -450,7 +658,7 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
450
658
  parsedResponse.body as RiskVerificationRequiredResponseV2;
451
659
 
452
660
  return {
453
- nextAction: ChallengeNextActionV2.RISK_VERIFY,
661
+ nextAction: RISK_VERIFY_RELATION,
454
662
  continuationToken: this.handler.requireContinuationToken(
455
663
  parsedResponse.continuationToken,
456
664
  parsedResponse.correlationId
@@ -490,36 +698,47 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
490
698
  "payload" in parsedResponse.body
491
699
  ? parsedResponse.body
492
700
  : undefined;
701
+ const isPasswordChallenge =
702
+ parsedResponse.body.type?.toLowerCase() ===
703
+ AuthenticationMethodTypeV2.PASSWORD;
704
+ const verifyHref = this.handler.requireHref(
705
+ links?.verify?.href,
706
+ VERIFY_RELATION,
707
+ parsedResponse.correlationId
708
+ );
709
+ const resendHref =
710
+ !isPasswordChallenge && links && "resend" in links
711
+ ? this.handler.requireHref(
712
+ links.resend?.href,
713
+ RESEND_RELATION,
714
+ parsedResponse.correlationId
715
+ )
716
+ : undefined;
717
+ const codeLength = isPasswordChallenge
718
+ ? undefined
719
+ : this.normalizeCodeLength(
720
+ codeMetadata?.codeLength ?? codeMetadata?.payload?.codeLength
721
+ );
493
722
 
494
723
  return {
495
- nextAction: ChallengeNextActionV2.VERIFY,
724
+ nextAction: VERIFY_RELATION,
496
725
  continuationToken,
497
- verifyHref: this.handler.requireHref(
498
- links?.verify?.href,
499
- "verify",
500
- parsedResponse.correlationId
501
- ),
502
- resendHref:
503
- links && "resend" in links ? links.resend?.href : undefined,
504
- codeLength:
505
- codeMetadata?.codeLength ?? codeMetadata?.payload?.codeLength,
726
+ verifyHref,
727
+ resendHref,
728
+ codeLength,
506
729
  hint: codeMetadata?.hint,
507
730
  type: parsedResponse.body.type,
508
731
  };
509
732
  }
510
733
 
734
+ private normalizeCodeLength(value: unknown): number {
735
+ return typeof value === "number" && Number.isInteger(value) ? value : 0;
736
+ }
737
+
511
738
  private resolveMethods(
512
- body: {
513
- _embedded?: {
514
- methods?: EmbeddedMethodV2[];
515
- };
516
- },
739
+ methods: EmbeddedMethodV2[],
517
740
  correlationId: string
518
741
  ): StartMethodV2[] {
519
- const methods = this.handler.requireMethods(
520
- body._embedded?.methods,
521
- correlationId
522
- );
523
742
  const resolved: StartMethodV2[] = [];
524
743
 
525
744
  methods.forEach((method, index) => {
@@ -7,7 +7,7 @@ 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 { EmbeddedMethodV2, ParsedResponseV2 } from "./response/ResponsesV2.js";
10
+ import { ParsedResponseV2 } from "./response/ResponsesV2.js";
11
11
  import {
12
12
  CONTINUATION_TOKEN_MISSING,
13
13
  INVALID_HAL_RESPONSE,
@@ -64,12 +64,12 @@ export class ResponseHandlerV2 {
64
64
 
65
65
  // Required href; throws when it is absent.
66
66
  requireHref(
67
- href: string | undefined,
67
+ href: unknown,
68
68
  relation: string,
69
69
  correlationId: string,
70
70
  missingHrefError?: { code: string; message: string }
71
71
  ): string {
72
- if (!href) {
72
+ if (typeof href !== "string" || !href.trim()) {
73
73
  const errorCode = missingHrefError?.code ?? INVALID_HAL_RESPONSE;
74
74
  const errorMessage =
75
75
  missingHrefError?.message ??
@@ -109,10 +109,7 @@ export class ResponseHandlerV2 {
109
109
  }
110
110
 
111
111
  // Required embedded auth methods; throws when `_embedded.methods` is absent or empty.
112
- requireMethods(
113
- methods: EmbeddedMethodV2[] | undefined,
114
- correlationId: string
115
- ): EmbeddedMethodV2[] {
112
+ requireMethods<T>(methods: T[] | undefined, correlationId: string): T[] {
116
113
  if (!methods?.length) {
117
114
  this.logger?.error(
118
115
  "V2 HAL response is missing the required embedded authentication methods",
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { ApiRequestBase } from "../../types/ApiTypesBase.js";
7
7
  import { UserAccountAttributes } from "../../../../../UserAccountAttributes.js";
8
+ import { PhoneRegistrationChannelV2 } from "../ApiClientConstantsV2.js";
8
9
 
9
10
  /*
10
11
  * Per-request context threaded through every V2 network-layer call. These shared fields drive
@@ -92,6 +93,26 @@ export interface SignUpSubmitAttributesRequestV2 extends ActionRequestBaseV2 {
92
93
  // Request or resend a challenge.
93
94
  export type ChallengeRequestV2 = ActionRequestBaseV2;
94
95
 
96
+ export interface EmailAuthMethodRegistrationRequestV2
97
+ extends ActionRequestBaseV2 {
98
+ email: string;
99
+ }
100
+
101
+ export interface PhoneAuthMethodRegistrationRequestV2
102
+ extends ActionRequestBaseV2 {
103
+ phoneNumber: string;
104
+ channel: typeof PhoneRegistrationChannelV2.SMS;
105
+ }
106
+
107
+ export type AuthMethodRegistrationRequestV2 =
108
+ | EmailAuthMethodRegistrationRequestV2
109
+ | PhoneAuthMethodRegistrationRequestV2;
110
+
111
+ export interface AuthMethodRegistrationVerificationRequestV2
112
+ extends ActionRequestBaseV2 {
113
+ otp: string;
114
+ }
115
+
95
116
  // Submit a single credential to `/methods/{type}/{id}/verify`.
96
117
  /*
97
118
  * The credential is a distinct top-level key per method type (never overloaded onto one field):