@azure/msal-browser 5.22.0 → 5.23.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 +23 -3
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +5 -2
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +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 +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +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 +8 -2
- 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 +189 -5
- 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 +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 +195 -11
- package/lib/custom-auth-path/msal-custom-auth.cjs +2975 -198
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +2975 -198
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +2 -2
- package/lib/msal-browser.cjs +155 -81
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +155 -81
- 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 +1 -1
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +40 -2
- package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +4 -1
- package/src/broker/nativeBroker/PlatformAuthRequest.ts +118 -6
- package/src/broker/nativeBroker/PlatformAuthResponse.ts +14 -1
- 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 +23 -2
- package/src/interaction_client/RedirectClient.ts +15 -5
- package/src/packageMetadata.ts +1 -1
- package/src/webBrokerBridge/PerfEventNames.ts +43 -0
- package/src/webBrokerBridge/index.ts +26 -0
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.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/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/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/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,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Logger } from "@azure/msal-common/browser";
|
|
7
|
+
import { HttpHeaderKeys } from "../../../../CustomAuthConstants.js";
|
|
8
|
+
import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
|
|
9
|
+
import { normalizeServerErrorV2 } from "./response/ErrorNormalizerV2.js";
|
|
10
|
+
import { EmbeddedMethodV2, ParsedResponseV2 } from "./response/ResponsesV2.js";
|
|
11
|
+
import { ResponseStateV2 } from "./ApiClientConstantsV2.js";
|
|
12
|
+
import {
|
|
13
|
+
CONTINUATION_TOKEN_MISSING,
|
|
14
|
+
INVALID_HAL_RESPONSE,
|
|
15
|
+
INVALID_RESPONSE_BODY,
|
|
16
|
+
NO_AUTHENTICATION_METHODS,
|
|
17
|
+
REDIRECT_TO_WEB,
|
|
18
|
+
} from "./ErrorCodesV2.js";
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
* Turns a raw HTTP response from a V2 endpoint into a typed, checked envelope, and validates HAL
|
|
22
|
+
* relations. Raw-preserving: the body keeps its HAL `_links`/`_embedded` shape so the api-client
|
|
23
|
+
* navigates typed hrefs directly. Parsing never throws on a non-200 status - every V2 response
|
|
24
|
+
* (including the entry response) carries a meaningful body, so only a non-object body is a hard
|
|
25
|
+
* failure; the wire error is normalized onto the envelope (`error`). Required response values use
|
|
26
|
+
* shared guards after callers read their strongly typed response properties directly.
|
|
27
|
+
*/
|
|
28
|
+
export class ResponseHandlerV2 {
|
|
29
|
+
constructor(private readonly logger?: Logger) {}
|
|
30
|
+
|
|
31
|
+
async parseResponse<T>(
|
|
32
|
+
response: Response,
|
|
33
|
+
requestCorrelationId: string
|
|
34
|
+
): Promise<ParsedResponseV2<T>> {
|
|
35
|
+
const correlationId =
|
|
36
|
+
response.headers.get(HttpHeaderKeys.X_MS_REQUEST_ID) ??
|
|
37
|
+
requestCorrelationId;
|
|
38
|
+
|
|
39
|
+
const json = await this.parseBody(response, correlationId);
|
|
40
|
+
|
|
41
|
+
const state = typeof json.state === "string" ? json.state : undefined;
|
|
42
|
+
|
|
43
|
+
const continuationToken =
|
|
44
|
+
(typeof json.continuationToken === "string"
|
|
45
|
+
? json.continuationToken
|
|
46
|
+
: undefined) ??
|
|
47
|
+
(typeof json.continuation_token === "string"
|
|
48
|
+
? json.continuation_token
|
|
49
|
+
: undefined);
|
|
50
|
+
|
|
51
|
+
const flatError =
|
|
52
|
+
typeof json.error === "string" ? json.error : undefined;
|
|
53
|
+
|
|
54
|
+
const isWebFallbackRequired =
|
|
55
|
+
flatError === REDIRECT_TO_WEB ||
|
|
56
|
+
state === ResponseStateV2.WEB_FALLBACK_REQUIRED;
|
|
57
|
+
|
|
58
|
+
const error = normalizeServerErrorV2(json);
|
|
59
|
+
|
|
60
|
+
// Surface the header correlation id on the body (HalResponseBaseV2.correlationId).
|
|
61
|
+
json.correlationId = correlationId;
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
statusCode: response.status,
|
|
65
|
+
correlationId,
|
|
66
|
+
continuationToken,
|
|
67
|
+
isWebFallbackRequired,
|
|
68
|
+
error,
|
|
69
|
+
body: json as T,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Required href; throws when it is absent.
|
|
74
|
+
requireHref(
|
|
75
|
+
href: string | undefined,
|
|
76
|
+
relation: string,
|
|
77
|
+
correlationId: string,
|
|
78
|
+
missingHrefError?: { code: string; message: string }
|
|
79
|
+
): string {
|
|
80
|
+
if (!href) {
|
|
81
|
+
const errorCode = missingHrefError?.code ?? INVALID_HAL_RESPONSE;
|
|
82
|
+
const errorMessage =
|
|
83
|
+
missingHrefError?.message ??
|
|
84
|
+
`Invalid HAL response: missing '${relation}' link`;
|
|
85
|
+
|
|
86
|
+
this.logger?.error(errorMessage, correlationId);
|
|
87
|
+
|
|
88
|
+
throw new CustomAuthApiError(
|
|
89
|
+
errorCode,
|
|
90
|
+
errorMessage,
|
|
91
|
+
correlationId
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return href;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Required continuation token to advance the flow; throws when absent.
|
|
99
|
+
requireContinuationToken(
|
|
100
|
+
continuationToken: string | undefined,
|
|
101
|
+
correlationId: string
|
|
102
|
+
): string {
|
|
103
|
+
if (!continuationToken) {
|
|
104
|
+
this.logger?.error(
|
|
105
|
+
"V2 HAL response is missing the required continuation token",
|
|
106
|
+
correlationId
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
throw new CustomAuthApiError(
|
|
110
|
+
CONTINUATION_TOKEN_MISSING,
|
|
111
|
+
"Continuation token is missing in the response",
|
|
112
|
+
correlationId
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return continuationToken;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Required embedded auth methods; throws when `_embedded.methods` is absent or empty.
|
|
120
|
+
requireMethods(
|
|
121
|
+
methods: EmbeddedMethodV2[] | undefined,
|
|
122
|
+
correlationId: string
|
|
123
|
+
): EmbeddedMethodV2[] {
|
|
124
|
+
if (!methods?.length) {
|
|
125
|
+
this.logger?.error(
|
|
126
|
+
"V2 HAL response is missing the required embedded authentication methods",
|
|
127
|
+
correlationId
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
throw new CustomAuthApiError(
|
|
131
|
+
NO_AUTHENTICATION_METHODS,
|
|
132
|
+
"Invalid HAL response: no embedded authentication methods",
|
|
133
|
+
correlationId
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return methods;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private async parseBody(
|
|
141
|
+
response: Response,
|
|
142
|
+
correlationId: string
|
|
143
|
+
): Promise<Record<string, unknown>> {
|
|
144
|
+
let json: unknown;
|
|
145
|
+
|
|
146
|
+
try {
|
|
147
|
+
json = await response.json();
|
|
148
|
+
} catch (e) {
|
|
149
|
+
this.logger?.error(
|
|
150
|
+
"V2 response serialization failed: body is not valid JSON",
|
|
151
|
+
correlationId
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
throw new CustomAuthApiError(
|
|
155
|
+
INVALID_RESPONSE_BODY,
|
|
156
|
+
`V2 response body is not valid JSON: '${e}'`,
|
|
157
|
+
correlationId
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// response.json() accepts primitives/arrays; every V2 body must be a JSON object.
|
|
162
|
+
if (typeof json !== "object" || json === null || Array.isArray(json)) {
|
|
163
|
+
this.logger?.error(
|
|
164
|
+
"V2 response serialization failed: body is not a JSON object",
|
|
165
|
+
correlationId
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
throw new CustomAuthApiError(
|
|
169
|
+
INVALID_RESPONSE_BODY,
|
|
170
|
+
"V2 response body is not a JSON object",
|
|
171
|
+
correlationId
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return json as Record<string, unknown>;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ApiRequestBase } from "../../types/ApiTypesBase.js";
|
|
7
|
+
import { UserAccountAttributes } from "../../../../../UserAccountAttributes.js";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Per-request context threaded through every V2 network-layer call. These shared fields drive
|
|
11
|
+
* headers and correlation only; they are never serialized into the V2 request body.
|
|
12
|
+
*/
|
|
13
|
+
export type RequestContextV2 = ApiRequestBase;
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Base for the V2 OAuth form-encoded (`application/x-www-form-urlencoded`) requests that carry
|
|
17
|
+
* `client_id` in the body: authorize-challenge entry and token. Unlike the HAL `/api` JSON
|
|
18
|
+
* endpoints, these require `client_id` declared explicitly because the V2 api-client does not
|
|
19
|
+
* reuse the V1 injection layer.
|
|
20
|
+
*/
|
|
21
|
+
export interface OAuthFormRequestV2 {
|
|
22
|
+
client_id: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Entry (POST /oauth2/v2.0/authorize-challenge): the flow's front door. OAuth form-encoded
|
|
27
|
+
* and carries only `client_id` (via OAuthFormRequestV2). The response
|
|
28
|
+
* (`AuthorizeChallengeEntryResponseV2`) returns the seed `continuation_token` and the flat
|
|
29
|
+
* `reset_password`/`sign_in`/`sign_up` hrefs.
|
|
30
|
+
*/
|
|
31
|
+
export interface AuthorizeChallengeEntryRequestV2 extends OAuthFormRequestV2 {
|
|
32
|
+
scope?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* Resume (POST /oauth2/v2.0/authorize-challenge): redeem the continuation token for an
|
|
37
|
+
* authorization code. OAuth form-encoded, but - unlike the entry and token requests - it sends
|
|
38
|
+
* ONLY `continuation_token` and does NOT carry `client_id`.
|
|
39
|
+
*/
|
|
40
|
+
export interface AuthorizeChallengeContinueRequestV2 {
|
|
41
|
+
continuation_token: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* Token exchange (POST /oauth2/v2.0/token). Redeems the authorization `code` for
|
|
46
|
+
* tokens. OAuth form-encoded, so it carries `client_id` (via OAuthFormRequestV2). `client_info`
|
|
47
|
+
* is required so the server returns the `client_info` blob (base64 `{uid, utid}`) that MSAL needs
|
|
48
|
+
* to build the account's home id.
|
|
49
|
+
*/
|
|
50
|
+
export interface TokenRequestV2 extends OAuthFormRequestV2 {
|
|
51
|
+
grant_type: string;
|
|
52
|
+
code: string;
|
|
53
|
+
client_info: string;
|
|
54
|
+
scope?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Compound token-completion operation. The continuation is first redeemed for
|
|
59
|
+
* an authorization code, which is then exchanged using the requested scopes.
|
|
60
|
+
*/
|
|
61
|
+
export interface CompleteWithTokensRequestV2 {
|
|
62
|
+
continuationToken: string;
|
|
63
|
+
scopes: string[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* Base for raw-JSON action request bodies. Every server-driven request carries the
|
|
68
|
+
* `continuationToken` that threads the flow forward; operation-specific fields (`username`, `otp`,
|
|
69
|
+
* `newPassword`) are added by the concrete request types. `sendActionRequest` accepts this
|
|
70
|
+
* base so callers must pass a real action request DTO, without the shared base client depending on
|
|
71
|
+
* any one flow's request types.
|
|
72
|
+
*/
|
|
73
|
+
export interface ActionRequestBaseV2 {
|
|
74
|
+
continuationToken: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface StartRequestV2 extends ActionRequestBaseV2 {
|
|
78
|
+
username: string;
|
|
79
|
+
}
|
|
80
|
+
export type PasswordResetStartRequestV2 = StartRequestV2;
|
|
81
|
+
|
|
82
|
+
export type SignInStartRequestV2 = StartRequestV2;
|
|
83
|
+
|
|
84
|
+
export type SignUpStartRequestV2 = ActionRequestBaseV2;
|
|
85
|
+
|
|
86
|
+
export interface SignUpSubmitAttributesRequestV2 extends ActionRequestBaseV2 {
|
|
87
|
+
attributes: UserAccountAttributes & {
|
|
88
|
+
email?: string;
|
|
89
|
+
password?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Request or resend a challenge.
|
|
94
|
+
export type ChallengeRequestV2 = ActionRequestBaseV2;
|
|
95
|
+
|
|
96
|
+
// Submit a single credential to `/methods/{type}/{id}/verify`.
|
|
97
|
+
/*
|
|
98
|
+
* The credential is a distinct top-level key per method type (never overloaded onto one field):
|
|
99
|
+
* email OTP sends `otp`. This is modelled as a discriminated union so the compiler enforces
|
|
100
|
+
* that exactly one credential is present. Password-based verify is a future extension point:
|
|
101
|
+
* add a `VerifyPasswordRequestV2` member (`password: string`) and include it in the union
|
|
102
|
+
* without touching the OTP member.
|
|
103
|
+
*/
|
|
104
|
+
type VerifyRequestBaseV2 = ActionRequestBaseV2;
|
|
105
|
+
|
|
106
|
+
interface VerifyOtpRequestV2 extends VerifyRequestBaseV2 {
|
|
107
|
+
otp: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface VerifyPasswordRequestV2 extends VerifyRequestBaseV2 {
|
|
111
|
+
password: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type VerifyRequestV2 = VerifyOtpRequestV2 | VerifyPasswordRequestV2;
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
* Submit a new password (PUT `/methods/password/{id}`). SSPR (recovery) only — this
|
|
118
|
+
* update-then-poll cycle is part of the password-reset flow, not sign-in. `newPassword`
|
|
119
|
+
* matches the server's HAL body key.
|
|
120
|
+
*/
|
|
121
|
+
export interface UpdatePasswordRequestV2 extends ActionRequestBaseV2 {
|
|
122
|
+
newPassword: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/*
|
|
126
|
+
* Poll for completion (`/methods/password/{id}/pollUpdate`). SSPR (recovery) only.
|
|
127
|
+
* Repeated until the reset finishes.
|
|
128
|
+
*/
|
|
129
|
+
export type PollRequestV2 = ActionRequestBaseV2;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
HalErrorResponseV2,
|
|
8
|
+
OAuthErrorResponseV2,
|
|
9
|
+
ServerErrorV2,
|
|
10
|
+
} from "./ErrorResponsesV2.js";
|
|
11
|
+
import { UNEXPECTED_ERROR } from "../ErrorCodesV2.js";
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Normalizes nested HAL and flat OAuth error bodies into a `ServerErrorV2`.
|
|
15
|
+
* Returns `undefined` when the response contains no recognized error.
|
|
16
|
+
*/
|
|
17
|
+
export function normalizeServerErrorV2(
|
|
18
|
+
body: Record<string, unknown>
|
|
19
|
+
): ServerErrorV2 | undefined {
|
|
20
|
+
const error = body.error;
|
|
21
|
+
|
|
22
|
+
if (error && typeof error === "object") {
|
|
23
|
+
return normalizeHalError(body as HalErrorResponseV2);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (typeof error === "string") {
|
|
27
|
+
return normalizeOAuthError(body as OAuthErrorResponseV2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function normalizeHalError(response: HalErrorResponseV2): ServerErrorV2 {
|
|
34
|
+
const error = response.error ?? {};
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
code: readString(error.code) ?? UNEXPECTED_ERROR,
|
|
38
|
+
message: readString(error.message),
|
|
39
|
+
innerErrorCode: readString(error.innerError?.code),
|
|
40
|
+
attributeValidationDetails: error.innerError?.details,
|
|
41
|
+
correlationId: readString(error.correlationId),
|
|
42
|
+
traceId: readString(error.traceId),
|
|
43
|
+
timestamp: readString(error.timestamp),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function normalizeOAuthError(response: OAuthErrorResponseV2): ServerErrorV2 {
|
|
48
|
+
return {
|
|
49
|
+
code: readString(response.error) ?? UNEXPECTED_ERROR,
|
|
50
|
+
message: readString(response.error_description),
|
|
51
|
+
errorCodes: readNumberArray(response.error_codes),
|
|
52
|
+
correlationId: readString(response.correlation_id),
|
|
53
|
+
traceId: readString(response.trace_id),
|
|
54
|
+
timestamp: readString(response.timestamp),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function readString(value: unknown): string | undefined {
|
|
59
|
+
return typeof value === "string" ? value : undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function readNumberArray(value: unknown): number[] | undefined {
|
|
63
|
+
if (Array.isArray(value) && value.every((v) => typeof v === "number")) {
|
|
64
|
+
return value as number[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Nested error shape returned by the HAL `/api` resource endpoints.
|
|
7
|
+
export interface AttributeValidationDetailV2 {
|
|
8
|
+
attributeIds?: string[];
|
|
9
|
+
code?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface HalErrorResponseV2 {
|
|
14
|
+
error?: {
|
|
15
|
+
code?: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
timestamp?: string;
|
|
18
|
+
traceId?: string;
|
|
19
|
+
correlationId?: string;
|
|
20
|
+
innerError?: {
|
|
21
|
+
code?: string;
|
|
22
|
+
details?: AttributeValidationDetailV2[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Flat error shape returned by the OAuth endpoints (authorize-challenge entry and token).
|
|
28
|
+
export interface OAuthErrorResponseV2 {
|
|
29
|
+
error?: string;
|
|
30
|
+
error_description?: string;
|
|
31
|
+
error_codes?: number[];
|
|
32
|
+
timestamp?: string;
|
|
33
|
+
trace_id?: string;
|
|
34
|
+
correlation_id?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* Normalized server error folded from either wire shape (flat OAuth or nested HAL) into one
|
|
39
|
+
* struct. Response parsing adds it to the envelope so the api-client stays shape-agnostic.
|
|
40
|
+
*/
|
|
41
|
+
export interface ServerErrorV2 {
|
|
42
|
+
code: string;
|
|
43
|
+
message?: string;
|
|
44
|
+
innerErrorCode?: string;
|
|
45
|
+
errorCodes?: number[];
|
|
46
|
+
correlationId?: string;
|
|
47
|
+
traceId?: string;
|
|
48
|
+
timestamp?: string;
|
|
49
|
+
attributeValidationDetails?: AttributeValidationDetailV2[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface HalLink {
|
|
7
|
+
href: string;
|
|
8
|
+
templated?: boolean;
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// A relation may map to a single link or an array of links.
|
|
13
|
+
export type HalLinks = Record<string, HalLink | HalLink[]>;
|
|
14
|
+
|
|
15
|
+
export type HalEmbedded = Record<string, HalResource | HalResource[]>;
|
|
16
|
+
|
|
17
|
+
export interface HalResource {
|
|
18
|
+
_links?: HalLinks;
|
|
19
|
+
_embedded?: HalEmbedded;
|
|
20
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { OAuthErrorResponseV2, ServerErrorV2 } from "./ErrorResponsesV2.js";
|
|
7
|
+
import { HalLink, HalResource } from "./HalResource.js";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Envelope shared by every JSON HAL response. `correlationId` is not on the HAL body -
|
|
11
|
+
* it is injected by the api-client from the response header; the rest are server body fields.
|
|
12
|
+
*/
|
|
13
|
+
export interface HalResponseBaseV2 extends HalResource {
|
|
14
|
+
continuationToken?: string;
|
|
15
|
+
state?: string;
|
|
16
|
+
action?: string;
|
|
17
|
+
scenario?: string;
|
|
18
|
+
challengeContext?: {
|
|
19
|
+
authenticationFactor?: string;
|
|
20
|
+
};
|
|
21
|
+
correlationId?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* A method embedded under `_embedded.methods[]`.
|
|
26
|
+
*/
|
|
27
|
+
export interface EmbeddedMethodV2 extends Omit<HalResource, "_links"> {
|
|
28
|
+
id?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
hint?: string;
|
|
31
|
+
_links?: {
|
|
32
|
+
challenge?: HalLink;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* Authorize-challenge continuation response containing the authorization code
|
|
38
|
+
* that is redeemed at the token endpoint.
|
|
39
|
+
*/
|
|
40
|
+
export interface AuthorizeChallengeContinueResponseV2 {
|
|
41
|
+
code?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* Authorize-challenge entry response. Success is indicated by a continuation
|
|
46
|
+
* token and flat flow hrefs rather than the HTTP status or HAL links.
|
|
47
|
+
*/
|
|
48
|
+
export interface AuthorizeChallengeEntryResponseV2
|
|
49
|
+
extends OAuthErrorResponseV2 {
|
|
50
|
+
continuation_token?: string;
|
|
51
|
+
reset_password?: string;
|
|
52
|
+
sign_in?: string;
|
|
53
|
+
sign_up?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* Start response containing the available authentication
|
|
58
|
+
* methods. Each method provides the challenge link used after selection.
|
|
59
|
+
*/
|
|
60
|
+
interface StartResponseV2 extends Omit<HalResponseBaseV2, "_embedded"> {
|
|
61
|
+
_embedded?: {
|
|
62
|
+
methods?: EmbeddedMethodV2[];
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type PasswordResetStartResponseV2 = StartResponseV2;
|
|
67
|
+
export type SignInStartResponseV2 = StartResponseV2;
|
|
68
|
+
|
|
69
|
+
export interface SignUpAttributeResponseV2 {
|
|
70
|
+
attributeId: string;
|
|
71
|
+
inputType?: string;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
canChange?: boolean;
|
|
74
|
+
label?: string;
|
|
75
|
+
regex?: string;
|
|
76
|
+
confirmationInput?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface SignUpStartResponseV2
|
|
80
|
+
extends Omit<HalResponseBaseV2, "_links"> {
|
|
81
|
+
attributes?: SignUpAttributeResponseV2[];
|
|
82
|
+
_links?: {
|
|
83
|
+
submitAttributes?: HalLink;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ChallengeResponseBaseV2 extends Omit<HalResponseBaseV2, "_links"> {
|
|
88
|
+
id?: string;
|
|
89
|
+
type?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface CodeChallengeResponseV2 extends ChallengeResponseBaseV2 {
|
|
93
|
+
hint?: string;
|
|
94
|
+
codeLength?: number;
|
|
95
|
+
payload?: { codeLength?: number };
|
|
96
|
+
_links?: {
|
|
97
|
+
verify?: HalLink;
|
|
98
|
+
resend?: HalLink;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface PasswordChallengeResponseV2 extends ChallengeResponseBaseV2 {
|
|
103
|
+
_links?: {
|
|
104
|
+
verify?: HalLink;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type VerificationChallengeResponseV2 =
|
|
109
|
+
| CodeChallengeResponseV2
|
|
110
|
+
| PasswordChallengeResponseV2;
|
|
111
|
+
|
|
112
|
+
export interface RiskVerificationRequiredResponseV2
|
|
113
|
+
extends ChallengeResponseBaseV2 {
|
|
114
|
+
_links?: {
|
|
115
|
+
riskverify?: HalLink;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type ChallengeResponseV2 =
|
|
120
|
+
| VerificationChallengeResponseV2
|
|
121
|
+
| RiskVerificationRequiredResponseV2;
|
|
122
|
+
|
|
123
|
+
export type RiskVerificationResponseV2 = CodeChallengeResponseV2;
|
|
124
|
+
|
|
125
|
+
export interface SignUpSubmitAttributesResponseV2
|
|
126
|
+
extends Omit<CodeChallengeResponseV2, "_links"> {
|
|
127
|
+
attributes?: SignUpAttributeResponseV2[];
|
|
128
|
+
_links?: {
|
|
129
|
+
verify?: HalLink;
|
|
130
|
+
resend?: HalLink;
|
|
131
|
+
submitAttributes?: HalLink;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/*
|
|
136
|
+
* Credential-verification response. For password reset, the `update` relation
|
|
137
|
+
* identifies where the new password is submitted.
|
|
138
|
+
*/
|
|
139
|
+
export interface VerifyResponseV2 extends Omit<HalResponseBaseV2, "_links"> {
|
|
140
|
+
id?: string;
|
|
141
|
+
type?: string;
|
|
142
|
+
payload?: Record<string, unknown>;
|
|
143
|
+
attributes?: SignUpAttributeResponseV2[];
|
|
144
|
+
_links?: {
|
|
145
|
+
update?: HalLink;
|
|
146
|
+
submitAttributes?: HalLink;
|
|
147
|
+
};
|
|
148
|
+
_embedded?: {
|
|
149
|
+
methods?: EmbeddedMethodV2[];
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
* Password-update response for the reset-password flow. The `poll` relation
|
|
155
|
+
* identifies where the client checks for completion.
|
|
156
|
+
*/
|
|
157
|
+
export interface UpdatePasswordResponseV2
|
|
158
|
+
extends Omit<HalResponseBaseV2, "_links"> {
|
|
159
|
+
id?: string;
|
|
160
|
+
type?: string;
|
|
161
|
+
payload?: Record<string, unknown>;
|
|
162
|
+
_links?: {
|
|
163
|
+
poll?: HalLink;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
* Password-reset polling response.
|
|
169
|
+
*/
|
|
170
|
+
export interface PollResponseV2 extends Omit<HalResponseBaseV2, "_links"> {
|
|
171
|
+
_links?: {
|
|
172
|
+
poll?: HalLink;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/*
|
|
177
|
+
* Flat OAuth token response containing the standard token fields observed on
|
|
178
|
+
* the wire. Token errors use `OAuthErrorResponseV2`.
|
|
179
|
+
*/
|
|
180
|
+
export interface TokenResponseV2 {
|
|
181
|
+
token_type: string;
|
|
182
|
+
expires_in: number;
|
|
183
|
+
access_token: string;
|
|
184
|
+
refresh_token?: string;
|
|
185
|
+
scope: string;
|
|
186
|
+
id_token?: string;
|
|
187
|
+
client_info?: string;
|
|
188
|
+
ext_expires_in?: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/*
|
|
192
|
+
* Parsed envelope produced by the response handler. It carries the typed body
|
|
193
|
+
* together with normalized HTTP metadata and error information.
|
|
194
|
+
*/
|
|
195
|
+
export interface ParsedResponseV2<T> {
|
|
196
|
+
statusCode: number;
|
|
197
|
+
correlationId: string;
|
|
198
|
+
continuationToken?: string;
|
|
199
|
+
isWebFallbackRequired: boolean;
|
|
200
|
+
error?: ServerErrorV2;
|
|
201
|
+
body: T;
|
|
202
|
+
}
|