@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
|
@@ -107,6 +107,11 @@ export type PlatformAuthRequest = {
|
|
|
107
107
|
enclave?: PlatformAuthEnclave;
|
|
108
108
|
reqCnf?: string;
|
|
109
109
|
keyId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Records whether a binding preference was included on the broker wire.
|
|
112
|
+
* This is internal response-validation state and must not be sent.
|
|
113
|
+
*/
|
|
114
|
+
bindingPreferenceSent?: boolean;
|
|
110
115
|
tokenType?: PlatformAuthTokenType;
|
|
111
116
|
shrClaims?: string;
|
|
112
117
|
shrNonce?: string;
|
|
@@ -123,27 +128,26 @@ export type PlatformAuthRequest = {
|
|
|
123
128
|
* Adds canonical proof request fields to the broker no-cache property bag.
|
|
124
129
|
*/
|
|
125
130
|
export function createPlatformAuthExtraParametersNoCache(
|
|
126
|
-
|
|
127
|
-
isProofOfPossessionRequest: boolean,
|
|
131
|
+
tokenType: PlatformAuthTokenType | undefined,
|
|
128
132
|
resourceRequestMethod?: string,
|
|
129
133
|
resourceRequestUri?: string,
|
|
130
134
|
dpopNonce?: string
|
|
131
135
|
): PlatformAuthExtraParametersNoCache | undefined {
|
|
132
|
-
if (!
|
|
133
|
-
return
|
|
136
|
+
if (!isProofOfPossessionTokenType(tokenType)) {
|
|
137
|
+
return undefined;
|
|
134
138
|
}
|
|
135
139
|
|
|
136
140
|
return {
|
|
137
|
-
...extraParametersNoCache,
|
|
138
141
|
...(resourceRequestMethod && {
|
|
139
142
|
pop_method: resourceRequestMethod,
|
|
140
143
|
}),
|
|
141
144
|
...(resourceRequestUri && {
|
|
142
145
|
pop_url: resourceRequestUri,
|
|
143
146
|
}),
|
|
144
|
-
...(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
...(tokenType === PlatformAuthTokenType.DPOP_WITH_PROOF &&
|
|
148
|
+
dpopNonce && {
|
|
149
|
+
pop_nonce: dpopNonce,
|
|
150
|
+
}),
|
|
147
151
|
};
|
|
148
152
|
}
|
|
149
153
|
|
|
@@ -12,6 +12,34 @@ export type NativeAccountInfo = {
|
|
|
12
12
|
userName: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Bounded failure reasons emitted when validating a broker DPoP response.
|
|
17
|
+
*/
|
|
18
|
+
export type BrokerDpopFailureReason =
|
|
19
|
+
| "conflicting_fields"
|
|
20
|
+
| "invalid_attestation"
|
|
21
|
+
| "missing_attestation"
|
|
22
|
+
| "missing_l1_binding"
|
|
23
|
+
| "missing_proof"
|
|
24
|
+
| "unexpected_response"
|
|
25
|
+
| "unknown_token_type";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Validated binding outcome for a broker DPoP response.
|
|
29
|
+
*/
|
|
30
|
+
export type BrokerDpopOutcome = "none" | "L1" | "L3";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Normalized DPoP fields used to validate a broker response.
|
|
34
|
+
*/
|
|
35
|
+
export type NormalizedDpopBrokerResponse = {
|
|
36
|
+
tokenType?: string;
|
|
37
|
+
proof?: unknown;
|
|
38
|
+
bindingAttested?: boolean;
|
|
39
|
+
hasBindingAttested: boolean;
|
|
40
|
+
hasMalformedBindingAttested: boolean;
|
|
41
|
+
};
|
|
42
|
+
|
|
15
43
|
/**
|
|
16
44
|
* Token response returned by Native Platform
|
|
17
45
|
*/
|
|
@@ -36,6 +64,9 @@ export type PlatformAuthResponse = {
|
|
|
36
64
|
*/
|
|
37
65
|
export type NativeResponseProperties = {
|
|
38
66
|
MATS?: string;
|
|
67
|
+
token_type?: string;
|
|
68
|
+
DPoP?: string;
|
|
69
|
+
binding_attested?: string;
|
|
39
70
|
};
|
|
40
71
|
|
|
41
72
|
/**
|
|
@@ -110,6 +110,22 @@ export class AsyncMemoryStorage<T> implements IAsyncStorage<T> {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Returns whether a key is available in persistent storage. Unlike
|
|
115
|
+
* containsKey, this does not consult the in-memory fallback.
|
|
116
|
+
*/
|
|
117
|
+
async containsKeyInPersistentStorage(
|
|
118
|
+
key: string,
|
|
119
|
+
correlationId: string
|
|
120
|
+
): Promise<boolean> {
|
|
121
|
+
try {
|
|
122
|
+
return await this.indexedDBCache.containsKey(key);
|
|
123
|
+
} catch (e) {
|
|
124
|
+
this.handleDatabaseAccessError(e, correlationId);
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
113
129
|
/**
|
|
114
130
|
* Returns true or false if the given key is present in the cache.
|
|
115
131
|
* @param key
|
|
@@ -1144,9 +1144,10 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
1144
1144
|
throw cacheError;
|
|
1145
1145
|
}
|
|
1146
1146
|
// When cache quota is exceeded, start removing access tokens until we can successfully set the item
|
|
1147
|
-
this.
|
|
1147
|
+
await this.removeAccessTokenAndTokenBindingKey(
|
|
1148
1148
|
accessTokenKeys[i],
|
|
1149
1149
|
correlationId,
|
|
1150
|
+
undefined,
|
|
1150
1151
|
false // Don't save token keys yet, do it at the end
|
|
1151
1152
|
);
|
|
1152
1153
|
} else {
|
|
@@ -1378,6 +1379,23 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
1378
1379
|
updateTokenKeys && this.removeAccessTokenKeys([key], correlationId);
|
|
1379
1380
|
}
|
|
1380
1381
|
|
|
1382
|
+
/**
|
|
1383
|
+
* Removes an access token and awaits token-binding key cleanup.
|
|
1384
|
+
*/
|
|
1385
|
+
async removeAccessTokenAndTokenBindingKey(
|
|
1386
|
+
key: string,
|
|
1387
|
+
correlationId: string,
|
|
1388
|
+
preservedKeyId?: string,
|
|
1389
|
+
updateTokenKeys: boolean = true
|
|
1390
|
+
): Promise<void> {
|
|
1391
|
+
await super.removeAccessTokenAndTokenBindingKey(
|
|
1392
|
+
key,
|
|
1393
|
+
correlationId,
|
|
1394
|
+
preservedKeyId
|
|
1395
|
+
);
|
|
1396
|
+
updateTokenKeys && this.removeAccessTokenKeys([key], correlationId);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1381
1399
|
/**
|
|
1382
1400
|
* Remove access token key from the key map
|
|
1383
1401
|
* @param key
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Constants,
|
|
24
24
|
} from "@azure/msal-common/browser";
|
|
25
25
|
import { BrowserCacheLocation } from "../utils/BrowserConstants.js";
|
|
26
|
+
import { topOpenerIsSameOriginOrAbsent } from "../utils/PopupOriginCheck.js";
|
|
26
27
|
import { INavigationClient } from "../navigation/INavigationClient.js";
|
|
27
28
|
import { NavigationClient } from "../navigation/NavigationClient.js";
|
|
28
29
|
import { FetchClient } from "../network/FetchClient.js";
|
|
@@ -115,6 +116,14 @@ export type BrowserAuthOptions = {
|
|
|
115
116
|
* This is a boolean flag and defaults to false if not specified.
|
|
116
117
|
*/
|
|
117
118
|
verifySSO?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Compute whether to send `pocd=1` on authorize and logout requests.
|
|
121
|
+
* Set to `false` to always assert it and accept responsibility for the framing threat model.
|
|
122
|
+
* Defaults to `true`; legacy polling defaults it to `false` unless explicitly set.
|
|
123
|
+
*
|
|
124
|
+
* See [Cross-Origin-Opener-Policy and popup responses](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md#cross-origin-opener-policy-and-popup-responses).
|
|
125
|
+
*/
|
|
126
|
+
originCheck?: boolean;
|
|
118
127
|
};
|
|
119
128
|
|
|
120
129
|
/** @internal */
|
|
@@ -161,6 +170,14 @@ export type BrowserSystemOptions = SystemOptions & {
|
|
|
161
170
|
* Sets the timeout for waiting for response from an iframe using BroadcastChannel
|
|
162
171
|
*/
|
|
163
172
|
iframeBridgeTimeout?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Use same-origin URL polling instead of the redirect bridge for popup and silent iframe responses.
|
|
175
|
+
* Requires a passive same-origin callback and a COOP-compatible popup round-trip.
|
|
176
|
+
* Defaults to `false`. When enabled, {@link BrowserAuthOptions.originCheck} defaults to `false`.
|
|
177
|
+
*
|
|
178
|
+
* See [Cross-Origin-Opener-Policy and popup responses](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md#cross-origin-opener-policy-and-popup-responses).
|
|
179
|
+
*/
|
|
180
|
+
enableLegacyPolling?: boolean;
|
|
164
181
|
/**
|
|
165
182
|
* Time to wait for redirection to occur before resolving promise
|
|
166
183
|
*/
|
|
@@ -305,6 +322,8 @@ export function buildConfiguration(
|
|
|
305
322
|
instanceAware: false,
|
|
306
323
|
isMcp: false,
|
|
307
324
|
verifySSO: false,
|
|
325
|
+
// Legacy polling needs COOP omitted, so it implies asserting pocd=1.
|
|
326
|
+
originCheck: !userInputSystem?.enableLegacyPolling,
|
|
308
327
|
};
|
|
309
328
|
|
|
310
329
|
// Default cache options for browser
|
|
@@ -344,6 +363,7 @@ export function buildConfiguration(
|
|
|
344
363
|
DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
|
|
345
364
|
protocolMode: ProtocolMode.AAD,
|
|
346
365
|
serverTelemetryEnabled: false,
|
|
366
|
+
enableLegacyPolling: false,
|
|
347
367
|
};
|
|
348
368
|
|
|
349
369
|
const providedSystemOptions: Required<BrowserSystemOptions> = {
|
|
@@ -365,17 +385,24 @@ export function buildConfiguration(
|
|
|
365
385
|
allowPlatformBrokerWithDOM: false,
|
|
366
386
|
};
|
|
367
387
|
|
|
388
|
+
let logger: Logger | undefined;
|
|
389
|
+
const getLogger = (): Logger => {
|
|
390
|
+
if (!logger) {
|
|
391
|
+
logger = new Logger(
|
|
392
|
+
providedSystemOptions.loggerOptions,
|
|
393
|
+
name,
|
|
394
|
+
version
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
return logger;
|
|
398
|
+
};
|
|
399
|
+
|
|
368
400
|
// Throw an error if user has set OIDCOptions without being in OIDC protocol mode
|
|
369
401
|
if (
|
|
370
402
|
userInputSystem?.protocolMode !== ProtocolMode.OIDC &&
|
|
371
403
|
userInputAuth?.OIDCOptions
|
|
372
404
|
) {
|
|
373
|
-
|
|
374
|
-
providedSystemOptions.loggerOptions,
|
|
375
|
-
name,
|
|
376
|
-
version
|
|
377
|
-
);
|
|
378
|
-
logger.warning(
|
|
405
|
+
getLogger().warning(
|
|
379
406
|
JSON.stringify(
|
|
380
407
|
createClientConfigurationError(
|
|
381
408
|
ClientConfigurationErrorCodes.cannotSetOIDCOptions,
|
|
@@ -398,6 +425,36 @@ export function buildConfiguration(
|
|
|
398
425
|
);
|
|
399
426
|
}
|
|
400
427
|
|
|
428
|
+
/*
|
|
429
|
+
* The origin check computes 0 in the embedded contexts legacy polling
|
|
430
|
+
* serves, so re-enabling it there breaks the flow. Honor it, but warn.
|
|
431
|
+
*/
|
|
432
|
+
if (
|
|
433
|
+
userInputSystem?.enableLegacyPolling &&
|
|
434
|
+
userInputAuth?.originCheck === true
|
|
435
|
+
) {
|
|
436
|
+
getLogger().warning(
|
|
437
|
+
"buildConfiguration: system.enableLegacyPolling is true and auth.originCheck is explicitly true. Legacy polling requires pocd=1, which the origin check will not produce in an embedded context. Unset auth.originCheck to let legacy polling assert it.",
|
|
438
|
+
""
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/*
|
|
443
|
+
* Opting out is a deliberate risk transfer, not an error — but the app
|
|
444
|
+
* cannot know at config time that the risky topology is actually present.
|
|
445
|
+
*/
|
|
446
|
+
if (
|
|
447
|
+
(userInputAuth?.originCheck ?? DEFAULT_AUTH_OPTIONS.originCheck) ===
|
|
448
|
+
false &&
|
|
449
|
+
typeof window !== "undefined" &&
|
|
450
|
+
!topOpenerIsSameOriginOrAbsent(window)
|
|
451
|
+
) {
|
|
452
|
+
getLogger().warning(
|
|
453
|
+
"buildConfiguration: auth.originCheck is disabled and the top-level window has a cross-origin opener. MSAL will assert pocd=1, so the STS omits Cross-Origin-Opener-Policy and that opener can reach the auth popup. The application is responsible for this risk.",
|
|
454
|
+
""
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
|
|
401
458
|
const overlayedConfig: BrowserConfiguration = {
|
|
402
459
|
auth: {
|
|
403
460
|
...DEFAULT_AUTH_OPTIONS,
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
INTERACTION_TYPE,
|
|
55
55
|
} from "../utils/BrowserConstants.js";
|
|
56
56
|
import * as BrowserUtils from "../utils/BrowserUtils.js";
|
|
57
|
+
import { cancelPendingPopupPollingResponse } from "../utils/PopupMonitor.js";
|
|
57
58
|
import { RedirectRequest } from "../request/RedirectRequest.js";
|
|
58
59
|
import { PopupRequest } from "../request/PopupRequest.js";
|
|
59
60
|
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
|
@@ -245,7 +246,6 @@ export class StandardController implements IController {
|
|
|
245
246
|
this.browserCrypto = DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
246
247
|
this.tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER;
|
|
247
248
|
}
|
|
248
|
-
|
|
249
249
|
this.eventHandler = new EventHandler(this.logger);
|
|
250
250
|
|
|
251
251
|
// Initialize the browser storage class.
|
|
@@ -473,7 +473,39 @@ export class StandardController implements IController {
|
|
|
473
473
|
private async handleRedirectPromiseInternal(
|
|
474
474
|
options?: HandleRedirectPromiseOptions
|
|
475
475
|
): Promise<AuthenticationResult | null> {
|
|
476
|
-
|
|
476
|
+
// Preserve the response for RedirectClient before removing it from the URL.
|
|
477
|
+
const responseString =
|
|
478
|
+
options?.hash ||
|
|
479
|
+
(this.config.auth.OIDCOptions.responseMode ===
|
|
480
|
+
Constants.ResponseMode.QUERY
|
|
481
|
+
? window.location.search
|
|
482
|
+
: window.location.hash);
|
|
483
|
+
const anyClientInteractionInProgress =
|
|
484
|
+
this.browserStorage.isInteractionInProgress(false);
|
|
485
|
+
const currentClientInteraction =
|
|
486
|
+
this.browserStorage.isInteractionInProgress(true);
|
|
487
|
+
const isBridgeCallback =
|
|
488
|
+
BrowserUtils.isInPopup() ||
|
|
489
|
+
(BrowserUtils.isInIframe() &&
|
|
490
|
+
!this.config.system.allowRedirectInIframe);
|
|
491
|
+
/*
|
|
492
|
+
* Clear recognized response fragments for:
|
|
493
|
+
* - Stale callbacks with no pending interaction.
|
|
494
|
+
* - This client's login callback, even if request setup or response validation fails.
|
|
495
|
+
* - This client's logout callback containing state, before the SIGNOUT early return.
|
|
496
|
+
* Leave another client's callback untouched. clearHash preserves query strings
|
|
497
|
+
* and application routes, and does nothing when no response fragment is present.
|
|
498
|
+
* Skip popup and non-redirect iframe callbacks: legacy apps may call HRP
|
|
499
|
+
* before their redirect bridge reads and broadcasts the response.
|
|
500
|
+
*/
|
|
501
|
+
if (
|
|
502
|
+
!isBridgeCallback &&
|
|
503
|
+
(!anyClientInteractionInProgress || currentClientInteraction)
|
|
504
|
+
) {
|
|
505
|
+
BrowserUtils.clearHash(window);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (!currentClientInteraction) {
|
|
477
509
|
this.logger.info(
|
|
478
510
|
"handleRedirectPromise called but there is no interaction in progress, returning null.",
|
|
479
511
|
""
|
|
@@ -489,7 +521,7 @@ export class StandardController implements IController {
|
|
|
489
521
|
""
|
|
490
522
|
);
|
|
491
523
|
this.browserStorage.setInteractionInProgress(false);
|
|
492
|
-
return
|
|
524
|
+
return null;
|
|
493
525
|
}
|
|
494
526
|
|
|
495
527
|
const loggedInAccounts = this.getAllAccounts();
|
|
@@ -571,7 +603,14 @@ export class StandardController implements IController {
|
|
|
571
603
|
this.logger,
|
|
572
604
|
this.performanceClient,
|
|
573
605
|
rootMeasurement.event.correlationId
|
|
574
|
-
)(
|
|
606
|
+
)(
|
|
607
|
+
standardRequest,
|
|
608
|
+
codeVerifier,
|
|
609
|
+
rootMeasurement,
|
|
610
|
+
options?.hash
|
|
611
|
+
? options
|
|
612
|
+
: { ...options, hash: responseString }
|
|
613
|
+
);
|
|
575
614
|
}
|
|
576
615
|
} catch (e) {
|
|
577
616
|
this.browserStorage.resetRequestCache("");
|
|
@@ -729,6 +768,10 @@ export class StandardController implements IController {
|
|
|
729
768
|
const platformAuthProvider = this.platformAuthProvider;
|
|
730
769
|
|
|
731
770
|
if (this.canUsePlatformBroker(request) && platformAuthProvider) {
|
|
771
|
+
const nativeRequest = this.sanitizeNativeBrokerRequest(
|
|
772
|
+
request,
|
|
773
|
+
correlationId
|
|
774
|
+
);
|
|
732
775
|
const nativeClient = new PlatformAuthInteractionClient(
|
|
733
776
|
this.config,
|
|
734
777
|
this.browserStorage,
|
|
@@ -750,7 +793,7 @@ export class StandardController implements IController {
|
|
|
750
793
|
this.logger,
|
|
751
794
|
this.performanceClient,
|
|
752
795
|
correlationId
|
|
753
|
-
)(
|
|
796
|
+
)(nativeRequest, atrMeasurement).catch((e: AuthError) => {
|
|
754
797
|
if (
|
|
755
798
|
e instanceof NativeAuthError &&
|
|
756
799
|
isFatalNativeAuthError(e)
|
|
@@ -840,6 +883,9 @@ export class StandardController implements IController {
|
|
|
840
883
|
request.overrideInteractionInProgress,
|
|
841
884
|
correlationId
|
|
842
885
|
);
|
|
886
|
+
if (request.overrideInteractionInProgress) {
|
|
887
|
+
cancelPendingPopupPollingResponse(this.logger);
|
|
888
|
+
}
|
|
843
889
|
} catch (e) {
|
|
844
890
|
// Since this function is syncronous we need to reject
|
|
845
891
|
return Promise.reject(e);
|
|
@@ -1603,6 +1649,12 @@ export class StandardController implements IController {
|
|
|
1603
1649
|
INTERACTION_TYPE.SIGNOUT
|
|
1604
1650
|
);
|
|
1605
1651
|
|
|
1652
|
+
try {
|
|
1653
|
+
await this.clearNativeCache(logoutRequest?.account, correlationId);
|
|
1654
|
+
} catch (error) {
|
|
1655
|
+
this.browserStorage.setInteractionInProgress(false);
|
|
1656
|
+
throw error;
|
|
1657
|
+
}
|
|
1606
1658
|
const redirectClient = this.createRedirectClient(correlationId);
|
|
1607
1659
|
return redirectClient.logout(logoutRequest);
|
|
1608
1660
|
}
|
|
@@ -1621,9 +1673,16 @@ export class StandardController implements IController {
|
|
|
1621
1673
|
);
|
|
1622
1674
|
|
|
1623
1675
|
const popupClient = this.createPopupClient(correlationId);
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1676
|
+
const nativeCacheClear = this.clearNativeCache(
|
|
1677
|
+
logoutRequest?.account,
|
|
1678
|
+
correlationId
|
|
1679
|
+
);
|
|
1680
|
+
const popupLogout = popupClient.logout(logoutRequest);
|
|
1681
|
+
return Promise.all([nativeCacheClear, popupLogout])
|
|
1682
|
+
.then(() => undefined)
|
|
1683
|
+
.finally(() => {
|
|
1684
|
+
this.browserStorage.setInteractionInProgress(false);
|
|
1685
|
+
});
|
|
1627
1686
|
} catch (e) {
|
|
1628
1687
|
// Since this function is syncronous we need to reject
|
|
1629
1688
|
return Promise.reject(e);
|
|
@@ -1640,7 +1699,53 @@ export class StandardController implements IController {
|
|
|
1640
1699
|
}
|
|
1641
1700
|
const correlationId = this.getRequestCorrelationId(logoutRequest);
|
|
1642
1701
|
const cacheClient = this.createSilentCacheClient(correlationId);
|
|
1643
|
-
|
|
1702
|
+
const nativeCacheClear = this.clearNativeCache(
|
|
1703
|
+
logoutRequest?.account,
|
|
1704
|
+
correlationId
|
|
1705
|
+
);
|
|
1706
|
+
const browserCacheClear = cacheClient.logout(logoutRequest);
|
|
1707
|
+
await Promise.all([nativeCacheClear, browserCacheClear]);
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
private async clearNativeCache(
|
|
1711
|
+
account: AccountInfo | null | undefined,
|
|
1712
|
+
correlationId: string
|
|
1713
|
+
): Promise<void> {
|
|
1714
|
+
const homeAccountId = account?.homeAccountId.toLowerCase();
|
|
1715
|
+
const environment = account?.environment.toLowerCase();
|
|
1716
|
+
const accessTokenKeys = this.nativeInternalStorage
|
|
1717
|
+
.getTokenKeys()
|
|
1718
|
+
.accessToken.filter((key) => {
|
|
1719
|
+
if (!account) {
|
|
1720
|
+
return true;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
const accessToken =
|
|
1724
|
+
this.nativeInternalStorage.getAccessTokenCredential(
|
|
1725
|
+
key,
|
|
1726
|
+
correlationId
|
|
1727
|
+
);
|
|
1728
|
+
if (!accessToken) {
|
|
1729
|
+
return false;
|
|
1730
|
+
}
|
|
1731
|
+
return (
|
|
1732
|
+
accessToken.homeAccountId.toLowerCase() === homeAccountId &&
|
|
1733
|
+
accessToken.environment.toLowerCase() === environment
|
|
1734
|
+
);
|
|
1735
|
+
});
|
|
1736
|
+
|
|
1737
|
+
await Promise.all(
|
|
1738
|
+
accessTokenKeys.map((key) =>
|
|
1739
|
+
this.nativeInternalStorage.removeAccessTokenAndTokenBindingKey(
|
|
1740
|
+
key,
|
|
1741
|
+
correlationId
|
|
1742
|
+
)
|
|
1743
|
+
)
|
|
1744
|
+
);
|
|
1745
|
+
|
|
1746
|
+
if (!account) {
|
|
1747
|
+
this.nativeInternalStorage.clear(correlationId);
|
|
1748
|
+
}
|
|
1644
1749
|
}
|
|
1645
1750
|
|
|
1646
1751
|
// #endregion
|
|
@@ -1811,6 +1916,27 @@ export class StandardController implements IController {
|
|
|
1811
1916
|
|
|
1812
1917
|
// #region Helpers
|
|
1813
1918
|
|
|
1919
|
+
/**
|
|
1920
|
+
* Removes internal DPoP key state from application-originated broker requests.
|
|
1921
|
+
*/
|
|
1922
|
+
private sanitizeNativeBrokerRequest<T extends { dpopJkt?: string }>(
|
|
1923
|
+
request: T,
|
|
1924
|
+
correlationId: string
|
|
1925
|
+
): T {
|
|
1926
|
+
if (!request.dpopJkt) {
|
|
1927
|
+
return request;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
this.logger.warning(
|
|
1931
|
+
"Ignoring caller-provided dpopJkt for a direct platform broker request.",
|
|
1932
|
+
correlationId
|
|
1933
|
+
);
|
|
1934
|
+
return {
|
|
1935
|
+
...request,
|
|
1936
|
+
dpopJkt: undefined,
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1814
1940
|
/**
|
|
1815
1941
|
* Acquire a token from native device (e.g. WAM)
|
|
1816
1942
|
* @param request
|
|
@@ -1853,6 +1979,10 @@ export class StandardController implements IController {
|
|
|
1853
1979
|
correlationId,
|
|
1854
1980
|
this.tokenBindingKeyManager
|
|
1855
1981
|
);
|
|
1982
|
+
const nativeRequest = this.sanitizeNativeBrokerRequest(
|
|
1983
|
+
request,
|
|
1984
|
+
correlationId
|
|
1985
|
+
);
|
|
1856
1986
|
|
|
1857
1987
|
return invokeAsync(
|
|
1858
1988
|
nativeClient.acquireToken.bind(nativeClient),
|
|
@@ -1860,7 +1990,7 @@ export class StandardController implements IController {
|
|
|
1860
1990
|
this.logger,
|
|
1861
1991
|
this.performanceClient,
|
|
1862
1992
|
correlationId
|
|
1863
|
-
)(
|
|
1993
|
+
)(nativeRequest, cacheLookupPolicy);
|
|
1864
1994
|
}
|
|
1865
1995
|
|
|
1866
1996
|
/**
|
|
@@ -2310,13 +2440,18 @@ export class StandardController implements IController {
|
|
|
2310
2440
|
this.performanceClient
|
|
2311
2441
|
);
|
|
2312
2442
|
|
|
2313
|
-
const
|
|
2314
|
-
preparedRequest.
|
|
2315
|
-
|
|
2443
|
+
const shouldDeduplicate =
|
|
2444
|
+
preparedRequest.request.authenticationScheme !==
|
|
2445
|
+
Constants.AuthenticationScheme.DPOP;
|
|
2446
|
+
const inProgressRequest = shouldDeduplicate
|
|
2447
|
+
? this.activeSilentTokenRequests.get(preparedRequest.key)
|
|
2448
|
+
: undefined;
|
|
2316
2449
|
|
|
2317
2450
|
if (typeof inProgressRequest === "undefined") {
|
|
2318
2451
|
this.logger.verbose(
|
|
2319
|
-
|
|
2452
|
+
shouldDeduplicate
|
|
2453
|
+
? "acquireTokenSilent called for the first time, storing active request"
|
|
2454
|
+
: "acquireTokenSilent called for DPoP request, starting an independent operation",
|
|
2320
2455
|
correlationId
|
|
2321
2456
|
);
|
|
2322
2457
|
this.performanceClient.addFields({ deduped: false }, correlationId);
|
|
@@ -2334,6 +2469,10 @@ export class StandardController implements IController {
|
|
|
2334
2469
|
},
|
|
2335
2470
|
preparedRequest.account
|
|
2336
2471
|
);
|
|
2472
|
+
if (!shouldDeduplicate) {
|
|
2473
|
+
return activeRequest;
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2337
2476
|
this.activeSilentTokenRequests.set(
|
|
2338
2477
|
preparedRequest.key,
|
|
2339
2478
|
activeRequest
|
|
@@ -147,6 +147,16 @@ export class TokenBindingKeyManager implements ITokenBindingKeyManager {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Returns whether a browser token-binding key is available.
|
|
152
|
+
*/
|
|
153
|
+
async hasTokenBindingKey(
|
|
154
|
+
keyId: string,
|
|
155
|
+
correlationId: string
|
|
156
|
+
): Promise<boolean> {
|
|
157
|
+
return this.cache.containsKey(keyId, correlationId);
|
|
158
|
+
}
|
|
159
|
+
|
|
150
160
|
/**
|
|
151
161
|
* Clears browser token-binding keys from memory and persistent storage.
|
|
152
162
|
* @param correlationId - Request correlation identifier.
|
|
@@ -260,6 +270,17 @@ export class TokenBindingKeyManager implements ITokenBindingKeyManager {
|
|
|
260
270
|
return cachedKeyPair;
|
|
261
271
|
}
|
|
262
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Returns whether a browser token-binding key survived in persistent
|
|
275
|
+
* storage and can be restored after a redirect navigation.
|
|
276
|
+
*/
|
|
277
|
+
async isTokenBindingKeyPersisted(
|
|
278
|
+
keyId: string,
|
|
279
|
+
correlationId: string
|
|
280
|
+
): Promise<boolean> {
|
|
281
|
+
return this.cache.containsKeyInPersistentStorage(keyId, correlationId);
|
|
282
|
+
}
|
|
283
|
+
|
|
263
284
|
/** @internal */
|
|
264
285
|
getTokenBindingKeyTelemetry(
|
|
265
286
|
cachedKeyPair: CachedKeyPair,
|
|
@@ -36,6 +36,7 @@ import { SignInStartResultV2 } from "../sign_in/auth_flow/v2/result/SignInStartR
|
|
|
36
36
|
import { SignUpStartResultV2 } from "../sign_up/auth_flow/v2/result/SignUpStartResultV2.js";
|
|
37
37
|
import {
|
|
38
38
|
FLOW_COMPLETED_V2,
|
|
39
|
+
FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
|
|
39
40
|
FLOW_ATTRIBUTES_REQUIRED_V2,
|
|
40
41
|
FLOW_CODE_REQUIRED_V2,
|
|
41
42
|
FLOW_METHOD_SELECTION_REQUIRED_V2,
|
|
@@ -52,6 +53,7 @@ import { PasswordRequiredStateV2 } from "../sign_in/auth_flow/v2/state/PasswordR
|
|
|
52
53
|
import { SignUpStateTransitionHandlerV2 } from "../sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.js";
|
|
53
54
|
import { SignUpPasswordRequiredStateV2 } from "../sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.js";
|
|
54
55
|
import { AttributesRequiredStateV2 } from "../sign_up/auth_flow/v2/state/AttributesRequiredStateV2.js";
|
|
56
|
+
import { AuthMethodRegistrationRequiredStateV2 } from "../core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.js";
|
|
55
57
|
import { CustomAuthAuthority } from "../core/CustomAuthAuthority.js";
|
|
56
58
|
import { DefaultPackageInfo } from "../CustomAuthConstants.js";
|
|
57
59
|
import {
|
|
@@ -804,6 +806,22 @@ export class CustomAuthStandardController
|
|
|
804
806
|
);
|
|
805
807
|
}
|
|
806
808
|
|
|
809
|
+
if (result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2) {
|
|
810
|
+
return new CustomAuthResultV2(
|
|
811
|
+
new AuthMethodRegistrationRequiredStateV2({
|
|
812
|
+
correlationId: result.correlationId,
|
|
813
|
+
logger: this.logger,
|
|
814
|
+
config: this.customAuthConfig,
|
|
815
|
+
flowClient: this.flowClientV2,
|
|
816
|
+
continuationState: result.continuationState,
|
|
817
|
+
cacheClient: this.cacheClient,
|
|
818
|
+
methods: result.methods,
|
|
819
|
+
}),
|
|
820
|
+
undefined,
|
|
821
|
+
result.continuationState.scenario
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
|
|
807
825
|
if (result.type === FLOW_CODE_REQUIRED_V2) {
|
|
808
826
|
return new CustomAuthResultV2(
|
|
809
827
|
new CodeRequiredStateV2({
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An authentication method that can be registered for the current account.
|
|
8
|
+
* The enrollment link is supplied by the server and is used when the app
|
|
9
|
+
* selects this method.
|
|
10
|
+
*/
|
|
11
|
+
export interface AuthenticationMethodRegistrationV2 {
|
|
12
|
+
type: string;
|
|
13
|
+
channels?: readonly string[];
|
|
14
|
+
enrollHref: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { FailedStateV2 } from "../state/FailedStateV2.js";
|
|
8
|
+
import type { AuthMethodVerificationRequiredStateV2 } from "../state/AuthMethodVerificationRequiredStateV2.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The states a registration challenge action can resolve to. Successful
|
|
12
|
+
* registration requires verification before the flow can complete.
|
|
13
|
+
*/
|
|
14
|
+
export type AuthMethodRegistrationChallengeResultStateV2 =
|
|
15
|
+
| AuthMethodVerificationRequiredStateV2
|
|
16
|
+
| FailedStateV2;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Result of challenging a selected authentication method for registration.
|
|
20
|
+
* It wraps the verification-required or failed state.
|
|
21
|
+
*/
|
|
22
|
+
export type AuthMethodRegistrationChallengeResultV2 =
|
|
23
|
+
CustomAuthResultV2<AuthMethodRegistrationChallengeResultStateV2>;
|