@azure/msal-browser 5.28.0 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +6 -4
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +58 -62
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +3 -5
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +19 -13
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +8 -2
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +58 -69
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +3 -3
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +42 -15
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +17 -4
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +14 -18
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +2 -4
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +2 -3
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +17 -6
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +110 -0
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs +2 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
- package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
- package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +256 -150
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +2 -6
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +10 -3
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -7
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +35 -19
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +20 -9
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -2
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +5 -7
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +3 -2
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +17 -2
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
- package/dist/custom_auth/index.mjs +4 -3
- package/dist/custom_auth/index.mjs.map +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +23 -7
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +24 -0
- package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs.map +1 -0
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +4 -7
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +2 -2
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs.map +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +17 -8
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +78 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +48 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +49 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +17 -24
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +38 -31
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +21 -9
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/request/SilentRequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserDetection.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/IframeMonitor.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/utils/PopupMonitor.mjs +1 -1
- package/dist/utils/PopupOriginCheck.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
- package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
- package/dist/webBrokerBridge/index.mjs +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +21 -9
- package/lib/custom-auth-path/msal-custom-auth.cjs +1100 -765
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +1100 -765
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +7 -3
- package/lib/msal-browser.cjs +117 -107
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +117 -107
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +2 -2
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
- package/package.json +2 -2
- package/src/custom_auth/CustomAuthActionInputs.ts +12 -5
- package/src/custom_auth/CustomAuthPublicClientApplication.ts +5 -3
- package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +5 -3
- package/src/custom_auth/controller/CustomAuthStandardController.ts +79 -110
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +1 -2
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +1 -4
- package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +5 -4
- package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +28 -16
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +6 -0
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +83 -72
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +3 -3
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +7 -5
- package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +10 -6
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +9 -6
- package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +4 -6
- package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +36 -0
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +6 -8
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +2 -2
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +61 -12
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +21 -3
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +30 -24
- package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +1 -3
- package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +11 -2
- package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +1 -2
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +26 -7
- package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +179 -0
- package/src/custom_auth/core/error/InvalidArgumentError.ts +1 -1
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +12 -12
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +394 -238
- package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +2 -6
- package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +2 -15
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +63 -26
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +0 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +74 -26
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +48 -9
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +4 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +0 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +14 -53
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +0 -18
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +32 -13
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +8 -9
- package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +4 -5
- package/src/custom_auth/core/telemetry/PublicApiId.ts +1 -0
- package/src/custom_auth/core/utils/ArgumentValidator.ts +26 -0
- package/src/custom_auth/index.ts +10 -11
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +6 -7
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +28 -5
- package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.ts +30 -0
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +4 -8
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +4 -7
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +3 -6
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +0 -3
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.ts +2 -3
- package/src/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.ts +49 -0
- package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +8 -4
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +16 -4
- package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +26 -5
- package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.ts +101 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.ts +53 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.ts +97 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +0 -6
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +25 -48
- package/src/interaction_client/PlatformAuthInteractionClient.ts +53 -38
- package/src/packageMetadata.ts +1 -1
- package/types/custom_auth/CustomAuthActionInputs.d.ts +12 -5
- package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +5 -3
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +5 -3
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts +2 -0
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +1 -2
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +1 -4
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +5 -4
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +17 -8
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +6 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +23 -44
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +3 -3
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +7 -6
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +7 -6
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +8 -7
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +4 -6
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +20 -0
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +6 -8
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +2 -2
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +3 -6
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +3 -3
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +6 -8
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +1 -3
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +9 -2
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +1 -2
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +5 -6
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +23 -0
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/error/InvalidArgumentError.d.ts +1 -0
- package/types/custom_auth/core/error/InvalidArgumentError.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +8 -1
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +12 -10
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +1 -1
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +2 -5
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +22 -3
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +2 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +8 -8
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +18 -6
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +6 -10
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +0 -4
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts +1 -0
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/types/custom_auth/core/utils/ArgumentValidator.d.ts +3 -0
- package/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
- package/types/custom_auth/index.d.ts +5 -5
- package/types/custom_auth/index.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +6 -8
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +7 -5
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts +7 -0
- package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +4 -8
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +5 -6
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +3 -6
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts +3 -2
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts +27 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +6 -3
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +12 -3
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +8 -3
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts +24 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts +18 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts +7 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +0 -4
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +5 -4
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts +4 -3
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +0 -82
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +0 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +0 -25
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +0 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +0 -45
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +0 -1
- package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +0 -23
- package/src/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.ts +0 -19
- package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -22
- package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +0 -115
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +0 -34
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +0 -61
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +0 -14
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts +0 -13
- package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -9
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -17
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +0 -11
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +0 -19
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +0 -1
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
createFlowMethodSelectionRequiredResultV2,
|
|
28
28
|
createFlowCodeRequiredResultV2,
|
|
29
|
+
createFlowExistingAccountCodeRequiredResultV2,
|
|
30
|
+
createFlowExistingAccountPasswordRequiredResultV2,
|
|
29
31
|
createFlowPasswordRequiredResultV2,
|
|
30
32
|
createFlowSignUpPasswordRequiredResultV2,
|
|
31
33
|
createFlowMFARequiredResultV2,
|
|
@@ -36,21 +38,21 @@ import {
|
|
|
36
38
|
createFlowAuthMethodRegistrationRequiredResultV2,
|
|
37
39
|
createFlowAuthMethodVerificationRequiredResultV2,
|
|
38
40
|
FLOW_CODE_REQUIRED_V2,
|
|
39
|
-
|
|
40
|
-
FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
|
|
41
|
+
FLOW_PASSWORD_REQUIRED_V2,
|
|
41
42
|
} from "./result/FlowActionResultV2.js";
|
|
42
43
|
import type {
|
|
43
|
-
FlowMethodSelectionRequiredResultV2,
|
|
44
44
|
FlowCodeRequiredResultV2,
|
|
45
|
-
|
|
46
|
-
FlowResetPasswordCodeRequiredResultV2,
|
|
47
|
-
FlowPasswordRequiredResultV2,
|
|
48
|
-
FlowSignUpPasswordRequiredResultV2,
|
|
49
|
-
FlowMFARequiredResultV2,
|
|
50
|
-
FlowAttributesRequiredResultV2,
|
|
51
|
-
FlowSignInContinuationRequiredResultV2,
|
|
45
|
+
FlowExistingAccountChallengeResultV2,
|
|
52
46
|
FlowCompletedResultV2,
|
|
53
|
-
|
|
47
|
+
FlowSignInContinuationRequiredResultV2,
|
|
48
|
+
FlowSignInStartResultV2,
|
|
49
|
+
FlowSignUpStartResultV2,
|
|
50
|
+
FlowResetPasswordStartResultV2,
|
|
51
|
+
FlowRequestChallengeResultV2,
|
|
52
|
+
FlowSubmitNewPasswordResultV2,
|
|
53
|
+
FlowSubmitSignInPasswordResultV2,
|
|
54
|
+
FlowSignUpSubmitAttributesResultV2,
|
|
55
|
+
FlowSignUpVerificationResultV2,
|
|
54
56
|
FlowSubmitCodeResultV2,
|
|
55
57
|
FlowAuthMethodRegistrationRequiredResultV2,
|
|
56
58
|
FlowAuthMethodVerificationRequiredResultV2,
|
|
@@ -100,16 +102,14 @@ import type { AuthenticationMethodV2 } from "../../auth_flow/v2/AuthenticationMe
|
|
|
100
102
|
import type { AuthenticationMethodRegistrationV2 } from "../../auth_flow/v2/AuthenticationMethodRegistrationV2.js";
|
|
101
103
|
import {
|
|
102
104
|
SignUpSubmitAttributesNextActionV2,
|
|
105
|
+
type SignUpAttributeV2,
|
|
103
106
|
type SignUpSubmitAttributesApiResultV2,
|
|
104
107
|
} from "../../network_client/custom_auth_api/v2/result/SignUpResultsV2.js";
|
|
105
108
|
import type { AuthMethodRegistrationRequestV2 } from "../../network_client/custom_auth_api/v2/request/RequestsV2.js";
|
|
106
109
|
import { InvalidArgumentError } from "../../error/InvalidArgumentError.js";
|
|
107
110
|
import type { ResetPasswordPollResultV2 } from "../../network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.js";
|
|
111
|
+
import * as ArgumentValidator from "../../utils/ArgumentValidator.js";
|
|
108
112
|
|
|
109
|
-
/*
|
|
110
|
-
* Polls up to five times for password-update completion, waiting 1.5 seconds
|
|
111
|
-
* between attempts. The first request runs immediately.
|
|
112
|
-
*/
|
|
113
113
|
const POLL_MAX_ATTEMPTS = 5;
|
|
114
114
|
// TODO: Replace this fallback with the server-provided polling interval once available.
|
|
115
115
|
const POLL_INTERVAL_MS = 1500;
|
|
@@ -118,8 +118,7 @@ const delay = (ms: number): Promise<void> =>
|
|
|
118
118
|
new Promise((resolve) => setTimeout(resolve, ms));
|
|
119
119
|
|
|
120
120
|
/*
|
|
121
|
-
* Drives server-directed Native Auth V2 flows
|
|
122
|
-
* and HAL links. Each operation returns only its valid discriminated results.
|
|
121
|
+
* Drives server-directed Native Auth V2 flows.
|
|
123
122
|
*/
|
|
124
123
|
export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
125
124
|
constructor(
|
|
@@ -146,19 +145,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
/*
|
|
149
|
-
* Starts sign-in
|
|
150
|
-
* multiple supported methods for user selection.
|
|
148
|
+
* Starts native auth V2 sign-in.
|
|
151
149
|
*/
|
|
152
150
|
async signIn(
|
|
153
151
|
parameters: FlowSignInStartParamsV2
|
|
154
|
-
): Promise<
|
|
155
|
-
| FlowMethodSelectionRequiredResultV2
|
|
156
|
-
| FlowPasswordRequiredResultV2
|
|
157
|
-
| FlowSignInCodeRequiredResultV2
|
|
158
|
-
| FlowMFARequiredResultV2
|
|
159
|
-
| FlowAuthMethodRegistrationRequiredResultV2
|
|
160
|
-
| FlowCompletedResultV2
|
|
161
|
-
> {
|
|
152
|
+
): Promise<FlowSignInStartResultV2> {
|
|
162
153
|
const correlationId = parameters.correlationId;
|
|
163
154
|
const context = this.createRequestContext(
|
|
164
155
|
PublicApiId.SIGN_IN_V2_START,
|
|
@@ -237,28 +228,22 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
237
228
|
};
|
|
238
229
|
}
|
|
239
230
|
|
|
240
|
-
if (parameters.password) {
|
|
241
|
-
return this.submitSignInPassword({
|
|
242
|
-
correlationId,
|
|
243
|
-
continuationState: challengeResult.continuationState,
|
|
244
|
-
password: parameters.password,
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
231
|
return challengeResult;
|
|
249
232
|
}
|
|
250
233
|
|
|
251
234
|
/*
|
|
252
|
-
* Starts
|
|
235
|
+
* Starts native auth V2 sign-up.
|
|
253
236
|
*/
|
|
254
237
|
async signUp(
|
|
255
238
|
parameters: FlowSignUpStartParamsV2
|
|
256
|
-
): Promise<
|
|
257
|
-
| FlowCodeRequiredResultV2
|
|
258
|
-
| FlowSignUpPasswordRequiredResultV2
|
|
259
|
-
| FlowAttributesRequiredResultV2
|
|
260
|
-
> {
|
|
239
|
+
): Promise<FlowSignUpStartResultV2> {
|
|
261
240
|
const correlationId = parameters.correlationId;
|
|
241
|
+
const pendingProfileAttributes =
|
|
242
|
+
ArgumentValidator.filterReservedSignUpAttributesV2(
|
|
243
|
+
parameters.attributes,
|
|
244
|
+
this.logger,
|
|
245
|
+
correlationId
|
|
246
|
+
);
|
|
262
247
|
const context = this.createRequestContext(
|
|
263
248
|
PublicApiId.SIGN_UP_V2_START,
|
|
264
249
|
correlationId
|
|
@@ -280,70 +265,117 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
280
265
|
}),
|
|
281
266
|
{
|
|
282
267
|
continuationToken: entryResult.continuationToken,
|
|
268
|
+
username: parameters.username,
|
|
283
269
|
},
|
|
284
270
|
context
|
|
285
271
|
);
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
272
|
+
if (startResult.nextAction === VERIFY_RELATION) {
|
|
273
|
+
if (
|
|
274
|
+
startResult.type?.toLowerCase() !==
|
|
275
|
+
AuthenticationMethodTypeV2.EMAIL
|
|
276
|
+
) {
|
|
277
|
+
const message =
|
|
278
|
+
"New-account sign-up requires an email code challenge.";
|
|
279
|
+
this.logger.error(message, correlationId);
|
|
280
|
+
throw new CustomAuthError(
|
|
281
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
282
|
+
message,
|
|
283
|
+
correlationId
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return createFlowCodeRequiredResultV2({
|
|
288
|
+
correlationId,
|
|
289
|
+
continuationState: {
|
|
290
|
+
continuationToken: startResult.continuationToken,
|
|
291
|
+
scenario: CustomAuthFlowScenarioV2.SignUp,
|
|
292
|
+
scopes,
|
|
293
|
+
links: {
|
|
294
|
+
verify: startResult.verifyHref,
|
|
295
|
+
resend: startResult.resendHref,
|
|
296
|
+
},
|
|
297
|
+
signUp: {
|
|
298
|
+
purpose: "newAccount",
|
|
299
|
+
pendingProfileAttributes,
|
|
300
|
+
submittedAttributeIds: [],
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
channel: startResult.type,
|
|
304
|
+
sentTo: startResult.hint,
|
|
305
|
+
codeLength: startResult.codeLength,
|
|
306
|
+
});
|
|
296
307
|
}
|
|
297
|
-
|
|
298
|
-
startResult.submitAttributesHref,
|
|
299
|
-
{
|
|
300
|
-
continuationToken: startResult.continuationToken,
|
|
301
|
-
attributes,
|
|
302
|
-
},
|
|
303
|
-
context
|
|
304
|
-
);
|
|
308
|
+
|
|
305
309
|
const continuationState: FlowContinuationStateV2 = {
|
|
306
310
|
continuationToken: startResult.continuationToken,
|
|
307
311
|
scenario: CustomAuthFlowScenarioV2.SignUp,
|
|
308
312
|
scopes,
|
|
309
313
|
links: {},
|
|
310
314
|
signUp: {
|
|
311
|
-
|
|
315
|
+
purpose: "existingAccount",
|
|
312
316
|
},
|
|
313
317
|
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
+
this.ensureAuthenticationFactor(
|
|
319
|
+
startResult.authenticationFactor,
|
|
320
|
+
AuthenticationFactorV2.SINGLE_FACTOR,
|
|
321
|
+
"existing-account sign-up",
|
|
318
322
|
correlationId
|
|
319
323
|
);
|
|
324
|
+
const supportedMethods = startResult.methods
|
|
325
|
+
.map((method) => ({
|
|
326
|
+
id: method.id,
|
|
327
|
+
type: method.type ?? "",
|
|
328
|
+
hint: method.hint,
|
|
329
|
+
challengeHref: method.challengeHref,
|
|
330
|
+
}))
|
|
331
|
+
.filter((method) => {
|
|
332
|
+
const methodType = method.type.toLowerCase();
|
|
333
|
+
return (
|
|
334
|
+
methodType === AuthenticationMethodTypeV2.EMAIL ||
|
|
335
|
+
methodType === AuthenticationMethodTypeV2.PASSWORD
|
|
336
|
+
);
|
|
337
|
+
});
|
|
320
338
|
|
|
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}'.`;
|
|
326
|
-
this.logger.error(message, correlationId);
|
|
339
|
+
if (supportedMethods.length === 0) {
|
|
327
340
|
throw new CustomAuthError(
|
|
328
341
|
UNSUPPORTED_FLOW_TRANSITION,
|
|
329
|
-
|
|
342
|
+
"The existing-account sign-up response must include an email or password method.",
|
|
330
343
|
correlationId
|
|
331
344
|
);
|
|
332
345
|
}
|
|
333
346
|
|
|
334
|
-
|
|
347
|
+
if (supportedMethods.length > 1) {
|
|
348
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
349
|
+
correlationId,
|
|
350
|
+
continuationState,
|
|
351
|
+
methods: supportedMethods,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const selectedMethod = supportedMethods[0];
|
|
356
|
+
const challengeResult = await this.requestChallenge({
|
|
357
|
+
correlationId,
|
|
358
|
+
continuationState: {
|
|
359
|
+
...continuationState,
|
|
360
|
+
links: {
|
|
361
|
+
challenge: selectedMethod.challengeHref,
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
return this.toExistingAccountChallengeResult(
|
|
367
|
+
challengeResult,
|
|
368
|
+
selectedMethod,
|
|
369
|
+
correlationId
|
|
370
|
+
);
|
|
335
371
|
}
|
|
336
372
|
|
|
337
373
|
/*
|
|
338
|
-
* Starts
|
|
339
|
-
* returning multiple methods for selection.
|
|
374
|
+
* Starts native auth V2 password reset.
|
|
340
375
|
*/
|
|
341
376
|
async resetPassword(
|
|
342
377
|
parameters: FlowStartParamsV2
|
|
343
|
-
): Promise<
|
|
344
|
-
| FlowMethodSelectionRequiredResultV2
|
|
345
|
-
| FlowResetPasswordCodeRequiredResultV2
|
|
346
|
-
> {
|
|
378
|
+
): Promise<FlowResetPasswordStartResultV2> {
|
|
347
379
|
const correlationId = parameters.correlationId;
|
|
348
380
|
const context = this.createRequestContext(
|
|
349
381
|
PublicApiId.RESET_PASSWORD_V2_START,
|
|
@@ -403,63 +435,62 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
403
435
|
);
|
|
404
436
|
}
|
|
405
437
|
|
|
406
|
-
if (methods.length
|
|
407
|
-
|
|
408
|
-
|
|
438
|
+
if (methods.length > 1) {
|
|
439
|
+
this.logger.verbose(
|
|
440
|
+
"V2 self-service password reset method selection required.",
|
|
441
|
+
correlationId
|
|
442
|
+
);
|
|
443
|
+
|
|
444
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
409
445
|
correlationId,
|
|
410
|
-
continuationState
|
|
411
|
-
|
|
412
|
-
links: {
|
|
413
|
-
challenge: selectedMethod.challengeHref,
|
|
414
|
-
},
|
|
415
|
-
},
|
|
446
|
+
continuationState,
|
|
447
|
+
methods,
|
|
416
448
|
});
|
|
449
|
+
}
|
|
417
450
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
};
|
|
429
|
-
}
|
|
451
|
+
const selectedMethod = methods[0];
|
|
452
|
+
const challengeResult = await this.requestChallenge({
|
|
453
|
+
correlationId,
|
|
454
|
+
continuationState: {
|
|
455
|
+
...continuationState,
|
|
456
|
+
links: {
|
|
457
|
+
challenge: selectedMethod.challengeHref,
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
});
|
|
430
461
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
462
|
+
if (
|
|
463
|
+
challengeResult.type === FLOW_CODE_REQUIRED_V2 &&
|
|
464
|
+
(challengeResult.channel?.toLowerCase() ===
|
|
465
|
+
AuthenticationMethodTypeV2.EMAIL ||
|
|
466
|
+
challengeResult.channel?.toLowerCase() ===
|
|
467
|
+
AuthenticationMethodTypeV2.SMS)
|
|
468
|
+
) {
|
|
469
|
+
return {
|
|
470
|
+
...challengeResult,
|
|
471
|
+
method: selectedMethod,
|
|
472
|
+
};
|
|
442
473
|
}
|
|
443
474
|
|
|
444
|
-
|
|
445
|
-
|
|
475
|
+
const channel =
|
|
476
|
+
challengeResult.type === FLOW_CODE_REQUIRED_V2
|
|
477
|
+
? challengeResult.channel
|
|
478
|
+
: AuthenticationMethodTypeV2.PASSWORD;
|
|
479
|
+
const message = `Challenge type '${challengeResult.type}' with channel '${channel}' is not supported for password reset.`;
|
|
480
|
+
this.logger.error(message, correlationId);
|
|
481
|
+
throw new CustomAuthError(
|
|
482
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
483
|
+
message,
|
|
446
484
|
correlationId
|
|
447
485
|
);
|
|
448
|
-
|
|
449
|
-
return createFlowMethodSelectionRequiredResultV2({
|
|
450
|
-
correlationId,
|
|
451
|
-
continuationState,
|
|
452
|
-
methods,
|
|
453
|
-
});
|
|
454
486
|
}
|
|
455
487
|
|
|
456
488
|
/*
|
|
457
|
-
* Requests a
|
|
458
|
-
* the continuation state and code metadata needed for verification.
|
|
489
|
+
* Requests a challenge for the selected authentication method.
|
|
459
490
|
*/
|
|
460
491
|
async requestChallenge(
|
|
461
492
|
parameters: FlowChallengeParamsV2
|
|
462
|
-
): Promise<
|
|
493
|
+
): Promise<FlowRequestChallengeResultV2> {
|
|
463
494
|
const challengeResult = await this.sendMethodChallenge(
|
|
464
495
|
parameters,
|
|
465
496
|
"requestChallenge"
|
|
@@ -503,7 +534,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
503
534
|
}
|
|
504
535
|
|
|
505
536
|
/*
|
|
506
|
-
* Registers the selected
|
|
537
|
+
* Registers the selected authentication method.
|
|
507
538
|
*/
|
|
508
539
|
async registerAuthMethod(
|
|
509
540
|
parameters: FlowRegisterAuthMethodParamsV2
|
|
@@ -545,12 +576,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
545
576
|
}
|
|
546
577
|
|
|
547
578
|
/*
|
|
548
|
-
* Activates the registered method
|
|
549
|
-
* for tokens.
|
|
579
|
+
* Activates the registered authentication method.
|
|
550
580
|
*/
|
|
551
581
|
async verifyAuthMethodRegistration(
|
|
552
582
|
parameters: FlowVerifyAuthMethodRegistrationParamsV2
|
|
553
|
-
): Promise<FlowCompletedResultV2> {
|
|
583
|
+
): Promise<FlowCompletedResultV2 | FlowSignInContinuationRequiredResultV2> {
|
|
554
584
|
const { continuationState, correlationId } = parameters;
|
|
555
585
|
|
|
556
586
|
const context = this.createRequestContext(
|
|
@@ -570,6 +600,21 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
570
600
|
context
|
|
571
601
|
);
|
|
572
602
|
|
|
603
|
+
if (
|
|
604
|
+
continuationState.scenario === CustomAuthFlowScenarioV2.SignUp ||
|
|
605
|
+
continuationState.scenario ===
|
|
606
|
+
CustomAuthFlowScenarioV2.PasswordReset
|
|
607
|
+
) {
|
|
608
|
+
return createFlowSignInContinuationRequiredResultV2({
|
|
609
|
+
correlationId,
|
|
610
|
+
continuationState: {
|
|
611
|
+
...continuationState,
|
|
612
|
+
continuationToken: result.continuationToken,
|
|
613
|
+
links: {},
|
|
614
|
+
},
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
|
|
573
618
|
return this.completeSignInAfterVerification(
|
|
574
619
|
continuationState,
|
|
575
620
|
result.continuationToken,
|
|
@@ -578,8 +623,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
578
623
|
}
|
|
579
624
|
|
|
580
625
|
/*
|
|
581
|
-
* Requests a replacement activation challenge
|
|
582
|
-
* resend link using the latest continuation token.
|
|
626
|
+
* Requests a replacement authentication-method activation challenge.
|
|
583
627
|
*/
|
|
584
628
|
async resendAuthMethodRegistrationChallenge(
|
|
585
629
|
parameters: FlowChallengeParamsV2
|
|
@@ -610,8 +654,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
610
654
|
}
|
|
611
655
|
|
|
612
656
|
/*
|
|
613
|
-
* Verifies the submitted one-time code
|
|
614
|
-
* response determines the next required action.
|
|
657
|
+
* Verifies the submitted one-time code.
|
|
615
658
|
*/
|
|
616
659
|
async submitCode(
|
|
617
660
|
parameters: FlowSubmitCodeParamsV2
|
|
@@ -647,6 +690,25 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
647
690
|
if (
|
|
648
691
|
continuationState.scenario ===
|
|
649
692
|
CustomAuthFlowScenarioV2.PasswordReset &&
|
|
693
|
+
parameters.authenticationFactor ===
|
|
694
|
+
AuthenticationFactorV2.MULTI_FACTOR &&
|
|
695
|
+
verifyResult.nextAction === ResponseStateV2.CONTINUE
|
|
696
|
+
) {
|
|
697
|
+
return createFlowSignInContinuationRequiredResultV2({
|
|
698
|
+
correlationId,
|
|
699
|
+
continuationState: {
|
|
700
|
+
...continuationState,
|
|
701
|
+
continuationToken: verifyResult.continuationToken,
|
|
702
|
+
links: {},
|
|
703
|
+
},
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
if (
|
|
708
|
+
continuationState.scenario ===
|
|
709
|
+
CustomAuthFlowScenarioV2.PasswordReset &&
|
|
710
|
+
parameters.authenticationFactor !==
|
|
711
|
+
AuthenticationFactorV2.MULTI_FACTOR &&
|
|
650
712
|
verifyResult.nextAction === UPDATE_RELATION
|
|
651
713
|
) {
|
|
652
714
|
return createFlowNewPasswordRequiredResultV2({
|
|
@@ -668,6 +730,17 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
668
730
|
);
|
|
669
731
|
}
|
|
670
732
|
|
|
733
|
+
if (
|
|
734
|
+
continuationState.scenario === CustomAuthFlowScenarioV2.SignUp &&
|
|
735
|
+
continuationState.signUp?.purpose === "existingAccount"
|
|
736
|
+
) {
|
|
737
|
+
return this.handleSignInVerification(
|
|
738
|
+
continuationState,
|
|
739
|
+
verifyResult,
|
|
740
|
+
correlationId
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
|
|
671
744
|
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp) {
|
|
672
745
|
return this.handleSignUpVerification(
|
|
673
746
|
continuationState,
|
|
@@ -687,8 +760,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
687
760
|
}
|
|
688
761
|
|
|
689
762
|
/*
|
|
690
|
-
* Requests a
|
|
691
|
-
* Returns refreshed continuation state and code metadata.
|
|
763
|
+
* Requests a replacement one-time code.
|
|
692
764
|
*/
|
|
693
765
|
async resendCode(
|
|
694
766
|
parameters: FlowChallengeParamsV2
|
|
@@ -697,6 +769,20 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
697
769
|
parameters,
|
|
698
770
|
"resendCode"
|
|
699
771
|
);
|
|
772
|
+
const challengeType = challengeResult.type?.toLowerCase();
|
|
773
|
+
if (
|
|
774
|
+
challengeType !== AuthenticationMethodTypeV2.EMAIL &&
|
|
775
|
+
challengeType !== AuthenticationMethodTypeV2.SMS
|
|
776
|
+
) {
|
|
777
|
+
const message =
|
|
778
|
+
"A replacement code requires an email or SMS code challenge.";
|
|
779
|
+
this.logger.error(message, parameters.correlationId);
|
|
780
|
+
throw new CustomAuthError(
|
|
781
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
782
|
+
message,
|
|
783
|
+
parameters.correlationId
|
|
784
|
+
);
|
|
785
|
+
}
|
|
700
786
|
|
|
701
787
|
return createFlowCodeRequiredResultV2({
|
|
702
788
|
correlationId: parameters.correlationId,
|
|
@@ -712,8 +798,12 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
712
798
|
|
|
713
799
|
async submitSignUpAttributes(
|
|
714
800
|
parameters: FlowSubmitSignUpAttributesParamsV2
|
|
715
|
-
): Promise<
|
|
716
|
-
const {
|
|
801
|
+
): Promise<FlowSignUpSubmitAttributesResultV2> {
|
|
802
|
+
const {
|
|
803
|
+
continuationState,
|
|
804
|
+
correlationId,
|
|
805
|
+
attributes: submittedAttributes,
|
|
806
|
+
} = parameters;
|
|
717
807
|
const context = this.createRequestContext(
|
|
718
808
|
this.resolveStepApiId(
|
|
719
809
|
continuationState.scenario,
|
|
@@ -728,6 +818,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
728
818
|
correlationId
|
|
729
819
|
);
|
|
730
820
|
|
|
821
|
+
const submittedAttributeIds = Object.keys(submittedAttributes);
|
|
731
822
|
const submitResult = await this.apiClient.submitSignUpAttributes(
|
|
732
823
|
this.requireLink(
|
|
733
824
|
correlationId,
|
|
@@ -735,19 +826,24 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
735
826
|
),
|
|
736
827
|
{
|
|
737
828
|
continuationToken: continuationState.continuationToken,
|
|
738
|
-
attributes,
|
|
829
|
+
attributes: submittedAttributes,
|
|
739
830
|
},
|
|
740
831
|
context
|
|
741
832
|
);
|
|
742
833
|
|
|
743
|
-
return this.
|
|
834
|
+
return this.toSignUpSubmitAttributesResult(
|
|
744
835
|
submitResult,
|
|
745
836
|
{
|
|
746
837
|
...continuationState,
|
|
747
838
|
signUp: {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
839
|
+
purpose: "newAccount",
|
|
840
|
+
submittedAttributeIds: [
|
|
841
|
+
...new Set([
|
|
842
|
+
...(continuationState.signUp
|
|
843
|
+
?.submittedAttributeIds ?? []),
|
|
844
|
+
...submittedAttributeIds,
|
|
845
|
+
]),
|
|
846
|
+
],
|
|
751
847
|
},
|
|
752
848
|
},
|
|
753
849
|
correlationId
|
|
@@ -755,15 +851,12 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
755
851
|
}
|
|
756
852
|
|
|
757
853
|
/*
|
|
758
|
-
* Submits the new password and polls
|
|
759
|
-
*
|
|
854
|
+
* Submits the new password and polls for the next action: method registration,
|
|
855
|
+
* MFA, or a continuation for explicit sign-in.
|
|
760
856
|
*/
|
|
761
857
|
async submitNewPassword(
|
|
762
858
|
parameters: FlowSubmitNewPasswordParamsV2
|
|
763
|
-
): Promise<
|
|
764
|
-
| FlowSignInContinuationRequiredResultV2
|
|
765
|
-
| FlowAuthMethodRegistrationRequiredResultV2
|
|
766
|
-
> {
|
|
859
|
+
): Promise<FlowSubmitNewPasswordResultV2> {
|
|
767
860
|
const continuationState = parameters.continuationState;
|
|
768
861
|
const correlationId = parameters.correlationId;
|
|
769
862
|
const context = this.createRequestContext(
|
|
@@ -799,7 +892,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
799
892
|
);
|
|
800
893
|
|
|
801
894
|
isPolling = pollResult.nextAction === POLL_RELATION;
|
|
802
|
-
if (
|
|
895
|
+
if (pollResult.nextAction !== POLL_RELATION) {
|
|
803
896
|
break;
|
|
804
897
|
}
|
|
805
898
|
|
|
@@ -823,10 +916,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
823
916
|
);
|
|
824
917
|
}
|
|
825
918
|
|
|
826
|
-
if (
|
|
827
|
-
pollResult.nextAction === ENROLL_RELATION &&
|
|
828
|
-
pollResult.enrollmentMethods
|
|
829
|
-
) {
|
|
919
|
+
if (pollResult.nextAction === ENROLL_RELATION && pollResult.methods) {
|
|
830
920
|
return this.createAuthMethodRegistrationRequiredResult({
|
|
831
921
|
correlationId,
|
|
832
922
|
continuationState: {
|
|
@@ -834,7 +924,43 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
834
924
|
continuationToken: pollResult.continuationToken,
|
|
835
925
|
links: {},
|
|
836
926
|
},
|
|
837
|
-
methods: pollResult.
|
|
927
|
+
methods: pollResult.methods,
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
if (pollResult.nextAction === CHALLENGE_RELATION) {
|
|
932
|
+
if (!pollResult.authenticationFactor) {
|
|
933
|
+
const message =
|
|
934
|
+
"Password-reset MFA challenge is missing its authentication factor.";
|
|
935
|
+
this.logger.error(message, correlationId);
|
|
936
|
+
throw new CustomAuthError(
|
|
937
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
938
|
+
message,
|
|
939
|
+
correlationId
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
this.ensureAuthenticationFactor(
|
|
944
|
+
pollResult.authenticationFactor,
|
|
945
|
+
AuthenticationFactorV2.MULTI_FACTOR,
|
|
946
|
+
"after password reset",
|
|
947
|
+
correlationId
|
|
948
|
+
);
|
|
949
|
+
|
|
950
|
+
return createFlowMFARequiredResultV2({
|
|
951
|
+
correlationId,
|
|
952
|
+
continuationState: {
|
|
953
|
+
continuationToken: pollResult.continuationToken,
|
|
954
|
+
scenario: continuationState.scenario,
|
|
955
|
+
scopes: continuationState.scopes,
|
|
956
|
+
links: {},
|
|
957
|
+
},
|
|
958
|
+
methods: pollResult.methods.map((method) => ({
|
|
959
|
+
id: method.id,
|
|
960
|
+
type: method.type ?? "",
|
|
961
|
+
hint: method.hint,
|
|
962
|
+
challengeHref: method.challengeHref,
|
|
963
|
+
})),
|
|
838
964
|
});
|
|
839
965
|
}
|
|
840
966
|
|
|
@@ -865,15 +991,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
865
991
|
}
|
|
866
992
|
|
|
867
993
|
/*
|
|
868
|
-
* Verifies
|
|
994
|
+
* Verifies the sign-in password.
|
|
869
995
|
*/
|
|
870
996
|
async submitSignInPassword(
|
|
871
997
|
parameters: FlowSubmitSignInPasswordParamsV2
|
|
872
|
-
): Promise<
|
|
873
|
-
| FlowMFARequiredResultV2
|
|
874
|
-
| FlowAuthMethodRegistrationRequiredResultV2
|
|
875
|
-
| FlowCompletedResultV2
|
|
876
|
-
> {
|
|
998
|
+
): Promise<FlowSubmitSignInPasswordResultV2> {
|
|
877
999
|
const verifyResult = await this.verifySignInPassword(parameters);
|
|
878
1000
|
|
|
879
1001
|
return this.handleSignInVerification(
|
|
@@ -884,8 +1006,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
884
1006
|
}
|
|
885
1007
|
|
|
886
1008
|
/*
|
|
887
|
-
*
|
|
888
|
-
* authentication result after validating and caching the response.
|
|
1009
|
+
* Signs the user in from a completed flow.
|
|
889
1010
|
*/
|
|
890
1011
|
async signInWithContinuation(
|
|
891
1012
|
parameters: FlowSignInWithContinuationParamsV2
|
|
@@ -933,11 +1054,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
933
1054
|
continuationState: FlowContinuationStateV2,
|
|
934
1055
|
verifyResult: VerifyResultV2,
|
|
935
1056
|
correlationId: string
|
|
936
|
-
): Promise<
|
|
937
|
-
| FlowMFARequiredResultV2
|
|
938
|
-
| FlowAuthMethodRegistrationRequiredResultV2
|
|
939
|
-
| FlowCompletedResultV2
|
|
940
|
-
> {
|
|
1057
|
+
): Promise<FlowSubmitSignInPasswordResultV2> {
|
|
941
1058
|
if (verifyResult.nextAction === ENROLL_RELATION) {
|
|
942
1059
|
return this.createAuthMethodRegistrationRequiredResult({
|
|
943
1060
|
correlationId,
|
|
@@ -954,16 +1071,15 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
954
1071
|
this.ensureAuthenticationFactor(
|
|
955
1072
|
verifyResult.authenticationFactor,
|
|
956
1073
|
AuthenticationFactorV2.MULTI_FACTOR,
|
|
957
|
-
"after
|
|
1074
|
+
"after authentication verification",
|
|
958
1075
|
correlationId
|
|
959
1076
|
);
|
|
960
1077
|
|
|
961
1078
|
return createFlowMFARequiredResultV2({
|
|
962
1079
|
correlationId,
|
|
963
1080
|
continuationState: {
|
|
1081
|
+
...continuationState,
|
|
964
1082
|
continuationToken: verifyResult.continuationToken,
|
|
965
|
-
scenario: continuationState.scenario,
|
|
966
|
-
scopes: continuationState.scopes,
|
|
967
1083
|
links: {},
|
|
968
1084
|
},
|
|
969
1085
|
methods: verifyResult.methods.map((method) => ({
|
|
@@ -983,7 +1099,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
983
1099
|
);
|
|
984
1100
|
}
|
|
985
1101
|
|
|
986
|
-
const message = `Verification next action '${verifyResult.nextAction}' is not supported for
|
|
1102
|
+
const message = `Verification next action '${verifyResult.nextAction}' is not supported for authentication.`;
|
|
987
1103
|
this.logger.error(message, correlationId);
|
|
988
1104
|
throw new CustomAuthError(
|
|
989
1105
|
UNSUPPORTED_FLOW_TRANSITION,
|
|
@@ -992,51 +1108,50 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
992
1108
|
);
|
|
993
1109
|
}
|
|
994
1110
|
|
|
995
|
-
private handleSignUpVerification(
|
|
1111
|
+
private async handleSignUpVerification(
|
|
996
1112
|
continuationState: FlowContinuationStateV2,
|
|
997
1113
|
verifyResult: VerifyResultV2,
|
|
998
1114
|
correlationId: string
|
|
999
|
-
):
|
|
1000
|
-
| FlowAuthMethodRegistrationRequiredResultV2
|
|
1001
|
-
| FlowSignUpPasswordRequiredResultV2
|
|
1002
|
-
| FlowAttributesRequiredResultV2
|
|
1003
|
-
| FlowSignInContinuationRequiredResultV2 {
|
|
1115
|
+
): Promise<FlowSignUpVerificationResultV2> {
|
|
1004
1116
|
if (verifyResult.nextAction === COLLECT_ATTRIBUTES_RELATION) {
|
|
1005
|
-
const
|
|
1117
|
+
const requestedAttributes = verifyResult.attributes;
|
|
1118
|
+
const requestedPasswordAttribute = requestedAttributes.find(
|
|
1006
1119
|
(attribute) =>
|
|
1007
|
-
attribute.attributeId.toLowerCase() === "password"
|
|
1008
|
-
attribute.required === true
|
|
1120
|
+
attribute.attributeId.toLowerCase() === "password"
|
|
1009
1121
|
);
|
|
1010
1122
|
const nextContinuationState: FlowContinuationStateV2 = {
|
|
1123
|
+
...continuationState,
|
|
1011
1124
|
continuationToken: verifyResult.continuationToken,
|
|
1012
|
-
scenario: continuationState.scenario,
|
|
1013
|
-
scopes: continuationState.scopes,
|
|
1014
1125
|
links: {
|
|
1015
1126
|
submitAttributes: verifyResult.submitAttributesHref,
|
|
1016
1127
|
},
|
|
1017
|
-
signUp: continuationState.signUp,
|
|
1018
1128
|
};
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1021
|
-
attribute.attributeId.toLowerCase() !== "password"
|
|
1022
|
-
);
|
|
1129
|
+
const pendingProfileAttributes =
|
|
1130
|
+
continuationState.signUp?.pendingProfileAttributes;
|
|
1023
1131
|
|
|
1024
1132
|
if (
|
|
1025
|
-
|
|
1026
|
-
|
|
1133
|
+
pendingProfileAttributes &&
|
|
1134
|
+
Object.keys(pendingProfileAttributes).length > 0
|
|
1027
1135
|
) {
|
|
1136
|
+
return this.submitSignUpAttributes({
|
|
1137
|
+
correlationId,
|
|
1138
|
+
continuationState: nextContinuationState,
|
|
1139
|
+
attributes: pendingProfileAttributes,
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
if (requestedPasswordAttribute) {
|
|
1028
1144
|
return createFlowSignUpPasswordRequiredResultV2({
|
|
1029
1145
|
correlationId,
|
|
1030
1146
|
continuationState: nextContinuationState,
|
|
1031
|
-
|
|
1032
|
-
requiredPasswordAttribute,
|
|
1147
|
+
requestedPasswordAttribute,
|
|
1033
1148
|
});
|
|
1034
1149
|
}
|
|
1035
1150
|
|
|
1036
1151
|
return createFlowAttributesRequiredResultV2({
|
|
1037
1152
|
correlationId,
|
|
1038
1153
|
continuationState: nextContinuationState,
|
|
1039
|
-
attributes,
|
|
1154
|
+
attributes: requestedAttributes,
|
|
1040
1155
|
});
|
|
1041
1156
|
}
|
|
1042
1157
|
|
|
@@ -1056,9 +1171,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1056
1171
|
return createFlowSignInContinuationRequiredResultV2({
|
|
1057
1172
|
correlationId,
|
|
1058
1173
|
continuationState: {
|
|
1174
|
+
...continuationState,
|
|
1059
1175
|
continuationToken: verifyResult.continuationToken,
|
|
1060
|
-
scenario: continuationState.scenario,
|
|
1061
|
-
scopes: continuationState.scopes,
|
|
1062
1176
|
links: {},
|
|
1063
1177
|
},
|
|
1064
1178
|
});
|
|
@@ -1226,32 +1340,13 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1226
1340
|
});
|
|
1227
1341
|
}
|
|
1228
1342
|
|
|
1229
|
-
private
|
|
1343
|
+
private toSignUpSubmitAttributesResult(
|
|
1230
1344
|
result: SignUpSubmitAttributesApiResultV2,
|
|
1231
1345
|
continuationState: FlowContinuationStateV2,
|
|
1232
1346
|
correlationId: string
|
|
1233
|
-
):
|
|
1347
|
+
): FlowSignUpSubmitAttributesResultV2 {
|
|
1234
1348
|
const nextAction: string = result.nextAction;
|
|
1235
1349
|
|
|
1236
|
-
if (result.nextAction === SignUpSubmitAttributesNextActionV2.VERIFY) {
|
|
1237
|
-
return createFlowCodeRequiredResultV2({
|
|
1238
|
-
correlationId,
|
|
1239
|
-
continuationState: {
|
|
1240
|
-
continuationToken: result.continuationToken,
|
|
1241
|
-
scenario: continuationState.scenario,
|
|
1242
|
-
scopes: continuationState.scopes,
|
|
1243
|
-
links: {
|
|
1244
|
-
verify: result.verifyHref,
|
|
1245
|
-
resend: result.resendHref,
|
|
1246
|
-
},
|
|
1247
|
-
signUp: continuationState.signUp,
|
|
1248
|
-
},
|
|
1249
|
-
channel: result.type,
|
|
1250
|
-
sentTo: result.hint,
|
|
1251
|
-
codeLength: result.codeLength,
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
1350
|
if (result.nextAction === SignUpSubmitAttributesNextActionV2.ENROLL) {
|
|
1256
1351
|
return this.createAuthMethodRegistrationRequiredResult({
|
|
1257
1352
|
correlationId,
|
|
@@ -1268,41 +1363,36 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1268
1363
|
result.nextAction ===
|
|
1269
1364
|
SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES
|
|
1270
1365
|
) {
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1366
|
+
const requestedAttributes = result.attributes;
|
|
1367
|
+
this.ensureValidSignUpAttributeCollectionAfterSubmission(
|
|
1368
|
+
requestedAttributes,
|
|
1369
|
+
continuationState,
|
|
1370
|
+
correlationId
|
|
1275
1371
|
);
|
|
1276
1372
|
const nextContinuationState: FlowContinuationStateV2 = {
|
|
1373
|
+
...continuationState,
|
|
1277
1374
|
continuationToken: result.continuationToken,
|
|
1278
|
-
scenario: continuationState.scenario,
|
|
1279
|
-
scopes: continuationState.scopes,
|
|
1280
1375
|
links: {
|
|
1281
1376
|
submitAttributes: result.submitAttributesHref,
|
|
1282
1377
|
},
|
|
1283
|
-
signUp: continuationState.signUp,
|
|
1284
1378
|
};
|
|
1285
|
-
|
|
1379
|
+
|
|
1380
|
+
const requestedPasswordAttribute = requestedAttributes.find(
|
|
1286
1381
|
(attribute) =>
|
|
1287
|
-
attribute.attributeId.toLowerCase()
|
|
1382
|
+
attribute.attributeId.toLowerCase() === "password"
|
|
1288
1383
|
);
|
|
1289
|
-
|
|
1290
|
-
if (
|
|
1291
|
-
requiredPasswordAttribute &&
|
|
1292
|
-
continuationState.signUp?.passwordWasSupplied !== true
|
|
1293
|
-
) {
|
|
1384
|
+
if (requestedPasswordAttribute) {
|
|
1294
1385
|
return createFlowSignUpPasswordRequiredResultV2({
|
|
1295
1386
|
correlationId,
|
|
1296
1387
|
continuationState: nextContinuationState,
|
|
1297
|
-
|
|
1298
|
-
requiredPasswordAttribute,
|
|
1388
|
+
requestedPasswordAttribute,
|
|
1299
1389
|
});
|
|
1300
1390
|
}
|
|
1301
1391
|
|
|
1302
1392
|
return createFlowAttributesRequiredResultV2({
|
|
1303
1393
|
correlationId,
|
|
1304
1394
|
continuationState: nextContinuationState,
|
|
1305
|
-
attributes,
|
|
1395
|
+
attributes: requestedAttributes,
|
|
1306
1396
|
});
|
|
1307
1397
|
}
|
|
1308
1398
|
|
|
@@ -1310,9 +1400,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1310
1400
|
return createFlowSignInContinuationRequiredResultV2({
|
|
1311
1401
|
correlationId,
|
|
1312
1402
|
continuationState: {
|
|
1403
|
+
...continuationState,
|
|
1313
1404
|
continuationToken: result.continuationToken,
|
|
1314
|
-
scenario: continuationState.scenario,
|
|
1315
|
-
scopes: continuationState.scopes,
|
|
1316
1405
|
links: {},
|
|
1317
1406
|
},
|
|
1318
1407
|
});
|
|
@@ -1327,6 +1416,38 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1327
1416
|
);
|
|
1328
1417
|
}
|
|
1329
1418
|
|
|
1419
|
+
private ensureValidSignUpAttributeCollectionAfterSubmission(
|
|
1420
|
+
requestedAttributes: SignUpAttributeV2[],
|
|
1421
|
+
continuationState: FlowContinuationStateV2,
|
|
1422
|
+
correlationId: string
|
|
1423
|
+
): void {
|
|
1424
|
+
const submittedAttributeIds =
|
|
1425
|
+
continuationState.signUp?.submittedAttributeIds ?? [];
|
|
1426
|
+
const hasSubmittedPassword = submittedAttributeIds.some(
|
|
1427
|
+
(attributeId) => attributeId.toLowerCase() === "password"
|
|
1428
|
+
);
|
|
1429
|
+
const invalidAttribute = requestedAttributes.find(
|
|
1430
|
+
(requestedAttribute) =>
|
|
1431
|
+
requestedAttribute.attributeId.toLowerCase() === "password"
|
|
1432
|
+
? hasSubmittedPassword
|
|
1433
|
+
: submittedAttributeIds.includes(
|
|
1434
|
+
requestedAttribute.attributeId
|
|
1435
|
+
)
|
|
1436
|
+
);
|
|
1437
|
+
if (invalidAttribute) {
|
|
1438
|
+
const message =
|
|
1439
|
+
invalidAttribute.attributeId.toLowerCase() === "password"
|
|
1440
|
+
? "The sign-up API cannot request password collection after attribute submission."
|
|
1441
|
+
: "The sign-up API requested an attribute that was already successfully submitted.";
|
|
1442
|
+
this.logger.error(message, correlationId);
|
|
1443
|
+
throw new CustomAuthError(
|
|
1444
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
1445
|
+
message,
|
|
1446
|
+
correlationId
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1330
1451
|
private ensureAuthenticationFactor(
|
|
1331
1452
|
authenticationFactor: AuthenticationFactorV2,
|
|
1332
1453
|
expectedFactor: AuthenticationFactorV2,
|
|
@@ -1346,6 +1467,43 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1346
1467
|
);
|
|
1347
1468
|
}
|
|
1348
1469
|
|
|
1470
|
+
private toExistingAccountChallengeResult(
|
|
1471
|
+
challengeResult: FlowRequestChallengeResultV2,
|
|
1472
|
+
method: AuthenticationMethodV2,
|
|
1473
|
+
correlationId: string
|
|
1474
|
+
): FlowExistingAccountChallengeResultV2 {
|
|
1475
|
+
if (
|
|
1476
|
+
challengeResult.type === FLOW_CODE_REQUIRED_V2 &&
|
|
1477
|
+
challengeResult.channel?.toLowerCase() ===
|
|
1478
|
+
AuthenticationMethodTypeV2.EMAIL
|
|
1479
|
+
) {
|
|
1480
|
+
return createFlowExistingAccountCodeRequiredResultV2({
|
|
1481
|
+
correlationId,
|
|
1482
|
+
continuationState: challengeResult.continuationState,
|
|
1483
|
+
method,
|
|
1484
|
+
channel: challengeResult.channel,
|
|
1485
|
+
sentTo: challengeResult.sentTo,
|
|
1486
|
+
codeLength: challengeResult.codeLength,
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
if (challengeResult.type === FLOW_PASSWORD_REQUIRED_V2) {
|
|
1491
|
+
return createFlowExistingAccountPasswordRequiredResultV2({
|
|
1492
|
+
correlationId,
|
|
1493
|
+
continuationState: challengeResult.continuationState,
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
const message =
|
|
1498
|
+
"Existing-account sign-up requires an email code challenge or a password challenge.";
|
|
1499
|
+
this.logger.error(message, correlationId);
|
|
1500
|
+
throw new CustomAuthError(
|
|
1501
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
1502
|
+
message,
|
|
1503
|
+
correlationId
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1349
1507
|
private async verifySignInPassword(
|
|
1350
1508
|
parameters: FlowSubmitSignInPasswordParamsV2
|
|
1351
1509
|
): Promise<VerifyResultV2> {
|
|
@@ -1359,7 +1517,10 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1359
1517
|
correlationId
|
|
1360
1518
|
);
|
|
1361
1519
|
|
|
1362
|
-
this.logger.verbose(
|
|
1520
|
+
this.logger.verbose(
|
|
1521
|
+
"Submitting V2 authentication password.",
|
|
1522
|
+
correlationId
|
|
1523
|
+
);
|
|
1363
1524
|
|
|
1364
1525
|
return this.apiClient.verifyChallenge(
|
|
1365
1526
|
this.requireLink(correlationId, continuationState.links.verify),
|
|
@@ -1379,9 +1540,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1379
1540
|
return this.signInWithContinuation({
|
|
1380
1541
|
correlationId,
|
|
1381
1542
|
continuationState: {
|
|
1543
|
+
...continuationState,
|
|
1382
1544
|
continuationToken,
|
|
1383
|
-
scenario: continuationState.scenario,
|
|
1384
|
-
scopes: continuationState.scopes,
|
|
1385
1545
|
links: {},
|
|
1386
1546
|
},
|
|
1387
1547
|
});
|
|
@@ -1447,9 +1607,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1447
1607
|
challengeResult: ChallengeVerificationResultV2
|
|
1448
1608
|
): FlowContinuationStateV2 {
|
|
1449
1609
|
return {
|
|
1610
|
+
...continuationState,
|
|
1450
1611
|
continuationToken: challengeResult.continuationToken,
|
|
1451
|
-
scenario: continuationState.scenario,
|
|
1452
|
-
scopes: continuationState.scopes,
|
|
1453
1612
|
links: {
|
|
1454
1613
|
challenge: continuationState.links.challenge,
|
|
1455
1614
|
verify: challengeResult.verifyHref,
|
|
@@ -1457,9 +1616,6 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1457
1616
|
challengeResult.resendHref ??
|
|
1458
1617
|
continuationState.links.resend,
|
|
1459
1618
|
},
|
|
1460
|
-
...(continuationState.signUp && {
|
|
1461
|
-
signUp: continuationState.signUp,
|
|
1462
|
-
}),
|
|
1463
1619
|
};
|
|
1464
1620
|
}
|
|
1465
1621
|
|