@azure/msal-browser 5.22.0 → 5.24.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 +133 -29
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +178 -64
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +61 -22
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +49 -0
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs.map +1 -0
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +97 -29
- package/dist/cache/LocalStorage.mjs.map +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 +10 -10
- 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 +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +27 -2
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +192 -2
- 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 +21 -0
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +80 -0
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs +102 -0
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +12 -0
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs +20 -0
- package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs +36 -0
- package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs +29 -0
- package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +76 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs +36 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +36 -0
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +134 -0
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +23 -0
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +22 -0
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs +61 -0
- package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +87 -0
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +3 -2
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs.map +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 +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 +602 -0
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -0
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +67 -0
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -0
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +46 -0
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -0
- 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 +3 -2
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs.map +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 +30 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +193 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +236 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +26 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +66 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +97 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +56 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +23 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +14 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -0
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +3 -2
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs.map +1 -1
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +38 -0
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -0
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +20 -3
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +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 +23 -1
- 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/error_type/SubmitNewPasswordErrorV2.mjs +29 -0
- package/dist/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.mjs.map +1 -0
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +59 -0
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.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/error_type/SignInContinuationErrorV2.mjs +18 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.mjs.map +1 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs +37 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs.map +1 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs +23 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs.map +1 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +70 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +61 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -0
- 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/error_type/SignUpStartErrorV2.mjs +25 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs +33 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +40 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +25 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +47 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +60 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -0
- 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 +21 -14
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +11 -8
- 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 +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 +1381 -1185
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +16 -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/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
- package/dist/webBrokerBridge/PerfEventNames.mjs +38 -0
- package/dist/webBrokerBridge/PerfEventNames.mjs.map +1 -0
- 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 +2 -1
- package/dist/webBrokerBridge/index.mjs.map +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +215 -19
- package/lib/custom-auth-path/msal-custom-auth.cjs +3571 -479
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +3571 -479
- 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 +622 -233
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +622 -233
- 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 +59 -1
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs.map +1 -1
- package/package.json +3 -3
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +217 -45
- package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +261 -107
- package/src/broker/nativeBroker/PlatformAuthProvider.ts +92 -37
- package/src/broker/nativeBroker/PlatformAuthRequest.ts +118 -6
- package/src/broker/nativeBroker/PlatformAuthResponse.ts +14 -1
- package/src/cache/LocalStorage.ts +135 -28
- package/src/controllers/StandardController.ts +17 -23
- package/src/custom_auth/CustomAuthActionInputs.ts +11 -0
- package/src/custom_auth/CustomAuthPublicClientApplication.ts +40 -4
- package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +44 -0
- package/src/custom_auth/controller/CustomAuthStandardController.ts +360 -1
- package/src/custom_auth/controller/ICustomAuthStandardController.ts +14 -0
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +18 -0
- package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +20 -0
- package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +133 -0
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.ts +146 -0
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +8 -0
- package/src/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.ts +15 -0
- package/src/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.ts +33 -0
- package/src/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.ts +25 -0
- package/src/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.ts +18 -0
- package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +26 -0
- package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +26 -0
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +25 -0
- package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +30 -0
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +40 -0
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +100 -0
- package/src/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.ts +59 -0
- package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +53 -0
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +196 -0
- package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +16 -0
- package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +44 -0
- package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +15 -0
- package/src/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.ts +76 -0
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +119 -0
- package/src/custom_auth/core/error/CustomAuthApiError.ts +3 -1
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +35 -0
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +1145 -0
- package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +150 -0
- package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +66 -0
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +185 -0
- package/src/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.ts +1 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +30 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +423 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +553 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.ts +24 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.ts +81 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +177 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +129 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.ts +68 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +50 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/HalResource.ts +20 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +202 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +111 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +26 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +44 -0
- package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +64 -0
- package/src/custom_auth/core/telemetry/PublicApiId.ts +18 -0
- package/src/custom_auth/index.ts +96 -0
- package/src/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.ts +25 -0
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +33 -0
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +69 -0
- package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateParametersV2.ts +9 -0
- package/src/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.ts +13 -0
- package/src/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.ts +35 -0
- package/src/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.ts +19 -0
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +31 -0
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +32 -0
- package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +22 -0
- package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +96 -0
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +83 -0
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +12 -0
- package/src/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.ts +21 -0
- package/src/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.ts +32 -0
- package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +28 -0
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +20 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +48 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +34 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +63 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +24 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +112 -0
- package/src/interaction_client/PlatformAuthInteractionClient.ts +79 -17
- package/src/interaction_client/RedirectClient.ts +15 -5
- package/src/packageMetadata.ts +1 -1
- package/src/telemetry/BrowserPerformanceEvents.ts +20 -0
- package/src/webBrokerBridge/PerfEventNames.ts +43 -0
- package/src/webBrokerBridge/index.ts +26 -0
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +3 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts +3 -1
- package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +68 -5
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +12 -1
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
- package/types/cache/LocalStorage.d.ts +4 -5
- package/types/cache/LocalStorage.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthActionInputs.d.ts +7 -0
- 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 +27 -5
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +30 -0
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -0
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts +11 -2
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/controller/ICustomAuthStandardController.d.ts +7 -1
- package/types/custom_auth/controller/ICustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +14 -0
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +14 -0
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +53 -0
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.d.ts +40 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +4 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.d.ts +11 -0
- package/types/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.d.ts +23 -0
- package/types/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.d.ts +18 -0
- package/types/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.d.ts +7 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +15 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +16 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +16 -0
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +18 -0
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +23 -0
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +21 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.d.ts +17 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts +14 -0
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +25 -0
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +11 -0
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +28 -0
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +10 -0
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.d.ts +18 -0
- package/types/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +25 -0
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/error/CustomAuthApiError.d.ts +3 -1
- package/types/custom_auth/core/error/CustomAuthApiError.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +21 -0
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +35 -0
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -0
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +26 -0
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -0
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +43 -0
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -0
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +80 -0
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts +17 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts +31 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts +23 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.d.ts +19 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts +2 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +15 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +52 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.d.ts +3 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts +37 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/HalResource.d.ts +12 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/HalResource.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +133 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +70 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +10 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +33 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -0
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +4 -0
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -0
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts +16 -0
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/types/custom_auth/index.d.ts +37 -0
- package/types/custom_auth/index.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.d.ts +18 -0
- package/types/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.d.ts.map +1 -0
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +22 -0
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -0
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +19 -0
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateParametersV2.d.ts +3 -0
- package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateParametersV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.d.ts +9 -0
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.d.ts +22 -0
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.d.ts +12 -0
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +21 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +17 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +9 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +17 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +24 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +4 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.d.ts +14 -0
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.d.ts +20 -0
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +15 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +8 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +15 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +11 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +19 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +14 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +10 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -0
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +13 -0
- package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/types/webBrokerBridge/PerfEventNames.d.ts +30 -0
- package/types/webBrokerBridge/PerfEventNames.d.ts.map +1 -0
- package/types/webBrokerBridge/index.d.ts +1 -0
- package/types/webBrokerBridge/index.d.ts.map +1 -1
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { HttpMethod } from "../../http_client/IHttpClient.js";
|
|
7
|
+
import { BaseApiClientV2 } from "./BaseApiClientV2.js";
|
|
8
|
+
import {
|
|
9
|
+
ResetPasswordUpdateResultV2,
|
|
10
|
+
ResetPasswordPollResultV2,
|
|
11
|
+
} from "./result/ResetPasswordResultsV2.js";
|
|
12
|
+
import {
|
|
13
|
+
ResetPasswordStartApiResultV2,
|
|
14
|
+
SignInStartApiResultV2,
|
|
15
|
+
StartResultV2,
|
|
16
|
+
StartMethodV2,
|
|
17
|
+
ChallengeResultV2,
|
|
18
|
+
ChallengeNextActionV2,
|
|
19
|
+
ChallengeVerificationResultV2,
|
|
20
|
+
VerifyResultV2,
|
|
21
|
+
VerifyNextActionV2,
|
|
22
|
+
AuthenticationFactorV2,
|
|
23
|
+
} from "./result/BaseResultsV2.js";
|
|
24
|
+
import {
|
|
25
|
+
SignUpStartApiResultV2,
|
|
26
|
+
SignUpSubmitAttributesApiResultV2,
|
|
27
|
+
SignUpSubmitAttributesNextActionV2,
|
|
28
|
+
} from "./result/SignUpResultsV2.js";
|
|
29
|
+
import {
|
|
30
|
+
PasswordResetStartResponseV2,
|
|
31
|
+
SignInStartResponseV2,
|
|
32
|
+
SignUpStartResponseV2,
|
|
33
|
+
SignUpSubmitAttributesResponseV2,
|
|
34
|
+
ChallengeResponseV2,
|
|
35
|
+
RiskVerificationRequiredResponseV2,
|
|
36
|
+
RiskVerificationResponseV2,
|
|
37
|
+
VerificationChallengeResponseV2,
|
|
38
|
+
VerifyResponseV2,
|
|
39
|
+
UpdatePasswordResponseV2,
|
|
40
|
+
PollResponseV2,
|
|
41
|
+
ParsedResponseV2,
|
|
42
|
+
EmbeddedMethodV2,
|
|
43
|
+
} from "./response/ResponsesV2.js";
|
|
44
|
+
import {
|
|
45
|
+
RequestContextV2,
|
|
46
|
+
PasswordResetStartRequestV2,
|
|
47
|
+
SignInStartRequestV2,
|
|
48
|
+
SignUpStartRequestV2,
|
|
49
|
+
SignUpSubmitAttributesRequestV2,
|
|
50
|
+
ChallengeRequestV2,
|
|
51
|
+
VerifyRequestV2,
|
|
52
|
+
UpdatePasswordRequestV2,
|
|
53
|
+
PollRequestV2,
|
|
54
|
+
} from "./request/RequestsV2.js";
|
|
55
|
+
import {
|
|
56
|
+
CHALLENGE_RELATION,
|
|
57
|
+
COLLECT_ATTRIBUTES_RELATION,
|
|
58
|
+
UPDATE_RELATION,
|
|
59
|
+
VERIFY_RELATION,
|
|
60
|
+
RISK_VERIFY_RELATION,
|
|
61
|
+
AuthenticationMethodTypeV2,
|
|
62
|
+
ResponseStateV2,
|
|
63
|
+
} from "./ApiClientConstantsV2.js";
|
|
64
|
+
import {
|
|
65
|
+
INVALID_HAL_RESPONSE,
|
|
66
|
+
NO_AUTHENTICATION_METHODS,
|
|
67
|
+
UNEXPECTED_AUTHENTICATION_FACTOR,
|
|
68
|
+
} from "./ErrorCodesV2.js";
|
|
69
|
+
import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
* Native Auth V2 network client that follows server-provided HAL links.
|
|
73
|
+
* Flow-specific entry methods reuse shared challenge, verification, and token operations.
|
|
74
|
+
*/
|
|
75
|
+
export class CustomAuthApiClientV2 extends BaseApiClientV2 {
|
|
76
|
+
/*
|
|
77
|
+
* Starts the reset-password flow using a server-provided link.
|
|
78
|
+
*/
|
|
79
|
+
async resetPasswordStart(
|
|
80
|
+
resetPasswordHref: string,
|
|
81
|
+
request: PasswordResetStartRequestV2,
|
|
82
|
+
context: RequestContextV2
|
|
83
|
+
): Promise<ResetPasswordStartApiResultV2> {
|
|
84
|
+
return this.sendStartRequest(resetPasswordHref, request, context);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
* Starts sign-in using a server-provided link.
|
|
89
|
+
*/
|
|
90
|
+
async signInStart(
|
|
91
|
+
signInHref: string,
|
|
92
|
+
request: SignInStartRequestV2,
|
|
93
|
+
context: RequestContextV2
|
|
94
|
+
): Promise<SignInStartApiResultV2> {
|
|
95
|
+
const result = await this.sendStartRequest(
|
|
96
|
+
signInHref,
|
|
97
|
+
request,
|
|
98
|
+
context
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
* Starts sign-up using a server-provided link.
|
|
106
|
+
*/
|
|
107
|
+
async signUpStart(
|
|
108
|
+
signUpHref: string,
|
|
109
|
+
request: SignUpStartRequestV2,
|
|
110
|
+
context: RequestContextV2
|
|
111
|
+
): Promise<SignUpStartApiResultV2> {
|
|
112
|
+
const parsedResponse =
|
|
113
|
+
await this.sendActionRequest<SignUpStartResponseV2>(
|
|
114
|
+
signUpHref,
|
|
115
|
+
HttpMethod.POST,
|
|
116
|
+
request,
|
|
117
|
+
context
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
continuationToken: this.handler.requireContinuationToken(
|
|
122
|
+
parsedResponse.continuationToken,
|
|
123
|
+
parsedResponse.correlationId
|
|
124
|
+
),
|
|
125
|
+
submitAttributesHref: this.handler.requireHref(
|
|
126
|
+
parsedResponse.body._links?.submitAttributes?.href,
|
|
127
|
+
"submitAttributes",
|
|
128
|
+
parsedResponse.correlationId
|
|
129
|
+
),
|
|
130
|
+
attributes: parsedResponse.body.attributes,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
* Submits the initial sign-up attributes. A successful response has already
|
|
136
|
+
* sent the email code and supplies the links needed to verify or resend it.
|
|
137
|
+
*/
|
|
138
|
+
async submitSignUpAttributes(
|
|
139
|
+
submitAttributesHref: string,
|
|
140
|
+
request: SignUpSubmitAttributesRequestV2,
|
|
141
|
+
context: RequestContextV2
|
|
142
|
+
): Promise<SignUpSubmitAttributesApiResultV2> {
|
|
143
|
+
const parsedResponse =
|
|
144
|
+
await this.sendActionRequest<SignUpSubmitAttributesResponseV2>(
|
|
145
|
+
submitAttributesHref,
|
|
146
|
+
HttpMethod.POST,
|
|
147
|
+
request,
|
|
148
|
+
context
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const correlationId = parsedResponse.correlationId;
|
|
152
|
+
const continuationToken = this.handler.requireContinuationToken(
|
|
153
|
+
parsedResponse.continuationToken,
|
|
154
|
+
correlationId
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
if (parsedResponse.body.state === ResponseStateV2.CONTINUE) {
|
|
158
|
+
return {
|
|
159
|
+
nextAction: SignUpSubmitAttributesNextActionV2.CONTINUE,
|
|
160
|
+
continuationToken,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (parsedResponse.body.action === COLLECT_ATTRIBUTES_RELATION) {
|
|
165
|
+
return {
|
|
166
|
+
nextAction:
|
|
167
|
+
SignUpSubmitAttributesNextActionV2.COLLECT_ATTRIBUTES,
|
|
168
|
+
continuationToken,
|
|
169
|
+
attributes: parsedResponse.body.attributes ?? [],
|
|
170
|
+
submitAttributesHref: this.handler.requireHref(
|
|
171
|
+
parsedResponse.body._links?.submitAttributes?.href,
|
|
172
|
+
"submitAttributes",
|
|
173
|
+
correlationId
|
|
174
|
+
),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (parsedResponse.body.action === VERIFY_RELATION) {
|
|
179
|
+
return {
|
|
180
|
+
...this.toChallengeVerificationResult(parsedResponse),
|
|
181
|
+
attributes: parsedResponse.body.attributes,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const message =
|
|
186
|
+
"Invalid HAL response: sign-up attribute submission returned no known next action";
|
|
187
|
+
this.logger?.error(message, correlationId);
|
|
188
|
+
|
|
189
|
+
throw new CustomAuthApiError(
|
|
190
|
+
INVALID_HAL_RESPONSE,
|
|
191
|
+
message,
|
|
192
|
+
correlationId
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/*
|
|
197
|
+
* Requests the selected method's challenge and returns the data needed for verification.
|
|
198
|
+
*/
|
|
199
|
+
async requestChallenge(
|
|
200
|
+
challengeHref: string,
|
|
201
|
+
request: ChallengeRequestV2,
|
|
202
|
+
context: RequestContextV2
|
|
203
|
+
): Promise<ChallengeResultV2> {
|
|
204
|
+
const parsedResponse =
|
|
205
|
+
await this.sendActionRequest<ChallengeResponseV2>(
|
|
206
|
+
challengeHref,
|
|
207
|
+
HttpMethod.POST,
|
|
208
|
+
request,
|
|
209
|
+
context
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
return this.toChallengeResult(parsedResponse);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
async verifyRisk(
|
|
216
|
+
riskVerifyHref: string,
|
|
217
|
+
request: ChallengeRequestV2,
|
|
218
|
+
context: RequestContextV2
|
|
219
|
+
): Promise<ChallengeVerificationResultV2> {
|
|
220
|
+
const parsedResponse =
|
|
221
|
+
await this.sendActionRequest<RiskVerificationResponseV2>(
|
|
222
|
+
riskVerifyHref,
|
|
223
|
+
HttpMethod.POST,
|
|
224
|
+
request,
|
|
225
|
+
context
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
if (parsedResponse.body.action !== VERIFY_RELATION) {
|
|
229
|
+
throw new CustomAuthApiError(
|
|
230
|
+
INVALID_HAL_RESPONSE,
|
|
231
|
+
"Invalid HAL response: SMS risk verification returned no known next action",
|
|
232
|
+
parsedResponse.correlationId
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (
|
|
237
|
+
parsedResponse.body.type?.toLowerCase() !==
|
|
238
|
+
AuthenticationMethodTypeV2.SMS
|
|
239
|
+
) {
|
|
240
|
+
throw new CustomAuthApiError(
|
|
241
|
+
INVALID_HAL_RESPONSE,
|
|
242
|
+
"Invalid HAL response: SMS risk verification returned a non-SMS challenge",
|
|
243
|
+
parsedResponse.correlationId
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return this.toChallengeVerificationResult(parsedResponse);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/*
|
|
251
|
+
* Verifies the submitted credential and returns the server-directed next action.
|
|
252
|
+
*/
|
|
253
|
+
async verifyChallenge(
|
|
254
|
+
verifyHref: string,
|
|
255
|
+
request: VerifyRequestV2,
|
|
256
|
+
context: RequestContextV2
|
|
257
|
+
): Promise<VerifyResultV2> {
|
|
258
|
+
const parsedResponse = await this.sendActionRequest<VerifyResponseV2>(
|
|
259
|
+
verifyHref,
|
|
260
|
+
HttpMethod.POST,
|
|
261
|
+
request,
|
|
262
|
+
context
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
return this.toVerifyResult(parsedResponse);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/*
|
|
269
|
+
* Submits the new password and returns the link used to poll for completion.
|
|
270
|
+
*/
|
|
271
|
+
async submitNewPassword(
|
|
272
|
+
updateHref: string,
|
|
273
|
+
request: UpdatePasswordRequestV2,
|
|
274
|
+
context: RequestContextV2
|
|
275
|
+
): Promise<ResetPasswordUpdateResultV2> {
|
|
276
|
+
const parsedResponse =
|
|
277
|
+
await this.sendActionRequest<UpdatePasswordResponseV2>(
|
|
278
|
+
updateHref,
|
|
279
|
+
HttpMethod.PUT,
|
|
280
|
+
request,
|
|
281
|
+
context
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
const nextContinuationToken = this.handler.requireContinuationToken(
|
|
285
|
+
parsedResponse.continuationToken,
|
|
286
|
+
parsedResponse.correlationId
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
return {
|
|
290
|
+
continuationToken: nextContinuationToken,
|
|
291
|
+
pollHref: this.handler.requireHref(
|
|
292
|
+
parsedResponse.body._links?.poll?.href,
|
|
293
|
+
"poll",
|
|
294
|
+
parsedResponse.correlationId
|
|
295
|
+
),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/*
|
|
300
|
+
* Polls once for reset completion and returns the next server-provided link.
|
|
301
|
+
*/
|
|
302
|
+
async poll(
|
|
303
|
+
pollHref: string,
|
|
304
|
+
request: PollRequestV2,
|
|
305
|
+
context: RequestContextV2
|
|
306
|
+
): Promise<ResetPasswordPollResultV2> {
|
|
307
|
+
const parsedResponse = await this.sendActionRequest<PollResponseV2>(
|
|
308
|
+
pollHref,
|
|
309
|
+
HttpMethod.POST,
|
|
310
|
+
request,
|
|
311
|
+
context
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
const isCompleted =
|
|
315
|
+
parsedResponse.body.state === ResponseStateV2.CONTINUE;
|
|
316
|
+
|
|
317
|
+
return {
|
|
318
|
+
continuationToken:
|
|
319
|
+
parsedResponse.continuationToken ?? request.continuationToken,
|
|
320
|
+
isCompleted,
|
|
321
|
+
pollHref: isCompleted
|
|
322
|
+
? undefined
|
|
323
|
+
: this.handler.requireHref(
|
|
324
|
+
parsedResponse.body._links?.poll?.href,
|
|
325
|
+
"poll",
|
|
326
|
+
parsedResponse.correlationId
|
|
327
|
+
),
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
private async sendStartRequest(
|
|
332
|
+
startHref: string,
|
|
333
|
+
request: PasswordResetStartRequestV2 | SignInStartRequestV2,
|
|
334
|
+
context: RequestContextV2
|
|
335
|
+
): Promise<StartResultV2> {
|
|
336
|
+
const parsedResponse = await this.sendActionRequest<
|
|
337
|
+
PasswordResetStartResponseV2 | SignInStartResponseV2
|
|
338
|
+
>(startHref, HttpMethod.POST, request, context);
|
|
339
|
+
|
|
340
|
+
const continuationToken = this.handler.requireContinuationToken(
|
|
341
|
+
parsedResponse.continuationToken,
|
|
342
|
+
parsedResponse.correlationId
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
continuationToken,
|
|
347
|
+
methods: this.resolveMethods(
|
|
348
|
+
parsedResponse.body,
|
|
349
|
+
parsedResponse.correlationId
|
|
350
|
+
),
|
|
351
|
+
authenticationFactor: this.resolveAuthenticationFactor(
|
|
352
|
+
parsedResponse.body.challengeContext?.authenticationFactor,
|
|
353
|
+
parsedResponse.correlationId
|
|
354
|
+
),
|
|
355
|
+
scenario: parsedResponse.body.scenario,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
private toVerifyResult(
|
|
360
|
+
parsedResponse: ParsedResponseV2<VerifyResponseV2>
|
|
361
|
+
): VerifyResultV2 {
|
|
362
|
+
const correlationId = parsedResponse.correlationId;
|
|
363
|
+
const continuationToken = this.handler.requireContinuationToken(
|
|
364
|
+
parsedResponse.continuationToken,
|
|
365
|
+
correlationId
|
|
366
|
+
);
|
|
367
|
+
|
|
368
|
+
if (parsedResponse.body.state === ResponseStateV2.CONTINUE) {
|
|
369
|
+
return {
|
|
370
|
+
nextAction: VerifyNextActionV2.CONTINUE,
|
|
371
|
+
continuationToken,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (parsedResponse.body.action === COLLECT_ATTRIBUTES_RELATION) {
|
|
376
|
+
return {
|
|
377
|
+
nextAction: VerifyNextActionV2.COLLECT_ATTRIBUTES,
|
|
378
|
+
continuationToken,
|
|
379
|
+
attributes: parsedResponse.body.attributes ?? [],
|
|
380
|
+
submitAttributesHref: this.handler.requireHref(
|
|
381
|
+
parsedResponse.body._links?.submitAttributes?.href,
|
|
382
|
+
"submitAttributes",
|
|
383
|
+
correlationId
|
|
384
|
+
),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (parsedResponse.body.action === UPDATE_RELATION) {
|
|
389
|
+
return {
|
|
390
|
+
nextAction: VerifyNextActionV2.UPDATE,
|
|
391
|
+
continuationToken,
|
|
392
|
+
updateHref: this.handler.requireHref(
|
|
393
|
+
parsedResponse.body._links?.update?.href,
|
|
394
|
+
"update",
|
|
395
|
+
correlationId
|
|
396
|
+
),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (parsedResponse.body.action === CHALLENGE_RELATION) {
|
|
401
|
+
return {
|
|
402
|
+
nextAction: VerifyNextActionV2.CHALLENGE,
|
|
403
|
+
continuationToken,
|
|
404
|
+
authenticationFactor: this.resolveAuthenticationFactor(
|
|
405
|
+
parsedResponse.body.challengeContext?.authenticationFactor,
|
|
406
|
+
correlationId
|
|
407
|
+
),
|
|
408
|
+
methods: this.resolveMethods(
|
|
409
|
+
parsedResponse.body,
|
|
410
|
+
correlationId
|
|
411
|
+
),
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
throw new CustomAuthApiError(
|
|
416
|
+
INVALID_HAL_RESPONSE,
|
|
417
|
+
"Invalid HAL response: verify returned no known next action",
|
|
418
|
+
correlationId
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
private resolveAuthenticationFactor(
|
|
423
|
+
authenticationFactor: string | undefined,
|
|
424
|
+
correlationId: string
|
|
425
|
+
): AuthenticationFactorV2 {
|
|
426
|
+
if (
|
|
427
|
+
authenticationFactor === AuthenticationFactorV2.SINGLE_FACTOR ||
|
|
428
|
+
authenticationFactor === AuthenticationFactorV2.MULTI_FACTOR
|
|
429
|
+
) {
|
|
430
|
+
return authenticationFactor;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
const message = authenticationFactor
|
|
434
|
+
? `Unexpected authentication factor '${authenticationFactor}'.`
|
|
435
|
+
: "The response did not include an authentication factor.";
|
|
436
|
+
this.logger?.error(message, correlationId);
|
|
437
|
+
|
|
438
|
+
throw new CustomAuthApiError(
|
|
439
|
+
UNEXPECTED_AUTHENTICATION_FACTOR,
|
|
440
|
+
message,
|
|
441
|
+
correlationId
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
private toChallengeResult(
|
|
446
|
+
parsedResponse: ParsedResponseV2<ChallengeResponseV2>
|
|
447
|
+
): ChallengeResultV2 {
|
|
448
|
+
if (parsedResponse.body.action === RISK_VERIFY_RELATION) {
|
|
449
|
+
const riskResponse =
|
|
450
|
+
parsedResponse.body as RiskVerificationRequiredResponseV2;
|
|
451
|
+
|
|
452
|
+
return {
|
|
453
|
+
nextAction: ChallengeNextActionV2.RISK_VERIFY,
|
|
454
|
+
continuationToken: this.handler.requireContinuationToken(
|
|
455
|
+
parsedResponse.continuationToken,
|
|
456
|
+
parsedResponse.correlationId
|
|
457
|
+
),
|
|
458
|
+
riskVerifyHref: this.handler.requireHref(
|
|
459
|
+
riskResponse._links?.riskverify?.href,
|
|
460
|
+
RISK_VERIFY_RELATION,
|
|
461
|
+
parsedResponse.correlationId
|
|
462
|
+
),
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
if (parsedResponse.body.action === VERIFY_RELATION) {
|
|
467
|
+
return this.toChallengeVerificationResult(
|
|
468
|
+
parsedResponse as ParsedResponseV2<VerificationChallengeResponseV2>
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
throw new CustomAuthApiError(
|
|
473
|
+
INVALID_HAL_RESPONSE,
|
|
474
|
+
"Invalid HAL response: challenge returned no known next action",
|
|
475
|
+
parsedResponse.correlationId
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
private toChallengeVerificationResult(
|
|
480
|
+
parsedResponse: ParsedResponseV2<VerificationChallengeResponseV2>
|
|
481
|
+
): ChallengeVerificationResultV2 {
|
|
482
|
+
const continuationToken = this.handler.requireContinuationToken(
|
|
483
|
+
parsedResponse.continuationToken,
|
|
484
|
+
parsedResponse.correlationId
|
|
485
|
+
);
|
|
486
|
+
const links = parsedResponse.body._links;
|
|
487
|
+
const codeMetadata =
|
|
488
|
+
"hint" in parsedResponse.body ||
|
|
489
|
+
"codeLength" in parsedResponse.body ||
|
|
490
|
+
"payload" in parsedResponse.body
|
|
491
|
+
? parsedResponse.body
|
|
492
|
+
: undefined;
|
|
493
|
+
|
|
494
|
+
return {
|
|
495
|
+
nextAction: ChallengeNextActionV2.VERIFY,
|
|
496
|
+
continuationToken,
|
|
497
|
+
verifyHref: this.handler.requireHref(
|
|
498
|
+
links?.verify?.href,
|
|
499
|
+
"verify",
|
|
500
|
+
parsedResponse.correlationId
|
|
501
|
+
),
|
|
502
|
+
resendHref:
|
|
503
|
+
links && "resend" in links ? links.resend?.href : undefined,
|
|
504
|
+
codeLength:
|
|
505
|
+
codeMetadata?.codeLength ?? codeMetadata?.payload?.codeLength,
|
|
506
|
+
hint: codeMetadata?.hint,
|
|
507
|
+
type: parsedResponse.body.type,
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
private resolveMethods(
|
|
512
|
+
body: {
|
|
513
|
+
_embedded?: {
|
|
514
|
+
methods?: EmbeddedMethodV2[];
|
|
515
|
+
};
|
|
516
|
+
},
|
|
517
|
+
correlationId: string
|
|
518
|
+
): StartMethodV2[] {
|
|
519
|
+
const methods = this.handler.requireMethods(
|
|
520
|
+
body._embedded?.methods,
|
|
521
|
+
correlationId
|
|
522
|
+
);
|
|
523
|
+
const resolved: StartMethodV2[] = [];
|
|
524
|
+
|
|
525
|
+
methods.forEach((method, index) => {
|
|
526
|
+
const href = method._links?.challenge?.href;
|
|
527
|
+
|
|
528
|
+
if (href) {
|
|
529
|
+
resolved.push({
|
|
530
|
+
id: method.id ?? method.type ?? `method-${index}`,
|
|
531
|
+
type: method.type,
|
|
532
|
+
hint: method.hint,
|
|
533
|
+
challengeHref: href,
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
if (resolved.length === 0) {
|
|
539
|
+
this.logger?.error(
|
|
540
|
+
"V2 start response has no authentication method advertising a challenge link",
|
|
541
|
+
correlationId
|
|
542
|
+
);
|
|
543
|
+
|
|
544
|
+
throw new CustomAuthApiError(
|
|
545
|
+
NO_AUTHENTICATION_METHODS,
|
|
546
|
+
"The flow-start response contains no authentication method with a challenge link",
|
|
547
|
+
correlationId
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
return resolved;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const HTTP_REQUEST_FAILED = "http_request_failed";
|
|
7
|
+
export const REDIRECT_TO_WEB = "redirect_to_web";
|
|
8
|
+
export const UNEXPECTED_ERROR = "unexpected_error";
|
|
9
|
+
export const INVALID_INPUT = "invalid_input";
|
|
10
|
+
export const AUTH_CODE_MISSING = "authorization_code_missing";
|
|
11
|
+
export const INVALID_TOKEN_RESPONSE = "invalid_token_response";
|
|
12
|
+
export const INVALID_RESPONSE_BODY = "invalid_response_body";
|
|
13
|
+
export const CONTINUATION_TOKEN_MISSING = "continuation_token_missing";
|
|
14
|
+
export const INVALID_HAL_RESPONSE = "invalid_hal_response";
|
|
15
|
+
export const RESET_PASSWORD_UNSUPPORTED = "reset_password_unsupported";
|
|
16
|
+
export const SIGN_IN_UNSUPPORTED = "sign_in_unsupported";
|
|
17
|
+
export const SIGN_UP_UNSUPPORTED = "sign_up_unsupported";
|
|
18
|
+
export const CONTINUATION_LINK_MISSING = "continuation_link_missing";
|
|
19
|
+
export const RESET_PASSWORD_TIMEOUT = "reset_password_timeout";
|
|
20
|
+
export const UNSUPPORTED_FLOW_STEP = "unsupported_flow_step";
|
|
21
|
+
export const UNSUPPORTED_FLOW_TRANSITION = "unsupported_flow_transition";
|
|
22
|
+
export const NO_AUTHENTICATION_METHODS = "no_authentication_methods";
|
|
23
|
+
export const UNEXPECTED_AUTHENTICATION_FACTOR =
|
|
24
|
+
"unexpected_authentication_factor";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ParsedUrlError } from "../../../error/ParsedUrlError.js";
|
|
7
|
+
import { InvalidUrl } from "../../../error/ParsedUrlErrorCodes.js";
|
|
8
|
+
|
|
9
|
+
const API_MARKERS = ["/api/", "/oauth2/"];
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Resolves a HAL href against the configured authority. Absolute HTTP(S) URLs
|
|
13
|
+
* pass through; relative URLs retain their API path and query while using the
|
|
14
|
+
* configured tenant path.
|
|
15
|
+
*
|
|
16
|
+
* TODO: Remove tenant-path rewriting once the service consistently returns links that can be
|
|
17
|
+
* resolved directly against the configured authority.
|
|
18
|
+
*/
|
|
19
|
+
export function resolveHrefV2(base: URL, href: string): URL {
|
|
20
|
+
const trimmed = href.trim();
|
|
21
|
+
|
|
22
|
+
if (!trimmed) {
|
|
23
|
+
throw new ParsedUrlError(InvalidUrl, "The HAL href cannot be empty");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const absolute = tryParseAbsolute(trimmed);
|
|
27
|
+
|
|
28
|
+
if (absolute) {
|
|
29
|
+
return absolute;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let resolved: URL;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
resolved = new URL(trimmed, base.origin);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
throw new ParsedUrlError(
|
|
38
|
+
InvalidUrl,
|
|
39
|
+
`The HAL href "${href}" could not be resolved: ${e}`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (resolved.protocol !== "http:" && resolved.protocol !== "https:") {
|
|
44
|
+
throw new ParsedUrlError(
|
|
45
|
+
InvalidUrl,
|
|
46
|
+
`The HAL href "${href}" must use the HTTP or HTTPS protocol`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const tenantPath = base.pathname.endsWith("/")
|
|
51
|
+
? base.pathname.slice(0, -1)
|
|
52
|
+
: base.pathname;
|
|
53
|
+
|
|
54
|
+
resolved.pathname = tenantPath + apiPath(resolved.pathname);
|
|
55
|
+
|
|
56
|
+
return resolved;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function tryParseAbsolute(href: string): URL | undefined {
|
|
60
|
+
try {
|
|
61
|
+
const url = new URL(href);
|
|
62
|
+
|
|
63
|
+
return url.protocol === "http:" || url.protocol === "https:"
|
|
64
|
+
? url
|
|
65
|
+
: undefined;
|
|
66
|
+
} catch {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function apiPath(path: string): string {
|
|
72
|
+
for (const marker of API_MARKERS) {
|
|
73
|
+
const index = path.indexOf(marker);
|
|
74
|
+
|
|
75
|
+
if (index >= 0) {
|
|
76
|
+
return path.slice(index);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
81
|
+
}
|