@azure/msal-browser 5.25.0 → 5.26.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 +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
- 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 +7 -2
- package/dist/controllers/NestedAppAuthController.mjs.map +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 +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +49 -19
- 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 +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +8 -7
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +4 -3
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +174 -0
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +67 -17
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +3 -4
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +7 -15
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -5
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
- 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 +61 -52
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +6 -3
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -2
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +12 -10
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +3 -3
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +3 -7
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +2 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +8 -2
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
- package/dist/custom_auth/index.mjs +2 -11
- package/dist/custom_auth/index.mjs.map +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -3
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +5 -5
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +5 -16
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +35 -0
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.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/state/AttributesRequiredStateV2.mjs +1 -3
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +1 -3
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
- package/dist/interaction_client/PopupClient.mjs +4 -3
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +4 -3
- 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 +4 -3
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +1027 -1027
- 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/request/SilentRequestHelpers.mjs +9 -3
- package/dist/request/SilentRequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserDetection.mjs +53 -0
- package/dist/utils/BrowserDetection.mjs.map +1 -0
- 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 +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
- package/dist/webBrokerBridge/index.mjs +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +519 -519
- package/lib/custom-auth-path/msal-custom-auth.cjs +601 -657
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +602 -658
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +7 -3
- package/lib/msal-browser.cjs +136 -78
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +136 -78
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +2 -2
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
- package/package.json +2 -2
- package/src/controllers/NestedAppAuthController.ts +6 -1
- package/src/custom_auth/CustomAuthActionInputs.ts +16 -6
- package/src/custom_auth/controller/CustomAuthStandardController.ts +78 -17
- package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +18 -30
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +1 -0
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +239 -0
- package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +2 -5
- package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +13 -10
- package/src/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.ts +19 -0
- package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +3 -6
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +4 -6
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +114 -17
- package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +6 -3
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +17 -19
- package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +5 -5
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +0 -4
- package/src/custom_auth/core/error/CustomAuthApiError.ts +2 -1
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +3 -4
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +75 -68
- package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +6 -3
- package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +2 -4
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +0 -1
- package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +17 -15
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.ts +1 -1
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +3 -11
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +2 -3
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.ts +1 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +2 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +1 -1
- package/src/custom_auth/core/utils/ArgumentValidator.ts +13 -0
- package/src/custom_auth/index.ts +4 -14
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +6 -10
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +3 -6
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +2 -4
- package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +2 -4
- package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +5 -4
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +4 -23
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.ts +56 -0
- package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +1 -5
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +2 -5
- package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +0 -2
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +0 -2
- package/src/interaction_client/PopupClient.ts +9 -1
- package/src/interaction_client/RedirectClient.ts +9 -4
- package/src/interaction_client/SilentIframeClient.ts +9 -2
- package/src/packageMetadata.ts +1 -1
- package/src/request/SilentRequestHelpers.ts +11 -2
- package/src/utils/BrowserDetection.ts +85 -0
- package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthActionInputs.d.ts +16 -5
- package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts +1 -0
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +9 -11
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +1 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +90 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +1 -2
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +1 -2
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +8 -7
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts +13 -0
- package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +2 -3
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +5 -6
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +9 -6
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +2 -2
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +5 -3
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/error/CustomAuthApiError.d.ts +2 -1
- package/types/custom_auth/core/error/CustomAuthApiError.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +1 -3
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +2 -2
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +2 -2
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +2 -4
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts +0 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts +2 -2
- package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.d.ts +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -2
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts +2 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/utils/ArgumentValidator.d.ts +1 -0
- package/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
- package/types/custom_auth/index.d.ts +3 -12
- package/types/custom_auth/index.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +5 -7
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +4 -6
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +3 -4
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +3 -4
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +4 -9
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts +9 -0
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +1 -2
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +1 -2
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/request/SilentRequestHelpers.d.ts +1 -1
- package/types/request/SilentRequestHelpers.d.ts.map +1 -1
- package/types/utils/BrowserDetection.d.ts +17 -0
- package/types/utils/BrowserDetection.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs +0 -102
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs.map +0 -1
- package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs +0 -20
- package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs.map +0 -1
- package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs +0 -36
- package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs.map +0 -1
- package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs +0 -29
- package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs.map +0 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs +0 -36
- package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs.map +0 -1
- package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs +0 -61
- package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs.map +0 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.mjs +0 -29
- package/dist/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.mjs.map +0 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.mjs +0 -18
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.mjs.map +0 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs +0 -37
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs.map +0 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs +0 -23
- package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs.map +0 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.mjs +0 -25
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.mjs.map +0 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs +0 -33
- package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs.map +0 -1
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.ts +0 -146
- package/src/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.ts +0 -15
- package/src/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.ts +0 -33
- package/src/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.ts +0 -25
- package/src/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.ts +0 -18
- package/src/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.ts +0 -59
- package/src/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.ts +0 -76
- package/src/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.ts +0 -25
- package/src/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.ts +0 -13
- package/src/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.ts +0 -35
- package/src/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.ts +0 -19
- package/src/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.ts +0 -21
- package/src/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.ts +0 -32
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.d.ts +0 -40
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.d.ts +0 -11
- package/types/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.d.ts +0 -23
- package/types/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.d.ts +0 -18
- package/types/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.d.ts +0 -7
- package/types/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.d.ts +0 -17
- package/types/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.d.ts +0 -18
- package/types/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.d.ts.map +0 -1
- package/types/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.d.ts +0 -18
- package/types/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.d.ts +0 -9
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.d.ts +0 -22
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.d.ts +0 -12
- package/types/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.d.ts.map +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.d.ts +0 -14
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.d.ts.map +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.d.ts +0 -20
- package/types/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.d.ts.map +0 -1
|
@@ -124,11 +124,13 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/*
|
|
127
|
-
* Starts sign-in using
|
|
127
|
+
* Starts sign-in by automatically using a sole supported method or returning
|
|
128
|
+
* multiple supported methods for user selection.
|
|
128
129
|
*/
|
|
129
130
|
async signIn(
|
|
130
131
|
parameters: FlowSignInStartParamsV2
|
|
131
132
|
): Promise<
|
|
133
|
+
| FlowMethodSelectionRequiredResultV2
|
|
132
134
|
| FlowPasswordRequiredResultV2
|
|
133
135
|
| FlowSignInCodeRequiredResultV2
|
|
134
136
|
| FlowMFARequiredResultV2
|
|
@@ -142,8 +144,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
142
144
|
|
|
143
145
|
this.logger.verbose("Starting V2 sign-in.", correlationId);
|
|
144
146
|
|
|
147
|
+
const scopes = this.getScopes(parameters.scopes);
|
|
145
148
|
const entryResult = await this.apiClient.authorizeChallengeStart(
|
|
146
|
-
context
|
|
149
|
+
context,
|
|
150
|
+
scopes,
|
|
151
|
+
parameters.claims
|
|
147
152
|
);
|
|
148
153
|
const startResult = await this.apiClient.signInStart(
|
|
149
154
|
this.requireLink(correlationId, entryResult.signInHref, {
|
|
@@ -167,10 +172,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
167
172
|
const continuationState: FlowContinuationStateV2 = {
|
|
168
173
|
continuationToken: startResult.continuationToken,
|
|
169
174
|
scenario: CustomAuthFlowScenarioV2.SignIn,
|
|
175
|
+
scopes,
|
|
170
176
|
links: {},
|
|
171
|
-
tokenRequest: {
|
|
172
|
-
scopes: parameters.scopes,
|
|
173
|
-
},
|
|
174
177
|
};
|
|
175
178
|
const methods = startResult.methods.map((method) => ({
|
|
176
179
|
id: method.id,
|
|
@@ -178,12 +181,21 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
178
181
|
hint: method.hint,
|
|
179
182
|
challengeHref: method.challengeHref,
|
|
180
183
|
}));
|
|
181
|
-
const
|
|
184
|
+
const supportedMethods = this.getSupportedSignInMethods(
|
|
182
185
|
methods,
|
|
183
|
-
parameters.password !== undefined,
|
|
184
186
|
correlationId
|
|
185
187
|
);
|
|
186
188
|
|
|
189
|
+
if (supportedMethods.length > 1) {
|
|
190
|
+
return createFlowMethodSelectionRequiredResultV2({
|
|
191
|
+
correlationId,
|
|
192
|
+
continuationState,
|
|
193
|
+
methods: supportedMethods,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const selectedMethod = supportedMethods[0];
|
|
198
|
+
|
|
187
199
|
const challengeResult = await this.requestChallenge({
|
|
188
200
|
correlationId,
|
|
189
201
|
continuationState: {
|
|
@@ -231,9 +243,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
231
243
|
|
|
232
244
|
this.logger.verbose("Starting V2 sign-up.", correlationId);
|
|
233
245
|
|
|
246
|
+
const scopes = this.getScopes(parameters.scopes);
|
|
234
247
|
const entryResult = await this.apiClient.authorizeChallengeStart(
|
|
235
248
|
context,
|
|
236
|
-
|
|
249
|
+
scopes,
|
|
250
|
+
parameters.claims
|
|
237
251
|
);
|
|
238
252
|
const startResult = await this.apiClient.signUpStart(
|
|
239
253
|
this.requireLink(correlationId, entryResult.signUpHref, {
|
|
@@ -268,10 +282,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
268
282
|
const continuationState: FlowContinuationStateV2 = {
|
|
269
283
|
continuationToken: startResult.continuationToken,
|
|
270
284
|
scenario: CustomAuthFlowScenarioV2.SignUp,
|
|
285
|
+
scopes,
|
|
271
286
|
links: {},
|
|
272
|
-
tokenRequest: {
|
|
273
|
-
scopes: parameters.scopes,
|
|
274
|
-
},
|
|
275
287
|
signUp: {
|
|
276
288
|
passwordWasSupplied: attributes.password !== undefined,
|
|
277
289
|
},
|
|
@@ -318,8 +330,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
318
330
|
correlationId
|
|
319
331
|
);
|
|
320
332
|
|
|
333
|
+
const scopes = this.getScopes(parameters.scopes);
|
|
321
334
|
const entryResult = await this.apiClient.authorizeChallengeStart(
|
|
322
|
-
context
|
|
335
|
+
context,
|
|
336
|
+
scopes,
|
|
337
|
+
parameters.claims
|
|
323
338
|
);
|
|
324
339
|
const startResult = await this.apiClient.resetPasswordStart(
|
|
325
340
|
this.requireLink(correlationId, entryResult.resetPasswordHref, {
|
|
@@ -342,6 +357,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
342
357
|
const continuationState: FlowContinuationStateV2 = {
|
|
343
358
|
continuationToken: startResult.continuationToken,
|
|
344
359
|
scenario: CustomAuthFlowScenarioV2.PasswordReset,
|
|
360
|
+
scopes,
|
|
345
361
|
links: {},
|
|
346
362
|
};
|
|
347
363
|
const methods = startResult.methods.map((method) => ({
|
|
@@ -423,29 +439,42 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
423
439
|
parameters,
|
|
424
440
|
"requestChallenge"
|
|
425
441
|
);
|
|
426
|
-
const challengeType =
|
|
427
|
-
|
|
442
|
+
const challengeType = challengeResult.type;
|
|
443
|
+
const normalizedChallengeType = challengeType?.toLowerCase();
|
|
428
444
|
const continuationState = this.createChallengeContinuationState(
|
|
429
445
|
parameters.continuationState,
|
|
430
446
|
challengeResult
|
|
431
447
|
);
|
|
432
448
|
|
|
449
|
+
if (normalizedChallengeType === AuthenticationMethodTypeV2.PASSWORD) {
|
|
450
|
+
return createFlowPasswordRequiredResultV2({
|
|
451
|
+
correlationId: parameters.correlationId,
|
|
452
|
+
continuationState,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
|
|
433
456
|
if (
|
|
434
|
-
|
|
457
|
+
normalizedChallengeType === AuthenticationMethodTypeV2.EMAIL ||
|
|
458
|
+
normalizedChallengeType === AuthenticationMethodTypeV2.SMS
|
|
435
459
|
) {
|
|
436
|
-
return
|
|
460
|
+
return createFlowCodeRequiredResultV2({
|
|
437
461
|
correlationId: parameters.correlationId,
|
|
438
462
|
continuationState,
|
|
463
|
+
channel: challengeType,
|
|
464
|
+
sentTo: challengeResult.hint,
|
|
465
|
+
codeLength: challengeResult.codeLength,
|
|
439
466
|
});
|
|
440
467
|
}
|
|
441
468
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
469
|
+
const message = challengeType
|
|
470
|
+
? `Challenge type '${challengeType}' is not supported.`
|
|
471
|
+
: "Challenge type is missing.";
|
|
472
|
+
this.logger.error(message, parameters.correlationId);
|
|
473
|
+
throw new CustomAuthError(
|
|
474
|
+
UNSUPPORTED_FLOW_TRANSITION,
|
|
475
|
+
message,
|
|
476
|
+
parameters.correlationId
|
|
477
|
+
);
|
|
449
478
|
}
|
|
450
479
|
|
|
451
480
|
/*
|
|
@@ -492,6 +521,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
492
521
|
continuationState: {
|
|
493
522
|
continuationToken: verifyResult.continuationToken,
|
|
494
523
|
scenario: continuationState.scenario,
|
|
524
|
+
scopes: continuationState.scopes,
|
|
495
525
|
links: { update: verifyResult.updateHref },
|
|
496
526
|
},
|
|
497
527
|
});
|
|
@@ -517,10 +547,10 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
517
547
|
const nextContinuationState: FlowContinuationStateV2 = {
|
|
518
548
|
continuationToken: verifyResult.continuationToken,
|
|
519
549
|
scenario: continuationState.scenario,
|
|
550
|
+
scopes: continuationState.scopes,
|
|
520
551
|
links: {
|
|
521
552
|
submitAttributes: verifyResult.submitAttributesHref,
|
|
522
553
|
},
|
|
523
|
-
tokenRequest: continuationState.tokenRequest,
|
|
524
554
|
signUp: continuationState.signUp,
|
|
525
555
|
};
|
|
526
556
|
const attributes = verifyResult.attributes.filter(
|
|
@@ -556,8 +586,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
556
586
|
continuationState: {
|
|
557
587
|
continuationToken: verifyResult.continuationToken,
|
|
558
588
|
scenario: continuationState.scenario,
|
|
589
|
+
scopes: continuationState.scopes,
|
|
559
590
|
links: {},
|
|
560
|
-
tokenRequest: continuationState.tokenRequest,
|
|
561
591
|
},
|
|
562
592
|
});
|
|
563
593
|
}
|
|
@@ -715,6 +745,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
715
745
|
continuationState: {
|
|
716
746
|
continuationToken: completionToken,
|
|
717
747
|
scenario: continuationState.scenario,
|
|
748
|
+
scopes: continuationState.scopes,
|
|
718
749
|
links: {},
|
|
719
750
|
},
|
|
720
751
|
});
|
|
@@ -756,19 +787,16 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
756
787
|
correlationId
|
|
757
788
|
);
|
|
758
789
|
|
|
759
|
-
const scopes = this.getScopes(parameters.scopes);
|
|
760
|
-
|
|
761
790
|
const tokenResponse = await this.apiClient.completeWithTokens(
|
|
762
791
|
{
|
|
763
792
|
continuationToken: continuationState.continuationToken,
|
|
764
|
-
scopes,
|
|
765
793
|
},
|
|
766
794
|
context
|
|
767
795
|
);
|
|
768
796
|
|
|
769
797
|
const authenticationResult = await this.handleTokenResponse(
|
|
770
798
|
tokenResponse,
|
|
771
|
-
scopes,
|
|
799
|
+
continuationState.scopes,
|
|
772
800
|
correlationId,
|
|
773
801
|
apiId
|
|
774
802
|
);
|
|
@@ -802,8 +830,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
802
830
|
continuationState: {
|
|
803
831
|
continuationToken: verifyResult.continuationToken,
|
|
804
832
|
scenario: continuationState.scenario,
|
|
833
|
+
scopes: continuationState.scopes,
|
|
805
834
|
links: {},
|
|
806
|
-
tokenRequest: continuationState.tokenRequest,
|
|
807
835
|
},
|
|
808
836
|
methods: verifyResult.methods.map((method) => ({
|
|
809
837
|
id: method.id,
|
|
@@ -831,43 +859,25 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
831
859
|
);
|
|
832
860
|
}
|
|
833
861
|
|
|
834
|
-
private
|
|
862
|
+
private getSupportedSignInMethods(
|
|
835
863
|
methods: AuthenticationMethodV2[],
|
|
836
|
-
passwordProvided: boolean,
|
|
837
864
|
correlationId: string
|
|
838
|
-
): AuthenticationMethodV2 {
|
|
839
|
-
const
|
|
840
|
-
(
|
|
841
|
-
|
|
842
|
-
AuthenticationMethodTypeV2.
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
(method) =>
|
|
846
|
-
method.type.toLowerCase() === AuthenticationMethodTypeV2.EMAIL
|
|
847
|
-
);
|
|
848
|
-
|
|
849
|
-
if (passwordProvided) {
|
|
850
|
-
if (passwordMethod) {
|
|
851
|
-
return passwordMethod;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
const message =
|
|
855
|
-
"A password was supplied, but the sign-in response did not include a password method.";
|
|
856
|
-
this.logger.error(message, correlationId);
|
|
857
|
-
throw new CustomAuthError(
|
|
858
|
-
UNSUPPORTED_FLOW_TRANSITION,
|
|
859
|
-
message,
|
|
860
|
-
correlationId
|
|
865
|
+
): AuthenticationMethodV2[] {
|
|
866
|
+
const supportedMethods = methods.filter((method) => {
|
|
867
|
+
const methodType = method.type.toLowerCase();
|
|
868
|
+
return (
|
|
869
|
+
methodType === AuthenticationMethodTypeV2.EMAIL ||
|
|
870
|
+
methodType === AuthenticationMethodTypeV2.PASSWORD ||
|
|
871
|
+
methodType === AuthenticationMethodTypeV2.SMS
|
|
861
872
|
);
|
|
862
|
-
}
|
|
873
|
+
});
|
|
863
874
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
return selectedMethod;
|
|
875
|
+
if (supportedMethods.length > 0) {
|
|
876
|
+
return supportedMethods;
|
|
867
877
|
}
|
|
868
878
|
|
|
869
879
|
const message =
|
|
870
|
-
"The sign-in start response did not include a supported email or password method.";
|
|
880
|
+
"The sign-in start response did not include a supported email, SMS, or password method.";
|
|
871
881
|
this.logger.error(message, correlationId);
|
|
872
882
|
throw new CustomAuthError(
|
|
873
883
|
UNSUPPORTED_FLOW_TRANSITION,
|
|
@@ -889,11 +899,11 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
889
899
|
continuationState: {
|
|
890
900
|
continuationToken: result.continuationToken,
|
|
891
901
|
scenario: continuationState.scenario,
|
|
902
|
+
scopes: continuationState.scopes,
|
|
892
903
|
links: {
|
|
893
904
|
verify: result.verifyHref,
|
|
894
905
|
resend: result.resendHref,
|
|
895
906
|
},
|
|
896
|
-
tokenRequest: continuationState.tokenRequest,
|
|
897
907
|
signUp: continuationState.signUp,
|
|
898
908
|
},
|
|
899
909
|
channel: result.type,
|
|
@@ -914,10 +924,10 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
914
924
|
const nextContinuationState: FlowContinuationStateV2 = {
|
|
915
925
|
continuationToken: result.continuationToken,
|
|
916
926
|
scenario: continuationState.scenario,
|
|
927
|
+
scopes: continuationState.scopes,
|
|
917
928
|
links: {
|
|
918
929
|
submitAttributes: result.submitAttributesHref,
|
|
919
930
|
},
|
|
920
|
-
tokenRequest: continuationState.tokenRequest,
|
|
921
931
|
signUp: continuationState.signUp,
|
|
922
932
|
};
|
|
923
933
|
const attributes = result.attributes.filter(
|
|
@@ -950,8 +960,8 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
950
960
|
continuationState: {
|
|
951
961
|
continuationToken: result.continuationToken,
|
|
952
962
|
scenario: continuationState.scenario,
|
|
963
|
+
scopes: continuationState.scopes,
|
|
953
964
|
links: {},
|
|
954
|
-
tokenRequest: continuationState.tokenRequest,
|
|
955
965
|
},
|
|
956
966
|
});
|
|
957
967
|
}
|
|
@@ -1019,10 +1029,9 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1019
1029
|
continuationState: {
|
|
1020
1030
|
continuationToken,
|
|
1021
1031
|
scenario: continuationState.scenario,
|
|
1032
|
+
scopes: continuationState.scopes,
|
|
1022
1033
|
links: {},
|
|
1023
|
-
tokenRequest: continuationState.tokenRequest,
|
|
1024
1034
|
},
|
|
1025
|
-
scopes: continuationState.tokenRequest?.scopes,
|
|
1026
1035
|
});
|
|
1027
1036
|
}
|
|
1028
1037
|
|
|
@@ -1087,6 +1096,7 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1087
1096
|
return {
|
|
1088
1097
|
continuationToken: challengeResult.continuationToken,
|
|
1089
1098
|
scenario: continuationState.scenario,
|
|
1099
|
+
scopes: continuationState.scopes,
|
|
1090
1100
|
links: {
|
|
1091
1101
|
challenge: continuationState.links.challenge,
|
|
1092
1102
|
verify: challengeResult.verifyHref,
|
|
@@ -1094,9 +1104,6 @@ export class FlowInteractionClientV2 extends InteractionClientBaseV2 {
|
|
|
1094
1104
|
challengeResult.resendHref ??
|
|
1095
1105
|
continuationState.links.resend,
|
|
1096
1106
|
},
|
|
1097
|
-
...(continuationState.tokenRequest && {
|
|
1098
|
-
tokenRequest: continuationState.tokenRequest,
|
|
1099
|
-
}),
|
|
1100
1107
|
...(continuationState.signUp && {
|
|
1101
1108
|
signUp: continuationState.signUp,
|
|
1102
1109
|
}),
|
|
@@ -86,7 +86,7 @@ export abstract class InteractionClientBaseV2 extends StandardInteractionClient
|
|
|
86
86
|
throw new MethodNotImplementedError("InteractionClientBaseV2.logout");
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
protected getScopes(scopes: string[] | undefined): string[] {
|
|
89
|
+
protected getScopes(scopes: string[] | null | undefined): string[] {
|
|
90
90
|
const requestedScopes = scopes?.filter((scope) => !!scope) ?? [];
|
|
91
91
|
const seenScopes = new Set(
|
|
92
92
|
requestedScopes.map((scope) => scope.toLowerCase())
|
|
@@ -108,13 +108,16 @@ export abstract class InteractionClientBaseV2 extends StandardInteractionClient
|
|
|
108
108
|
|
|
109
109
|
protected async handleTokenResponse(
|
|
110
110
|
tokenResponse: TokenResponseV2,
|
|
111
|
-
|
|
111
|
+
requestedScopes: string[],
|
|
112
112
|
correlationId: string,
|
|
113
113
|
apiId: number
|
|
114
114
|
): Promise<AuthenticationResult> {
|
|
115
115
|
this.logger.verbose("Processing V2 token response.", correlationId);
|
|
116
116
|
|
|
117
117
|
const requestTimestamp = Math.round(new Date().getTime() / 1000.0);
|
|
118
|
+
const responseScopes = tokenResponse.scope
|
|
119
|
+
? tokenResponse.scope.split(" ").filter((scope) => !!scope)
|
|
120
|
+
: requestedScopes;
|
|
118
121
|
|
|
119
122
|
const result =
|
|
120
123
|
await this.tokenResponseHandler.handleServerTokenResponse(
|
|
@@ -124,7 +127,7 @@ export abstract class InteractionClientBaseV2 extends StandardInteractionClient
|
|
|
124
127
|
{
|
|
125
128
|
authority: this.customAuthAuthority.canonicalAuthority,
|
|
126
129
|
correlationId,
|
|
127
|
-
scopes:
|
|
130
|
+
scopes: responseScopes,
|
|
128
131
|
},
|
|
129
132
|
apiId
|
|
130
133
|
);
|
|
@@ -18,18 +18,17 @@ interface FlowParamsBaseV2 {
|
|
|
18
18
|
// Begin a reset for the given account.
|
|
19
19
|
export interface FlowStartParamsV2 extends FlowParamsBaseV2 {
|
|
20
20
|
username: string;
|
|
21
|
+
scopes?: string[] | null;
|
|
22
|
+
claims?: string;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export interface FlowSignInStartParamsV2 extends FlowStartParamsV2 {
|
|
24
26
|
password?: string;
|
|
25
|
-
scopes?: string[];
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface FlowSignUpStartParamsV2 extends FlowStartParamsV2 {
|
|
29
30
|
password?: string;
|
|
30
31
|
attributes?: UserAccountAttributes;
|
|
31
|
-
scopes?: string[];
|
|
32
|
-
claims?: string;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
// Request the challenge for the selected method, sending the one-time code to it.
|
|
@@ -62,5 +61,4 @@ export interface FlowSubmitSignUpAttributesParamsV2 extends FlowParamsBaseV2 {
|
|
|
62
61
|
// Sign the account in by redeeming a completed flow's continuation for tokens.
|
|
63
62
|
export interface FlowSignInWithContinuationParamsV2 extends FlowParamsBaseV2 {
|
|
64
63
|
continuationState: FlowContinuationStateV2;
|
|
65
|
-
scopes?: string[];
|
|
66
64
|
}
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
CONTINUATION_TOKEN_MISSING,
|
|
35
35
|
HTTP_REQUEST_FAILED,
|
|
36
36
|
INVALID_TOKEN_RESPONSE,
|
|
37
|
-
|
|
37
|
+
WEB_REDIRECT_REQUIRED,
|
|
38
38
|
} from "./ErrorCodesV2.js";
|
|
39
39
|
import {
|
|
40
40
|
RequestContextV2,
|
|
@@ -75,7 +75,8 @@ export abstract class BaseApiClientV2 {
|
|
|
75
75
|
*/
|
|
76
76
|
async authorizeChallengeStart(
|
|
77
77
|
context: RequestContextV2,
|
|
78
|
-
scopes?: string[]
|
|
78
|
+
scopes?: string[],
|
|
79
|
+
claims?: string
|
|
79
80
|
): Promise<AuthorizeChallengeEntryResultV2> {
|
|
80
81
|
const request: AuthorizeChallengeEntryRequestV2 = {
|
|
81
82
|
client_id: this.clientId,
|
|
@@ -85,6 +86,10 @@ export abstract class BaseApiClientV2 {
|
|
|
85
86
|
request.scope = scopes.join(" ");
|
|
86
87
|
}
|
|
87
88
|
|
|
89
|
+
if (claims) {
|
|
90
|
+
request.claims = claims;
|
|
91
|
+
}
|
|
92
|
+
|
|
88
93
|
const parsedResponse =
|
|
89
94
|
await this.postOAuthForm<AuthorizeChallengeEntryResponseV2>(
|
|
90
95
|
AUTHORIZE_CHALLENGE,
|
|
@@ -137,7 +142,7 @@ export abstract class BaseApiClientV2 {
|
|
|
137
142
|
context
|
|
138
143
|
);
|
|
139
144
|
|
|
140
|
-
return this.token(code,
|
|
145
|
+
return this.token(code, context);
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
/*
|
|
@@ -183,7 +188,6 @@ export abstract class BaseApiClientV2 {
|
|
|
183
188
|
*/
|
|
184
189
|
protected async token(
|
|
185
190
|
code: string,
|
|
186
|
-
scopes: string[],
|
|
187
191
|
context: RequestContextV2
|
|
188
192
|
): Promise<TokenResponseV2> {
|
|
189
193
|
const request: TokenRequestV2 = {
|
|
@@ -194,10 +198,6 @@ export abstract class BaseApiClientV2 {
|
|
|
194
198
|
client_info: "1",
|
|
195
199
|
};
|
|
196
200
|
|
|
197
|
-
if (scopes.length > 0) {
|
|
198
|
-
request.scope = scopes.join(" ");
|
|
199
|
-
}
|
|
200
|
-
|
|
201
201
|
const parsedResponse = await this.postOAuthForm<TokenResponseV2>(
|
|
202
202
|
SIGNIN_TOKEN,
|
|
203
203
|
request,
|
|
@@ -344,12 +344,13 @@ export abstract class BaseApiClientV2 {
|
|
|
344
344
|
serverError.message ?? "",
|
|
345
345
|
serverError.correlationId ?? correlationId,
|
|
346
346
|
serverError.errorCodes,
|
|
347
|
-
serverError.
|
|
347
|
+
serverError.subError,
|
|
348
348
|
undefined,
|
|
349
349
|
undefined,
|
|
350
350
|
serverError.traceId,
|
|
351
351
|
serverError.timestamp,
|
|
352
|
-
serverError.attributeValidationDetails
|
|
352
|
+
serverError.attributeValidationDetails,
|
|
353
|
+
serverError.innerErrorCode
|
|
353
354
|
);
|
|
354
355
|
}
|
|
355
356
|
|
|
@@ -357,11 +358,12 @@ export abstract class BaseApiClientV2 {
|
|
|
357
358
|
parsedResponse: ParsedResponseV2<unknown>
|
|
358
359
|
): void {
|
|
359
360
|
if (parsedResponse.isWebFallbackRequired) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
if (parsedResponse.error?.subError === WEB_REDIRECT_REQUIRED) {
|
|
362
|
+
throw this.toApiError(
|
|
363
|
+
parsedResponse.error,
|
|
364
|
+
parsedResponse.correlationId
|
|
365
|
+
);
|
|
366
|
+
}
|
|
365
367
|
}
|
|
366
368
|
}
|
|
367
369
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export const HTTP_REQUEST_FAILED = "http_request_failed";
|
|
7
|
-
export const
|
|
7
|
+
export const WEB_REDIRECT_REQUIRED = "web_redirect_required";
|
|
8
8
|
export const UNEXPECTED_ERROR = "unexpected_error";
|
|
9
9
|
export const INVALID_INPUT = "invalid_input";
|
|
10
10
|
export const AUTH_CODE_MISSING = "authorization_code_missing";
|
|
@@ -8,13 +8,12 @@ import { HttpHeaderKeys } from "../../../../CustomAuthConstants.js";
|
|
|
8
8
|
import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
|
|
9
9
|
import { normalizeServerErrorV2 } from "./response/ErrorNormalizerV2.js";
|
|
10
10
|
import { EmbeddedMethodV2, ParsedResponseV2 } from "./response/ResponsesV2.js";
|
|
11
|
-
import { ResponseStateV2 } from "./ApiClientConstantsV2.js";
|
|
12
11
|
import {
|
|
13
12
|
CONTINUATION_TOKEN_MISSING,
|
|
14
13
|
INVALID_HAL_RESPONSE,
|
|
15
14
|
INVALID_RESPONSE_BODY,
|
|
16
15
|
NO_AUTHENTICATION_METHODS,
|
|
17
|
-
|
|
16
|
+
WEB_REDIRECT_REQUIRED,
|
|
18
17
|
} from "./ErrorCodesV2.js";
|
|
19
18
|
|
|
20
19
|
/*
|
|
@@ -38,8 +37,6 @@ export class ResponseHandlerV2 {
|
|
|
38
37
|
|
|
39
38
|
const json = await this.parseBody(response, correlationId);
|
|
40
39
|
|
|
41
|
-
const state = typeof json.state === "string" ? json.state : undefined;
|
|
42
|
-
|
|
43
40
|
const continuationToken =
|
|
44
41
|
(typeof json.continuationToken === "string"
|
|
45
42
|
? json.continuationToken
|
|
@@ -48,15 +45,10 @@ export class ResponseHandlerV2 {
|
|
|
48
45
|
? json.continuation_token
|
|
49
46
|
: undefined);
|
|
50
47
|
|
|
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
48
|
const error = normalizeServerErrorV2(json);
|
|
59
49
|
|
|
50
|
+
const isWebFallbackRequired = error?.subError === WEB_REDIRECT_REQUIRED;
|
|
51
|
+
|
|
60
52
|
// Surface the header correlation id on the body (HalResponseBaseV2.correlationId).
|
|
61
53
|
json.correlationId = correlationId;
|
|
62
54
|
|
|
@@ -30,6 +30,7 @@ export interface OAuthFormRequestV2 {
|
|
|
30
30
|
*/
|
|
31
31
|
export interface AuthorizeChallengeEntryRequestV2 extends OAuthFormRequestV2 {
|
|
32
32
|
scope?: string;
|
|
33
|
+
claims?: string;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
/*
|
|
@@ -51,16 +52,14 @@ export interface TokenRequestV2 extends OAuthFormRequestV2 {
|
|
|
51
52
|
grant_type: string;
|
|
52
53
|
code: string;
|
|
53
54
|
client_info: string;
|
|
54
|
-
scope?: string;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/*
|
|
58
58
|
* Compound token-completion operation. The continuation is first redeemed for
|
|
59
|
-
* an authorization code, which is then exchanged
|
|
59
|
+
* an authorization code, which is then exchanged for tokens.
|
|
60
60
|
*/
|
|
61
61
|
export interface CompleteWithTokensRequestV2 {
|
|
62
62
|
continuationToken: string;
|
|
63
|
-
scopes: string[];
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
/*
|
package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.ts
CHANGED
|
@@ -49,6 +49,7 @@ function normalizeOAuthError(response: OAuthErrorResponseV2): ServerErrorV2 {
|
|
|
49
49
|
code: readString(response.error) ?? UNEXPECTED_ERROR,
|
|
50
50
|
message: readString(response.error_description),
|
|
51
51
|
errorCodes: readNumberArray(response.error_codes),
|
|
52
|
+
subError: readString(response.suberror),
|
|
52
53
|
correlationId: readString(response.correlation_id),
|
|
53
54
|
traceId: readString(response.trace_id),
|
|
54
55
|
timestamp: readString(response.timestamp),
|
|
@@ -29,6 +29,7 @@ export interface OAuthErrorResponseV2 {
|
|
|
29
29
|
error?: string;
|
|
30
30
|
error_description?: string;
|
|
31
31
|
error_codes?: number[];
|
|
32
|
+
suberror?: string;
|
|
32
33
|
timestamp?: string;
|
|
33
34
|
trace_id?: string;
|
|
34
35
|
correlation_id?: string;
|
|
@@ -42,6 +43,7 @@ export interface ServerErrorV2 {
|
|
|
42
43
|
code: string;
|
|
43
44
|
message?: string;
|
|
44
45
|
innerErrorCode?: string;
|
|
46
|
+
subError?: string;
|
|
45
47
|
errorCodes?: number[];
|
|
46
48
|
correlationId?: string;
|
|
47
49
|
traceId?: string;
|
|
@@ -46,3 +46,16 @@ export function ensureArgumentIsJSONString(
|
|
|
46
46
|
throw e; // Rethrow unexpected errors
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
export function ensureArgumentIsStringArray(
|
|
51
|
+
argName: string,
|
|
52
|
+
argValue: unknown,
|
|
53
|
+
correlationId?: string
|
|
54
|
+
): asserts argValue is string[] {
|
|
55
|
+
if (
|
|
56
|
+
!Array.isArray(argValue) ||
|
|
57
|
+
!argValue.every((value) => typeof value === "string")
|
|
58
|
+
) {
|
|
59
|
+
throw new InvalidArgumentError(argName, correlationId);
|
|
60
|
+
}
|
|
61
|
+
}
|