@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
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.29.0 2026-11-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { InteractionClientBaseV2 } from './InteractionClientBaseV2.mjs';
|
|
4
|
-
import { createFlowMethodSelectionRequiredResultV2, FLOW_CODE_REQUIRED_V2,
|
|
4
|
+
import { createFlowMethodSelectionRequiredResultV2, FLOW_CODE_REQUIRED_V2, createFlowCodeRequiredResultV2, createFlowPasswordRequiredResultV2, createFlowSignInContinuationRequiredResultV2, createFlowNewPasswordRequiredResultV2, createFlowMFARequiredResultV2, createFlowCompletedResultV2, createFlowSignUpPasswordRequiredResultV2, createFlowAttributesRequiredResultV2, createFlowAuthMethodRegistrationRequiredResultV2, createFlowAuthMethodVerificationRequiredResultV2, createFlowExistingAccountCodeRequiredResultV2, FLOW_PASSWORD_REQUIRED_V2, createFlowExistingAccountPasswordRequiredResultV2 } from './result/FlowActionResultV2.mjs';
|
|
5
5
|
import { CustomAuthError } from '../../error/CustomAuthError.mjs';
|
|
6
6
|
import { SIGN_IN_UNSUPPORTED, SIGN_UP_UNSUPPORTED, UNSUPPORTED_FLOW_TRANSITION, RESET_PASSWORD_UNSUPPORTED, RESET_PASSWORD_TIMEOUT, UNSUPPORTED_FLOW_STEP, CONTINUATION_LINK_MISSING } from '../../network_client/custom_auth_api/v2/ErrorCodesV2.mjs';
|
|
7
7
|
import { CustomAuthFlowScenarioV2 } from '../../auth_flow/v2/CustomAuthFlowScenarioV2.mjs';
|
|
8
8
|
import { SIGN_IN_V2_START, SIGN_UP_V2_START, RESET_PASSWORD_V2_START, JIT_V2_ENROLL_AUTH_METHOD, JIT_V2_SUBMIT_CHALLENGE, JIT_V2_RESEND_CHALLENGE } from '../../telemetry/PublicApiId.mjs';
|
|
9
9
|
import { getPublicApiIdV2 } from '../../telemetry/FlowApiIdHelperV2.mjs';
|
|
10
10
|
import { AuthenticationFactorV2 } from '../../network_client/custom_auth_api/v2/result/BaseResultsV2.mjs';
|
|
11
|
-
import { AuthenticationMethodTypeV2, UPDATE_RELATION,
|
|
11
|
+
import { VERIFY_RELATION, AuthenticationMethodTypeV2, ResponseStateV2, UPDATE_RELATION, POLL_RELATION, ENROLL_RELATION, CHALLENGE_RELATION, COLLECT_ATTRIBUTES_RELATION, PhoneRegistrationChannelV2, RISK_VERIFY_RELATION } from '../../network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs';
|
|
12
12
|
import { SignUpSubmitAttributesNextActionV2 } from '../../network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs';
|
|
13
13
|
import { InvalidArgumentError } from '../../error/InvalidArgumentError.mjs';
|
|
14
|
+
import { filterReservedSignUpAttributesV2 } from '../../utils/ArgumentValidator.mjs';
|
|
14
15
|
|
|
15
16
|
/*
|
|
16
17
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
17
18
|
* Licensed under the MIT License.
|
|
18
19
|
*/
|
|
19
|
-
/*
|
|
20
|
-
* Polls up to five times for password-update completion, waiting 1.5 seconds
|
|
21
|
-
* between attempts. The first request runs immediately.
|
|
22
|
-
*/
|
|
23
20
|
const POLL_MAX_ATTEMPTS = 5;
|
|
24
21
|
// TODO: Replace this fallback with the server-provided polling interval once available.
|
|
25
22
|
const POLL_INTERVAL_MS = 1500;
|
|
26
23
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
27
24
|
/*
|
|
28
|
-
* Drives server-directed Native Auth V2 flows
|
|
29
|
-
* and HAL links. Each operation returns only its valid discriminated results.
|
|
25
|
+
* Drives server-directed Native Auth V2 flows.
|
|
30
26
|
*/
|
|
31
27
|
class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
32
28
|
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, customAuthAuthority, apiClient) {
|
|
@@ -34,8 +30,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
34
30
|
this.apiClient = apiClient;
|
|
35
31
|
}
|
|
36
32
|
/*
|
|
37
|
-
* Starts sign-in
|
|
38
|
-
* multiple supported methods for user selection.
|
|
33
|
+
* Starts native auth V2 sign-in.
|
|
39
34
|
*/
|
|
40
35
|
async signIn(parameters) {
|
|
41
36
|
const correlationId = parameters.correlationId;
|
|
@@ -88,20 +83,14 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
88
83
|
method: selectedMethod,
|
|
89
84
|
};
|
|
90
85
|
}
|
|
91
|
-
if (parameters.password) {
|
|
92
|
-
return this.submitSignInPassword({
|
|
93
|
-
correlationId,
|
|
94
|
-
continuationState: challengeResult.continuationState,
|
|
95
|
-
password: parameters.password,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
86
|
return challengeResult;
|
|
99
87
|
}
|
|
100
88
|
/*
|
|
101
|
-
* Starts
|
|
89
|
+
* Starts native auth V2 sign-up.
|
|
102
90
|
*/
|
|
103
91
|
async signUp(parameters) {
|
|
104
92
|
const correlationId = parameters.correlationId;
|
|
93
|
+
const pendingProfileAttributes = filterReservedSignUpAttributesV2(parameters.attributes, this.logger, correlationId);
|
|
105
94
|
const context = this.createRequestContext(SIGN_UP_V2_START, correlationId);
|
|
106
95
|
this.logger.verbose("19e1ak", correlationId);
|
|
107
96
|
const scopes = this.getScopes(parameters.scopes);
|
|
@@ -111,38 +100,82 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
111
100
|
message: "The authorize-challenge entry response did not include a sign-up link.",
|
|
112
101
|
}), {
|
|
113
102
|
continuationToken: entryResult.continuationToken,
|
|
103
|
+
username: parameters.username,
|
|
114
104
|
}, context);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
if (startResult.nextAction === VERIFY_RELATION) {
|
|
106
|
+
if (startResult.type?.toLowerCase() !==
|
|
107
|
+
AuthenticationMethodTypeV2.EMAIL) {
|
|
108
|
+
const message = "New-account sign-up requires an email code challenge.";
|
|
109
|
+
this.logger.error(message, correlationId);
|
|
110
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
111
|
+
}
|
|
112
|
+
return createFlowCodeRequiredResultV2({
|
|
113
|
+
correlationId,
|
|
114
|
+
continuationState: {
|
|
115
|
+
continuationToken: startResult.continuationToken,
|
|
116
|
+
scenario: CustomAuthFlowScenarioV2.SignUp,
|
|
117
|
+
scopes,
|
|
118
|
+
links: {
|
|
119
|
+
verify: startResult.verifyHref,
|
|
120
|
+
resend: startResult.resendHref,
|
|
121
|
+
},
|
|
122
|
+
signUp: {
|
|
123
|
+
purpose: "newAccount",
|
|
124
|
+
pendingProfileAttributes,
|
|
125
|
+
submittedAttributeIds: [],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
channel: startResult.type,
|
|
129
|
+
sentTo: startResult.hint,
|
|
130
|
+
codeLength: startResult.codeLength,
|
|
131
|
+
});
|
|
120
132
|
}
|
|
121
|
-
const submitResult = await this.apiClient.submitSignUpAttributes(startResult.submitAttributesHref, {
|
|
122
|
-
continuationToken: startResult.continuationToken,
|
|
123
|
-
attributes,
|
|
124
|
-
}, context);
|
|
125
133
|
const continuationState = {
|
|
126
134
|
continuationToken: startResult.continuationToken,
|
|
127
135
|
scenario: CustomAuthFlowScenarioV2.SignUp,
|
|
128
136
|
scopes,
|
|
129
137
|
links: {},
|
|
130
138
|
signUp: {
|
|
131
|
-
|
|
139
|
+
purpose: "existingAccount",
|
|
132
140
|
},
|
|
133
141
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
this.ensureAuthenticationFactor(startResult.authenticationFactor, AuthenticationFactorV2.SINGLE_FACTOR, "existing-account sign-up", correlationId);
|
|
143
|
+
const supportedMethods = startResult.methods
|
|
144
|
+
.map((method) => ({
|
|
145
|
+
id: method.id,
|
|
146
|
+
type: method.type ?? "",
|
|
147
|
+
hint: method.hint,
|
|
148
|
+
challengeHref: method.challengeHref,
|
|
149
|
+
}))
|
|
150
|
+
.filter((method) => {
|
|
151
|
+
const methodType = method.type.toLowerCase();
|
|
152
|
+
return (methodType === AuthenticationMethodTypeV2.EMAIL ||
|
|
153
|
+
methodType === AuthenticationMethodTypeV2.PASSWORD);
|
|
154
|
+
});
|
|
155
|
+
if (supportedMethods.length === 0) {
|
|
156
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, "The existing-account sign-up response must include an email or password method.", correlationId);
|
|
140
157
|
}
|
|
141
|
-
|
|
158
|
+
if (supportedMethods.length > 1) {
|
|
159
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
160
|
+
correlationId,
|
|
161
|
+
continuationState,
|
|
162
|
+
methods: supportedMethods,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
const selectedMethod = supportedMethods[0];
|
|
166
|
+
const challengeResult = await this.requestChallenge({
|
|
167
|
+
correlationId,
|
|
168
|
+
continuationState: {
|
|
169
|
+
...continuationState,
|
|
170
|
+
links: {
|
|
171
|
+
challenge: selectedMethod.challengeHref,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
return this.toExistingAccountChallengeResult(challengeResult, selectedMethod, correlationId);
|
|
142
176
|
}
|
|
143
177
|
/*
|
|
144
|
-
* Starts
|
|
145
|
-
* returning multiple methods for selection.
|
|
178
|
+
* Starts native auth V2 password reset.
|
|
146
179
|
*/
|
|
147
180
|
async resetPassword(parameters) {
|
|
148
181
|
const correlationId = parameters.correlationId;
|
|
@@ -175,44 +208,43 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
175
208
|
this.logger.error(message, correlationId);
|
|
176
209
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
177
210
|
}
|
|
178
|
-
if (methods.length
|
|
179
|
-
|
|
180
|
-
|
|
211
|
+
if (methods.length > 1) {
|
|
212
|
+
this.logger.verbose("0k8yah", correlationId);
|
|
213
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
181
214
|
correlationId,
|
|
182
|
-
continuationState
|
|
183
|
-
|
|
184
|
-
links: {
|
|
185
|
-
challenge: selectedMethod.challengeHref,
|
|
186
|
-
},
|
|
187
|
-
},
|
|
215
|
+
continuationState,
|
|
216
|
+
methods,
|
|
188
217
|
});
|
|
189
|
-
if (challengeResult.type === FLOW_CODE_REQUIRED_V2 &&
|
|
190
|
-
(challengeResult.channel?.toLowerCase() ===
|
|
191
|
-
AuthenticationMethodTypeV2.EMAIL ||
|
|
192
|
-
challengeResult.channel?.toLowerCase() ===
|
|
193
|
-
AuthenticationMethodTypeV2.SMS)) {
|
|
194
|
-
return {
|
|
195
|
-
...challengeResult,
|
|
196
|
-
method: selectedMethod,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
const channel = challengeResult.type === FLOW_CODE_REQUIRED_V2
|
|
200
|
-
? challengeResult.channel
|
|
201
|
-
: AuthenticationMethodTypeV2.PASSWORD;
|
|
202
|
-
const message = `Challenge type '${challengeResult.type}' with channel '${channel}' is not supported for password reset.`;
|
|
203
|
-
this.logger.error(message, correlationId);
|
|
204
|
-
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
205
218
|
}
|
|
206
|
-
|
|
207
|
-
|
|
219
|
+
const selectedMethod = methods[0];
|
|
220
|
+
const challengeResult = await this.requestChallenge({
|
|
208
221
|
correlationId,
|
|
209
|
-
continuationState
|
|
210
|
-
|
|
222
|
+
continuationState: {
|
|
223
|
+
...continuationState,
|
|
224
|
+
links: {
|
|
225
|
+
challenge: selectedMethod.challengeHref,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
211
228
|
});
|
|
229
|
+
if (challengeResult.type === FLOW_CODE_REQUIRED_V2 &&
|
|
230
|
+
(challengeResult.channel?.toLowerCase() ===
|
|
231
|
+
AuthenticationMethodTypeV2.EMAIL ||
|
|
232
|
+
challengeResult.channel?.toLowerCase() ===
|
|
233
|
+
AuthenticationMethodTypeV2.SMS)) {
|
|
234
|
+
return {
|
|
235
|
+
...challengeResult,
|
|
236
|
+
method: selectedMethod,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
const channel = challengeResult.type === FLOW_CODE_REQUIRED_V2
|
|
240
|
+
? challengeResult.channel
|
|
241
|
+
: AuthenticationMethodTypeV2.PASSWORD;
|
|
242
|
+
const message = `Challenge type '${challengeResult.type}' with channel '${channel}' is not supported for password reset.`;
|
|
243
|
+
this.logger.error(message, correlationId);
|
|
244
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
212
245
|
}
|
|
213
246
|
/*
|
|
214
|
-
* Requests a
|
|
215
|
-
* the continuation state and code metadata needed for verification.
|
|
247
|
+
* Requests a challenge for the selected authentication method.
|
|
216
248
|
*/
|
|
217
249
|
async requestChallenge(parameters) {
|
|
218
250
|
const challengeResult = await this.sendMethodChallenge(parameters, "requestChallenge");
|
|
@@ -242,7 +274,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
242
274
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, parameters.correlationId);
|
|
243
275
|
}
|
|
244
276
|
/*
|
|
245
|
-
* Registers the selected
|
|
277
|
+
* Registers the selected authentication method.
|
|
246
278
|
*/
|
|
247
279
|
async registerAuthMethod(parameters) {
|
|
248
280
|
const { continuationState, correlationId } = parameters;
|
|
@@ -256,8 +288,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
256
288
|
return this.createAuthMethodVerificationRequiredResult(continuationState, result, correlationId);
|
|
257
289
|
}
|
|
258
290
|
/*
|
|
259
|
-
* Activates the registered method
|
|
260
|
-
* for tokens.
|
|
291
|
+
* Activates the registered authentication method.
|
|
261
292
|
*/
|
|
262
293
|
async verifyAuthMethodRegistration(parameters) {
|
|
263
294
|
const { continuationState, correlationId } = parameters;
|
|
@@ -267,11 +298,22 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
267
298
|
continuationToken: continuationState.continuationToken,
|
|
268
299
|
otp: parameters.code,
|
|
269
300
|
}, context);
|
|
301
|
+
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp ||
|
|
302
|
+
continuationState.scenario ===
|
|
303
|
+
CustomAuthFlowScenarioV2.PasswordReset) {
|
|
304
|
+
return createFlowSignInContinuationRequiredResultV2({
|
|
305
|
+
correlationId,
|
|
306
|
+
continuationState: {
|
|
307
|
+
...continuationState,
|
|
308
|
+
continuationToken: result.continuationToken,
|
|
309
|
+
links: {},
|
|
310
|
+
},
|
|
311
|
+
});
|
|
312
|
+
}
|
|
270
313
|
return this.completeSignInAfterVerification(continuationState, result.continuationToken, correlationId);
|
|
271
314
|
}
|
|
272
315
|
/*
|
|
273
|
-
* Requests a replacement activation challenge
|
|
274
|
-
* resend link using the latest continuation token.
|
|
316
|
+
* Requests a replacement authentication-method activation challenge.
|
|
275
317
|
*/
|
|
276
318
|
async resendAuthMethodRegistrationChallenge(parameters) {
|
|
277
319
|
const { continuationState, correlationId } = parameters;
|
|
@@ -283,8 +325,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
283
325
|
return this.createAuthMethodVerificationRequiredResult(continuationState, result, correlationId);
|
|
284
326
|
}
|
|
285
327
|
/*
|
|
286
|
-
* Verifies the submitted one-time code
|
|
287
|
-
* response determines the next required action.
|
|
328
|
+
* Verifies the submitted one-time code.
|
|
288
329
|
*/
|
|
289
330
|
async submitCode(parameters) {
|
|
290
331
|
const continuationState = parameters.continuationState;
|
|
@@ -299,6 +340,22 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
299
340
|
const verifyResult = await this.apiClient.verifyChallenge(verifyHref, verifyRequest, context);
|
|
300
341
|
if (continuationState.scenario ===
|
|
301
342
|
CustomAuthFlowScenarioV2.PasswordReset &&
|
|
343
|
+
parameters.authenticationFactor ===
|
|
344
|
+
AuthenticationFactorV2.MULTI_FACTOR &&
|
|
345
|
+
verifyResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
346
|
+
return createFlowSignInContinuationRequiredResultV2({
|
|
347
|
+
correlationId,
|
|
348
|
+
continuationState: {
|
|
349
|
+
...continuationState,
|
|
350
|
+
continuationToken: verifyResult.continuationToken,
|
|
351
|
+
links: {},
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (continuationState.scenario ===
|
|
356
|
+
CustomAuthFlowScenarioV2.PasswordReset &&
|
|
357
|
+
parameters.authenticationFactor !==
|
|
358
|
+
AuthenticationFactorV2.MULTI_FACTOR &&
|
|
302
359
|
verifyResult.nextAction === UPDATE_RELATION) {
|
|
303
360
|
return createFlowNewPasswordRequiredResultV2({
|
|
304
361
|
correlationId,
|
|
@@ -313,6 +370,10 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
313
370
|
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignIn) {
|
|
314
371
|
return this.handleSignInVerification(continuationState, verifyResult, correlationId);
|
|
315
372
|
}
|
|
373
|
+
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp &&
|
|
374
|
+
continuationState.signUp?.purpose === "existingAccount") {
|
|
375
|
+
return this.handleSignInVerification(continuationState, verifyResult, correlationId);
|
|
376
|
+
}
|
|
316
377
|
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp) {
|
|
317
378
|
return this.handleSignUpVerification(continuationState, verifyResult, correlationId);
|
|
318
379
|
}
|
|
@@ -321,11 +382,17 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
321
382
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
322
383
|
}
|
|
323
384
|
/*
|
|
324
|
-
* Requests a
|
|
325
|
-
* Returns refreshed continuation state and code metadata.
|
|
385
|
+
* Requests a replacement one-time code.
|
|
326
386
|
*/
|
|
327
387
|
async resendCode(parameters) {
|
|
328
388
|
const challengeResult = await this.sendMethodChallenge(parameters, "resendCode");
|
|
389
|
+
const challengeType = challengeResult.type?.toLowerCase();
|
|
390
|
+
if (challengeType !== AuthenticationMethodTypeV2.EMAIL &&
|
|
391
|
+
challengeType !== AuthenticationMethodTypeV2.SMS) {
|
|
392
|
+
const message = "A replacement code requires an email or SMS code challenge.";
|
|
393
|
+
this.logger.error(message, parameters.correlationId);
|
|
394
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, parameters.correlationId);
|
|
395
|
+
}
|
|
329
396
|
return createFlowCodeRequiredResultV2({
|
|
330
397
|
correlationId: parameters.correlationId,
|
|
331
398
|
continuationState: this.createChallengeContinuationState(parameters.continuationState, challengeResult),
|
|
@@ -335,24 +402,31 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
335
402
|
});
|
|
336
403
|
}
|
|
337
404
|
async submitSignUpAttributes(parameters) {
|
|
338
|
-
const { continuationState, correlationId, attributes } = parameters;
|
|
405
|
+
const { continuationState, correlationId, attributes: submittedAttributes, } = parameters;
|
|
339
406
|
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, "submitAttributes", correlationId), correlationId);
|
|
340
407
|
this.logger.verbose("0js2ub", correlationId);
|
|
408
|
+
const submittedAttributeIds = Object.keys(submittedAttributes);
|
|
341
409
|
const submitResult = await this.apiClient.submitSignUpAttributes(this.requireLink(correlationId, continuationState.links.submitAttributes), {
|
|
342
410
|
continuationToken: continuationState.continuationToken,
|
|
343
|
-
attributes,
|
|
411
|
+
attributes: submittedAttributes,
|
|
344
412
|
}, context);
|
|
345
|
-
return this.
|
|
413
|
+
return this.toSignUpSubmitAttributesResult(submitResult, {
|
|
346
414
|
...continuationState,
|
|
347
415
|
signUp: {
|
|
348
|
-
|
|
349
|
-
|
|
416
|
+
purpose: "newAccount",
|
|
417
|
+
submittedAttributeIds: [
|
|
418
|
+
...new Set([
|
|
419
|
+
...(continuationState.signUp
|
|
420
|
+
?.submittedAttributeIds ?? []),
|
|
421
|
+
...submittedAttributeIds,
|
|
422
|
+
]),
|
|
423
|
+
],
|
|
350
424
|
},
|
|
351
425
|
}, correlationId);
|
|
352
426
|
}
|
|
353
427
|
/*
|
|
354
|
-
* Submits the new password and polls
|
|
355
|
-
*
|
|
428
|
+
* Submits the new password and polls for the next action: method registration,
|
|
429
|
+
* MFA, or a continuation for explicit sign-in.
|
|
356
430
|
*/
|
|
357
431
|
async submitNewPassword(parameters) {
|
|
358
432
|
const continuationState = parameters.continuationState;
|
|
@@ -370,7 +444,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
370
444
|
for (let attempt = 1; attempt <= POLL_MAX_ATTEMPTS; attempt++) {
|
|
371
445
|
pollResult = await this.apiClient.poll(pollHref, { continuationToken: pollToken }, context);
|
|
372
446
|
isPolling = pollResult.nextAction === POLL_RELATION;
|
|
373
|
-
if (
|
|
447
|
+
if (pollResult.nextAction !== POLL_RELATION) {
|
|
374
448
|
break;
|
|
375
449
|
}
|
|
376
450
|
pollToken = pollResult.continuationToken;
|
|
@@ -384,8 +458,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
384
458
|
this.logger.error(message, correlationId);
|
|
385
459
|
throw new CustomAuthError(RESET_PASSWORD_TIMEOUT, message, correlationId);
|
|
386
460
|
}
|
|
387
|
-
if (pollResult.nextAction === ENROLL_RELATION &&
|
|
388
|
-
pollResult.enrollmentMethods) {
|
|
461
|
+
if (pollResult.nextAction === ENROLL_RELATION && pollResult.methods) {
|
|
389
462
|
return this.createAuthMethodRegistrationRequiredResult({
|
|
390
463
|
correlationId,
|
|
391
464
|
continuationState: {
|
|
@@ -393,7 +466,30 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
393
466
|
continuationToken: pollResult.continuationToken,
|
|
394
467
|
links: {},
|
|
395
468
|
},
|
|
396
|
-
methods: pollResult.
|
|
469
|
+
methods: pollResult.methods,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
if (pollResult.nextAction === CHALLENGE_RELATION) {
|
|
473
|
+
if (!pollResult.authenticationFactor) {
|
|
474
|
+
const message = "Password-reset MFA challenge is missing its authentication factor.";
|
|
475
|
+
this.logger.error(message, correlationId);
|
|
476
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
477
|
+
}
|
|
478
|
+
this.ensureAuthenticationFactor(pollResult.authenticationFactor, AuthenticationFactorV2.MULTI_FACTOR, "after password reset", correlationId);
|
|
479
|
+
return createFlowMFARequiredResultV2({
|
|
480
|
+
correlationId,
|
|
481
|
+
continuationState: {
|
|
482
|
+
continuationToken: pollResult.continuationToken,
|
|
483
|
+
scenario: continuationState.scenario,
|
|
484
|
+
scopes: continuationState.scopes,
|
|
485
|
+
links: {},
|
|
486
|
+
},
|
|
487
|
+
methods: pollResult.methods.map((method) => ({
|
|
488
|
+
id: method.id,
|
|
489
|
+
type: method.type ?? "",
|
|
490
|
+
hint: method.hint,
|
|
491
|
+
challengeHref: method.challengeHref,
|
|
492
|
+
})),
|
|
397
493
|
});
|
|
398
494
|
}
|
|
399
495
|
if (pollResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
@@ -413,15 +509,14 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
413
509
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
414
510
|
}
|
|
415
511
|
/*
|
|
416
|
-
* Verifies
|
|
512
|
+
* Verifies the sign-in password.
|
|
417
513
|
*/
|
|
418
514
|
async submitSignInPassword(parameters) {
|
|
419
515
|
const verifyResult = await this.verifySignInPassword(parameters);
|
|
420
516
|
return this.handleSignInVerification(parameters.continuationState, verifyResult, parameters.correlationId);
|
|
421
517
|
}
|
|
422
518
|
/*
|
|
423
|
-
*
|
|
424
|
-
* authentication result after validating and caching the response.
|
|
519
|
+
* Signs the user in from a completed flow.
|
|
425
520
|
*/
|
|
426
521
|
async signInWithContinuation(parameters) {
|
|
427
522
|
const continuationState = parameters.continuationState;
|
|
@@ -452,13 +547,12 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
452
547
|
});
|
|
453
548
|
}
|
|
454
549
|
if (verifyResult.nextAction === CHALLENGE_RELATION) {
|
|
455
|
-
this.ensureAuthenticationFactor(verifyResult.authenticationFactor, AuthenticationFactorV2.MULTI_FACTOR, "after
|
|
550
|
+
this.ensureAuthenticationFactor(verifyResult.authenticationFactor, AuthenticationFactorV2.MULTI_FACTOR, "after authentication verification", correlationId);
|
|
456
551
|
return createFlowMFARequiredResultV2({
|
|
457
552
|
correlationId,
|
|
458
553
|
continuationState: {
|
|
554
|
+
...continuationState,
|
|
459
555
|
continuationToken: verifyResult.continuationToken,
|
|
460
|
-
scenario: continuationState.scenario,
|
|
461
|
-
scopes: continuationState.scopes,
|
|
462
556
|
links: {},
|
|
463
557
|
},
|
|
464
558
|
methods: verifyResult.methods.map((method) => ({
|
|
@@ -472,37 +566,41 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
472
566
|
if (verifyResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
473
567
|
return this.completeSignInAfterVerification(continuationState, verifyResult.continuationToken, correlationId);
|
|
474
568
|
}
|
|
475
|
-
const message = `Verification next action '${verifyResult.nextAction}' is not supported for
|
|
569
|
+
const message = `Verification next action '${verifyResult.nextAction}' is not supported for authentication.`;
|
|
476
570
|
this.logger.error(message, correlationId);
|
|
477
571
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
478
572
|
}
|
|
479
|
-
handleSignUpVerification(continuationState, verifyResult, correlationId) {
|
|
573
|
+
async handleSignUpVerification(continuationState, verifyResult, correlationId) {
|
|
480
574
|
if (verifyResult.nextAction === COLLECT_ATTRIBUTES_RELATION) {
|
|
481
|
-
const
|
|
482
|
-
|
|
575
|
+
const requestedAttributes = verifyResult.attributes;
|
|
576
|
+
const requestedPasswordAttribute = requestedAttributes.find((attribute) => attribute.attributeId.toLowerCase() === "password");
|
|
483
577
|
const nextContinuationState = {
|
|
578
|
+
...continuationState,
|
|
484
579
|
continuationToken: verifyResult.continuationToken,
|
|
485
|
-
scenario: continuationState.scenario,
|
|
486
|
-
scopes: continuationState.scopes,
|
|
487
580
|
links: {
|
|
488
581
|
submitAttributes: verifyResult.submitAttributesHref,
|
|
489
582
|
},
|
|
490
|
-
signUp: continuationState.signUp,
|
|
491
583
|
};
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
|
|
584
|
+
const pendingProfileAttributes = continuationState.signUp?.pendingProfileAttributes;
|
|
585
|
+
if (pendingProfileAttributes &&
|
|
586
|
+
Object.keys(pendingProfileAttributes).length > 0) {
|
|
587
|
+
return this.submitSignUpAttributes({
|
|
588
|
+
correlationId,
|
|
589
|
+
continuationState: nextContinuationState,
|
|
590
|
+
attributes: pendingProfileAttributes,
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
if (requestedPasswordAttribute) {
|
|
495
594
|
return createFlowSignUpPasswordRequiredResultV2({
|
|
496
595
|
correlationId,
|
|
497
596
|
continuationState: nextContinuationState,
|
|
498
|
-
|
|
499
|
-
requiredPasswordAttribute,
|
|
597
|
+
requestedPasswordAttribute,
|
|
500
598
|
});
|
|
501
599
|
}
|
|
502
600
|
return createFlowAttributesRequiredResultV2({
|
|
503
601
|
correlationId,
|
|
504
602
|
continuationState: nextContinuationState,
|
|
505
|
-
attributes,
|
|
603
|
+
attributes: requestedAttributes,
|
|
506
604
|
});
|
|
507
605
|
}
|
|
508
606
|
if (verifyResult.nextAction === ENROLL_RELATION) {
|
|
@@ -520,9 +618,8 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
520
618
|
return createFlowSignInContinuationRequiredResultV2({
|
|
521
619
|
correlationId,
|
|
522
620
|
continuationState: {
|
|
621
|
+
...continuationState,
|
|
523
622
|
continuationToken: verifyResult.continuationToken,
|
|
524
|
-
scenario: continuationState.scenario,
|
|
525
|
-
scopes: continuationState.scopes,
|
|
526
623
|
links: {},
|
|
527
624
|
},
|
|
528
625
|
});
|
|
@@ -618,26 +715,8 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
618
715
|
codeLength: result.codeLength,
|
|
619
716
|
});
|
|
620
717
|
}
|
|
621
|
-
|
|
718
|
+
toSignUpSubmitAttributesResult(result, continuationState, correlationId) {
|
|
622
719
|
const nextAction = result.nextAction;
|
|
623
|
-
if (result.nextAction === SignUpSubmitAttributesNextActionV2.VERIFY) {
|
|
624
|
-
return createFlowCodeRequiredResultV2({
|
|
625
|
-
correlationId,
|
|
626
|
-
continuationState: {
|
|
627
|
-
continuationToken: result.continuationToken,
|
|
628
|
-
scenario: continuationState.scenario,
|
|
629
|
-
scopes: continuationState.scopes,
|
|
630
|
-
links: {
|
|
631
|
-
verify: result.verifyHref,
|
|
632
|
-
resend: result.resendHref,
|
|
633
|
-
},
|
|
634
|
-
signUp: continuationState.signUp,
|
|
635
|
-
},
|
|
636
|
-
channel: result.type,
|
|
637
|
-
sentTo: result.hint,
|
|
638
|
-
codeLength: result.codeLength,
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
720
|
if (result.nextAction === SignUpSubmitAttributesNextActionV2.ENROLL) {
|
|
642
721
|
return this.createAuthMethodRegistrationRequiredResult({
|
|
643
722
|
correlationId,
|
|
@@ -651,40 +730,35 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
651
730
|
}
|
|
652
731
|
if (result.nextAction ===
|
|
653
732
|
SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES) {
|
|
654
|
-
const
|
|
655
|
-
|
|
733
|
+
const requestedAttributes = result.attributes;
|
|
734
|
+
this.ensureValidSignUpAttributeCollectionAfterSubmission(requestedAttributes, continuationState, correlationId);
|
|
656
735
|
const nextContinuationState = {
|
|
736
|
+
...continuationState,
|
|
657
737
|
continuationToken: result.continuationToken,
|
|
658
|
-
scenario: continuationState.scenario,
|
|
659
|
-
scopes: continuationState.scopes,
|
|
660
738
|
links: {
|
|
661
739
|
submitAttributes: result.submitAttributesHref,
|
|
662
740
|
},
|
|
663
|
-
signUp: continuationState.signUp,
|
|
664
741
|
};
|
|
665
|
-
const
|
|
666
|
-
if (
|
|
667
|
-
continuationState.signUp?.passwordWasSupplied !== true) {
|
|
742
|
+
const requestedPasswordAttribute = requestedAttributes.find((attribute) => attribute.attributeId.toLowerCase() === "password");
|
|
743
|
+
if (requestedPasswordAttribute) {
|
|
668
744
|
return createFlowSignUpPasswordRequiredResultV2({
|
|
669
745
|
correlationId,
|
|
670
746
|
continuationState: nextContinuationState,
|
|
671
|
-
|
|
672
|
-
requiredPasswordAttribute,
|
|
747
|
+
requestedPasswordAttribute,
|
|
673
748
|
});
|
|
674
749
|
}
|
|
675
750
|
return createFlowAttributesRequiredResultV2({
|
|
676
751
|
correlationId,
|
|
677
752
|
continuationState: nextContinuationState,
|
|
678
|
-
attributes,
|
|
753
|
+
attributes: requestedAttributes,
|
|
679
754
|
});
|
|
680
755
|
}
|
|
681
756
|
if (result.nextAction === SignUpSubmitAttributesNextActionV2.CONTINUE) {
|
|
682
757
|
return createFlowSignInContinuationRequiredResultV2({
|
|
683
758
|
correlationId,
|
|
684
759
|
continuationState: {
|
|
760
|
+
...continuationState,
|
|
685
761
|
continuationToken: result.continuationToken,
|
|
686
|
-
scenario: continuationState.scenario,
|
|
687
|
-
scopes: continuationState.scopes,
|
|
688
762
|
links: {},
|
|
689
763
|
},
|
|
690
764
|
});
|
|
@@ -693,6 +767,20 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
693
767
|
this.logger.error(message, correlationId);
|
|
694
768
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
695
769
|
}
|
|
770
|
+
ensureValidSignUpAttributeCollectionAfterSubmission(requestedAttributes, continuationState, correlationId) {
|
|
771
|
+
const submittedAttributeIds = continuationState.signUp?.submittedAttributeIds ?? [];
|
|
772
|
+
const hasSubmittedPassword = submittedAttributeIds.some((attributeId) => attributeId.toLowerCase() === "password");
|
|
773
|
+
const invalidAttribute = requestedAttributes.find((requestedAttribute) => requestedAttribute.attributeId.toLowerCase() === "password"
|
|
774
|
+
? hasSubmittedPassword
|
|
775
|
+
: submittedAttributeIds.includes(requestedAttribute.attributeId));
|
|
776
|
+
if (invalidAttribute) {
|
|
777
|
+
const message = invalidAttribute.attributeId.toLowerCase() === "password"
|
|
778
|
+
? "The sign-up API cannot request password collection after attribute submission."
|
|
779
|
+
: "The sign-up API requested an attribute that was already successfully submitted.";
|
|
780
|
+
this.logger.error(message, correlationId);
|
|
781
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
696
784
|
ensureAuthenticationFactor(authenticationFactor, expectedFactor, transition, correlationId) {
|
|
697
785
|
if (authenticationFactor === expectedFactor) {
|
|
698
786
|
return;
|
|
@@ -701,10 +789,33 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
701
789
|
this.logger.error(message, correlationId);
|
|
702
790
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
703
791
|
}
|
|
792
|
+
toExistingAccountChallengeResult(challengeResult, method, correlationId) {
|
|
793
|
+
if (challengeResult.type === FLOW_CODE_REQUIRED_V2 &&
|
|
794
|
+
challengeResult.channel?.toLowerCase() ===
|
|
795
|
+
AuthenticationMethodTypeV2.EMAIL) {
|
|
796
|
+
return createFlowExistingAccountCodeRequiredResultV2({
|
|
797
|
+
correlationId,
|
|
798
|
+
continuationState: challengeResult.continuationState,
|
|
799
|
+
method,
|
|
800
|
+
channel: challengeResult.channel,
|
|
801
|
+
sentTo: challengeResult.sentTo,
|
|
802
|
+
codeLength: challengeResult.codeLength,
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
if (challengeResult.type === FLOW_PASSWORD_REQUIRED_V2) {
|
|
806
|
+
return createFlowExistingAccountPasswordRequiredResultV2({
|
|
807
|
+
correlationId,
|
|
808
|
+
continuationState: challengeResult.continuationState,
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
const message = "Existing-account sign-up requires an email code challenge or a password challenge.";
|
|
812
|
+
this.logger.error(message, correlationId);
|
|
813
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
814
|
+
}
|
|
704
815
|
async verifySignInPassword(parameters) {
|
|
705
816
|
const { continuationState, correlationId } = parameters;
|
|
706
817
|
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, "submitPassword", correlationId), correlationId);
|
|
707
|
-
this.logger.verbose("
|
|
818
|
+
this.logger.verbose("13uf3o", correlationId);
|
|
708
819
|
return this.apiClient.verifyChallenge(this.requireLink(correlationId, continuationState.links.verify), {
|
|
709
820
|
continuationToken: continuationState.continuationToken,
|
|
710
821
|
password: parameters.password,
|
|
@@ -714,9 +825,8 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
714
825
|
return this.signInWithContinuation({
|
|
715
826
|
correlationId,
|
|
716
827
|
continuationState: {
|
|
828
|
+
...continuationState,
|
|
717
829
|
continuationToken,
|
|
718
|
-
scenario: continuationState.scenario,
|
|
719
|
-
scopes: continuationState.scopes,
|
|
720
830
|
links: {},
|
|
721
831
|
},
|
|
722
832
|
});
|
|
@@ -745,18 +855,14 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
745
855
|
}
|
|
746
856
|
createChallengeContinuationState(continuationState, challengeResult) {
|
|
747
857
|
return {
|
|
858
|
+
...continuationState,
|
|
748
859
|
continuationToken: challengeResult.continuationToken,
|
|
749
|
-
scenario: continuationState.scenario,
|
|
750
|
-
scopes: continuationState.scopes,
|
|
751
860
|
links: {
|
|
752
861
|
challenge: continuationState.links.challenge,
|
|
753
862
|
verify: challengeResult.verifyHref,
|
|
754
863
|
resend: challengeResult.resendHref ??
|
|
755
864
|
continuationState.links.resend,
|
|
756
865
|
},
|
|
757
|
-
...(continuationState.signUp && {
|
|
758
|
-
signUp: continuationState.signUp,
|
|
759
|
-
}),
|
|
760
866
|
};
|
|
761
867
|
}
|
|
762
868
|
resolveStepApiId(scenario, step, correlationId, authenticationFactor) {
|