@azure/msal-browser 5.27.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 +9 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +7 -6
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +4 -2
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +21 -7
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs.map +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +14 -1
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +9 -2
- package/dist/cache/BrowserCacheManager.mjs.map +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 +65 -7
- package/dist/controllers/StandardController.mjs.map +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 +14 -1
- package/dist/crypto/TokenBindingKeyManager.mjs.map +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 -50
- 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 +68 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +44 -16
- 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 +100 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +5 -3
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +27 -19
- 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 +20 -8
- 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 +465 -186
- 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 +18 -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 +10 -8
- 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 +147 -38
- 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 +21 -10
- 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 +2 -12
- 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 +2 -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 +15 -3
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +10 -3
- 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 +6 -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 +49 -14
- 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 +21 -21
- 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 +526 -90
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +27 -20
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +29 -14
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +44 -32
- package/dist/interaction_client/SilentIframeClient.mjs.map +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 +77 -25
- 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 +21 -13
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +35 -11
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/request/SilentRequestHelpers.mjs +6 -6
- package/dist/request/SilentRequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +3 -2
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +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 +69 -17
- package/lib/custom-auth-path/msal-custom-auth.cjs +2394 -920
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +2394 -920
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +23 -11
- package/lib/msal-browser.cjs +943 -278
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +943 -278
- 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/broker/nativeBroker/PlatformAuthDOMHandler.ts +15 -0
- package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +6 -21
- package/src/broker/nativeBroker/PlatformAuthProvider.ts +3 -1
- package/src/broker/nativeBroker/PlatformAuthRequest.ts +12 -8
- package/src/broker/nativeBroker/PlatformAuthResponse.ts +31 -0
- package/src/cache/AsyncMemoryStorage.ts +16 -0
- package/src/cache/BrowserCacheManager.ts +19 -1
- package/src/controllers/StandardController.ts +107 -11
- package/src/crypto/TokenBindingKeyManager.ts +21 -0
- 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 -92
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +14 -0
- 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 +23 -0
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +28 -0
- 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 +8 -8
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +94 -0
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +68 -14
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +150 -0
- package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +8 -2
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +48 -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 +24 -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 +34 -9
- 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 +13 -12
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +771 -261
- package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +2 -6
- package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +27 -15
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +97 -26
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +9 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +330 -63
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +51 -15
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +25 -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 +48 -48
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +44 -37
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +32 -15
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +14 -10
- package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +24 -1
- package/src/custom_auth/core/telemetry/PublicApiId.ts +7 -0
- package/src/custom_auth/core/utils/ArgumentValidator.ts +26 -0
- package/src/custom_auth/index.ts +21 -11
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +8 -10
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +71 -16
- 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 -5
- 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 +18 -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 +33 -43
- package/src/interaction_client/PlatformAuthInteractionClient.ts +886 -148
- package/src/interaction_client/PopupClient.ts +104 -83
- package/src/interaction_client/RedirectClient.ts +88 -34
- package/src/interaction_client/SilentIframeClient.ts +121 -95
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +46 -18
- package/src/request/RequestHelpers.ts +64 -11
- package/src/request/SilentRequestHelpers.ts +8 -9
- package/src/telemetry/BrowserPerformanceEvents.ts +1 -0
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +6 -1
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +21 -0
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
- package/types/cache/AsyncMemoryStorage.d.ts +5 -0
- package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +4 -0
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +5 -0
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/crypto/TokenBindingKeyManager.d.ts +9 -0
- package/types/crypto/TokenBindingKeyManager.d.ts.map +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 +10 -0
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -0
- 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 +14 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +16 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -0
- 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 +7 -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 +22 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -0
- 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 +28 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts +3 -2
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.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 +18 -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 +9 -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 +19 -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 +19 -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 +39 -4
- 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 +8 -0
- 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 +8 -2
- 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 +4 -3
- 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 +13 -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 +36 -9
- 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 +30 -17
- 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 -4
- 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 +8 -11
- 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 +2 -1
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts +7 -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 +10 -5
- package/types/custom_auth/index.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +7 -11
- 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 -5
- 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 +13 -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 +110 -8
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/protocol/Authorize.d.ts +4 -4
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts +21 -3
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/request/SilentRequestHelpers.d.ts.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +1 -0
- package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +0 -70
- 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 -20
- package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +0 -97
- 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 -8
- 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,31 +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
|
-
import { SIGN_IN_V2_START, SIGN_UP_V2_START, RESET_PASSWORD_V2_START } from '../../telemetry/PublicApiId.mjs';
|
|
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
|
-
import { AuthenticationFactorV2
|
|
11
|
-
import { AuthenticationMethodTypeV2 } from '../../network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs';
|
|
10
|
+
import { AuthenticationFactorV2 } from '../../network_client/custom_auth_api/v2/result/BaseResultsV2.mjs';
|
|
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
|
+
import { InvalidArgumentError } from '../../error/InvalidArgumentError.mjs';
|
|
14
|
+
import { filterReservedSignUpAttributesV2 } from '../../utils/ArgumentValidator.mjs';
|
|
13
15
|
|
|
14
16
|
/*
|
|
15
17
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
18
|
* Licensed under the MIT License.
|
|
17
19
|
*/
|
|
18
|
-
/*
|
|
19
|
-
* Polls up to five times for password-update completion, waiting 1.5 seconds
|
|
20
|
-
* between attempts. The first request runs immediately.
|
|
21
|
-
*/
|
|
22
20
|
const POLL_MAX_ATTEMPTS = 5;
|
|
23
21
|
// TODO: Replace this fallback with the server-provided polling interval once available.
|
|
24
22
|
const POLL_INTERVAL_MS = 1500;
|
|
25
23
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
26
24
|
/*
|
|
27
|
-
* Drives server-directed Native Auth V2 flows
|
|
28
|
-
* and HAL links. Each operation returns only its valid discriminated results.
|
|
25
|
+
* Drives server-directed Native Auth V2 flows.
|
|
29
26
|
*/
|
|
30
27
|
class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
31
28
|
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, customAuthAuthority, apiClient) {
|
|
@@ -33,8 +30,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
33
30
|
this.apiClient = apiClient;
|
|
34
31
|
}
|
|
35
32
|
/*
|
|
36
|
-
* Starts sign-in
|
|
37
|
-
* multiple supported methods for user selection.
|
|
33
|
+
* Starts native auth V2 sign-in.
|
|
38
34
|
*/
|
|
39
35
|
async signIn(parameters) {
|
|
40
36
|
const correlationId = parameters.correlationId;
|
|
@@ -87,20 +83,14 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
87
83
|
method: selectedMethod,
|
|
88
84
|
};
|
|
89
85
|
}
|
|
90
|
-
if (parameters.password) {
|
|
91
|
-
return this.submitSignInPassword({
|
|
92
|
-
correlationId,
|
|
93
|
-
continuationState: challengeResult.continuationState,
|
|
94
|
-
password: parameters.password,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
86
|
return challengeResult;
|
|
98
87
|
}
|
|
99
88
|
/*
|
|
100
|
-
* Starts
|
|
89
|
+
* Starts native auth V2 sign-up.
|
|
101
90
|
*/
|
|
102
91
|
async signUp(parameters) {
|
|
103
92
|
const correlationId = parameters.correlationId;
|
|
93
|
+
const pendingProfileAttributes = filterReservedSignUpAttributesV2(parameters.attributes, this.logger, correlationId);
|
|
104
94
|
const context = this.createRequestContext(SIGN_UP_V2_START, correlationId);
|
|
105
95
|
this.logger.verbose("19e1ak", correlationId);
|
|
106
96
|
const scopes = this.getScopes(parameters.scopes);
|
|
@@ -110,37 +100,82 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
110
100
|
message: "The authorize-challenge entry response did not include a sign-up link.",
|
|
111
101
|
}), {
|
|
112
102
|
continuationToken: entryResult.continuationToken,
|
|
103
|
+
username: parameters.username,
|
|
113
104
|
}, context);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
+
});
|
|
119
132
|
}
|
|
120
|
-
const submitResult = await this.apiClient.submitSignUpAttributes(startResult.submitAttributesHref, {
|
|
121
|
-
continuationToken: startResult.continuationToken,
|
|
122
|
-
attributes,
|
|
123
|
-
}, context);
|
|
124
133
|
const continuationState = {
|
|
125
134
|
continuationToken: startResult.continuationToken,
|
|
126
135
|
scenario: CustomAuthFlowScenarioV2.SignUp,
|
|
127
136
|
scopes,
|
|
128
137
|
links: {},
|
|
129
138
|
signUp: {
|
|
130
|
-
|
|
139
|
+
purpose: "existingAccount",
|
|
131
140
|
},
|
|
132
141
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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);
|
|
157
|
+
}
|
|
158
|
+
if (supportedMethods.length > 1) {
|
|
159
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
160
|
+
correlationId,
|
|
161
|
+
continuationState,
|
|
162
|
+
methods: supportedMethods,
|
|
163
|
+
});
|
|
138
164
|
}
|
|
139
|
-
|
|
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);
|
|
140
176
|
}
|
|
141
177
|
/*
|
|
142
|
-
* Starts
|
|
143
|
-
* returning multiple methods for selection.
|
|
178
|
+
* Starts native auth V2 password reset.
|
|
144
179
|
*/
|
|
145
180
|
async resetPassword(parameters) {
|
|
146
181
|
const correlationId = parameters.correlationId;
|
|
@@ -173,44 +208,43 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
173
208
|
this.logger.error(message, correlationId);
|
|
174
209
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
175
210
|
}
|
|
176
|
-
if (methods.length
|
|
177
|
-
|
|
178
|
-
|
|
211
|
+
if (methods.length > 1) {
|
|
212
|
+
this.logger.verbose("0k8yah", correlationId);
|
|
213
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
179
214
|
correlationId,
|
|
180
|
-
continuationState
|
|
181
|
-
|
|
182
|
-
links: {
|
|
183
|
-
challenge: selectedMethod.challengeHref,
|
|
184
|
-
},
|
|
185
|
-
},
|
|
215
|
+
continuationState,
|
|
216
|
+
methods,
|
|
186
217
|
});
|
|
187
|
-
if (challengeResult.type === FLOW_CODE_REQUIRED_V2 &&
|
|
188
|
-
(challengeResult.channel?.toLowerCase() ===
|
|
189
|
-
AuthenticationMethodTypeV2.EMAIL ||
|
|
190
|
-
challengeResult.channel?.toLowerCase() ===
|
|
191
|
-
AuthenticationMethodTypeV2.SMS)) {
|
|
192
|
-
return {
|
|
193
|
-
...challengeResult,
|
|
194
|
-
method: selectedMethod,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
const channel = challengeResult.type === FLOW_CODE_REQUIRED_V2
|
|
198
|
-
? challengeResult.channel
|
|
199
|
-
: AuthenticationMethodTypeV2.PASSWORD;
|
|
200
|
-
const message = `Challenge type '${challengeResult.type}' with channel '${channel}' is not supported for password reset.`;
|
|
201
|
-
this.logger.error(message, correlationId);
|
|
202
|
-
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
203
218
|
}
|
|
204
|
-
|
|
205
|
-
|
|
219
|
+
const selectedMethod = methods[0];
|
|
220
|
+
const challengeResult = await this.requestChallenge({
|
|
206
221
|
correlationId,
|
|
207
|
-
continuationState
|
|
208
|
-
|
|
222
|
+
continuationState: {
|
|
223
|
+
...continuationState,
|
|
224
|
+
links: {
|
|
225
|
+
challenge: selectedMethod.challengeHref,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
209
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);
|
|
210
245
|
}
|
|
211
246
|
/*
|
|
212
|
-
* Requests a
|
|
213
|
-
* the continuation state and code metadata needed for verification.
|
|
247
|
+
* Requests a challenge for the selected authentication method.
|
|
214
248
|
*/
|
|
215
249
|
async requestChallenge(parameters) {
|
|
216
250
|
const challengeResult = await this.sendMethodChallenge(parameters, "requestChallenge");
|
|
@@ -240,13 +274,63 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
240
274
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, parameters.correlationId);
|
|
241
275
|
}
|
|
242
276
|
/*
|
|
243
|
-
*
|
|
244
|
-
|
|
277
|
+
* Registers the selected authentication method.
|
|
278
|
+
*/
|
|
279
|
+
async registerAuthMethod(parameters) {
|
|
280
|
+
const { continuationState, correlationId } = parameters;
|
|
281
|
+
if (!parameters.verificationContact?.trim()) {
|
|
282
|
+
throw new InvalidArgumentError("verificationContact", correlationId);
|
|
283
|
+
}
|
|
284
|
+
const registrationRequest = this.createRegistrationRequest(parameters.method, parameters.verificationContact, continuationState.continuationToken, correlationId);
|
|
285
|
+
const context = this.createRequestContext(JIT_V2_ENROLL_AUTH_METHOD, correlationId);
|
|
286
|
+
this.logger.verbose("0dfkz9", correlationId);
|
|
287
|
+
const result = await this.apiClient.enrollAuthMethod(this.requireLink(correlationId, parameters.method.enrollHref), registrationRequest, context);
|
|
288
|
+
return this.createAuthMethodVerificationRequiredResult(continuationState, result, correlationId);
|
|
289
|
+
}
|
|
290
|
+
/*
|
|
291
|
+
* Activates the registered authentication method.
|
|
292
|
+
*/
|
|
293
|
+
async verifyAuthMethodRegistration(parameters) {
|
|
294
|
+
const { continuationState, correlationId } = parameters;
|
|
295
|
+
const context = this.createRequestContext(JIT_V2_SUBMIT_CHALLENGE, correlationId);
|
|
296
|
+
this.logger.verbose("073pof", correlationId);
|
|
297
|
+
const result = await this.apiClient.activateAuthMethod(this.requireLink(correlationId, continuationState.links.activate), {
|
|
298
|
+
continuationToken: continuationState.continuationToken,
|
|
299
|
+
otp: parameters.code,
|
|
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
|
+
}
|
|
313
|
+
return this.completeSignInAfterVerification(continuationState, result.continuationToken, correlationId);
|
|
314
|
+
}
|
|
315
|
+
/*
|
|
316
|
+
* Requests a replacement authentication-method activation challenge.
|
|
317
|
+
*/
|
|
318
|
+
async resendAuthMethodRegistrationChallenge(parameters) {
|
|
319
|
+
const { continuationState, correlationId } = parameters;
|
|
320
|
+
const context = this.createRequestContext(JIT_V2_RESEND_CHALLENGE, correlationId);
|
|
321
|
+
this.logger.verbose("04qvjc", correlationId);
|
|
322
|
+
const result = await this.apiClient.resendAuthMethodRegistrationChallenge(this.requireLink(correlationId, continuationState.links.resend), {
|
|
323
|
+
continuationToken: continuationState.continuationToken,
|
|
324
|
+
}, context);
|
|
325
|
+
return this.createAuthMethodVerificationRequiredResult(continuationState, result, correlationId);
|
|
326
|
+
}
|
|
327
|
+
/*
|
|
328
|
+
* Verifies the submitted one-time code.
|
|
245
329
|
*/
|
|
246
330
|
async submitCode(parameters) {
|
|
247
331
|
const continuationState = parameters.continuationState;
|
|
248
332
|
const correlationId = parameters.correlationId;
|
|
249
|
-
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, "submitCode", correlationId), correlationId);
|
|
333
|
+
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, "submitCode", correlationId, parameters.authenticationFactor), correlationId);
|
|
250
334
|
this.logger.verbose("16ks6n", correlationId);
|
|
251
335
|
const verifyHref = this.requireLink(correlationId, continuationState.links.verify);
|
|
252
336
|
const verifyRequest = {
|
|
@@ -256,7 +340,23 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
256
340
|
const verifyResult = await this.apiClient.verifyChallenge(verifyHref, verifyRequest, context);
|
|
257
341
|
if (continuationState.scenario ===
|
|
258
342
|
CustomAuthFlowScenarioV2.PasswordReset &&
|
|
259
|
-
|
|
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 &&
|
|
359
|
+
verifyResult.nextAction === UPDATE_RELATION) {
|
|
260
360
|
return createFlowNewPasswordRequiredResultV2({
|
|
261
361
|
correlationId,
|
|
262
362
|
continuationState: {
|
|
@@ -271,56 +371,28 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
271
371
|
return this.handleSignInVerification(continuationState, verifyResult, correlationId);
|
|
272
372
|
}
|
|
273
373
|
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp &&
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
attribute.required === true);
|
|
277
|
-
const nextContinuationState = {
|
|
278
|
-
continuationToken: verifyResult.continuationToken,
|
|
279
|
-
scenario: continuationState.scenario,
|
|
280
|
-
scopes: continuationState.scopes,
|
|
281
|
-
links: {
|
|
282
|
-
submitAttributes: verifyResult.submitAttributesHref,
|
|
283
|
-
},
|
|
284
|
-
signUp: continuationState.signUp,
|
|
285
|
-
};
|
|
286
|
-
const attributes = verifyResult.attributes.filter((attribute) => attribute.attributeId.toLowerCase() !== "password");
|
|
287
|
-
if (requiredPasswordAttribute &&
|
|
288
|
-
continuationState.signUp?.passwordWasSupplied !== true) {
|
|
289
|
-
return createFlowSignUpPasswordRequiredResultV2({
|
|
290
|
-
correlationId,
|
|
291
|
-
continuationState: nextContinuationState,
|
|
292
|
-
attributes,
|
|
293
|
-
requiredPasswordAttribute,
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
return createFlowAttributesRequiredResultV2({
|
|
297
|
-
correlationId,
|
|
298
|
-
continuationState: nextContinuationState,
|
|
299
|
-
attributes,
|
|
300
|
-
});
|
|
374
|
+
continuationState.signUp?.purpose === "existingAccount") {
|
|
375
|
+
return this.handleSignInVerification(continuationState, verifyResult, correlationId);
|
|
301
376
|
}
|
|
302
|
-
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp
|
|
303
|
-
|
|
304
|
-
return createFlowSignInContinuationRequiredResultV2({
|
|
305
|
-
correlationId,
|
|
306
|
-
continuationState: {
|
|
307
|
-
continuationToken: verifyResult.continuationToken,
|
|
308
|
-
scenario: continuationState.scenario,
|
|
309
|
-
scopes: continuationState.scopes,
|
|
310
|
-
links: {},
|
|
311
|
-
},
|
|
312
|
-
});
|
|
377
|
+
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp) {
|
|
378
|
+
return this.handleSignUpVerification(continuationState, verifyResult, correlationId);
|
|
313
379
|
}
|
|
314
380
|
const message = `Verification next action '${verifyResult.nextAction}' is not supported for the '${continuationState.scenario}' flow.`;
|
|
315
381
|
this.logger.error(message, correlationId);
|
|
316
382
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
317
383
|
}
|
|
318
384
|
/*
|
|
319
|
-
* Requests a
|
|
320
|
-
* Returns refreshed continuation state and code metadata.
|
|
385
|
+
* Requests a replacement one-time code.
|
|
321
386
|
*/
|
|
322
387
|
async resendCode(parameters) {
|
|
323
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
|
+
}
|
|
324
396
|
return createFlowCodeRequiredResultV2({
|
|
325
397
|
correlationId: parameters.correlationId,
|
|
326
398
|
continuationState: this.createChallengeContinuationState(parameters.continuationState, challengeResult),
|
|
@@ -330,24 +402,31 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
330
402
|
});
|
|
331
403
|
}
|
|
332
404
|
async submitSignUpAttributes(parameters) {
|
|
333
|
-
const { continuationState, correlationId, attributes } = parameters;
|
|
405
|
+
const { continuationState, correlationId, attributes: submittedAttributes, } = parameters;
|
|
334
406
|
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, "submitAttributes", correlationId), correlationId);
|
|
335
407
|
this.logger.verbose("0js2ub", correlationId);
|
|
408
|
+
const submittedAttributeIds = Object.keys(submittedAttributes);
|
|
336
409
|
const submitResult = await this.apiClient.submitSignUpAttributes(this.requireLink(correlationId, continuationState.links.submitAttributes), {
|
|
337
410
|
continuationToken: continuationState.continuationToken,
|
|
338
|
-
attributes,
|
|
411
|
+
attributes: submittedAttributes,
|
|
339
412
|
}, context);
|
|
340
|
-
return this.
|
|
413
|
+
return this.toSignUpSubmitAttributesResult(submitResult, {
|
|
341
414
|
...continuationState,
|
|
342
415
|
signUp: {
|
|
343
|
-
|
|
344
|
-
|
|
416
|
+
purpose: "newAccount",
|
|
417
|
+
submittedAttributeIds: [
|
|
418
|
+
...new Set([
|
|
419
|
+
...(continuationState.signUp
|
|
420
|
+
?.submittedAttributeIds ?? []),
|
|
421
|
+
...submittedAttributeIds,
|
|
422
|
+
]),
|
|
423
|
+
],
|
|
345
424
|
},
|
|
346
425
|
}, correlationId);
|
|
347
426
|
}
|
|
348
427
|
/*
|
|
349
|
-
* Submits the new password and polls
|
|
350
|
-
*
|
|
428
|
+
* Submits the new password and polls for the next action: method registration,
|
|
429
|
+
* MFA, or a continuation for explicit sign-in.
|
|
351
430
|
*/
|
|
352
431
|
async submitNewPassword(parameters) {
|
|
353
432
|
const continuationState = parameters.continuationState;
|
|
@@ -360,45 +439,84 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
360
439
|
}, context);
|
|
361
440
|
let pollToken = updateResult.continuationToken;
|
|
362
441
|
let pollHref = updateResult.pollHref;
|
|
363
|
-
let
|
|
442
|
+
let pollResult;
|
|
443
|
+
let isPolling = false;
|
|
364
444
|
for (let attempt = 1; attempt <= POLL_MAX_ATTEMPTS; attempt++) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
445
|
+
pollResult = await this.apiClient.poll(pollHref, { continuationToken: pollToken }, context);
|
|
446
|
+
isPolling = pollResult.nextAction === POLL_RELATION;
|
|
447
|
+
if (pollResult.nextAction !== POLL_RELATION) {
|
|
368
448
|
break;
|
|
369
449
|
}
|
|
370
450
|
pollToken = pollResult.continuationToken;
|
|
371
|
-
pollHref = pollResult.pollHref
|
|
451
|
+
pollHref = this.requireLink(correlationId, pollResult.pollHref);
|
|
372
452
|
if (attempt < POLL_MAX_ATTEMPTS) {
|
|
373
453
|
await delay(POLL_INTERVAL_MS);
|
|
374
454
|
}
|
|
375
455
|
}
|
|
376
|
-
if (!
|
|
456
|
+
if (!pollResult || isPolling) {
|
|
377
457
|
const message = "The password reset did not complete within the allotted number of polling attempts.";
|
|
378
458
|
this.logger.error(message, correlationId);
|
|
379
459
|
throw new CustomAuthError(RESET_PASSWORD_TIMEOUT, message, correlationId);
|
|
380
460
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
461
|
+
if (pollResult.nextAction === ENROLL_RELATION && pollResult.methods) {
|
|
462
|
+
return this.createAuthMethodRegistrationRequiredResult({
|
|
463
|
+
correlationId,
|
|
464
|
+
continuationState: {
|
|
465
|
+
...continuationState,
|
|
466
|
+
continuationToken: pollResult.continuationToken,
|
|
467
|
+
links: {},
|
|
468
|
+
},
|
|
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
|
+
})),
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
if (pollResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
496
|
+
this.logger.verbose("0hrwdj", correlationId);
|
|
497
|
+
return createFlowSignInContinuationRequiredResultV2({
|
|
498
|
+
correlationId,
|
|
499
|
+
continuationState: {
|
|
500
|
+
continuationToken: pollResult.continuationToken,
|
|
501
|
+
scenario: continuationState.scenario,
|
|
502
|
+
scopes: continuationState.scopes,
|
|
503
|
+
links: {},
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
const message = `Password reset poll next action '${pollResult.nextAction}' is not supported.`;
|
|
508
|
+
this.logger.error(message, correlationId);
|
|
509
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
391
510
|
}
|
|
392
511
|
/*
|
|
393
|
-
* Verifies
|
|
512
|
+
* Verifies the sign-in password.
|
|
394
513
|
*/
|
|
395
514
|
async submitSignInPassword(parameters) {
|
|
396
515
|
const verifyResult = await this.verifySignInPassword(parameters);
|
|
397
516
|
return this.handleSignInVerification(parameters.continuationState, verifyResult, parameters.correlationId);
|
|
398
517
|
}
|
|
399
518
|
/*
|
|
400
|
-
*
|
|
401
|
-
* authentication result after validating and caching the response.
|
|
519
|
+
* Signs the user in from a completed flow.
|
|
402
520
|
*/
|
|
403
521
|
async signInWithContinuation(parameters) {
|
|
404
522
|
const continuationState = parameters.continuationState;
|
|
@@ -417,14 +535,24 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
417
535
|
});
|
|
418
536
|
}
|
|
419
537
|
async handleSignInVerification(continuationState, verifyResult, correlationId) {
|
|
420
|
-
if (verifyResult.nextAction ===
|
|
421
|
-
this.
|
|
538
|
+
if (verifyResult.nextAction === ENROLL_RELATION) {
|
|
539
|
+
return this.createAuthMethodRegistrationRequiredResult({
|
|
540
|
+
correlationId,
|
|
541
|
+
continuationState: {
|
|
542
|
+
...continuationState,
|
|
543
|
+
continuationToken: verifyResult.continuationToken,
|
|
544
|
+
links: {},
|
|
545
|
+
},
|
|
546
|
+
methods: verifyResult.methods,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
if (verifyResult.nextAction === CHALLENGE_RELATION) {
|
|
550
|
+
this.ensureAuthenticationFactor(verifyResult.authenticationFactor, AuthenticationFactorV2.MULTI_FACTOR, "after authentication verification", correlationId);
|
|
422
551
|
return createFlowMFARequiredResultV2({
|
|
423
552
|
correlationId,
|
|
424
553
|
continuationState: {
|
|
554
|
+
...continuationState,
|
|
425
555
|
continuationToken: verifyResult.continuationToken,
|
|
426
|
-
scenario: continuationState.scenario,
|
|
427
|
-
scopes: continuationState.scopes,
|
|
428
556
|
links: {},
|
|
429
557
|
},
|
|
430
558
|
methods: verifyResult.methods.map((method) => ({
|
|
@@ -435,10 +563,68 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
435
563
|
})),
|
|
436
564
|
});
|
|
437
565
|
}
|
|
438
|
-
if (verifyResult.nextAction ===
|
|
566
|
+
if (verifyResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
439
567
|
return this.completeSignInAfterVerification(continuationState, verifyResult.continuationToken, correlationId);
|
|
440
568
|
}
|
|
441
|
-
const message = `Verification next action '${verifyResult.nextAction}' is not supported for
|
|
569
|
+
const message = `Verification next action '${verifyResult.nextAction}' is not supported for authentication.`;
|
|
570
|
+
this.logger.error(message, correlationId);
|
|
571
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
572
|
+
}
|
|
573
|
+
async handleSignUpVerification(continuationState, verifyResult, correlationId) {
|
|
574
|
+
if (verifyResult.nextAction === COLLECT_ATTRIBUTES_RELATION) {
|
|
575
|
+
const requestedAttributes = verifyResult.attributes;
|
|
576
|
+
const requestedPasswordAttribute = requestedAttributes.find((attribute) => attribute.attributeId.toLowerCase() === "password");
|
|
577
|
+
const nextContinuationState = {
|
|
578
|
+
...continuationState,
|
|
579
|
+
continuationToken: verifyResult.continuationToken,
|
|
580
|
+
links: {
|
|
581
|
+
submitAttributes: verifyResult.submitAttributesHref,
|
|
582
|
+
},
|
|
583
|
+
};
|
|
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) {
|
|
594
|
+
return createFlowSignUpPasswordRequiredResultV2({
|
|
595
|
+
correlationId,
|
|
596
|
+
continuationState: nextContinuationState,
|
|
597
|
+
requestedPasswordAttribute,
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
return createFlowAttributesRequiredResultV2({
|
|
601
|
+
correlationId,
|
|
602
|
+
continuationState: nextContinuationState,
|
|
603
|
+
attributes: requestedAttributes,
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
if (verifyResult.nextAction === ENROLL_RELATION) {
|
|
607
|
+
return this.createAuthMethodRegistrationRequiredResult({
|
|
608
|
+
correlationId,
|
|
609
|
+
continuationState: {
|
|
610
|
+
...continuationState,
|
|
611
|
+
continuationToken: verifyResult.continuationToken,
|
|
612
|
+
links: {},
|
|
613
|
+
},
|
|
614
|
+
methods: verifyResult.methods,
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
if (verifyResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
618
|
+
return createFlowSignInContinuationRequiredResultV2({
|
|
619
|
+
correlationId,
|
|
620
|
+
continuationState: {
|
|
621
|
+
...continuationState,
|
|
622
|
+
continuationToken: verifyResult.continuationToken,
|
|
623
|
+
links: {},
|
|
624
|
+
},
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
const message = `Verification next action '${verifyResult.nextAction}' is not supported for the '${continuationState.scenario}' flow.`;
|
|
442
628
|
this.logger.error(message, correlationId);
|
|
443
629
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
444
630
|
}
|
|
@@ -456,62 +642,123 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
456
642
|
this.logger.error(message, correlationId);
|
|
457
643
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
458
644
|
}
|
|
459
|
-
|
|
645
|
+
createRegistrationRequest(method, verificationContact, continuationToken, correlationId) {
|
|
646
|
+
if (method.type === AuthenticationMethodTypeV2.EMAIL) {
|
|
647
|
+
return {
|
|
648
|
+
continuationToken,
|
|
649
|
+
email: verificationContact,
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
const [channel] = method.channels ?? [];
|
|
653
|
+
if (method.type === AuthenticationMethodTypeV2.PHONE &&
|
|
654
|
+
channel === PhoneRegistrationChannelV2.SMS) {
|
|
655
|
+
return {
|
|
656
|
+
continuationToken,
|
|
657
|
+
phoneNumber: verificationContact,
|
|
658
|
+
channel,
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, "The selected authentication method is not supported for registration.", correlationId);
|
|
662
|
+
}
|
|
663
|
+
createAuthMethodRegistrationRequiredResult(parameters) {
|
|
664
|
+
const { correlationId, continuationState } = parameters;
|
|
665
|
+
const supportedMethods = parameters.methods.filter((method) => {
|
|
666
|
+
const methodType = method.type.trim().toLowerCase();
|
|
667
|
+
return (methodType === AuthenticationMethodTypeV2.EMAIL ||
|
|
668
|
+
(methodType === AuthenticationMethodTypeV2.PHONE &&
|
|
669
|
+
method.channels?.includes(PhoneRegistrationChannelV2.SMS)));
|
|
670
|
+
});
|
|
671
|
+
if (supportedMethods.length === 0) {
|
|
672
|
+
const message = "The enrollment response did not include a supported registration method.";
|
|
673
|
+
this.logger.error(message, correlationId);
|
|
674
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
675
|
+
}
|
|
676
|
+
const methods = supportedMethods.map((method) => {
|
|
677
|
+
const methodType = method.type.trim().toLowerCase();
|
|
678
|
+
const channel = method.channels?.find((candidate) => candidate === PhoneRegistrationChannelV2.SMS);
|
|
679
|
+
if (methodType === AuthenticationMethodTypeV2.EMAIL) {
|
|
680
|
+
return {
|
|
681
|
+
type: AuthenticationMethodTypeV2.EMAIL,
|
|
682
|
+
enrollHref: this.requireLink(correlationId, method.enrollHref),
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
if (methodType === AuthenticationMethodTypeV2.PHONE &&
|
|
686
|
+
channel === PhoneRegistrationChannelV2.SMS) {
|
|
687
|
+
return {
|
|
688
|
+
type: AuthenticationMethodTypeV2.PHONE,
|
|
689
|
+
channels: [channel],
|
|
690
|
+
enrollHref: this.requireLink(correlationId, method.enrollHref),
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
const message = "The enrollment response included an unsupported registration method.";
|
|
694
|
+
this.logger.error(message, correlationId);
|
|
695
|
+
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
696
|
+
});
|
|
697
|
+
return createFlowAuthMethodRegistrationRequiredResultV2({
|
|
698
|
+
correlationId,
|
|
699
|
+
continuationState,
|
|
700
|
+
methods,
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
createAuthMethodVerificationRequiredResult(continuationState, result, correlationId) {
|
|
704
|
+
return createFlowAuthMethodVerificationRequiredResultV2({
|
|
705
|
+
correlationId,
|
|
706
|
+
continuationState: {
|
|
707
|
+
...continuationState,
|
|
708
|
+
continuationToken: result.continuationToken,
|
|
709
|
+
links: {
|
|
710
|
+
activate: this.requireLink(correlationId, result.activateHref),
|
|
711
|
+
resend: result.resendHref,
|
|
712
|
+
},
|
|
713
|
+
},
|
|
714
|
+
sentTo: result.hint,
|
|
715
|
+
codeLength: result.codeLength,
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
toSignUpSubmitAttributesResult(result, continuationState, correlationId) {
|
|
460
719
|
const nextAction = result.nextAction;
|
|
461
|
-
if (result.nextAction === SignUpSubmitAttributesNextActionV2.
|
|
462
|
-
return
|
|
720
|
+
if (result.nextAction === SignUpSubmitAttributesNextActionV2.ENROLL) {
|
|
721
|
+
return this.createAuthMethodRegistrationRequiredResult({
|
|
463
722
|
correlationId,
|
|
464
723
|
continuationState: {
|
|
724
|
+
...continuationState,
|
|
465
725
|
continuationToken: result.continuationToken,
|
|
466
|
-
|
|
467
|
-
scopes: continuationState.scopes,
|
|
468
|
-
links: {
|
|
469
|
-
verify: result.verifyHref,
|
|
470
|
-
resend: result.resendHref,
|
|
471
|
-
},
|
|
472
|
-
signUp: continuationState.signUp,
|
|
726
|
+
links: {},
|
|
473
727
|
},
|
|
474
|
-
|
|
475
|
-
sentTo: result.hint,
|
|
476
|
-
codeLength: result.codeLength,
|
|
728
|
+
methods: result.methods,
|
|
477
729
|
});
|
|
478
730
|
}
|
|
479
731
|
if (result.nextAction ===
|
|
480
732
|
SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES) {
|
|
481
|
-
const
|
|
482
|
-
|
|
733
|
+
const requestedAttributes = result.attributes;
|
|
734
|
+
this.ensureValidSignUpAttributeCollectionAfterSubmission(requestedAttributes, continuationState, correlationId);
|
|
483
735
|
const nextContinuationState = {
|
|
736
|
+
...continuationState,
|
|
484
737
|
continuationToken: result.continuationToken,
|
|
485
|
-
scenario: continuationState.scenario,
|
|
486
|
-
scopes: continuationState.scopes,
|
|
487
738
|
links: {
|
|
488
739
|
submitAttributes: result.submitAttributesHref,
|
|
489
740
|
},
|
|
490
|
-
signUp: continuationState.signUp,
|
|
491
741
|
};
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
continuationState.signUp?.passwordWasSupplied !== true) {
|
|
742
|
+
const requestedPasswordAttribute = requestedAttributes.find((attribute) => attribute.attributeId.toLowerCase() === "password");
|
|
743
|
+
if (requestedPasswordAttribute) {
|
|
495
744
|
return createFlowSignUpPasswordRequiredResultV2({
|
|
496
745
|
correlationId,
|
|
497
746
|
continuationState: nextContinuationState,
|
|
498
|
-
|
|
499
|
-
requiredPasswordAttribute,
|
|
747
|
+
requestedPasswordAttribute,
|
|
500
748
|
});
|
|
501
749
|
}
|
|
502
750
|
return createFlowAttributesRequiredResultV2({
|
|
503
751
|
correlationId,
|
|
504
752
|
continuationState: nextContinuationState,
|
|
505
|
-
attributes,
|
|
753
|
+
attributes: requestedAttributes,
|
|
506
754
|
});
|
|
507
755
|
}
|
|
508
756
|
if (result.nextAction === SignUpSubmitAttributesNextActionV2.CONTINUE) {
|
|
509
757
|
return createFlowSignInContinuationRequiredResultV2({
|
|
510
758
|
correlationId,
|
|
511
759
|
continuationState: {
|
|
760
|
+
...continuationState,
|
|
512
761
|
continuationToken: result.continuationToken,
|
|
513
|
-
scenario: continuationState.scenario,
|
|
514
|
-
scopes: continuationState.scopes,
|
|
515
762
|
links: {},
|
|
516
763
|
},
|
|
517
764
|
});
|
|
@@ -520,6 +767,20 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
520
767
|
this.logger.error(message, correlationId);
|
|
521
768
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
522
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
|
+
}
|
|
523
784
|
ensureAuthenticationFactor(authenticationFactor, expectedFactor, transition, correlationId) {
|
|
524
785
|
if (authenticationFactor === expectedFactor) {
|
|
525
786
|
return;
|
|
@@ -528,10 +789,33 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
528
789
|
this.logger.error(message, correlationId);
|
|
529
790
|
throw new CustomAuthError(UNSUPPORTED_FLOW_TRANSITION, message, correlationId);
|
|
530
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
|
+
}
|
|
531
815
|
async verifySignInPassword(parameters) {
|
|
532
816
|
const { continuationState, correlationId } = parameters;
|
|
533
817
|
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, "submitPassword", correlationId), correlationId);
|
|
534
|
-
this.logger.verbose("
|
|
818
|
+
this.logger.verbose("13uf3o", correlationId);
|
|
535
819
|
return this.apiClient.verifyChallenge(this.requireLink(correlationId, continuationState.links.verify), {
|
|
536
820
|
continuationToken: continuationState.continuationToken,
|
|
537
821
|
password: parameters.password,
|
|
@@ -541,9 +825,8 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
541
825
|
return this.signInWithContinuation({
|
|
542
826
|
correlationId,
|
|
543
827
|
continuationState: {
|
|
828
|
+
...continuationState,
|
|
544
829
|
continuationToken,
|
|
545
|
-
scenario: continuationState.scenario,
|
|
546
|
-
scopes: continuationState.scopes,
|
|
547
830
|
links: {},
|
|
548
831
|
},
|
|
549
832
|
});
|
|
@@ -554,16 +837,16 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
554
837
|
const challengeHref = step === "resendCode"
|
|
555
838
|
? continuationState.links.resend
|
|
556
839
|
: continuationState.links.challenge;
|
|
557
|
-
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, step, correlationId), correlationId);
|
|
840
|
+
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, step, correlationId, parameters.authenticationFactor), correlationId);
|
|
558
841
|
this.logger.verbose(step === "0d2mys"
|
|
559
842
|
? "Resending V2 one-time code."
|
|
560
843
|
: "Requesting V2 challenge.", correlationId);
|
|
561
844
|
const challengeResult = await this.apiClient.requestChallenge(this.requireLink(correlationId, challengeHref), { continuationToken: continuationState.continuationToken }, context);
|
|
562
845
|
const nextAction = challengeResult.nextAction;
|
|
563
|
-
if (challengeResult.nextAction ===
|
|
846
|
+
if (challengeResult.nextAction === VERIFY_RELATION) {
|
|
564
847
|
return challengeResult;
|
|
565
848
|
}
|
|
566
|
-
if (challengeResult.nextAction ===
|
|
849
|
+
if (challengeResult.nextAction === RISK_VERIFY_RELATION) {
|
|
567
850
|
return this.apiClient.verifyRisk(challengeResult.riskVerifyHref, { continuationToken: challengeResult.continuationToken }, context);
|
|
568
851
|
}
|
|
569
852
|
const message = `Challenge next action '${nextAction}' is not supported.`;
|
|
@@ -572,22 +855,18 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
572
855
|
}
|
|
573
856
|
createChallengeContinuationState(continuationState, challengeResult) {
|
|
574
857
|
return {
|
|
858
|
+
...continuationState,
|
|
575
859
|
continuationToken: challengeResult.continuationToken,
|
|
576
|
-
scenario: continuationState.scenario,
|
|
577
|
-
scopes: continuationState.scopes,
|
|
578
860
|
links: {
|
|
579
861
|
challenge: continuationState.links.challenge,
|
|
580
862
|
verify: challengeResult.verifyHref,
|
|
581
863
|
resend: challengeResult.resendHref ??
|
|
582
864
|
continuationState.links.resend,
|
|
583
865
|
},
|
|
584
|
-
...(continuationState.signUp && {
|
|
585
|
-
signUp: continuationState.signUp,
|
|
586
|
-
}),
|
|
587
866
|
};
|
|
588
867
|
}
|
|
589
|
-
resolveStepApiId(scenario, step, correlationId) {
|
|
590
|
-
const apiId = getPublicApiIdV2(scenario, step);
|
|
868
|
+
resolveStepApiId(scenario, step, correlationId, authenticationFactor) {
|
|
869
|
+
const apiId = getPublicApiIdV2(scenario, step, authenticationFactor);
|
|
591
870
|
if (apiId === undefined) {
|
|
592
871
|
const message = `No telemetry API id is registered for step '${step}' of the '${scenario}' flow.`;
|
|
593
872
|
this.logger.error(message, correlationId);
|
|
@@ -596,7 +875,7 @@ class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
596
875
|
return apiId;
|
|
597
876
|
}
|
|
598
877
|
requireLink(correlationId, href, missingLinkError) {
|
|
599
|
-
if (!href) {
|
|
878
|
+
if (typeof href !== "string" || !href.trim()) {
|
|
600
879
|
const errorCode = missingLinkError?.code ?? CONTINUATION_LINK_MISSING;
|
|
601
880
|
const message = missingLinkError?.message ??
|
|
602
881
|
"The continuation state is missing a link required to advance the flow.";
|