@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { AuthFlowActionRequiredStateBase } from "../../AuthFlowState.js";
|
|
7
|
+
import type { AuthenticationMethodRegistrationV2 } from "../AuthenticationMethodRegistrationV2.js";
|
|
8
|
+
import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
|
|
9
|
+
import type { AuthMethodRegistrationChallengeResultV2 } from "../result/AuthMethodRegistrationChallengeResultV2.js";
|
|
10
|
+
import type { AuthMethodRegistrationRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
|
|
11
|
+
import { AuthMethodVerificationRequiredStateV2 } from "./AuthMethodVerificationRequiredStateV2.js";
|
|
12
|
+
import { InvalidArgumentError } from "../../../error/InvalidArgumentError.js";
|
|
13
|
+
import { ensureArgumentIsNotEmptyString } from "../../../utils/ArgumentValidator.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* State returned when an authentication method must be registered.
|
|
17
|
+
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
18
|
+
*/
|
|
19
|
+
export class AuthMethodRegistrationRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodRegistrationRequiredStateParametersV2> {
|
|
20
|
+
readonly stateType = "authMethodRegistrationRequired";
|
|
21
|
+
readonly methods: readonly AuthenticationMethodRegistrationV2[];
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
stateParameters: AuthMethodRegistrationRequiredStateParametersV2
|
|
25
|
+
) {
|
|
26
|
+
super(stateParameters);
|
|
27
|
+
this.methods = stateParameters.methods;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Selects an authentication method for strong-auth registration and requests
|
|
32
|
+
* its activation challenge.
|
|
33
|
+
* @param method - A method from {@link methods}.
|
|
34
|
+
* @param verificationContact - The email address or phone number to register.
|
|
35
|
+
* @returns The registration activation result.
|
|
36
|
+
*/
|
|
37
|
+
async selectAuthMethod(
|
|
38
|
+
method: AuthenticationMethodRegistrationV2,
|
|
39
|
+
verificationContact: string
|
|
40
|
+
): Promise<AuthMethodRegistrationChallengeResultV2> {
|
|
41
|
+
const { correlationId, continuationState, flowClient, logger } =
|
|
42
|
+
this.stateParameters;
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const selectedMethod = this.methods.find(
|
|
46
|
+
(candidate) => candidate.type === method.type
|
|
47
|
+
);
|
|
48
|
+
if (!selectedMethod) {
|
|
49
|
+
throw new InvalidArgumentError("method", correlationId);
|
|
50
|
+
}
|
|
51
|
+
ensureArgumentIsNotEmptyString(
|
|
52
|
+
"verificationContact",
|
|
53
|
+
verificationContact,
|
|
54
|
+
correlationId
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
logger.verbose(
|
|
58
|
+
"Registering the selected V2 authentication method.",
|
|
59
|
+
correlationId
|
|
60
|
+
);
|
|
61
|
+
const result = await flowClient.registerAuthMethod({
|
|
62
|
+
correlationId,
|
|
63
|
+
continuationState,
|
|
64
|
+
method: selectedMethod,
|
|
65
|
+
verificationContact,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return new CustomAuthResultV2(
|
|
69
|
+
new AuthMethodVerificationRequiredStateV2({
|
|
70
|
+
correlationId: result.correlationId,
|
|
71
|
+
logger,
|
|
72
|
+
config: this.stateParameters.config,
|
|
73
|
+
flowClient,
|
|
74
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
75
|
+
continuationState: result.continuationState,
|
|
76
|
+
type: selectedMethod.type,
|
|
77
|
+
sentTo: result.sentTo,
|
|
78
|
+
codeLength: result.codeLength,
|
|
79
|
+
}),
|
|
80
|
+
undefined,
|
|
81
|
+
result.continuationState.scenario
|
|
82
|
+
);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
logger.errorPii(
|
|
85
|
+
`Failed to register the selected V2 authentication method. Error: '${error}'.`,
|
|
86
|
+
correlationId
|
|
87
|
+
);
|
|
88
|
+
return CustomAuthResultV2.createWithError(error, {
|
|
89
|
+
scenario: continuationState.scenario,
|
|
90
|
+
correlationId,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -22,12 +22,12 @@ import { InvalidArgumentError } from "../../../error/InvalidArgumentError.js";
|
|
|
22
22
|
import { UNSUPPORTED_FLOW_TRANSITION } from "../../../network_client/custom_auth_api/v2/ErrorCodesV2.js";
|
|
23
23
|
import { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
|
|
24
24
|
import { CustomAuthFlowScenarioV2 } from "../CustomAuthFlowScenarioV2.js";
|
|
25
|
+
import { ExistingAccountCodeRequiredStateV2 } from "../../../../sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.js";
|
|
26
|
+
import { ExistingAccountPasswordRequiredStateV2 } from "../../../../sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.js";
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
|
-
* State returned when the user must select
|
|
28
|
-
*
|
|
29
|
-
* methods and lets the app request a challenge for the chosen one. The flow
|
|
30
|
-
* stays on this state until a challenge is successfully requested.
|
|
29
|
+
* State returned when the user must select an authentication method.
|
|
30
|
+
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
31
31
|
*/
|
|
32
32
|
export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodSelectionRequiredStateParametersV2> {
|
|
33
33
|
readonly stateType = "authMethodSelectionRequired";
|
|
@@ -39,8 +39,7 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Selects an authentication method and requests its challenge.
|
|
43
|
-
* state identifies the credential the application must collect.
|
|
42
|
+
* Selects an authentication method and requests its challenge.
|
|
44
43
|
* @param method - The method to select, from {@link methods}.
|
|
45
44
|
* @returns The result of selecting the method and requesting its challenge.
|
|
46
45
|
*/
|
|
@@ -54,6 +53,7 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
54
53
|
continuationState,
|
|
55
54
|
flowClient,
|
|
56
55
|
signInStateTransitionHandler,
|
|
56
|
+
resetPasswordStateTransitionHandler,
|
|
57
57
|
} = this.stateParameters;
|
|
58
58
|
|
|
59
59
|
try {
|
|
@@ -72,20 +72,47 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
72
72
|
flowClient,
|
|
73
73
|
continuationState: result.continuationState,
|
|
74
74
|
cacheClient: this.stateParameters.cacheClient,
|
|
75
|
+
signInStateTransitionHandler,
|
|
75
76
|
};
|
|
77
|
+
const isExistingAccountSignUp =
|
|
78
|
+
continuationState.scenario ===
|
|
79
|
+
CustomAuthFlowScenarioV2.SignUp &&
|
|
80
|
+
continuationState.signUp?.purpose === "existingAccount";
|
|
81
|
+
|
|
82
|
+
const channel =
|
|
83
|
+
result.type === FLOW_CODE_REQUIRED_V2
|
|
84
|
+
? result.channel?.toLowerCase()
|
|
85
|
+
: undefined;
|
|
86
|
+
if (
|
|
87
|
+
isExistingAccountSignUp &&
|
|
88
|
+
authenticationFactor === AuthenticationFactorV2.SINGLE_FACTOR &&
|
|
89
|
+
result.type === FLOW_CODE_REQUIRED_V2 &&
|
|
90
|
+
channel === AuthenticationMethodTypeV2.EMAIL
|
|
91
|
+
) {
|
|
92
|
+
return new CustomAuthResultV2(
|
|
93
|
+
new ExistingAccountCodeRequiredStateV2({
|
|
94
|
+
...commonStateParameters,
|
|
95
|
+
method: selectedMethod,
|
|
96
|
+
sentTo: result.sentTo,
|
|
97
|
+
channel: result.channel,
|
|
98
|
+
codeLength: result.codeLength,
|
|
99
|
+
}),
|
|
100
|
+
undefined,
|
|
101
|
+
result.continuationState.scenario
|
|
102
|
+
);
|
|
103
|
+
}
|
|
76
104
|
|
|
77
105
|
if (
|
|
106
|
+
!isExistingAccountSignUp &&
|
|
78
107
|
authenticationFactor === AuthenticationFactorV2.SINGLE_FACTOR &&
|
|
79
108
|
result.type === FLOW_CODE_REQUIRED_V2 &&
|
|
80
|
-
(
|
|
81
|
-
AuthenticationMethodTypeV2.
|
|
82
|
-
result.channel?.toLowerCase() ===
|
|
83
|
-
AuthenticationMethodTypeV2.SMS)
|
|
109
|
+
(channel === AuthenticationMethodTypeV2.EMAIL ||
|
|
110
|
+
channel === AuthenticationMethodTypeV2.SMS)
|
|
84
111
|
) {
|
|
85
112
|
return new CustomAuthResultV2(
|
|
86
113
|
new CodeRequiredStateV2({
|
|
87
114
|
...commonStateParameters,
|
|
88
|
-
|
|
115
|
+
resetPasswordStateTransitionHandler,
|
|
89
116
|
method: selectedMethod,
|
|
90
117
|
sentTo: result.sentTo,
|
|
91
118
|
channel: result.channel,
|
|
@@ -96,6 +123,20 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
96
123
|
);
|
|
97
124
|
}
|
|
98
125
|
|
|
126
|
+
if (
|
|
127
|
+
isExistingAccountSignUp &&
|
|
128
|
+
authenticationFactor === AuthenticationFactorV2.SINGLE_FACTOR &&
|
|
129
|
+
result.type === FLOW_PASSWORD_REQUIRED_V2
|
|
130
|
+
) {
|
|
131
|
+
return new CustomAuthResultV2(
|
|
132
|
+
new ExistingAccountPasswordRequiredStateV2(
|
|
133
|
+
commonStateParameters
|
|
134
|
+
),
|
|
135
|
+
undefined,
|
|
136
|
+
result.continuationState.scenario
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
99
140
|
if (
|
|
100
141
|
continuationState.scenario ===
|
|
101
142
|
CustomAuthFlowScenarioV2.SignIn &&
|
|
@@ -133,13 +174,21 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
133
174
|
);
|
|
134
175
|
}
|
|
135
176
|
|
|
136
|
-
|
|
177
|
+
let expectedChallenge =
|
|
137
178
|
authenticationFactor === AuthenticationFactorV2.SINGLE_FACTOR
|
|
138
179
|
? continuationState.scenario ===
|
|
139
180
|
CustomAuthFlowScenarioV2.SignIn
|
|
140
181
|
? "an email or SMS code challenge or a password challenge for single-factor sign-in"
|
|
141
182
|
: "an email or SMS code challenge for single-factor authentication"
|
|
142
183
|
: "a code challenge for multi-factor authentication";
|
|
184
|
+
if (
|
|
185
|
+
isExistingAccountSignUp &&
|
|
186
|
+
authenticationFactor === AuthenticationFactorV2.SINGLE_FACTOR
|
|
187
|
+
) {
|
|
188
|
+
expectedChallenge =
|
|
189
|
+
"an email code challenge or a password challenge for existing-account sign-up";
|
|
190
|
+
}
|
|
191
|
+
|
|
143
192
|
const returnedChallenge =
|
|
144
193
|
result.type === FLOW_CODE_REQUIRED_V2
|
|
145
194
|
? result.channel
|
|
@@ -171,8 +220,12 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
171
220
|
result: FlowCodeRequiredResultV2 | FlowPasswordRequiredResultV2;
|
|
172
221
|
selectedMethod: AuthenticationMethodV2;
|
|
173
222
|
}> {
|
|
174
|
-
const {
|
|
175
|
-
|
|
223
|
+
const {
|
|
224
|
+
correlationId,
|
|
225
|
+
continuationState,
|
|
226
|
+
flowClient,
|
|
227
|
+
authenticationFactor,
|
|
228
|
+
} = this.stateParameters;
|
|
176
229
|
const selectedMethod = this.methods.find(
|
|
177
230
|
(candidate) => candidate.id === method.id
|
|
178
231
|
);
|
|
@@ -183,6 +236,7 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
183
236
|
|
|
184
237
|
const result = await flowClient.requestChallenge({
|
|
185
238
|
correlationId,
|
|
239
|
+
authenticationFactor,
|
|
186
240
|
continuationState: {
|
|
187
241
|
...continuationState,
|
|
188
242
|
links: {
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { AuthFlowActionRequiredStateBase } from "../../AuthFlowState.js";
|
|
7
|
+
import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
|
|
8
|
+
import type { AuthMethodRegistrationChallengeResultV2 } from "../result/AuthMethodRegistrationChallengeResultV2.js";
|
|
9
|
+
import type { AuthMethodVerificationSubmitChallengeResultV2 } from "../result/AuthMethodVerificationSubmitChallengeResultV2.js";
|
|
10
|
+
import type { AuthMethodVerificationRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
|
|
11
|
+
import { CompletedStateV2 } from "./CompletedStateV2.js";
|
|
12
|
+
import { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
|
|
13
|
+
import { ensureArgumentIsNotNullOrUndefined } from "../../../utils/ArgumentValidator.js";
|
|
14
|
+
import { FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2 } from "../../../interaction_client/v2/result/FlowActionResultV2.js";
|
|
15
|
+
import { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* State returned when a newly registered authentication method must be
|
|
19
|
+
* activated with the challenge sent by the service.
|
|
20
|
+
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
21
|
+
*/
|
|
22
|
+
export class AuthMethodVerificationRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodVerificationRequiredStateParametersV2> {
|
|
23
|
+
readonly stateType = "authMethodVerificationRequired";
|
|
24
|
+
readonly type: string;
|
|
25
|
+
readonly sentTo?: string;
|
|
26
|
+
readonly codeLength: number;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
stateParameters: AuthMethodVerificationRequiredStateParametersV2
|
|
30
|
+
) {
|
|
31
|
+
super(stateParameters);
|
|
32
|
+
this.type = stateParameters.type;
|
|
33
|
+
this.sentTo = stateParameters.sentTo;
|
|
34
|
+
this.codeLength = stateParameters.codeLength;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Submits the activation challenge for the registered method.
|
|
39
|
+
* @param challenge - The activation challenge to submit.
|
|
40
|
+
* @returns A sign-in continuation, completed authentication result, or failed state.
|
|
41
|
+
*/
|
|
42
|
+
async submitChallenge(
|
|
43
|
+
challenge: string
|
|
44
|
+
): Promise<AuthMethodVerificationSubmitChallengeResultV2> {
|
|
45
|
+
const { correlationId, continuationState, flowClient, logger } =
|
|
46
|
+
this.stateParameters;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
ensureArgumentIsNotNullOrUndefined(
|
|
50
|
+
"challenge",
|
|
51
|
+
challenge,
|
|
52
|
+
correlationId
|
|
53
|
+
);
|
|
54
|
+
logger.verbose(
|
|
55
|
+
"Submitting a V2 authentication-method activation challenge.",
|
|
56
|
+
correlationId
|
|
57
|
+
);
|
|
58
|
+
const result = await flowClient.verifyAuthMethodRegistration({
|
|
59
|
+
correlationId,
|
|
60
|
+
continuationState,
|
|
61
|
+
code: challenge,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (result.type === FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2) {
|
|
65
|
+
return new CustomAuthResultV2(
|
|
66
|
+
new SignInContinuationStateV2({
|
|
67
|
+
correlationId: result.correlationId,
|
|
68
|
+
logger,
|
|
69
|
+
config: this.stateParameters.config,
|
|
70
|
+
flowClient,
|
|
71
|
+
continuationState: result.continuationState,
|
|
72
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
73
|
+
}),
|
|
74
|
+
undefined,
|
|
75
|
+
result.continuationState.scenario
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const account = new CustomAuthAccountData(
|
|
80
|
+
result.authenticationResult.account,
|
|
81
|
+
this.stateParameters.config,
|
|
82
|
+
this.stateParameters.cacheClient,
|
|
83
|
+
logger,
|
|
84
|
+
correlationId
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
return new CustomAuthResultV2(
|
|
88
|
+
new CompletedStateV2(),
|
|
89
|
+
account,
|
|
90
|
+
continuationState.scenario
|
|
91
|
+
);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
logger.errorPii(
|
|
94
|
+
`Failed to submit the V2 authentication-method activation challenge. Error: '${error}'.`,
|
|
95
|
+
correlationId
|
|
96
|
+
);
|
|
97
|
+
return CustomAuthResultV2.createWithError(error, {
|
|
98
|
+
scenario: continuationState.scenario,
|
|
99
|
+
correlationId,
|
|
100
|
+
errorContext: "authMethodRegistration",
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Requests a replacement activation challenge for the registered method.
|
|
107
|
+
* @returns Refreshed activation metadata or a failed state.
|
|
108
|
+
*/
|
|
109
|
+
async resendChallenge(): Promise<AuthMethodRegistrationChallengeResultV2> {
|
|
110
|
+
const { correlationId, continuationState, flowClient, logger } =
|
|
111
|
+
this.stateParameters;
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
logger.verbose(
|
|
115
|
+
"Resending a V2 authentication-method activation challenge.",
|
|
116
|
+
correlationId
|
|
117
|
+
);
|
|
118
|
+
const result =
|
|
119
|
+
await flowClient.resendAuthMethodRegistrationChallenge({
|
|
120
|
+
correlationId,
|
|
121
|
+
continuationState,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
return new CustomAuthResultV2(
|
|
125
|
+
new AuthMethodVerificationRequiredStateV2({
|
|
126
|
+
correlationId: result.correlationId,
|
|
127
|
+
logger,
|
|
128
|
+
config: this.stateParameters.config,
|
|
129
|
+
flowClient,
|
|
130
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
131
|
+
continuationState: result.continuationState,
|
|
132
|
+
type: this.type,
|
|
133
|
+
sentTo: result.sentTo ?? this.sentTo,
|
|
134
|
+
codeLength: result.codeLength,
|
|
135
|
+
}),
|
|
136
|
+
undefined,
|
|
137
|
+
result.continuationState.scenario
|
|
138
|
+
);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
logger.errorPii(
|
|
141
|
+
`Failed to resend the V2 authentication-method activation challenge. Error: '${error}'.`,
|
|
142
|
+
correlationId
|
|
143
|
+
);
|
|
144
|
+
return CustomAuthResultV2.createWithError(error, {
|
|
145
|
+
scenario: continuationState.scenario,
|
|
146
|
+
correlationId,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
FlowSubmitCodeResultV2,
|
|
12
12
|
} from "../../../interaction_client/v2/result/FlowActionResultV2.js";
|
|
13
13
|
import { ensureArgumentIsNotNullOrUndefined } from "../../../utils/ArgumentValidator.js";
|
|
14
|
+
import type { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
|
|
14
15
|
|
|
15
16
|
export abstract class ChallengeVerificationStateBaseV2<
|
|
16
17
|
TParameters extends CodeVerificationStateParametersV2 = CodeVerificationStateParametersV2
|
|
@@ -32,7 +33,8 @@ export abstract class ChallengeVerificationStateBaseV2<
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
protected async submitCodeCore(
|
|
35
|
-
code: string
|
|
36
|
+
code: string,
|
|
37
|
+
authenticationFactor?: AuthenticationFactorV2
|
|
36
38
|
): Promise<FlowSubmitCodeResultV2> {
|
|
37
39
|
ensureArgumentIsNotNullOrUndefined(
|
|
38
40
|
"code",
|
|
@@ -43,14 +45,18 @@ export abstract class ChallengeVerificationStateBaseV2<
|
|
|
43
45
|
return this.stateParameters.flowClient.submitCode({
|
|
44
46
|
correlationId: this.stateParameters.correlationId,
|
|
45
47
|
continuationState: this.stateParameters.continuationState,
|
|
48
|
+
authenticationFactor,
|
|
46
49
|
code,
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
protected async resendCodeCore(
|
|
53
|
+
protected async resendCodeCore(
|
|
54
|
+
authenticationFactor?: AuthenticationFactorV2
|
|
55
|
+
): Promise<FlowCodeRequiredResultV2> {
|
|
51
56
|
return this.stateParameters.flowClient.resendCode({
|
|
52
57
|
correlationId: this.stateParameters.correlationId,
|
|
53
58
|
continuationState: this.stateParameters.continuationState,
|
|
59
|
+
authenticationFactor,
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
|
|
7
|
-
import { NewPasswordRequiredStateV2 } from "../../../../reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.js";
|
|
8
7
|
import type { CodeRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
|
|
9
8
|
import type { VerifyChallengeResultV2 } from "../result/VerifyChallengeResultV2.js";
|
|
10
|
-
import type {
|
|
9
|
+
import type { RequestChallengeResultV2 } from "../result/RequestChallengeResultV2.js";
|
|
11
10
|
import { CompletedStateV2 } from "./CompletedStateV2.js";
|
|
12
11
|
import { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
|
|
13
12
|
import {
|
|
14
13
|
FLOW_ATTRIBUTES_REQUIRED_V2,
|
|
14
|
+
FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
|
|
15
15
|
FLOW_COMPLETED_V2,
|
|
16
16
|
FLOW_MFA_REQUIRED_V2,
|
|
17
17
|
FLOW_NEW_PASSWORD_REQUIRED_V2,
|
|
@@ -22,17 +22,17 @@ import { CustomAuthError } from "../../../error/CustomAuthError.js";
|
|
|
22
22
|
import { UNSUPPORTED_FLOW_TRANSITION } from "../../../network_client/custom_auth_api/v2/ErrorCodesV2.js";
|
|
23
23
|
import { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
|
|
24
24
|
import { ChallengeVerificationStateBaseV2 } from "./ChallengeVerificationStateBaseV2.js";
|
|
25
|
+
import { AuthMethodRegistrationRequiredStateV2 } from "./AuthMethodRegistrationRequiredStateV2.js";
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
|
-
* State returned when first-factor
|
|
28
|
-
*
|
|
28
|
+
* State returned when first-factor authentication requires a one-time code.
|
|
29
|
+
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
29
30
|
*/
|
|
30
31
|
export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRequiredStateParametersV2> {
|
|
31
32
|
readonly stateType = "codeRequired";
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
|
-
* Submits the first-factor
|
|
35
|
-
* result may complete the operation or require another flow-specific step.
|
|
35
|
+
* Submits the first-factor code.
|
|
36
36
|
* @param code - The code to submit.
|
|
37
37
|
* @returns The result of submitting the first-factor code.
|
|
38
38
|
*/
|
|
@@ -46,17 +46,19 @@ export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRe
|
|
|
46
46
|
const resultType: string = result.type;
|
|
47
47
|
|
|
48
48
|
if (result.type === FLOW_NEW_PASSWORD_REQUIRED_V2) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
const resetPasswordStateTransitionHandler =
|
|
50
|
+
this.stateParameters.resetPasswordStateTransitionHandler;
|
|
51
|
+
if (!resetPasswordStateTransitionHandler) {
|
|
52
|
+
throw new CustomAuthError(
|
|
53
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
54
|
+
"Password-reset state transition handler is missing.",
|
|
55
|
+
correlationId
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return resetPasswordStateTransitionHandler.handleNewPasswordRequired(
|
|
60
|
+
result,
|
|
61
|
+
this.stateParameters
|
|
60
62
|
);
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -74,10 +76,14 @@ export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRe
|
|
|
74
76
|
);
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
return signUpStateTransitionHandler.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
return signUpStateTransitionHandler.handleAttributeSubmission(
|
|
80
|
+
result,
|
|
81
|
+
{
|
|
82
|
+
...this.stateParameters,
|
|
83
|
+
signUpStateTransitionHandler,
|
|
84
|
+
},
|
|
85
|
+
"attribute"
|
|
86
|
+
);
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
if (result.type === FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2) {
|
|
@@ -95,6 +101,22 @@ export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRe
|
|
|
95
101
|
);
|
|
96
102
|
}
|
|
97
103
|
|
|
104
|
+
if (result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2) {
|
|
105
|
+
return new CustomAuthResultV2(
|
|
106
|
+
new AuthMethodRegistrationRequiredStateV2({
|
|
107
|
+
correlationId: result.correlationId,
|
|
108
|
+
logger,
|
|
109
|
+
config: this.stateParameters.config,
|
|
110
|
+
flowClient: this.stateParameters.flowClient,
|
|
111
|
+
continuationState: result.continuationState,
|
|
112
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
113
|
+
methods: result.methods,
|
|
114
|
+
}),
|
|
115
|
+
undefined,
|
|
116
|
+
result.continuationState.scenario
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
98
120
|
if (result.type === FLOW_MFA_REQUIRED_V2) {
|
|
99
121
|
const signInStateTransitionHandler =
|
|
100
122
|
this.stateParameters.signInStateTransitionHandler;
|
|
@@ -147,11 +169,10 @@ export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRe
|
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
/**
|
|
150
|
-
* Requests a replacement first-factor
|
|
151
|
-
* contains the refreshed challenge metadata.
|
|
172
|
+
* Requests a replacement first-factor code.
|
|
152
173
|
* @returns The result of requesting a replacement code.
|
|
153
174
|
*/
|
|
154
|
-
async resendCode(): Promise<
|
|
175
|
+
async resendCode(): Promise<RequestChallengeResultV2> {
|
|
155
176
|
const { correlationId, logger, continuationState } =
|
|
156
177
|
this.stateParameters;
|
|
157
178
|
|
|
@@ -171,6 +192,9 @@ export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRe
|
|
|
171
192
|
this.stateParameters.signUpStateTransitionHandler,
|
|
172
193
|
signInStateTransitionHandler:
|
|
173
194
|
this.stateParameters.signInStateTransitionHandler,
|
|
195
|
+
resetPasswordStateTransitionHandler:
|
|
196
|
+
this.stateParameters
|
|
197
|
+
.resetPasswordStateTransitionHandler,
|
|
174
198
|
method: this.method,
|
|
175
199
|
sentTo: result.sentTo,
|
|
176
200
|
channel: result.channel,
|
|
@@ -7,9 +7,7 @@ import { AuthFlowStateBase } from "../../AuthFlowState.js";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Terminal state indicating the operation completed successfully.
|
|
10
|
-
*
|
|
11
|
-
* Completion data (for example the signed-in account) is carried by the
|
|
12
|
-
* result's `data` payload, not by this state.
|
|
10
|
+
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
13
11
|
*/
|
|
14
12
|
export class CompletedStateV2 extends AuthFlowStateBase {
|
|
15
13
|
readonly stateType = "completed";
|
|
@@ -11,19 +11,23 @@ import { CustomAuthSilentCacheClient } from "../../../../get_account/interaction
|
|
|
11
11
|
import type { SignUpStateTransitionHandlerV2 } from "../../../../sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.js";
|
|
12
12
|
import type { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
|
|
13
13
|
import type { SignInStateTransitionHandlerV2 } from "../../../../sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.js";
|
|
14
|
+
import type { ResetPasswordStateTransitionHandlerV2 } from "../../../../reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.js";
|
|
15
|
+
import type { AuthenticationMethodRegistrationV2 } from "../AuthenticationMethodRegistrationV2.js";
|
|
16
|
+
import type { SignUpAttributeV2 } from "../../../network_client/custom_auth_api/v2/result/SignUpResultsV2.js";
|
|
14
17
|
|
|
15
18
|
export interface CustomAuthActionRequiredStateParametersV2
|
|
16
19
|
extends AuthFlowActionRequiredStateParameters {
|
|
17
20
|
flowClient: FlowInteractionClientV2;
|
|
18
21
|
continuationState: FlowContinuationStateV2;
|
|
19
22
|
cacheClient: CustomAuthSilentCacheClient;
|
|
23
|
+
signInStateTransitionHandler?: SignInStateTransitionHandlerV2;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
export interface AuthMethodSelectionRequiredStateParametersV2
|
|
23
27
|
extends CustomAuthActionRequiredStateParametersV2 {
|
|
24
28
|
methods: readonly AuthenticationMethodV2[];
|
|
25
29
|
authenticationFactor: AuthenticationFactorV2;
|
|
26
|
-
|
|
30
|
+
resetPasswordStateTransitionHandler?: ResetPasswordStateTransitionHandlerV2;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
export interface CodeVerificationStateParametersV2
|
|
@@ -37,8 +41,26 @@ export interface CodeVerificationStateParametersV2
|
|
|
37
41
|
export interface CodeRequiredStateParametersV2
|
|
38
42
|
extends CodeVerificationStateParametersV2 {
|
|
39
43
|
signUpStateTransitionHandler?: SignUpStateTransitionHandlerV2;
|
|
40
|
-
|
|
44
|
+
resetPasswordStateTransitionHandler?: ResetPasswordStateTransitionHandlerV2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface PasswordRequiredStateParametersV2
|
|
48
|
+
extends CustomAuthActionRequiredStateParametersV2 {
|
|
49
|
+
requestedPasswordAttribute?: SignUpAttributeV2;
|
|
50
|
+
signUpStateTransitionHandler?: SignUpStateTransitionHandlerV2;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
export type MFAVerificationRequiredStateParametersV2 =
|
|
44
54
|
CodeVerificationStateParametersV2;
|
|
55
|
+
|
|
56
|
+
export interface AuthMethodRegistrationRequiredStateParametersV2
|
|
57
|
+
extends CustomAuthActionRequiredStateParametersV2 {
|
|
58
|
+
methods: readonly AuthenticationMethodRegistrationV2[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface AuthMethodVerificationRequiredStateParametersV2
|
|
62
|
+
extends CustomAuthActionRequiredStateParametersV2 {
|
|
63
|
+
type: string;
|
|
64
|
+
sentTo?: string;
|
|
65
|
+
codeLength: number;
|
|
66
|
+
}
|
|
@@ -7,8 +7,7 @@ import { AuthFlowStateBase } from "../../AuthFlowState.js";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Terminal state indicating the operation failed.
|
|
10
|
-
*
|
|
11
|
-
* The error is carried by the result's `error` payload, not by this state.
|
|
10
|
+
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
12
11
|
*/
|
|
13
12
|
export class FailedStateV2 extends AuthFlowStateBase {
|
|
14
13
|
readonly stateType = "failed";
|