@azure/msal-browser 5.26.0 → 5.28.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/README.md +2 -0
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +54 -14
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +9 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +7 -6
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +4 -2
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +21 -7
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs.map +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +14 -1
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +9 -2
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +32 -4
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +100 -11
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +14 -1
- package/dist/crypto/TokenBindingKeyManager.mjs.map +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +14 -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 +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +68 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +3 -2
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +87 -0
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +5 -3
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +14 -2
- 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 +4 -3
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs +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 +246 -73
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +10 -2
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +10 -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 +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +118 -25
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +2 -2
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +2 -12
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +2 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +17 -3
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +9 -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 +3 -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/state/NewPasswordRequiredStateV2.mjs +32 -13
- 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 +14 -2
- 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 +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +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 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +9 -2
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +504 -75
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +54 -20
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +30 -16
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +44 -32
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +7 -1
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +79 -19
- 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 +43 -25
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +35 -11
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/request/SilentRequestHelpers.mjs +6 -6
- package/dist/request/SilentRequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +3 -2
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserDetection.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +7 -2
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/IframeMonitor.mjs +81 -0
- package/dist/utils/IframeMonitor.mjs.map +1 -0
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/utils/PopupMonitor.mjs +119 -0
- package/dist/utils/PopupMonitor.mjs.map +1 -0
- package/dist/utils/PopupOriginCheck.mjs +88 -0
- package/dist/utils/PopupOriginCheck.mjs.map +1 -0
- 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 +71 -11
- package/lib/custom-auth-path/msal-custom-auth.cjs +2085 -451
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +2085 -451
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +39 -11
- package/lib/msal-browser.cjs +1461 -320
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +1461 -320
- 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/app/PublicClientApplication.ts +108 -8
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +15 -0
- package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +6 -21
- package/src/broker/nativeBroker/PlatformAuthProvider.ts +3 -1
- package/src/broker/nativeBroker/PlatformAuthRequest.ts +12 -8
- package/src/broker/nativeBroker/PlatformAuthResponse.ts +31 -0
- package/src/cache/AsyncMemoryStorage.ts +16 -0
- package/src/cache/BrowserCacheManager.ts +19 -1
- package/src/config/Configuration.ts +63 -6
- package/src/controllers/StandardController.ts +153 -14
- package/src/crypto/TokenBindingKeyManager.ts +21 -0
- package/src/custom_auth/controller/CustomAuthStandardController.ts +18 -0
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +15 -0
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +23 -0
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +26 -0
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +1 -1
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +2 -0
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +94 -0
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +7 -2
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +132 -0
- package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +8 -2
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +18 -0
- package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +13 -0
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +8 -2
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +1 -0
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +445 -91
- package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +25 -0
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +34 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +9 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +262 -43
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +4 -7
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +21 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +41 -2
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +44 -19
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +4 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +6 -1
- package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +25 -1
- package/src/custom_auth/core/telemetry/PublicApiId.ts +6 -0
- package/src/custom_auth/index.ts +11 -0
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +6 -7
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +47 -15
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +2 -0
- package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +2 -0
- package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +18 -0
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +2 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +13 -0
- package/src/interaction_client/PlatformAuthInteractionClient.ts +851 -128
- package/src/interaction_client/PopupClient.ts +140 -83
- package/src/interaction_client/RedirectClient.ts +88 -35
- package/src/interaction_client/SilentIframeClient.ts +121 -95
- package/src/interaction_client/StandardInteractionClient.ts +6 -0
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +80 -46
- package/src/request/RequestHelpers.ts +64 -11
- package/src/request/SilentRequestHelpers.ts +8 -9
- package/src/telemetry/BrowserPerformanceEvents.ts +1 -0
- package/src/utils/BrowserUtils.ts +8 -1
- package/src/utils/IframeMonitor.ts +98 -0
- package/src/utils/PopupMonitor.ts +158 -0
- package/src/utils/PopupOriginCheck.ts +94 -0
- package/types/app/PublicClientApplication.d.ts +6 -4
- package/types/app/PublicClientApplication.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +6 -1
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +21 -0
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
- package/types/cache/AsyncMemoryStorage.d.ts +5 -0
- package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +4 -0
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/config/Configuration.d.ts +16 -0
- package/types/config/Configuration.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +5 -0
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/crypto/TokenBindingKeyManager.d.ts +9 -0
- package/types/crypto/TokenBindingKeyManager.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +11 -0
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +14 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +15 -0
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +2 -1
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +22 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +28 -0
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts +3 -2
- package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +9 -0
- 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/interaction_client/v2/FlowContinuationStateV2.d.ts +1 -0
- 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 +12 -5
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +17 -0
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +18 -2
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts +8 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts +8 -2
- package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +3 -3
- package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +12 -0
- 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/ResponsesV2.d.ts +29 -2
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +30 -17
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +3 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +3 -2
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +6 -1
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts +6 -0
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/types/custom_auth/index.d.ts +5 -0
- package/types/custom_auth/index.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +6 -8
- 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 +4 -4
- 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/SignInStartResultV2.d.ts +2 -1
- 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 +2 -1
- 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_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +2 -1
- 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/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts +106 -5
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts +12 -0
- 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/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/protocol/Authorize.d.ts +4 -4
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts +21 -3
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/request/SilentRequestHelpers.d.ts.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +1 -0
- package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/types/utils/BrowserUtils.d.ts +2 -1
- package/types/utils/BrowserUtils.d.ts.map +1 -1
- package/types/utils/IframeMonitor.d.ts +17 -0
- package/types/utils/IframeMonitor.d.ts.map +1 -0
- package/types/utils/PopupMonitor.d.ts +37 -0
- package/types/utils/PopupMonitor.d.ts.map +1 -0
- package/types/utils/PopupOriginCheck.d.ts +27 -0
- package/types/utils/PopupOriginCheck.d.ts.map +1 -0
package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
|
|
7
|
+
import type { CompletedStateV2 } from "../state/CompletedStateV2.js";
|
|
8
|
+
import type { FailedStateV2 } from "../state/FailedStateV2.js";
|
|
9
|
+
import type { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The states an authentication-method verification submission can resolve to.
|
|
13
|
+
* A successful submission completes the authentication flow.
|
|
14
|
+
*/
|
|
15
|
+
export type AuthMethodVerificationSubmitChallengeResultStateV2 =
|
|
16
|
+
| CompletedStateV2
|
|
17
|
+
| FailedStateV2;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Result of submitting the authentication-method verification challenge. It
|
|
21
|
+
* includes account data when verification and token completion succeed.
|
|
22
|
+
*/
|
|
23
|
+
export type AuthMethodVerificationSubmitChallengeResultV2 = CustomAuthResultV2<
|
|
24
|
+
AuthMethodVerificationSubmitChallengeResultStateV2,
|
|
25
|
+
CustomAuthAccountData
|
|
26
|
+
>;
|
|
@@ -20,7 +20,7 @@ export type RequestChallengeResultStateV2 =
|
|
|
20
20
|
| FailedStateV2;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Result of requesting
|
|
23
|
+
* Result of requesting a challenge. It wraps one of
|
|
24
24
|
* {@link RequestChallengeResultStateV2} plus, on failure, the unified V2 flow
|
|
25
25
|
* error.
|
|
26
26
|
*/
|
|
@@ -12,6 +12,7 @@ import type { AttributesRequiredStateV2 } from "../../../../sign_up/auth_flow/v2
|
|
|
12
12
|
import type { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
|
|
13
13
|
import type { SignUpPasswordRequiredStateV2 } from "../../../../sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.js";
|
|
14
14
|
import type { AuthMethodSelectionRequiredStateV2 } from "../state/AuthMethodSelectionRequiredStateV2.js";
|
|
15
|
+
import type { AuthMethodRegistrationRequiredStateV2 } from "../state/AuthMethodRegistrationRequiredStateV2.js";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* The states a verify-challenge action can resolve to. Verifying the one-time
|
|
@@ -24,6 +25,7 @@ export type VerifyChallengeResultStateV2 =
|
|
|
24
25
|
| AttributesRequiredStateV2
|
|
25
26
|
| SignInContinuationStateV2
|
|
26
27
|
| AuthMethodSelectionRequiredStateV2
|
|
28
|
+
| AuthMethodRegistrationRequiredStateV2
|
|
27
29
|
| CompletedStateV2
|
|
28
30
|
| FailedStateV2;
|
|
29
31
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { AuthFlowActionRequiredStateBase } from "../../AuthFlowState.js";
|
|
7
|
+
import type { AuthenticationMethodRegistrationV2 } from "../AuthenticationMethodRegistrationV2.js";
|
|
8
|
+
import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
|
|
9
|
+
import type { AuthMethodRegistrationChallengeResultV2 } from "../result/AuthMethodRegistrationChallengeResultV2.js";
|
|
10
|
+
import type { AuthMethodRegistrationRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
|
|
11
|
+
import { AuthMethodVerificationRequiredStateV2 } from "./AuthMethodVerificationRequiredStateV2.js";
|
|
12
|
+
import { InvalidArgumentError } from "../../../error/InvalidArgumentError.js";
|
|
13
|
+
import { ensureArgumentIsNotEmptyString } from "../../../utils/ArgumentValidator.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* State returned when an authentication method must be registered. Applications
|
|
17
|
+
* select one of the sanitized offered methods and provide its contact value.
|
|
18
|
+
*/
|
|
19
|
+
export class AuthMethodRegistrationRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodRegistrationRequiredStateParametersV2> {
|
|
20
|
+
readonly stateType = "authMethodRegistrationRequired";
|
|
21
|
+
readonly methods: readonly AuthenticationMethodRegistrationV2[];
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
stateParameters: AuthMethodRegistrationRequiredStateParametersV2
|
|
25
|
+
) {
|
|
26
|
+
super(stateParameters);
|
|
27
|
+
this.methods = stateParameters.methods;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Selects an authentication method for strong-auth registration and requests
|
|
32
|
+
* its activation challenge.
|
|
33
|
+
* @param method - A method from {@link methods}.
|
|
34
|
+
* @param verificationContact - The email address or phone number to register.
|
|
35
|
+
* @returns The registration activation result.
|
|
36
|
+
*/
|
|
37
|
+
async selectAuthMethod(
|
|
38
|
+
method: AuthenticationMethodRegistrationV2,
|
|
39
|
+
verificationContact: string
|
|
40
|
+
): Promise<AuthMethodRegistrationChallengeResultV2> {
|
|
41
|
+
const { correlationId, continuationState, flowClient, logger } =
|
|
42
|
+
this.stateParameters;
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const selectedMethod = this.methods.find(
|
|
46
|
+
(candidate) => candidate.type === method.type
|
|
47
|
+
);
|
|
48
|
+
if (!selectedMethod) {
|
|
49
|
+
throw new InvalidArgumentError("method", correlationId);
|
|
50
|
+
}
|
|
51
|
+
ensureArgumentIsNotEmptyString(
|
|
52
|
+
"verificationContact",
|
|
53
|
+
verificationContact,
|
|
54
|
+
correlationId
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
logger.verbose(
|
|
58
|
+
"Registering the selected V2 authentication method.",
|
|
59
|
+
correlationId
|
|
60
|
+
);
|
|
61
|
+
const result = await flowClient.registerAuthMethod({
|
|
62
|
+
correlationId,
|
|
63
|
+
continuationState,
|
|
64
|
+
method: selectedMethod,
|
|
65
|
+
verificationContact,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return new CustomAuthResultV2(
|
|
69
|
+
new AuthMethodVerificationRequiredStateV2({
|
|
70
|
+
correlationId: result.correlationId,
|
|
71
|
+
logger,
|
|
72
|
+
config: this.stateParameters.config,
|
|
73
|
+
flowClient,
|
|
74
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
75
|
+
continuationState: result.continuationState,
|
|
76
|
+
type: selectedMethod.type,
|
|
77
|
+
sentTo: result.sentTo,
|
|
78
|
+
codeLength: result.codeLength,
|
|
79
|
+
}),
|
|
80
|
+
undefined,
|
|
81
|
+
result.continuationState.scenario
|
|
82
|
+
);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
logger.errorPii(
|
|
85
|
+
`Failed to register the selected V2 authentication method. Error: '${error}'.`,
|
|
86
|
+
correlationId
|
|
87
|
+
);
|
|
88
|
+
return CustomAuthResultV2.createWithError(error, {
|
|
89
|
+
scenario: continuationState.scenario,
|
|
90
|
+
correlationId,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -171,8 +171,12 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
171
171
|
result: FlowCodeRequiredResultV2 | FlowPasswordRequiredResultV2;
|
|
172
172
|
selectedMethod: AuthenticationMethodV2;
|
|
173
173
|
}> {
|
|
174
|
-
const {
|
|
175
|
-
|
|
174
|
+
const {
|
|
175
|
+
correlationId,
|
|
176
|
+
continuationState,
|
|
177
|
+
flowClient,
|
|
178
|
+
authenticationFactor,
|
|
179
|
+
} = this.stateParameters;
|
|
176
180
|
const selectedMethod = this.methods.find(
|
|
177
181
|
(candidate) => candidate.id === method.id
|
|
178
182
|
);
|
|
@@ -183,6 +187,7 @@ export class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredSt
|
|
|
183
187
|
|
|
184
188
|
const result = await flowClient.requestChallenge({
|
|
185
189
|
correlationId,
|
|
190
|
+
authenticationFactor,
|
|
186
191
|
continuationState: {
|
|
187
192
|
...continuationState,
|
|
188
193
|
links: {
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { AuthFlowActionRequiredStateBase } from "../../AuthFlowState.js";
|
|
7
|
+
import { CustomAuthResultV2 } from "../CustomAuthResultV2.js";
|
|
8
|
+
import type { AuthMethodRegistrationChallengeResultV2 } from "../result/AuthMethodRegistrationChallengeResultV2.js";
|
|
9
|
+
import type { AuthMethodVerificationSubmitChallengeResultV2 } from "../result/AuthMethodVerificationSubmitChallengeResultV2.js";
|
|
10
|
+
import type { AuthMethodVerificationRequiredStateParametersV2 } from "./CustomAuthStateParametersV2.js";
|
|
11
|
+
import { CompletedStateV2 } from "./CompletedStateV2.js";
|
|
12
|
+
import { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
|
|
13
|
+
import { ensureArgumentIsNotNullOrUndefined } from "../../../utils/ArgumentValidator.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* State returned when a newly registered authentication method must be
|
|
17
|
+
* activated with the challenge sent by the service.
|
|
18
|
+
*/
|
|
19
|
+
export class AuthMethodVerificationRequiredStateV2 extends AuthFlowActionRequiredStateBase<AuthMethodVerificationRequiredStateParametersV2> {
|
|
20
|
+
readonly stateType = "authMethodVerificationRequired";
|
|
21
|
+
readonly type: string;
|
|
22
|
+
readonly sentTo?: string;
|
|
23
|
+
readonly codeLength: number;
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
stateParameters: AuthMethodVerificationRequiredStateParametersV2
|
|
27
|
+
) {
|
|
28
|
+
super(stateParameters);
|
|
29
|
+
this.type = stateParameters.type;
|
|
30
|
+
this.sentTo = stateParameters.sentTo;
|
|
31
|
+
this.codeLength = stateParameters.codeLength;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Submits the activation challenge for the registered method.
|
|
36
|
+
* @param challenge - The activation challenge to submit.
|
|
37
|
+
* @returns The completed authentication result or a failed state.
|
|
38
|
+
*/
|
|
39
|
+
async submitChallenge(
|
|
40
|
+
challenge: string
|
|
41
|
+
): Promise<AuthMethodVerificationSubmitChallengeResultV2> {
|
|
42
|
+
const { correlationId, continuationState, flowClient, logger } =
|
|
43
|
+
this.stateParameters;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
ensureArgumentIsNotNullOrUndefined(
|
|
47
|
+
"challenge",
|
|
48
|
+
challenge,
|
|
49
|
+
correlationId
|
|
50
|
+
);
|
|
51
|
+
logger.verbose(
|
|
52
|
+
"Submitting a V2 authentication-method activation challenge.",
|
|
53
|
+
correlationId
|
|
54
|
+
);
|
|
55
|
+
const result = await flowClient.verifyAuthMethodRegistration({
|
|
56
|
+
correlationId,
|
|
57
|
+
continuationState,
|
|
58
|
+
code: challenge,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const account = new CustomAuthAccountData(
|
|
62
|
+
result.authenticationResult.account,
|
|
63
|
+
this.stateParameters.config,
|
|
64
|
+
this.stateParameters.cacheClient,
|
|
65
|
+
logger,
|
|
66
|
+
correlationId
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return new CustomAuthResultV2(
|
|
70
|
+
new CompletedStateV2(),
|
|
71
|
+
account,
|
|
72
|
+
continuationState.scenario
|
|
73
|
+
);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
logger.errorPii(
|
|
76
|
+
`Failed to submit the V2 authentication-method activation challenge. Error: '${error}'.`,
|
|
77
|
+
correlationId
|
|
78
|
+
);
|
|
79
|
+
return CustomAuthResultV2.createWithError(error, {
|
|
80
|
+
scenario: continuationState.scenario,
|
|
81
|
+
correlationId,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Requests a replacement activation challenge using the retained server
|
|
88
|
+
* resend link.
|
|
89
|
+
* @returns Refreshed activation metadata or a failed state.
|
|
90
|
+
*/
|
|
91
|
+
async resendChallenge(): Promise<AuthMethodRegistrationChallengeResultV2> {
|
|
92
|
+
const { correlationId, continuationState, flowClient, logger } =
|
|
93
|
+
this.stateParameters;
|
|
94
|
+
|
|
95
|
+
try {
|
|
96
|
+
logger.verbose(
|
|
97
|
+
"Resending a V2 authentication-method activation challenge.",
|
|
98
|
+
correlationId
|
|
99
|
+
);
|
|
100
|
+
const result =
|
|
101
|
+
await flowClient.resendAuthMethodRegistrationChallenge({
|
|
102
|
+
correlationId,
|
|
103
|
+
continuationState,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return new CustomAuthResultV2(
|
|
107
|
+
new AuthMethodVerificationRequiredStateV2({
|
|
108
|
+
correlationId: result.correlationId,
|
|
109
|
+
logger,
|
|
110
|
+
config: this.stateParameters.config,
|
|
111
|
+
flowClient,
|
|
112
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
113
|
+
continuationState: result.continuationState,
|
|
114
|
+
type: this.type,
|
|
115
|
+
sentTo: result.sentTo ?? this.sentTo,
|
|
116
|
+
codeLength: result.codeLength,
|
|
117
|
+
}),
|
|
118
|
+
undefined,
|
|
119
|
+
result.continuationState.scenario
|
|
120
|
+
);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
logger.errorPii(
|
|
123
|
+
`Failed to resend the V2 authentication-method activation challenge. Error: '${error}'.`,
|
|
124
|
+
correlationId
|
|
125
|
+
);
|
|
126
|
+
return CustomAuthResultV2.createWithError(error, {
|
|
127
|
+
scenario: continuationState.scenario,
|
|
128
|
+
correlationId,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
FlowSubmitCodeResultV2,
|
|
12
12
|
} from "../../../interaction_client/v2/result/FlowActionResultV2.js";
|
|
13
13
|
import { ensureArgumentIsNotNullOrUndefined } from "../../../utils/ArgumentValidator.js";
|
|
14
|
+
import type { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
|
|
14
15
|
|
|
15
16
|
export abstract class ChallengeVerificationStateBaseV2<
|
|
16
17
|
TParameters extends CodeVerificationStateParametersV2 = CodeVerificationStateParametersV2
|
|
@@ -32,7 +33,8 @@ export abstract class ChallengeVerificationStateBaseV2<
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
protected async submitCodeCore(
|
|
35
|
-
code: string
|
|
36
|
+
code: string,
|
|
37
|
+
authenticationFactor?: AuthenticationFactorV2
|
|
36
38
|
): Promise<FlowSubmitCodeResultV2> {
|
|
37
39
|
ensureArgumentIsNotNullOrUndefined(
|
|
38
40
|
"code",
|
|
@@ -43,14 +45,18 @@ export abstract class ChallengeVerificationStateBaseV2<
|
|
|
43
45
|
return this.stateParameters.flowClient.submitCode({
|
|
44
46
|
correlationId: this.stateParameters.correlationId,
|
|
45
47
|
continuationState: this.stateParameters.continuationState,
|
|
48
|
+
authenticationFactor,
|
|
46
49
|
code,
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
protected async resendCodeCore(
|
|
53
|
+
protected async resendCodeCore(
|
|
54
|
+
authenticationFactor?: AuthenticationFactorV2
|
|
55
|
+
): Promise<FlowCodeRequiredResultV2> {
|
|
51
56
|
return this.stateParameters.flowClient.resendCode({
|
|
52
57
|
correlationId: this.stateParameters.correlationId,
|
|
53
58
|
continuationState: this.stateParameters.continuationState,
|
|
59
|
+
authenticationFactor,
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
}
|
|
@@ -12,6 +12,7 @@ import { CompletedStateV2 } from "./CompletedStateV2.js";
|
|
|
12
12
|
import { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
|
|
13
13
|
import {
|
|
14
14
|
FLOW_ATTRIBUTES_REQUIRED_V2,
|
|
15
|
+
FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
|
|
15
16
|
FLOW_COMPLETED_V2,
|
|
16
17
|
FLOW_MFA_REQUIRED_V2,
|
|
17
18
|
FLOW_NEW_PASSWORD_REQUIRED_V2,
|
|
@@ -22,6 +23,7 @@ import { CustomAuthError } from "../../../error/CustomAuthError.js";
|
|
|
22
23
|
import { UNSUPPORTED_FLOW_TRANSITION } from "../../../network_client/custom_auth_api/v2/ErrorCodesV2.js";
|
|
23
24
|
import { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
|
|
24
25
|
import { ChallengeVerificationStateBaseV2 } from "./ChallengeVerificationStateBaseV2.js";
|
|
26
|
+
import { AuthMethodRegistrationRequiredStateV2 } from "./AuthMethodRegistrationRequiredStateV2.js";
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* State returned when first-factor email authentication requires a one-time
|
|
@@ -95,6 +97,22 @@ export class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2<CodeRe
|
|
|
95
97
|
);
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
if (result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2) {
|
|
101
|
+
return new CustomAuthResultV2(
|
|
102
|
+
new AuthMethodRegistrationRequiredStateV2({
|
|
103
|
+
correlationId: result.correlationId,
|
|
104
|
+
logger,
|
|
105
|
+
config: this.stateParameters.config,
|
|
106
|
+
flowClient: this.stateParameters.flowClient,
|
|
107
|
+
continuationState: result.continuationState,
|
|
108
|
+
cacheClient: this.stateParameters.cacheClient,
|
|
109
|
+
methods: result.methods,
|
|
110
|
+
}),
|
|
111
|
+
undefined,
|
|
112
|
+
result.continuationState.scenario
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
98
116
|
if (result.type === FLOW_MFA_REQUIRED_V2) {
|
|
99
117
|
const signInStateTransitionHandler =
|
|
100
118
|
this.stateParameters.signInStateTransitionHandler;
|
|
@@ -11,6 +11,7 @@ import { CustomAuthSilentCacheClient } from "../../../../get_account/interaction
|
|
|
11
11
|
import type { SignUpStateTransitionHandlerV2 } from "../../../../sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.js";
|
|
12
12
|
import type { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
|
|
13
13
|
import type { SignInStateTransitionHandlerV2 } from "../../../../sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.js";
|
|
14
|
+
import type { AuthenticationMethodRegistrationV2 } from "../AuthenticationMethodRegistrationV2.js";
|
|
14
15
|
|
|
15
16
|
export interface CustomAuthActionRequiredStateParametersV2
|
|
16
17
|
extends AuthFlowActionRequiredStateParameters {
|
|
@@ -42,3 +43,15 @@ export interface CodeRequiredStateParametersV2
|
|
|
42
43
|
|
|
43
44
|
export type MFAVerificationRequiredStateParametersV2 =
|
|
44
45
|
CodeVerificationStateParametersV2;
|
|
46
|
+
|
|
47
|
+
export interface AuthMethodRegistrationRequiredStateParametersV2
|
|
48
|
+
extends CustomAuthActionRequiredStateParametersV2 {
|
|
49
|
+
methods: readonly AuthenticationMethodRegistrationV2[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AuthMethodVerificationRequiredStateParametersV2
|
|
53
|
+
extends CustomAuthActionRequiredStateParametersV2 {
|
|
54
|
+
type: string;
|
|
55
|
+
sentTo?: string;
|
|
56
|
+
codeLength: number;
|
|
57
|
+
}
|
|
@@ -13,6 +13,7 @@ import { FLOW_COMPLETED_V2 } from "../../../interaction_client/v2/result/FlowAct
|
|
|
13
13
|
import { CustomAuthError } from "../../../error/CustomAuthError.js";
|
|
14
14
|
import { UNSUPPORTED_FLOW_TRANSITION } from "../../../network_client/custom_auth_api/v2/ErrorCodesV2.js";
|
|
15
15
|
import { ChallengeVerificationStateBaseV2 } from "./ChallengeVerificationStateBaseV2.js";
|
|
16
|
+
import { AuthenticationFactorV2 } from "../../../network_client/custom_auth_api/v2/result/BaseResultsV2.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* State returned when sign-in requires verification of an email or SMS MFA
|
|
@@ -35,7 +36,10 @@ export class MFAVerificationRequiredStateV2 extends ChallengeVerificationStateBa
|
|
|
35
36
|
|
|
36
37
|
try {
|
|
37
38
|
logger.verbose("Submitting V2 MFA challenge.", correlationId);
|
|
38
|
-
const result = await this.submitCodeCore(
|
|
39
|
+
const result = await this.submitCodeCore(
|
|
40
|
+
challenge,
|
|
41
|
+
AuthenticationFactorV2.MULTI_FACTOR
|
|
42
|
+
);
|
|
39
43
|
|
|
40
44
|
if (result.type !== FLOW_COMPLETED_V2) {
|
|
41
45
|
throw new CustomAuthError(
|
|
@@ -82,7 +86,9 @@ export class MFAVerificationRequiredStateV2 extends ChallengeVerificationStateBa
|
|
|
82
86
|
|
|
83
87
|
try {
|
|
84
88
|
logger.verbose("Resending V2 MFA challenge.", correlationId);
|
|
85
|
-
const result = await this.resendCodeCore(
|
|
89
|
+
const result = await this.resendCodeCore(
|
|
90
|
+
AuthenticationFactorV2.MULTI_FACTOR
|
|
91
|
+
);
|
|
86
92
|
|
|
87
93
|
return new CustomAuthResultV2(
|
|
88
94
|
new MFAVerificationRequiredStateV2({
|