@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
|
@@ -15,11 +15,12 @@ import {
|
|
|
15
15
|
StartResultV2,
|
|
16
16
|
StartMethodV2,
|
|
17
17
|
ChallengeResultV2,
|
|
18
|
-
ChallengeNextActionV2,
|
|
19
18
|
ChallengeVerificationResultV2,
|
|
20
19
|
VerifyResultV2,
|
|
21
|
-
VerifyNextActionV2,
|
|
22
20
|
AuthenticationFactorV2,
|
|
21
|
+
ActivationResultV2,
|
|
22
|
+
EnrollmentResultV2,
|
|
23
|
+
EnrollmentMethodV2,
|
|
23
24
|
} from "./result/BaseResultsV2.js";
|
|
24
25
|
import {
|
|
25
26
|
SignUpStartApiResultV2,
|
|
@@ -40,6 +41,9 @@ import {
|
|
|
40
41
|
PollResponseV2,
|
|
41
42
|
ParsedResponseV2,
|
|
42
43
|
EmbeddedMethodV2,
|
|
44
|
+
EmbeddedEnrollmentMethodV2,
|
|
45
|
+
EnrollmentResponseV2,
|
|
46
|
+
HalResponseBaseV2,
|
|
43
47
|
} from "./response/ResponsesV2.js";
|
|
44
48
|
import {
|
|
45
49
|
RequestContextV2,
|
|
@@ -51,6 +55,8 @@ import {
|
|
|
51
55
|
VerifyRequestV2,
|
|
52
56
|
UpdatePasswordRequestV2,
|
|
53
57
|
PollRequestV2,
|
|
58
|
+
AuthMethodRegistrationRequestV2,
|
|
59
|
+
AuthMethodRegistrationVerificationRequestV2,
|
|
54
60
|
} from "./request/RequestsV2.js";
|
|
55
61
|
import {
|
|
56
62
|
CHALLENGE_RELATION,
|
|
@@ -60,6 +66,10 @@ import {
|
|
|
60
66
|
RISK_VERIFY_RELATION,
|
|
61
67
|
AuthenticationMethodTypeV2,
|
|
62
68
|
ResponseStateV2,
|
|
69
|
+
ACTIVATE_RELATION,
|
|
70
|
+
ENROLL_RELATION,
|
|
71
|
+
RESEND_RELATION,
|
|
72
|
+
POLL_RELATION,
|
|
63
73
|
} from "./ApiClientConstantsV2.js";
|
|
64
74
|
import {
|
|
65
75
|
INVALID_HAL_RESPONSE,
|
|
@@ -70,7 +80,6 @@ import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
|
|
|
70
80
|
|
|
71
81
|
/*
|
|
72
82
|
* Native Auth V2 network client that follows server-provided HAL links.
|
|
73
|
-
* Flow-specific entry methods reuse shared challenge, verification, and token operations.
|
|
74
83
|
*/
|
|
75
84
|
export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
76
85
|
/*
|
|
@@ -117,23 +126,55 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
117
126
|
context
|
|
118
127
|
);
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
parsedResponse.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
const challengeType =
|
|
130
|
+
parsedResponse.body.action === VERIFY_RELATION
|
|
131
|
+
? parsedResponse.body.type
|
|
132
|
+
: undefined;
|
|
133
|
+
const isEmailChallenge =
|
|
134
|
+
typeof challengeType === "string" &&
|
|
135
|
+
challengeType.toLowerCase() === AuthenticationMethodTypeV2.EMAIL;
|
|
136
|
+
|
|
137
|
+
if (
|
|
138
|
+
parsedResponse.body.action === VERIFY_RELATION &&
|
|
139
|
+
isEmailChallenge
|
|
140
|
+
) {
|
|
141
|
+
return this.toChallengeVerificationResult(parsedResponse);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (parsedResponse.body.action === CHALLENGE_RELATION) {
|
|
145
|
+
return {
|
|
146
|
+
nextAction: CHALLENGE_RELATION,
|
|
147
|
+
continuationToken: this.handler.requireContinuationToken(
|
|
148
|
+
parsedResponse.continuationToken,
|
|
149
|
+
parsedResponse.correlationId
|
|
150
|
+
),
|
|
151
|
+
methods: this.resolveMethods(
|
|
152
|
+
this.handler.requireMethods(
|
|
153
|
+
parsedResponse.body._embedded?.methods,
|
|
154
|
+
parsedResponse.correlationId
|
|
155
|
+
),
|
|
156
|
+
parsedResponse.correlationId
|
|
157
|
+
),
|
|
158
|
+
authenticationFactor: this.resolveAuthenticationFactor(
|
|
159
|
+
parsedResponse.body.challengeContext?.authenticationFactor,
|
|
160
|
+
parsedResponse.correlationId
|
|
161
|
+
),
|
|
162
|
+
scenario: parsedResponse.body.scenario,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const message =
|
|
167
|
+
"Invalid HAL response: sign-up start did not return an email verification or authentication challenge";
|
|
168
|
+
this.logger?.error(message, parsedResponse.correlationId);
|
|
169
|
+
throw new CustomAuthApiError(
|
|
170
|
+
INVALID_HAL_RESPONSE,
|
|
171
|
+
message,
|
|
172
|
+
parsedResponse.correlationId
|
|
173
|
+
);
|
|
132
174
|
}
|
|
133
175
|
|
|
134
176
|
/*
|
|
135
|
-
* Submits the initial sign-up attributes.
|
|
136
|
-
* sent the email code and supplies the links needed to verify or resend it.
|
|
177
|
+
* Submits the initial sign-up attributes.
|
|
137
178
|
*/
|
|
138
179
|
async submitSignUpAttributes(
|
|
139
180
|
submitAttributesHref: string,
|
|
@@ -166,7 +207,10 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
166
207
|
nextAction:
|
|
167
208
|
SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES,
|
|
168
209
|
continuationToken,
|
|
169
|
-
attributes:
|
|
210
|
+
attributes: this.handler.resolveSignUpAttributes(
|
|
211
|
+
parsedResponse.body.attributes,
|
|
212
|
+
correlationId
|
|
213
|
+
),
|
|
170
214
|
submitAttributesHref: this.handler.requireHref(
|
|
171
215
|
parsedResponse.body._links?.submitAttributes?.href,
|
|
172
216
|
"submitAttributes",
|
|
@@ -175,10 +219,17 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
175
219
|
};
|
|
176
220
|
}
|
|
177
221
|
|
|
178
|
-
if (parsedResponse.body.action ===
|
|
222
|
+
if (parsedResponse.body.action === ENROLL_RELATION) {
|
|
179
223
|
return {
|
|
180
|
-
|
|
181
|
-
|
|
224
|
+
nextAction: ENROLL_RELATION,
|
|
225
|
+
continuationToken,
|
|
226
|
+
methods: this.resolveEnrollmentMethods(
|
|
227
|
+
this.handler.requireMethods(
|
|
228
|
+
parsedResponse.body._embedded?.methods,
|
|
229
|
+
correlationId
|
|
230
|
+
),
|
|
231
|
+
correlationId
|
|
232
|
+
),
|
|
182
233
|
};
|
|
183
234
|
}
|
|
184
235
|
|
|
@@ -265,6 +316,100 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
265
316
|
return this.toVerifyResult(parsedResponse);
|
|
266
317
|
}
|
|
267
318
|
|
|
319
|
+
async enrollAuthMethod(
|
|
320
|
+
enrollHref: string,
|
|
321
|
+
request: AuthMethodRegistrationRequestV2,
|
|
322
|
+
context: RequestContextV2
|
|
323
|
+
): Promise<EnrollmentResultV2> {
|
|
324
|
+
return this.sendEnrollmentRequest(enrollHref, request, context);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
async resendAuthMethodRegistrationChallenge(
|
|
328
|
+
resendHref: string,
|
|
329
|
+
request: ChallengeRequestV2,
|
|
330
|
+
context: RequestContextV2
|
|
331
|
+
): Promise<EnrollmentResultV2> {
|
|
332
|
+
return this.sendEnrollmentRequest(resendHref, request, context);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
private async sendEnrollmentRequest(
|
|
336
|
+
href: string,
|
|
337
|
+
request: ChallengeRequestV2,
|
|
338
|
+
context: RequestContextV2
|
|
339
|
+
): Promise<EnrollmentResultV2> {
|
|
340
|
+
const parsedResponse =
|
|
341
|
+
await this.sendActionRequest<EnrollmentResponseV2>(
|
|
342
|
+
href,
|
|
343
|
+
HttpMethod.POST,
|
|
344
|
+
request,
|
|
345
|
+
context
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
if (parsedResponse.body.action !== ACTIVATE_RELATION) {
|
|
349
|
+
throw new CustomAuthApiError(
|
|
350
|
+
INVALID_HAL_RESPONSE,
|
|
351
|
+
"Invalid HAL response: enrollment returned no activation action",
|
|
352
|
+
parsedResponse.correlationId
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const links = parsedResponse.body._links;
|
|
357
|
+
|
|
358
|
+
return {
|
|
359
|
+
nextAction: ACTIVATE_RELATION,
|
|
360
|
+
continuationToken: this.handler.requireContinuationToken(
|
|
361
|
+
parsedResponse.continuationToken,
|
|
362
|
+
parsedResponse.correlationId
|
|
363
|
+
),
|
|
364
|
+
hint: parsedResponse.body.hint,
|
|
365
|
+
codeLength: this.normalizeCodeLength(
|
|
366
|
+
parsedResponse.body.codeLength
|
|
367
|
+
),
|
|
368
|
+
activateHref: this.handler.requireHref(
|
|
369
|
+
links?.activate?.href,
|
|
370
|
+
ACTIVATE_RELATION,
|
|
371
|
+
parsedResponse.correlationId
|
|
372
|
+
),
|
|
373
|
+
resendHref:
|
|
374
|
+
links && "resend" in links
|
|
375
|
+
? this.handler.requireHref(
|
|
376
|
+
links.resend?.href,
|
|
377
|
+
RESEND_RELATION,
|
|
378
|
+
parsedResponse.correlationId
|
|
379
|
+
)
|
|
380
|
+
: undefined,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async activateAuthMethod(
|
|
385
|
+
activateHref: string,
|
|
386
|
+
request: AuthMethodRegistrationVerificationRequestV2,
|
|
387
|
+
context: RequestContextV2
|
|
388
|
+
): Promise<ActivationResultV2> {
|
|
389
|
+
const parsedResponse = await this.sendActionRequest<HalResponseBaseV2>(
|
|
390
|
+
activateHref,
|
|
391
|
+
HttpMethod.POST,
|
|
392
|
+
request,
|
|
393
|
+
context
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
if (parsedResponse.body.state !== ResponseStateV2.CONTINUE) {
|
|
397
|
+
throw new CustomAuthApiError(
|
|
398
|
+
INVALID_HAL_RESPONSE,
|
|
399
|
+
"Invalid HAL response: activation returned no continuation state",
|
|
400
|
+
parsedResponse.correlationId
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return {
|
|
405
|
+
nextAction: ResponseStateV2.CONTINUE,
|
|
406
|
+
continuationToken: this.handler.requireContinuationToken(
|
|
407
|
+
parsedResponse.continuationToken,
|
|
408
|
+
parsedResponse.correlationId
|
|
409
|
+
),
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
|
|
268
413
|
/*
|
|
269
414
|
* Submits the new password and returns the link used to poll for completion.
|
|
270
415
|
*/
|
|
@@ -297,7 +442,7 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
297
442
|
}
|
|
298
443
|
|
|
299
444
|
/*
|
|
300
|
-
*
|
|
445
|
+
* Sends a poll request and validates the data needed for the next flow step.
|
|
301
446
|
*/
|
|
302
447
|
async poll(
|
|
303
448
|
pollHref: string,
|
|
@@ -311,21 +456,72 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
311
456
|
context
|
|
312
457
|
);
|
|
313
458
|
|
|
314
|
-
const
|
|
315
|
-
|
|
459
|
+
const correlationId = parsedResponse.correlationId;
|
|
460
|
+
const continuationToken = this.handler.requireContinuationToken(
|
|
461
|
+
parsedResponse.continuationToken,
|
|
462
|
+
correlationId
|
|
463
|
+
);
|
|
464
|
+
const nextAction =
|
|
465
|
+
parsedResponse.body.action ?? parsedResponse.body.state;
|
|
316
466
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
467
|
+
if (nextAction === ENROLL_RELATION) {
|
|
468
|
+
return {
|
|
469
|
+
nextAction,
|
|
470
|
+
continuationToken,
|
|
471
|
+
methods: this.resolveEnrollmentMethods(
|
|
472
|
+
this.handler.requireMethods(
|
|
473
|
+
parsedResponse.body._embedded?.methods,
|
|
474
|
+
correlationId
|
|
475
|
+
) as EmbeddedEnrollmentMethodV2[],
|
|
476
|
+
correlationId
|
|
477
|
+
),
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (nextAction === CHALLENGE_RELATION) {
|
|
482
|
+
return {
|
|
483
|
+
nextAction,
|
|
484
|
+
continuationToken,
|
|
485
|
+
authenticationFactor: this.resolveAuthenticationFactor(
|
|
486
|
+
parsedResponse.body.challengeContext?.authenticationFactor,
|
|
487
|
+
correlationId
|
|
488
|
+
),
|
|
489
|
+
methods: this.resolveMethods(
|
|
490
|
+
this.handler.requireMethods(
|
|
491
|
+
parsedResponse.body._embedded?.methods,
|
|
492
|
+
correlationId
|
|
493
|
+
) as EmbeddedMethodV2[],
|
|
494
|
+
correlationId
|
|
495
|
+
),
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if (nextAction === POLL_RELATION) {
|
|
500
|
+
return {
|
|
501
|
+
nextAction: POLL_RELATION,
|
|
502
|
+
continuationToken,
|
|
503
|
+
pollHref: this.handler.requireHref(
|
|
504
|
+
parsedResponse.body._links?.poll?.href,
|
|
505
|
+
POLL_RELATION,
|
|
506
|
+
correlationId
|
|
507
|
+
),
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
if (nextAction === ResponseStateV2.CONTINUE) {
|
|
512
|
+
return {
|
|
513
|
+
nextAction,
|
|
514
|
+
continuationToken,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const message = `Password reset poll next action '${nextAction}' is not supported.`;
|
|
519
|
+
this.logger?.error(message, correlationId);
|
|
520
|
+
throw new CustomAuthApiError(
|
|
521
|
+
INVALID_HAL_RESPONSE,
|
|
522
|
+
message,
|
|
523
|
+
correlationId
|
|
524
|
+
);
|
|
329
525
|
}
|
|
330
526
|
|
|
331
527
|
private async sendStartRequest(
|
|
@@ -345,7 +541,10 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
345
541
|
return {
|
|
346
542
|
continuationToken,
|
|
347
543
|
methods: this.resolveMethods(
|
|
348
|
-
|
|
544
|
+
this.handler.requireMethods(
|
|
545
|
+
parsedResponse.body._embedded?.methods,
|
|
546
|
+
parsedResponse.correlationId
|
|
547
|
+
),
|
|
349
548
|
parsedResponse.correlationId
|
|
350
549
|
),
|
|
351
550
|
authenticationFactor: this.resolveAuthenticationFactor(
|
|
@@ -367,16 +566,19 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
367
566
|
|
|
368
567
|
if (parsedResponse.body.state === ResponseStateV2.CONTINUE) {
|
|
369
568
|
return {
|
|
370
|
-
nextAction:
|
|
569
|
+
nextAction: ResponseStateV2.CONTINUE,
|
|
371
570
|
continuationToken,
|
|
372
571
|
};
|
|
373
572
|
}
|
|
374
573
|
|
|
375
574
|
if (parsedResponse.body.action === COLLECT_ATTRIBUTES_RELATION) {
|
|
376
575
|
return {
|
|
377
|
-
nextAction:
|
|
576
|
+
nextAction: COLLECT_ATTRIBUTES_RELATION,
|
|
378
577
|
continuationToken,
|
|
379
|
-
attributes:
|
|
578
|
+
attributes: this.handler.resolveSignUpAttributes(
|
|
579
|
+
parsedResponse.body.attributes,
|
|
580
|
+
correlationId
|
|
581
|
+
),
|
|
380
582
|
submitAttributesHref: this.handler.requireHref(
|
|
381
583
|
parsedResponse.body._links?.submitAttributes?.href,
|
|
382
584
|
"submitAttributes",
|
|
@@ -387,7 +589,7 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
387
589
|
|
|
388
590
|
if (parsedResponse.body.action === UPDATE_RELATION) {
|
|
389
591
|
return {
|
|
390
|
-
nextAction:
|
|
592
|
+
nextAction: UPDATE_RELATION,
|
|
391
593
|
continuationToken,
|
|
392
594
|
updateHref: this.handler.requireHref(
|
|
393
595
|
parsedResponse.body._links?.update?.href,
|
|
@@ -399,14 +601,31 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
399
601
|
|
|
400
602
|
if (parsedResponse.body.action === CHALLENGE_RELATION) {
|
|
401
603
|
return {
|
|
402
|
-
nextAction:
|
|
604
|
+
nextAction: CHALLENGE_RELATION,
|
|
403
605
|
continuationToken,
|
|
404
606
|
authenticationFactor: this.resolveAuthenticationFactor(
|
|
405
607
|
parsedResponse.body.challengeContext?.authenticationFactor,
|
|
406
608
|
correlationId
|
|
407
609
|
),
|
|
408
610
|
methods: this.resolveMethods(
|
|
409
|
-
|
|
611
|
+
this.handler.requireMethods(
|
|
612
|
+
parsedResponse.body._embedded?.methods,
|
|
613
|
+
correlationId
|
|
614
|
+
) as EmbeddedMethodV2[],
|
|
615
|
+
correlationId
|
|
616
|
+
),
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
if (parsedResponse.body.action === ENROLL_RELATION) {
|
|
621
|
+
return {
|
|
622
|
+
nextAction: ENROLL_RELATION,
|
|
623
|
+
continuationToken,
|
|
624
|
+
methods: this.resolveEnrollmentMethods(
|
|
625
|
+
this.handler.requireMethods(
|
|
626
|
+
parsedResponse.body._embedded?.methods,
|
|
627
|
+
correlationId
|
|
628
|
+
) as EmbeddedEnrollmentMethodV2[],
|
|
410
629
|
correlationId
|
|
411
630
|
),
|
|
412
631
|
};
|
|
@@ -419,6 +638,43 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
419
638
|
);
|
|
420
639
|
}
|
|
421
640
|
|
|
641
|
+
private resolveEnrollmentMethods(
|
|
642
|
+
methods: EmbeddedEnrollmentMethodV2[],
|
|
643
|
+
correlationId: string
|
|
644
|
+
): EnrollmentMethodV2[] {
|
|
645
|
+
return methods.map((method) => {
|
|
646
|
+
if (typeof method.type !== "string" || !method.type.trim()) {
|
|
647
|
+
throw new CustomAuthApiError(
|
|
648
|
+
INVALID_HAL_RESPONSE,
|
|
649
|
+
"Invalid HAL response: enrollment method type is malformed",
|
|
650
|
+
correlationId
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
if (
|
|
655
|
+
method.channels !== undefined &&
|
|
656
|
+
(!Array.isArray(method.channels) ||
|
|
657
|
+
method.channels.length === 0)
|
|
658
|
+
) {
|
|
659
|
+
throw new CustomAuthApiError(
|
|
660
|
+
INVALID_HAL_RESPONSE,
|
|
661
|
+
"Invalid HAL response: enrollment method channels are malformed",
|
|
662
|
+
correlationId
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
return {
|
|
667
|
+
type: method.type,
|
|
668
|
+
channels: method.channels,
|
|
669
|
+
enrollHref: this.handler.requireHref(
|
|
670
|
+
method._links?.enroll?.href,
|
|
671
|
+
ENROLL_RELATION,
|
|
672
|
+
correlationId
|
|
673
|
+
),
|
|
674
|
+
};
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
|
|
422
678
|
private resolveAuthenticationFactor(
|
|
423
679
|
authenticationFactor: string | undefined,
|
|
424
680
|
correlationId: string
|
|
@@ -450,7 +706,7 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
450
706
|
parsedResponse.body as RiskVerificationRequiredResponseV2;
|
|
451
707
|
|
|
452
708
|
return {
|
|
453
|
-
nextAction:
|
|
709
|
+
nextAction: RISK_VERIFY_RELATION,
|
|
454
710
|
continuationToken: this.handler.requireContinuationToken(
|
|
455
711
|
parsedResponse.continuationToken,
|
|
456
712
|
parsedResponse.correlationId
|
|
@@ -490,36 +746,47 @@ export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
|
490
746
|
"payload" in parsedResponse.body
|
|
491
747
|
? parsedResponse.body
|
|
492
748
|
: undefined;
|
|
749
|
+
const isPasswordChallenge =
|
|
750
|
+
parsedResponse.body.type?.toLowerCase() ===
|
|
751
|
+
AuthenticationMethodTypeV2.PASSWORD;
|
|
752
|
+
const verifyHref = this.handler.requireHref(
|
|
753
|
+
links?.verify?.href,
|
|
754
|
+
VERIFY_RELATION,
|
|
755
|
+
parsedResponse.correlationId
|
|
756
|
+
);
|
|
757
|
+
const resendHref =
|
|
758
|
+
!isPasswordChallenge && links && "resend" in links
|
|
759
|
+
? this.handler.requireHref(
|
|
760
|
+
links.resend?.href,
|
|
761
|
+
RESEND_RELATION,
|
|
762
|
+
parsedResponse.correlationId
|
|
763
|
+
)
|
|
764
|
+
: undefined;
|
|
765
|
+
const codeLength = isPasswordChallenge
|
|
766
|
+
? undefined
|
|
767
|
+
: this.normalizeCodeLength(
|
|
768
|
+
codeMetadata?.codeLength ?? codeMetadata?.payload?.codeLength
|
|
769
|
+
);
|
|
493
770
|
|
|
494
771
|
return {
|
|
495
|
-
nextAction:
|
|
772
|
+
nextAction: VERIFY_RELATION,
|
|
496
773
|
continuationToken,
|
|
497
|
-
verifyHref
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
parsedResponse.correlationId
|
|
501
|
-
),
|
|
502
|
-
resendHref:
|
|
503
|
-
links && "resend" in links ? links.resend?.href : undefined,
|
|
504
|
-
codeLength:
|
|
505
|
-
codeMetadata?.codeLength ?? codeMetadata?.payload?.codeLength,
|
|
774
|
+
verifyHref,
|
|
775
|
+
resendHref,
|
|
776
|
+
codeLength,
|
|
506
777
|
hint: codeMetadata?.hint,
|
|
507
778
|
type: parsedResponse.body.type,
|
|
508
779
|
};
|
|
509
780
|
}
|
|
510
781
|
|
|
782
|
+
private normalizeCodeLength(value: unknown): number {
|
|
783
|
+
return typeof value === "number" && Number.isInteger(value) ? value : 0;
|
|
784
|
+
}
|
|
785
|
+
|
|
511
786
|
private resolveMethods(
|
|
512
|
-
|
|
513
|
-
_embedded?: {
|
|
514
|
-
methods?: EmbeddedMethodV2[];
|
|
515
|
-
};
|
|
516
|
-
},
|
|
787
|
+
methods: EmbeddedMethodV2[],
|
|
517
788
|
correlationId: string
|
|
518
789
|
): StartMethodV2[] {
|
|
519
|
-
const methods = this.handler.requireMethods(
|
|
520
|
-
body._embedded?.methods,
|
|
521
|
-
correlationId
|
|
522
|
-
);
|
|
523
790
|
const resolved: StartMethodV2[] = [];
|
|
524
791
|
|
|
525
792
|
methods.forEach((method, index) => {
|
|
@@ -7,7 +7,10 @@ import { Logger } from "@azure/msal-common/browser";
|
|
|
7
7
|
import { HttpHeaderKeys } from "../../../../CustomAuthConstants.js";
|
|
8
8
|
import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
|
|
9
9
|
import { normalizeServerErrorV2 } from "./response/ErrorNormalizerV2.js";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
ParsedResponseV2,
|
|
12
|
+
SignUpAttributeResponseV2,
|
|
13
|
+
} from "./response/ResponsesV2.js";
|
|
11
14
|
import {
|
|
12
15
|
CONTINUATION_TOKEN_MISSING,
|
|
13
16
|
INVALID_HAL_RESPONSE,
|
|
@@ -17,12 +20,7 @@ import {
|
|
|
17
20
|
} from "./ErrorCodesV2.js";
|
|
18
21
|
|
|
19
22
|
/*
|
|
20
|
-
*
|
|
21
|
-
* relations. Raw-preserving: the body keeps its HAL `_links`/`_embedded` shape so the api-client
|
|
22
|
-
* navigates typed hrefs directly. Parsing never throws on a non-200 status - every V2 response
|
|
23
|
-
* (including the entry response) carries a meaningful body, so only a non-object body is a hard
|
|
24
|
-
* failure; the wire error is normalized onto the envelope (`error`). Required response values use
|
|
25
|
-
* shared guards after callers read their strongly typed response properties directly.
|
|
23
|
+
* Parses V2 HTTP responses and validates required response values.
|
|
26
24
|
*/
|
|
27
25
|
export class ResponseHandlerV2 {
|
|
28
26
|
constructor(private readonly logger?: Logger) {}
|
|
@@ -49,7 +47,6 @@ export class ResponseHandlerV2 {
|
|
|
49
47
|
|
|
50
48
|
const isWebFallbackRequired = error?.subError === WEB_REDIRECT_REQUIRED;
|
|
51
49
|
|
|
52
|
-
// Surface the header correlation id on the body (HalResponseBaseV2.correlationId).
|
|
53
50
|
json.correlationId = correlationId;
|
|
54
51
|
|
|
55
52
|
return {
|
|
@@ -64,12 +61,12 @@ export class ResponseHandlerV2 {
|
|
|
64
61
|
|
|
65
62
|
// Required href; throws when it is absent.
|
|
66
63
|
requireHref(
|
|
67
|
-
href:
|
|
64
|
+
href: unknown,
|
|
68
65
|
relation: string,
|
|
69
66
|
correlationId: string,
|
|
70
67
|
missingHrefError?: { code: string; message: string }
|
|
71
68
|
): string {
|
|
72
|
-
if (!href) {
|
|
69
|
+
if (typeof href !== "string" || !href.trim()) {
|
|
73
70
|
const errorCode = missingHrefError?.code ?? INVALID_HAL_RESPONSE;
|
|
74
71
|
const errorMessage =
|
|
75
72
|
missingHrefError?.message ??
|
|
@@ -108,11 +105,51 @@ export class ResponseHandlerV2 {
|
|
|
108
105
|
return continuationToken;
|
|
109
106
|
}
|
|
110
107
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
methods: EmbeddedMethodV2[] | undefined,
|
|
108
|
+
resolveSignUpAttributes(
|
|
109
|
+
attributes: SignUpAttributeResponseV2[] | undefined,
|
|
114
110
|
correlationId: string
|
|
115
|
-
):
|
|
111
|
+
): SignUpAttributeResponseV2[] {
|
|
112
|
+
const resolved = attributes === undefined ? [] : attributes;
|
|
113
|
+
if (
|
|
114
|
+
!Array.isArray(resolved) ||
|
|
115
|
+
resolved.some(
|
|
116
|
+
(attribute) =>
|
|
117
|
+
typeof attribute !== "object" ||
|
|
118
|
+
attribute === null ||
|
|
119
|
+
typeof attribute.attributeId !== "string" ||
|
|
120
|
+
!attribute.attributeId.trim()
|
|
121
|
+
)
|
|
122
|
+
) {
|
|
123
|
+
const message =
|
|
124
|
+
"Invalid HAL response: sign-up attributes must be an array of objects with nonempty string attributeId values";
|
|
125
|
+
this.logger?.error(message, correlationId);
|
|
126
|
+
throw new CustomAuthApiError(
|
|
127
|
+
INVALID_HAL_RESPONSE,
|
|
128
|
+
message,
|
|
129
|
+
correlationId
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (
|
|
134
|
+
resolved.some(
|
|
135
|
+
(attribute) => attribute.attributeId.toLowerCase() === "email"
|
|
136
|
+
)
|
|
137
|
+
) {
|
|
138
|
+
const message =
|
|
139
|
+
"Invalid HAL response: email cannot be collected as a sign-up attribute";
|
|
140
|
+
this.logger?.error(message, correlationId);
|
|
141
|
+
throw new CustomAuthApiError(
|
|
142
|
+
INVALID_HAL_RESPONSE,
|
|
143
|
+
message,
|
|
144
|
+
correlationId
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return resolved;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Required embedded auth methods; throws when `_embedded.methods` is absent or empty.
|
|
152
|
+
requireMethods<T>(methods: T[] | undefined, correlationId: string): T[] {
|
|
116
153
|
if (!methods?.length) {
|
|
117
154
|
this.logger?.error(
|
|
118
155
|
"V2 HAL response is missing the required embedded authentication methods",
|
|
@@ -150,7 +187,6 @@ export class ResponseHandlerV2 {
|
|
|
150
187
|
);
|
|
151
188
|
}
|
|
152
189
|
|
|
153
|
-
// response.json() accepts primitives/arrays; every V2 body must be a JSON object.
|
|
154
190
|
if (typeof json !== "object" || json === null || Array.isArray(json)) {
|
|
155
191
|
this.logger?.error(
|
|
156
192
|
"V2 response serialization failed: body is not a JSON object",
|