@azure/msal-browser 5.29.1 → 5.31.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 +4 -2
- package/dist/app/IPublicClientApplication.mjs +4 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.mjs +14 -2
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +10 -23
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +2 -3
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +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 +40 -4
- 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 +11 -2
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +26 -5
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +44 -11
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +189 -5
- package/dist/crypto/BrowserCrypto.mjs.map +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 -4
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +11 -4
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +3 -3
- package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +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 -4
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -3
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +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 -8
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +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 -3
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -3
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +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 -7
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +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 -2
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +2 -5
- 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 +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -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 -2
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +2 -3
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.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 +32 -27
- 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 +6 -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 +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +7 -5
- 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 +12 -3
- 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 +9 -39
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +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 +1 -1
- 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 +1 -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 +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +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 +2 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
- package/dist/custom_auth/index.mjs +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 -2
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +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 -3
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -3
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -3
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -2
- 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 +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 -2
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +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 +3 -2
- package/dist/error/BrowserAuthErrorCodes.mjs.map +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 +4 -2
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +18 -5
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +27 -21
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +8 -10
- 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 +5 -8
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +2 -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 +13 -9
- 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 +24 -6
- package/dist/popup_relay/constants.mjs.map +1 -1
- package/dist/popup_relay/index.mjs +142 -44
- package/dist/popup_relay/index.mjs.map +1 -1
- package/dist/popup_relay/relayClient.mjs +66 -23
- package/dist/popup_relay/relayClient.mjs.map +1 -1
- package/dist/protocol/Authorize.mjs +71 -13
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +2 -1
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/request/SilentRequestHelpers.mjs +7 -4
- 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 +14 -2
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserDetection.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/IframeMonitor.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/utils/PopupMonitor.mjs +1 -1
- package/dist/utils/PopupOriginCheck.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
- package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
- package/dist/webBrokerBridge/index.mjs +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +13 -9
- package/lib/custom-auth-path/msal-custom-auth.cjs +764 -314
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +764 -314
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +13 -9
- package/lib/msal-browser.cjs +791 -215
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +791 -215
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +231 -60
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +231 -60
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +2 -2
- 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/IPublicClientApplication.ts +16 -0
- package/src/app/PublicClientApplication.ts +22 -0
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +11 -44
- package/src/broker/nativeBroker/PlatformAuthProvider.ts +1 -2
- package/src/broker/nativeBroker/PlatformAuthResponse.ts +2 -6
- package/src/cache/BrowserCacheManager.ts +66 -6
- package/src/config/Configuration.ts +35 -0
- package/src/controllers/NestedAppAuthController.ts +35 -2
- package/src/controllers/StandardController.ts +76 -12
- package/src/controllers/UnknownOperatingContextController.ts +10 -0
- package/src/crypto/BrowserCrypto.ts +367 -2
- package/src/custom_auth/CustomAuthActionInputs.ts +0 -9
- package/src/custom_auth/CustomAuthPublicClientApplication.ts +0 -3
- package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +0 -3
- package/src/custom_auth/controller/CustomAuthStandardController.ts +15 -2
- package/src/custom_auth/core/CustomAuthAuthority.ts +2 -1
- package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.ts +0 -3
- package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.ts +0 -2
- package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.ts +0 -7
- package/src/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.ts +0 -2
- package/src/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.ts +0 -2
- package/src/custom_auth/core/auth_flow/mfa/state/MfaState.ts +0 -6
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +0 -4
- package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +0 -3
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +8 -6
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +1 -0
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +43 -29
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +21 -2
- package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +12 -8
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +35 -4
- package/src/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.ts +10 -47
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +1 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +9 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +5 -5
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +2 -5
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +2 -4
- package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +0 -2
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +0 -1
- package/src/custom_auth/sign_in/auth_flow/result/SignInResult.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +0 -1
- package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +0 -2
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +0 -2
- package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +0 -1
- package/src/error/AsymmetricEarSubErrors.ts +18 -0
- package/src/error/BrowserAuthErrorCodes.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +6 -1
- package/src/interaction_client/PlatformAuthInteractionClient.ts +28 -8
- package/src/interaction_client/PopupClient.ts +59 -29
- package/src/interaction_client/RedirectClient.ts +10 -13
- package/src/interaction_client/SilentIframeClient.ts +9 -13
- package/src/interaction_client/StandardInteractionClient.ts +1 -0
- package/src/packageMetadata.ts +1 -1
- package/src/popup_relay/constants.ts +34 -3
- package/src/popup_relay/index.ts +200 -45
- package/src/popup_relay/relayClient.ts +108 -24
- package/src/protocol/Authorize.ts +123 -11
- package/src/request/EndSessionPopupRequest.ts +3 -0
- package/src/request/PopupRequest.ts +1 -0
- package/src/request/RedirectRequest.ts +4 -0
- package/src/request/RequestHelpers.ts +5 -0
- package/src/request/SilentRequestHelpers.ts +10 -4
- package/src/request/SsoSilentRequest.ts +1 -0
- package/src/telemetry/BrowserPerformanceEvents.ts +14 -0
- package/types/app/IPublicClientApplication.d.ts +8 -0
- package/types/app/IPublicClientApplication.d.ts.map +1 -1
- package/types/app/PublicClientApplication.d.ts +6 -1
- package/types/app/PublicClientApplication.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +0 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +2 -6
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +20 -2
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/config/Configuration.d.ts +14 -0
- package/types/config/Configuration.d.ts.map +1 -1
- package/types/controllers/NestedAppAuthController.d.ts +5 -0
- package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +4 -0
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/controllers/UnknownOperatingContextController.d.ts +5 -0
- package/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/types/crypto/BrowserCrypto.d.ts +34 -0
- package/types/crypto/BrowserCrypto.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthActionInputs.d.ts +0 -9
- package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +0 -3
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +0 -3
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +0 -3
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +0 -7
- package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +0 -6
- package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +0 -4
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +0 -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 +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +0 -2
- 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 +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +0 -1
- 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 +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +0 -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/CompletedStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.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 +3 -2
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +10 -1
- 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/BaseApiClientV2.d.ts +1 -1
- 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/CustomAuthApiClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -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 +8 -0
- 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 +4 -5
- 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 -6
- 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 +2 -5
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
- package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +0 -2
- 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 +0 -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/result/SignInResult.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +0 -2
- 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 +0 -2
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +0 -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 +0 -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 +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
- package/types/error/AsymmetricEarSubErrors.d.ts +14 -0
- package/types/error/AsymmetricEarSubErrors.d.ts.map +1 -0
- package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
- package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/types/interaction_client/BaseInteractionClient.d.ts +3 -2
- package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts +3 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts +0 -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/popup_relay/constants.d.ts +10 -3
- package/types/popup_relay/constants.d.ts.map +1 -1
- package/types/popup_relay/index.d.ts +27 -11
- package/types/popup_relay/index.d.ts.map +1 -1
- package/types/popup_relay/relayClient.d.ts +9 -11
- package/types/popup_relay/relayClient.d.ts.map +1 -1
- package/types/protocol/Authorize.d.ts +5 -0
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/EndSessionPopupRequest.d.ts +3 -0
- package/types/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/types/request/PopupRequest.d.ts +1 -1
- package/types/request/PopupRequest.d.ts.map +1 -1
- package/types/request/RedirectRequest.d.ts +4 -1
- package/types/request/RedirectRequest.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/request/SilentRequestHelpers.d.ts +1 -1
- package/types/request/SilentRequestHelpers.d.ts.map +1 -1
- package/types/request/SsoSilentRequest.d.ts +1 -1
- package/types/request/SsoSilentRequest.d.ts.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +12 -0
- package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
package/src/popup_relay/index.ts
CHANGED
|
@@ -3,16 +3,32 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { POPUP_RELAY_RESPONSE_TYPE } from "./constants.js";
|
|
7
6
|
import {
|
|
7
|
+
POPUP_RELAY_READY_TYPE,
|
|
8
|
+
POPUP_RELAY_REQUEST_TYPE,
|
|
9
|
+
POPUP_RELAY_RESPONSE_TYPE,
|
|
10
|
+
POPUP_RELAY_V2_RESPONSE_TYPE,
|
|
11
|
+
getPopupRelayProtocolVersion,
|
|
12
|
+
} from "./constants.js";
|
|
13
|
+
import {
|
|
14
|
+
BrowserAuthError,
|
|
8
15
|
BrowserAuthErrorCodes,
|
|
9
16
|
createBrowserAuthError,
|
|
10
17
|
} from "../error/BrowserAuthError.js";
|
|
11
18
|
import { createForm } from "../protocol/Authorize.js";
|
|
12
19
|
import { PopupWindowAttributes } from "../request/PopupWindowAttributes.js";
|
|
20
|
+
import { createNewGuid } from "../crypto/BrowserCrypto.js";
|
|
13
21
|
|
|
14
22
|
/** Options for {@link runPopupRelay}. */
|
|
15
23
|
export type PopupRelayOptions = {
|
|
24
|
+
/**
|
|
25
|
+
* Wire protocol accepted by this endpoint. Defaults to 1 to preserve
|
|
26
|
+
* existing relay deployments. Version 1 is deprecated due to security
|
|
27
|
+
* concerns: URL-fragment descriptors do not authenticate their provenance.
|
|
28
|
+
* Deploy a separate endpoint with version 2 for authenticated handoff,
|
|
29
|
+
* then retire the v1 endpoint.
|
|
30
|
+
*/
|
|
31
|
+
protocolVersion?: 1 | 2;
|
|
16
32
|
/**
|
|
17
33
|
* Sizing/positioning for the IdP child popup the relay page opens. Same
|
|
18
34
|
* shape as `PopupRequest.popupWindowAttributes` (`popupSize` with width and
|
|
@@ -37,7 +53,10 @@ export type PopupRelayOptions = {
|
|
|
37
53
|
* **Optional — omitting it does not disable the relay.** The relay page
|
|
38
54
|
* always rejects non-`https:` navigation targets; this option additionally
|
|
39
55
|
* pins *which* https origins are acceptable. When omitted, any https origin
|
|
40
|
-
* is allowed
|
|
56
|
+
* is allowed. V1 is deprecated due to security concerns: it accepts
|
|
57
|
+
* unauthenticated fragment descriptors and retains the legacy
|
|
58
|
+
* arbitrary-navigation risk until the endpoint is retired. V2 requires an
|
|
59
|
+
* authenticated opener request even when this option is omitted.
|
|
41
60
|
* Passing an explicitly empty array means "allow nothing" and will reject
|
|
42
61
|
* every navigation.
|
|
43
62
|
*/
|
|
@@ -101,12 +120,10 @@ function normalizeAllowedOrigins(allowedAuthorityOrigins: string[]): string[] {
|
|
|
101
120
|
}
|
|
102
121
|
|
|
103
122
|
/**
|
|
104
|
-
* Validates a navigation target
|
|
123
|
+
* Validates a navigation target before it can
|
|
105
124
|
* reach `window.open` or a form `action`.
|
|
106
125
|
*
|
|
107
|
-
*
|
|
108
|
-
* page, so a target must be proven safe rather than assumed to have been built
|
|
109
|
-
* by MSAL. Only absolute `https:` URLs without embedded credentials are
|
|
126
|
+
* Only absolute `https:` URLs without embedded credentials are
|
|
110
127
|
* accepted, which rules out active/local schemes (`javascript:`, `data:`,
|
|
111
128
|
* `blob:`, `vbscript:`, `file:`) that would otherwise execute in — or read
|
|
112
129
|
* from — the relay page's own first-party security origin. `https:`-only also
|
|
@@ -162,27 +179,20 @@ function validateNavigationTarget(
|
|
|
162
179
|
}
|
|
163
180
|
|
|
164
181
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* exactly (no implicit GET fallback for an unknown `method`) and both
|
|
182
|
+
* Fully validates a v1 descriptor or an authenticated v2 request. The shape
|
|
183
|
+
* is checked exactly (no implicit GET fallback for an unknown `method`) and both
|
|
168
184
|
* navigation targets — the GET `url` and the POST `action` — are run through
|
|
169
185
|
* {@link validateNavigationTarget}.
|
|
170
186
|
*/
|
|
171
187
|
function parseRelayRequest(
|
|
172
|
-
rawReq:
|
|
188
|
+
rawReq: unknown,
|
|
173
189
|
allowedAuthorityOrigins?: string[]
|
|
174
190
|
): PopupRelayRequest {
|
|
175
|
-
|
|
176
|
-
try {
|
|
177
|
-
parsed = JSON.parse(rawReq);
|
|
178
|
-
} catch (e) {
|
|
179
|
-
parsed = null;
|
|
180
|
-
}
|
|
181
|
-
if (typeof parsed !== "object" || parsed === null) {
|
|
191
|
+
if (typeof rawReq !== "object" || rawReq === null) {
|
|
182
192
|
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
183
193
|
}
|
|
184
194
|
|
|
185
|
-
const request =
|
|
195
|
+
const request = rawReq as Record<string, unknown>;
|
|
186
196
|
const id = request.id;
|
|
187
197
|
if (typeof id !== "string" || !id) {
|
|
188
198
|
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
@@ -245,17 +255,22 @@ function buildChildPopupFeatures(attributes?: PopupWindowAttributes): string {
|
|
|
245
255
|
/**
|
|
246
256
|
* Entry point for the top-level "popup-relay" page referenced by
|
|
247
257
|
* `auth.popupRelayUri`. Call this from the relay page (which MSAL opens as a
|
|
248
|
-
* top-level popup from inside an embedded, cross-origin iframe).
|
|
258
|
+
* top-level popup from inside an embedded, cross-origin iframe).
|
|
259
|
+
*
|
|
260
|
+
* V1 (the compatibility default) is deprecated due to security concerns. It
|
|
261
|
+
* executes validated but unauthenticated fragment descriptors and returns the
|
|
262
|
+
* legacy response envelope. It retains the legacy risk when origins are not
|
|
263
|
+
* pinned; retire that endpoint after migrating callers.
|
|
249
264
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* 3.
|
|
265
|
+
* V2 must be explicitly selected on both the app and its separate relay
|
|
266
|
+
* endpoint. It:
|
|
267
|
+
*
|
|
268
|
+
* 1. Reads the request id from the hash, then scrubs the hash. Navigation
|
|
269
|
+
* descriptors in the hash are never executed.
|
|
270
|
+
* 2. Reserves a blank child popup during the user gesture, then requests the
|
|
271
|
+
* navigation from the opener through an origin- and source-checked
|
|
272
|
+
* postMessage handoff bound to this relay document's nonce.
|
|
273
|
+
* 3. Validates and performs the authenticated navigation (the relay page
|
|
259
274
|
* stays put, so its `window.opener` link back to the embedded frame
|
|
260
275
|
* survives COOP).
|
|
261
276
|
* 4. Waits for the child's redirect URI page (which must run the redirect
|
|
@@ -274,13 +289,33 @@ function buildChildPopupFeatures(attributes?: PopupWindowAttributes): string {
|
|
|
274
289
|
* @param options - {@link PopupRelayOptions}
|
|
275
290
|
*/
|
|
276
291
|
export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
292
|
+
const protocolVersion = getPopupRelayProtocolVersion(
|
|
293
|
+
options?.protocolVersion
|
|
294
|
+
);
|
|
277
295
|
const opener = window.opener as Window | null;
|
|
278
296
|
const targetOrigin = window.location.origin;
|
|
279
297
|
|
|
280
298
|
const hashParams = new URLSearchParams(
|
|
281
299
|
window.location.hash.replace(/^#/, "")
|
|
282
300
|
);
|
|
283
|
-
const
|
|
301
|
+
const incomingVersion = hashParams.has("id") ? 2 : 1;
|
|
302
|
+
let legacyDescriptor: unknown;
|
|
303
|
+
if (incomingVersion === 1) {
|
|
304
|
+
try {
|
|
305
|
+
legacyDescriptor = JSON.parse(hashParams.get("req") || "");
|
|
306
|
+
} catch {
|
|
307
|
+
legacyDescriptor = null;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
let id: unknown = hashParams.get("id") || "";
|
|
311
|
+
if (
|
|
312
|
+
incomingVersion === 1 &&
|
|
313
|
+
legacyDescriptor &&
|
|
314
|
+
typeof legacyDescriptor === "object" &&
|
|
315
|
+
"id" in legacyDescriptor
|
|
316
|
+
) {
|
|
317
|
+
id = legacyDescriptor.id;
|
|
318
|
+
}
|
|
284
319
|
|
|
285
320
|
// Scrub the relayed request out of the relay page's own URL immediately.
|
|
286
321
|
if (typeof window.history.replaceState === "function") {
|
|
@@ -299,15 +334,42 @@ export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
|
299
334
|
);
|
|
300
335
|
}
|
|
301
336
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
*/
|
|
306
|
-
const request = parseRelayRequest(rawReq, options?.allowedAuthorityOrigins);
|
|
337
|
+
if (typeof id !== "string" || !id) {
|
|
338
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
339
|
+
}
|
|
307
340
|
|
|
308
|
-
|
|
341
|
+
if (incomingVersion !== protocolVersion) {
|
|
342
|
+
const error = createBrowserAuthError(
|
|
343
|
+
BrowserAuthErrorCodes.popupRelayUnsupportedFlow,
|
|
344
|
+
"",
|
|
345
|
+
"popup_relay_protocol_mismatch"
|
|
346
|
+
);
|
|
347
|
+
opener.postMessage(
|
|
348
|
+
{
|
|
349
|
+
type:
|
|
350
|
+
incomingVersion === 1
|
|
351
|
+
? POPUP_RELAY_RESPONSE_TYPE
|
|
352
|
+
: POPUP_RELAY_V2_RESPONSE_TYPE,
|
|
353
|
+
id,
|
|
354
|
+
error: error.errorCode,
|
|
355
|
+
subError: error.subError,
|
|
356
|
+
},
|
|
357
|
+
targetOrigin
|
|
358
|
+
);
|
|
359
|
+
throw error;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
const legacyRequest =
|
|
363
|
+
protocolVersion === 1
|
|
364
|
+
? parseRelayRequest(
|
|
365
|
+
legacyDescriptor,
|
|
366
|
+
options?.allowedAuthorityOrigins
|
|
367
|
+
)
|
|
368
|
+
: undefined;
|
|
369
|
+
const nonce = protocolVersion === 2 ? createNewGuid() : undefined;
|
|
309
370
|
const channel = new BroadcastChannel(id);
|
|
310
371
|
let settled = false;
|
|
372
|
+
let requestReceived = protocolVersion === 1;
|
|
311
373
|
/*
|
|
312
374
|
* Timer handles are kept on a const holder so relay() (declared before the
|
|
313
375
|
* timers are created) can clear them — `let` handles trip prefer-const, and
|
|
@@ -318,7 +380,11 @@ export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
|
318
380
|
timeoutId?: number;
|
|
319
381
|
} = {};
|
|
320
382
|
|
|
321
|
-
const relay = (message: {
|
|
383
|
+
const relay = (message: {
|
|
384
|
+
payload?: string;
|
|
385
|
+
error?: string;
|
|
386
|
+
subError?: string;
|
|
387
|
+
}): void => {
|
|
322
388
|
if (settled) {
|
|
323
389
|
return;
|
|
324
390
|
}
|
|
@@ -330,8 +396,18 @@ export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
|
330
396
|
}
|
|
331
397
|
clearInterval(timers.closedPoll);
|
|
332
398
|
clearTimeout(timers.timeoutId);
|
|
399
|
+
window.removeEventListener("message", onRequest);
|
|
400
|
+
window.removeEventListener("pagehide", onPageHide);
|
|
333
401
|
opener.postMessage(
|
|
334
|
-
{
|
|
402
|
+
{
|
|
403
|
+
type:
|
|
404
|
+
protocolVersion === 1
|
|
405
|
+
? POPUP_RELAY_RESPONSE_TYPE
|
|
406
|
+
: POPUP_RELAY_V2_RESPONSE_TYPE,
|
|
407
|
+
id,
|
|
408
|
+
...(protocolVersion === 2 ? { nonce } : {}),
|
|
409
|
+
...message,
|
|
410
|
+
},
|
|
335
411
|
targetOrigin
|
|
336
412
|
);
|
|
337
413
|
setTimeout(() => {
|
|
@@ -346,29 +422,96 @@ export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
|
346
422
|
// The redirect bridge broadcasts the raw auth response payload here.
|
|
347
423
|
channel.onmessage = (event: MessageEvent): void => {
|
|
348
424
|
const payload = event.data && event.data.payload;
|
|
349
|
-
if (payload) {
|
|
425
|
+
if (requestReceived && payload) {
|
|
350
426
|
relay({ payload });
|
|
351
427
|
}
|
|
352
428
|
};
|
|
353
429
|
|
|
430
|
+
const onRequest = (event: MessageEvent): void => {
|
|
431
|
+
const data = event.data;
|
|
432
|
+
if (
|
|
433
|
+
settled ||
|
|
434
|
+
requestReceived ||
|
|
435
|
+
protocolVersion !== 2 ||
|
|
436
|
+
!childPopup ||
|
|
437
|
+
event.origin !== targetOrigin ||
|
|
438
|
+
event.source !== opener ||
|
|
439
|
+
!data ||
|
|
440
|
+
data.type !== POPUP_RELAY_REQUEST_TYPE ||
|
|
441
|
+
data.id !== id ||
|
|
442
|
+
data.nonce !== nonce
|
|
443
|
+
) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
window.removeEventListener("message", onRequest);
|
|
447
|
+
try {
|
|
448
|
+
const request = parseRelayRequest(
|
|
449
|
+
data.request,
|
|
450
|
+
options?.allowedAuthorityOrigins
|
|
451
|
+
);
|
|
452
|
+
if (request.id !== id) {
|
|
453
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
454
|
+
}
|
|
455
|
+
requestReceived = true;
|
|
456
|
+
if (request.method === "GET") {
|
|
457
|
+
childPopup.location.replace(request.url);
|
|
458
|
+
} else {
|
|
459
|
+
createForm(
|
|
460
|
+
childPopup.document,
|
|
461
|
+
request.action,
|
|
462
|
+
request.fields
|
|
463
|
+
).submit();
|
|
464
|
+
}
|
|
465
|
+
} catch (e) {
|
|
466
|
+
relay({
|
|
467
|
+
error:
|
|
468
|
+
e instanceof BrowserAuthError
|
|
469
|
+
? e.errorCode
|
|
470
|
+
: BrowserAuthErrorCodes.popupWindowError,
|
|
471
|
+
subError:
|
|
472
|
+
e instanceof BrowserAuthError
|
|
473
|
+
? e.subError
|
|
474
|
+
: "popup_relay_navigation_failed",
|
|
475
|
+
});
|
|
476
|
+
childPopup.close();
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
|
|
354
480
|
const features = buildChildPopupFeatures(options?.popupWindowAttributes);
|
|
481
|
+
// Reserve a fresh window before the asynchronous handoff consumes activation.
|
|
355
482
|
const childPopup =
|
|
356
|
-
|
|
357
|
-
? window.open(
|
|
358
|
-
: window.open(
|
|
483
|
+
legacyRequest?.method === "GET"
|
|
484
|
+
? window.open(legacyRequest.url, "msalPopupRelayChild", features)
|
|
485
|
+
: window.open(
|
|
486
|
+
"about:blank",
|
|
487
|
+
protocolVersion === 1 ? "msalPopupRelayChild" : "_blank",
|
|
488
|
+
features
|
|
489
|
+
);
|
|
359
490
|
|
|
360
491
|
if (!childPopup) {
|
|
361
492
|
relay({ error: BrowserAuthErrorCodes.popupWindowError });
|
|
362
493
|
return;
|
|
363
494
|
}
|
|
364
495
|
|
|
365
|
-
|
|
496
|
+
function onPageHide(): void {
|
|
497
|
+
settled = true;
|
|
498
|
+
window.removeEventListener("message", onRequest);
|
|
499
|
+
window.removeEventListener("pagehide", onPageHide);
|
|
500
|
+
clearInterval(timers.closedPoll);
|
|
501
|
+
clearTimeout(timers.timeoutId);
|
|
502
|
+
channel.close();
|
|
503
|
+
childPopup?.close();
|
|
504
|
+
}
|
|
505
|
+
if (protocolVersion === 2) {
|
|
506
|
+
window.addEventListener("message", onRequest);
|
|
507
|
+
} else if (legacyRequest?.method === "POST") {
|
|
366
508
|
createForm(
|
|
367
509
|
childPopup.document,
|
|
368
|
-
|
|
369
|
-
|
|
510
|
+
legacyRequest.action,
|
|
511
|
+
legacyRequest.fields
|
|
370
512
|
).submit();
|
|
371
513
|
}
|
|
514
|
+
window.addEventListener("pagehide", onPageHide);
|
|
372
515
|
|
|
373
516
|
timers.closedPoll = window.setInterval(() => {
|
|
374
517
|
if (childPopup.closed && !settled) {
|
|
@@ -397,7 +540,19 @@ export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
|
397
540
|
} catch (e) {
|
|
398
541
|
/* ignore */
|
|
399
542
|
}
|
|
400
|
-
relay({
|
|
543
|
+
relay({
|
|
544
|
+
error: BrowserAuthErrorCodes.timedOut,
|
|
545
|
+
subError: requestReceived
|
|
546
|
+
? undefined
|
|
547
|
+
: "popup_relay_handshake_timeout",
|
|
548
|
+
});
|
|
401
549
|
}
|
|
402
550
|
}, options?.timeoutMs || DEFAULT_POPUP_RELAY_TIMEOUT_MS);
|
|
551
|
+
|
|
552
|
+
if (protocolVersion === 2) {
|
|
553
|
+
opener.postMessage(
|
|
554
|
+
{ type: POPUP_RELAY_READY_TYPE, id, nonce },
|
|
555
|
+
targetOrigin
|
|
556
|
+
);
|
|
557
|
+
}
|
|
403
558
|
}
|
|
@@ -15,7 +15,13 @@ import {
|
|
|
15
15
|
} from "../error/BrowserAuthError.js";
|
|
16
16
|
import { redirectBridgeEmptyResponse } from "../error/BrowserAuthErrorCodes.js";
|
|
17
17
|
import type { WaitForBridgeRequest } from "../utils/BrowserUtils.js";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
POPUP_RELAY_READY_TYPE,
|
|
20
|
+
POPUP_RELAY_REQUEST_TYPE,
|
|
21
|
+
POPUP_RELAY_RESPONSE_TYPE,
|
|
22
|
+
POPUP_RELAY_V2_RESPONSE_TYPE,
|
|
23
|
+
getPopupRelayProtocolVersion,
|
|
24
|
+
} from "./constants.js";
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* The navigation the popup-relay page should perform in its IdP child popup:
|
|
@@ -29,12 +35,9 @@ export type PopupRelayAction =
|
|
|
29
35
|
| { method: "POST"; action: string; fields: Record<string, string> };
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
|
-
* Builds the
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* library-state `id` so the relay page can listen on the right BroadcastChannel
|
|
36
|
-
* and echo the id back. The relay URI is resolved against the app origin, so it
|
|
37
|
-
* must be same-origin as the embedded frame. See `runPopupRelay`.
|
|
38
|
+
* Builds the same-origin relay URL. V1 preserves the fragment descriptor;
|
|
39
|
+
* explicitly selected v2 carries only the id and retains the navigation for
|
|
40
|
+
* the authenticated handoff.
|
|
38
41
|
*
|
|
39
42
|
* @internal
|
|
40
43
|
*/
|
|
@@ -42,9 +45,13 @@ export function buildPopupRelayUrl(
|
|
|
42
45
|
popupRelayUri: string,
|
|
43
46
|
id: string,
|
|
44
47
|
action: PopupRelayAction,
|
|
45
|
-
correlationId: string
|
|
48
|
+
correlationId: string,
|
|
49
|
+
protocolVersion?: 1 | 2
|
|
46
50
|
): string {
|
|
47
|
-
const
|
|
51
|
+
const version = getPopupRelayProtocolVersion(
|
|
52
|
+
protocolVersion,
|
|
53
|
+
correlationId
|
|
54
|
+
);
|
|
48
55
|
const target = new URL(popupRelayUri, window.location.origin);
|
|
49
56
|
/*
|
|
50
57
|
* The relay page must be same-origin as the embedded frame: the response is
|
|
@@ -61,7 +68,11 @@ export function buildPopupRelayUrl(
|
|
|
61
68
|
);
|
|
62
69
|
}
|
|
63
70
|
const hashParams = new URLSearchParams();
|
|
64
|
-
|
|
71
|
+
if (version === 1) {
|
|
72
|
+
hashParams.set("req", JSON.stringify({ id, ...action }));
|
|
73
|
+
} else {
|
|
74
|
+
hashParams.set("id", id);
|
|
75
|
+
}
|
|
65
76
|
target.hash = hashParams.toString();
|
|
66
77
|
return target.toString();
|
|
67
78
|
}
|
|
@@ -73,9 +84,10 @@ export function buildPopupRelayUrl(
|
|
|
73
84
|
* partitioning blocks the BroadcastChannel the redirect bridge uses from
|
|
74
85
|
* reaching the embedded frame.
|
|
75
86
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
87
|
+
* In v2, the retained navigation is sent once, after a ready signal from the popup
|
|
88
|
+
* window we opened on our own origin with the matching library-state id.
|
|
89
|
+
* Successful responses must also carry that handoff's relay-document nonce.
|
|
90
|
+
* Setup failures can reject the request before the handoff completes.
|
|
79
91
|
*
|
|
80
92
|
* @internal
|
|
81
93
|
*/
|
|
@@ -84,8 +96,21 @@ export async function waitForPopupRelayResponse(
|
|
|
84
96
|
logger: Logger,
|
|
85
97
|
request: WaitForBridgeRequest,
|
|
86
98
|
popupWindow: Window,
|
|
87
|
-
performanceClient: IPerformanceClient
|
|
99
|
+
performanceClient: IPerformanceClient,
|
|
100
|
+
action?: PopupRelayAction,
|
|
101
|
+
protocolVersion?: 1 | 2
|
|
88
102
|
): Promise<string> {
|
|
103
|
+
const version = getPopupRelayProtocolVersion(
|
|
104
|
+
protocolVersion,
|
|
105
|
+
request.correlationId
|
|
106
|
+
);
|
|
107
|
+
if (version === 2 && !action) {
|
|
108
|
+
throw createBrowserAuthError(
|
|
109
|
+
BrowserAuthErrorCodes.popupRelayUnsupportedFlow,
|
|
110
|
+
request.correlationId,
|
|
111
|
+
"popup_relay_bad_request"
|
|
112
|
+
);
|
|
113
|
+
}
|
|
89
114
|
return new Promise<string>((resolve, reject) => {
|
|
90
115
|
const correlationId = request.correlationId;
|
|
91
116
|
logger.verbose(
|
|
@@ -93,10 +118,12 @@ export async function waitForPopupRelayResponse(
|
|
|
93
118
|
correlationId
|
|
94
119
|
);
|
|
95
120
|
performanceClient.addFields(
|
|
96
|
-
{
|
|
121
|
+
{
|
|
122
|
+
redirectBridgeTimeoutMs: timeoutMs,
|
|
123
|
+
popupRelayProtocolVersion: version,
|
|
124
|
+
},
|
|
97
125
|
correlationId
|
|
98
126
|
);
|
|
99
|
-
|
|
100
127
|
const { libraryState } = ProtocolUtils.parseRequestState(
|
|
101
128
|
base64Decode,
|
|
102
129
|
request.state || "",
|
|
@@ -105,6 +132,7 @@ export async function waitForPopupRelayResponse(
|
|
|
105
132
|
const expectedId = libraryState.id;
|
|
106
133
|
const expectedOrigin = window.location.origin;
|
|
107
134
|
let settled = false;
|
|
135
|
+
let handoffNonce = "";
|
|
108
136
|
|
|
109
137
|
const cleanup = (): void => {
|
|
110
138
|
window.removeEventListener("message", onMessage);
|
|
@@ -120,21 +148,77 @@ export async function waitForPopupRelayResponse(
|
|
|
120
148
|
return;
|
|
121
149
|
}
|
|
122
150
|
const data = event.data;
|
|
123
|
-
if (
|
|
124
|
-
!data ||
|
|
125
|
-
data.type !== POPUP_RELAY_RESPONSE_TYPE ||
|
|
126
|
-
data.id !== expectedId
|
|
127
|
-
) {
|
|
151
|
+
if (!data || data.id !== expectedId) {
|
|
128
152
|
return;
|
|
129
153
|
}
|
|
130
154
|
if (settled) {
|
|
131
155
|
return;
|
|
132
156
|
}
|
|
157
|
+
if (version === 2 && data.type === POPUP_RELAY_READY_TYPE) {
|
|
158
|
+
if (
|
|
159
|
+
handoffNonce ||
|
|
160
|
+
typeof data.nonce !== "string" ||
|
|
161
|
+
!data.nonce
|
|
162
|
+
) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
handoffNonce = data.nonce;
|
|
166
|
+
try {
|
|
167
|
+
popupWindow.postMessage(
|
|
168
|
+
{
|
|
169
|
+
type: POPUP_RELAY_REQUEST_TYPE,
|
|
170
|
+
id: expectedId,
|
|
171
|
+
nonce: handoffNonce,
|
|
172
|
+
request: { id: expectedId, ...action },
|
|
173
|
+
},
|
|
174
|
+
expectedOrigin
|
|
175
|
+
);
|
|
176
|
+
performanceClient.addFields(
|
|
177
|
+
{ "ext.popupRelayRequestSent": true },
|
|
178
|
+
correlationId
|
|
179
|
+
);
|
|
180
|
+
} catch {
|
|
181
|
+
settled = true;
|
|
182
|
+
cleanup();
|
|
183
|
+
logger.error(
|
|
184
|
+
"PopupRelay.waitForPopupRelayResponse - request handoff failed",
|
|
185
|
+
correlationId
|
|
186
|
+
);
|
|
187
|
+
reject(
|
|
188
|
+
createBrowserAuthError(
|
|
189
|
+
BrowserAuthErrorCodes.popupWindowError,
|
|
190
|
+
correlationId,
|
|
191
|
+
"popup_relay_handoff_failed"
|
|
192
|
+
)
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const hasError =
|
|
198
|
+
typeof data.error === "string" && data.error.length > 0;
|
|
199
|
+
const responseType =
|
|
200
|
+
version === 1
|
|
201
|
+
? POPUP_RELAY_RESPONSE_TYPE
|
|
202
|
+
: POPUP_RELAY_V2_RESPONSE_TYPE;
|
|
203
|
+
if (
|
|
204
|
+
data.type !== responseType ||
|
|
205
|
+
(version === 2 &&
|
|
206
|
+
((!handoffNonce && !hasError) ||
|
|
207
|
+
(handoffNonce && data.nonce !== handoffNonce)))
|
|
208
|
+
) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
133
211
|
settled = true;
|
|
134
212
|
cleanup();
|
|
135
|
-
if (
|
|
136
|
-
reject(
|
|
137
|
-
|
|
213
|
+
if (hasError) {
|
|
214
|
+
reject(
|
|
215
|
+
createBrowserAuthError(
|
|
216
|
+
data.error,
|
|
217
|
+
correlationId,
|
|
218
|
+
data.subError
|
|
219
|
+
)
|
|
220
|
+
);
|
|
221
|
+
} else if (typeof data.payload === "string" && data.payload) {
|
|
138
222
|
resolve(data.payload);
|
|
139
223
|
} else {
|
|
140
224
|
reject(
|