@azure/msal-browser 5.27.0 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +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 +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +65 -7
- 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 +6 -4
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +58 -50
- 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 +3 -5
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +19 -13
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +8 -2
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +58 -69
- 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 +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 +44 -16
- 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 +100 -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 +27 -19
- 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 +2 -4
- 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 +2 -3
- 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 +20 -8
- 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 +110 -0
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
- 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 +2 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +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 +465 -186
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +2 -6
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +18 -3
- 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 -8
- 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 +147 -38
- 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 +21 -10
- 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 -2
- 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 +15 -3
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +10 -3
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +17 -2
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
- package/dist/custom_auth/index.mjs +6 -3
- 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 +49 -14
- 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 +24 -0
- package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs.map +1 -0
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +4 -7
- 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 +2 -2
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs.map +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 +17 -8
- 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 +78 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +48 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +49 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs.map +1 -0
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +21 -21
- 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 +526 -90
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +27 -20
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +29 -14
- 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 +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +77 -25
- 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 +21 -13
- 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 +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 +69 -17
- package/lib/custom-auth-path/msal-custom-auth.cjs +2394 -920
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +2394 -920
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +23 -11
- package/lib/msal-browser.cjs +943 -278
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +943 -278
- 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/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/controllers/StandardController.ts +107 -11
- package/src/crypto/TokenBindingKeyManager.ts +21 -0
- package/src/custom_auth/CustomAuthActionInputs.ts +12 -5
- package/src/custom_auth/CustomAuthPublicClientApplication.ts +5 -3
- package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +5 -3
- package/src/custom_auth/controller/CustomAuthStandardController.ts +79 -92
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +14 -0
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +1 -4
- package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +5 -4
- package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +28 -16
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +6 -0
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +83 -72
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +23 -0
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +28 -0
- package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +10 -6
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +9 -6
- package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +4 -6
- package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +36 -0
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +8 -8
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +94 -0
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +68 -14
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +150 -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 +48 -24
- package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +1 -3
- package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +24 -2
- package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +1 -2
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +34 -9
- package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +179 -0
- package/src/custom_auth/core/error/InvalidArgumentError.ts +1 -1
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +13 -12
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +771 -261
- package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +2 -6
- package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +27 -15
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +97 -26
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +9 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +330 -63
- package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +51 -15
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +25 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +0 -6
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +48 -48
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +44 -37
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +32 -15
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +14 -10
- package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +24 -1
- package/src/custom_auth/core/telemetry/PublicApiId.ts +7 -0
- package/src/custom_auth/core/utils/ArgumentValidator.ts +26 -0
- package/src/custom_auth/index.ts +21 -11
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +8 -10
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +71 -16
- package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.ts +30 -0
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +4 -8
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +4 -5
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +3 -6
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +0 -3
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.ts +2 -3
- package/src/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.ts +49 -0
- package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +8 -4
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +18 -4
- package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +26 -5
- package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.ts +101 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.ts +53 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.ts +97 -0
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +0 -6
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +33 -43
- package/src/interaction_client/PlatformAuthInteractionClient.ts +886 -148
- package/src/interaction_client/PopupClient.ts +104 -83
- package/src/interaction_client/RedirectClient.ts +88 -34
- package/src/interaction_client/SilentIframeClient.ts +121 -95
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +46 -18
- package/src/request/RequestHelpers.ts +64 -11
- package/src/request/SilentRequestHelpers.ts +8 -9
- package/src/telemetry/BrowserPerformanceEvents.ts +1 -0
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/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/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/CustomAuthActionInputs.d.ts +12 -5
- 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 +5 -3
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +5 -3
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts +2 -0
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +10 -0
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +1 -4
- 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 +5 -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 +17 -8
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +6 -0
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +23 -44
- 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 +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 +16 -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/MFASubmitChallengeResultV2.d.ts +7 -6
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +8 -7
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +4 -6
- 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 +20 -0
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +7 -8
- 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 +3 -6
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/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 +6 -8
- 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 +1 -3
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +18 -2
- package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +1 -2
- 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 +5 -6
- 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 +23 -0
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/core/error/InvalidArgumentError.d.ts +1 -0
- package/types/custom_auth/core/error/InvalidArgumentError.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +9 -1
- 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 +19 -10
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +1 -1
- package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +19 -5
- 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 +39 -4
- 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 +4 -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 +13 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +36 -9
- 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 +18 -4
- 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 +8 -11
- 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 +2 -1
- package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts +7 -0
- package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/types/custom_auth/core/utils/ArgumentValidator.d.ts +3 -0
- package/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
- package/types/custom_auth/index.d.ts +10 -5
- package/types/custom_auth/index.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +7 -11
- 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 +7 -5
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts +7 -0
- package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts.map +1 -0
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +4 -8
- 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 +5 -5
- 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 +3 -6
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts +3 -2
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts +27 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +6 -3
- 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 +13 -3
- 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 +8 -3
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts +24 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts +18 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts +7 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts.map +1 -0
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +0 -4
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +5 -4
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts +110 -8
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/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/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +0 -70
- package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +0 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +0 -25
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +0 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +0 -45
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +0 -1
- package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +0 -23
- package/src/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.ts +0 -19
- package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -20
- package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +0 -97
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +0 -34
- package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +0 -61
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +0 -14
- package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +0 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts +0 -13
- package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -8
- package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -17
- package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +0 -11
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +0 -19
- package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +0 -1
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.29.0 2026-11-06 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { ServerTelemetryManager, AADServerParamKeys, TimeUtils, invokeAsync, AuthError, ScopeSet, createClientAuthError, ClientAuthErrorCodes, AuthToken, updateAccountTenantProfileData, UrlString, buildAccountToCache, AccountEntityUtils, AuthorityType,
|
|
4
|
-
import { createPlatformAuthExtraParametersNoCache,
|
|
3
|
+
import { ServerTelemetryManager, AADServerParamKeys, TimeUtils, invokeAsync, AuthError, ScopeSet, Constants, createClientAuthError, ClientAuthErrorCodes, AuthToken, updateAccountTenantProfileData, UrlString, buildAccountToCache, AccountEntityUtils, AuthorityType, PopTokenGenerator, CacheHelpers, RequestParameterBuilder, PerformanceEvents, createClientConfigurationError, ClientConfigurationErrorCodes, normalizeDpopResourceRequestContext, createAuthError, AuthErrorCodes, JsonWebTokenAlgorithms, DpopProofGenerator } from '@azure/msal-common/browser';
|
|
4
|
+
import { createPlatformAuthExtraParametersNoCache, PlatformAuthBindingPreference, PlatformAuthTokenType, PlatformAuthEnclave } from '../broker/nativeBroker/PlatformAuthRequest.mjs';
|
|
5
5
|
import { base64Decode } from '../encode/Base64Decode.mjs';
|
|
6
6
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
7
7
|
import { NativeAuthError, isFatalNativeAuthError, createNativeAuthError } from '../error/NativeAuthError.mjs';
|
|
8
8
|
import { version } from '../packageMetadata.mjs';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { isTokenBindingKeyPersistedForRedirect } from '../request/RequestHelpers.mjs';
|
|
10
|
+
import { NativeInteractionClientAcquireToken, PlatformAuthInteractionClientInitializeRequest, PlatformAuthHandleNativeResponse, NativeGenerateAuthResult, PlatformAuthCacheAccount, PlatformAuthCacheNativeTokens, PlatformAuthDpopKeyCleanup } from '../telemetry/BrowserPerformanceEvents.mjs';
|
|
11
|
+
import { BrowserConstants, ApiId, CacheLookupPolicy, TemporaryCacheKeys, PlatformAuthConstants } from '../utils/BrowserConstants.mjs';
|
|
11
12
|
import { getCurrentUri } from '../utils/BrowserUtils.mjs';
|
|
12
13
|
import { BaseInteractionClient, initializeServerTelemetryManager, getRedirectUri, getDiscoveredAuthority } from './BaseInteractionClient.mjs';
|
|
13
14
|
import { SilentCacheClient } from './SilentCacheClient.mjs';
|
|
14
|
-
import {
|
|
15
|
+
import { nativePromptNotSupported } from '../error/BrowserAuthErrorCodes.mjs';
|
|
15
16
|
import { userSwitch } from '../error/NativeAuthErrorCodes.mjs';
|
|
16
17
|
|
|
17
18
|
/*
|
|
18
19
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
20
|
* Licensed under the MIT License.
|
|
20
21
|
*/
|
|
22
|
+
const DPOP_POP_KID_NOT_SUPPORTED = "dpop_pop_kid_not_supported";
|
|
21
23
|
class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
22
24
|
constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId, tokenBindingKeyManager) {
|
|
23
25
|
super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, tokenBindingKeyManager);
|
|
@@ -75,35 +77,43 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
75
77
|
}, e);
|
|
76
78
|
throw e;
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
80
|
+
if (this.apiId === ApiId.acquireTokenSilent_silentFlow) {
|
|
81
|
+
let cachedResult;
|
|
82
|
+
try {
|
|
83
|
+
cachedResult = await this.acquireTokensFromCache(this.accountId, nativeRequest, cacheLookupPolicy);
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
|
|
87
|
+
this.logger.info("0eitbc", this.correlationId);
|
|
88
|
+
nativeATMeasurement.add({
|
|
89
|
+
isNativeBroker: false,
|
|
90
|
+
});
|
|
91
|
+
nativeATMeasurement.end({
|
|
92
|
+
success: false,
|
|
93
|
+
});
|
|
94
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
95
|
+
throw e;
|
|
96
|
+
}
|
|
97
|
+
// continue with a native call for any and all errors
|
|
98
|
+
this.logger.info("0957j1", this.correlationId);
|
|
99
|
+
}
|
|
100
|
+
if (cachedResult) {
|
|
101
|
+
// Served from the native internal cache; token did not come directly from the broker
|
|
94
102
|
nativeATMeasurement.add({
|
|
95
103
|
isNativeBroker: false,
|
|
96
104
|
});
|
|
97
105
|
nativeATMeasurement.end({
|
|
98
|
-
success:
|
|
106
|
+
success: true,
|
|
107
|
+
fromCache: true,
|
|
99
108
|
});
|
|
100
|
-
|
|
109
|
+
await this.resetGeneratedDpopRequestKey(nativeRequest);
|
|
110
|
+
return cachedResult;
|
|
101
111
|
}
|
|
102
|
-
// continue with a native call for any and all errors
|
|
103
|
-
this.logger.info("0957j1", this.correlationId);
|
|
104
112
|
}
|
|
105
113
|
// dispatch the request to the broker
|
|
106
114
|
try {
|
|
115
|
+
await this.prepareDpopBrokerRequest(nativeRequest);
|
|
116
|
+
this.addDpopBrokerAttemptTelemetry(nativeRequest);
|
|
107
117
|
const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
|
|
108
118
|
const result = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
|
|
109
119
|
nativeATMeasurement.end({
|
|
@@ -121,6 +131,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
121
131
|
success: false,
|
|
122
132
|
}, e);
|
|
123
133
|
this.setBrokerErrorTelemetry(e);
|
|
134
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
124
135
|
throw e;
|
|
125
136
|
}
|
|
126
137
|
}
|
|
@@ -155,6 +166,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
155
166
|
scopes: ScopeSet.fromString(request.scope, this.correlationId).asArray(),
|
|
156
167
|
account: cachedAccount,
|
|
157
168
|
forceRefresh: false,
|
|
169
|
+
...this.createSilentCacheTokenBindingParameters(request),
|
|
158
170
|
resource: request.extraParameters?.resource,
|
|
159
171
|
};
|
|
160
172
|
// Preserve FMI partition semantics for silent cache filtering.
|
|
@@ -164,12 +176,41 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
164
176
|
return silentRequest;
|
|
165
177
|
}
|
|
166
178
|
/**
|
|
167
|
-
*
|
|
179
|
+
* Maps platform-broker token-binding state to silent-cache request fields.
|
|
180
|
+
* @param request
|
|
181
|
+
*/
|
|
182
|
+
createSilentCacheTokenBindingParameters(request) {
|
|
183
|
+
const authenticationScheme = this.isDpopBrokerRequest(request)
|
|
184
|
+
? Constants.AuthenticationScheme.DPOP
|
|
185
|
+
: request.tokenType;
|
|
186
|
+
if (authenticationScheme !== Constants.AuthenticationScheme.DPOP &&
|
|
187
|
+
authenticationScheme !== Constants.AuthenticationScheme.POP) {
|
|
188
|
+
return { authenticationScheme };
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
authenticationScheme,
|
|
192
|
+
...(authenticationScheme === Constants.AuthenticationScheme.DPOP &&
|
|
193
|
+
request.keyId && { dpopJkt: request.keyId }),
|
|
194
|
+
...(authenticationScheme === Constants.AuthenticationScheme.POP &&
|
|
195
|
+
request.signPopToken === false &&
|
|
196
|
+
request.keyId && { popKid: request.keyId }),
|
|
197
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
198
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Fetches unexpired tokens when allowed by cache policy.
|
|
168
203
|
* @param nativeAccountId
|
|
169
204
|
* @param request
|
|
170
|
-
* @
|
|
205
|
+
* @param cacheLookupPolicy
|
|
206
|
+
* @returns Cached result, or undefined when cache policy bypasses lookup.
|
|
171
207
|
*/
|
|
172
|
-
async acquireTokensFromCache(nativeAccountId, request) {
|
|
208
|
+
async acquireTokensFromCache(nativeAccountId, request, cacheLookupPolicy = CacheLookupPolicy.Default) {
|
|
209
|
+
if (cacheLookupPolicy === CacheLookupPolicy.RefreshTokenAndNetwork ||
|
|
210
|
+
cacheLookupPolicy === CacheLookupPolicy.Skip) {
|
|
211
|
+
this.logger.verbose("03uwyk", this.correlationId);
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
173
214
|
if (!nativeAccountId) {
|
|
174
215
|
this.logger.warning("1ndf3e", this.correlationId);
|
|
175
216
|
throw createClientAuthError(ClientAuthErrorCodes.noAccountFound, this.correlationId);
|
|
@@ -211,10 +252,22 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
211
252
|
const nativeRequest = await invokeAsync(this.initializePlatformRequest.bind(this), PlatformAuthInteractionClientInitializeRequest, this.logger, this.performanceClient, this.correlationId)(request);
|
|
212
253
|
const navigateToLoginRequestUrl = options?.navigateToLoginRequestUrl ?? true;
|
|
213
254
|
try {
|
|
214
|
-
await this.
|
|
255
|
+
await this.prepareDpopBrokerRequest(nativeRequest);
|
|
256
|
+
this.addDpopBrokerAttemptTelemetry(nativeRequest);
|
|
257
|
+
const response = await this.platformAuthProvider.sendMessage(nativeRequest);
|
|
258
|
+
const dpopBrokerOutcome = this.validateDpopBrokerOutcome(response, nativeRequest);
|
|
259
|
+
if (dpopBrokerOutcome === "L3") {
|
|
260
|
+
await this.resetGeneratedDpopRequestKey(nativeRequest);
|
|
261
|
+
}
|
|
215
262
|
}
|
|
216
263
|
catch (e) {
|
|
217
|
-
|
|
264
|
+
/*
|
|
265
|
+
* Raw persistent/transient broker errors are retrieved again in
|
|
266
|
+
* phase two. Availability errors are thrown for controller-managed
|
|
267
|
+
* web fallback, while translated cancellation, network, and
|
|
268
|
+
* interaction-required errors are surfaced without being swallowed.
|
|
269
|
+
*/
|
|
270
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
218
271
|
if (e instanceof NativeAuthError) {
|
|
219
272
|
const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
220
273
|
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
@@ -229,6 +282,16 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
229
282
|
throw e;
|
|
230
283
|
}
|
|
231
284
|
}
|
|
285
|
+
else if (this.isDpopBrokerRequest(nativeRequest)) {
|
|
286
|
+
throw e;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
try {
|
|
290
|
+
await this.ensureRedirectDpopKeyIsPersisted(nativeRequest);
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
294
|
+
throw e;
|
|
232
295
|
}
|
|
233
296
|
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify({
|
|
234
297
|
...nativeRequest,
|
|
@@ -243,7 +306,14 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
243
306
|
? UrlString.getAbsoluteUrl(request.redirectStartPage || window.location.href, getCurrentUri(), this.correlationId)
|
|
244
307
|
: getRedirectUri(request.redirectUri, this.config.auth.redirectUri, this.logger, this.correlationId);
|
|
245
308
|
rootMeasurement.end({ success: true });
|
|
246
|
-
|
|
309
|
+
try {
|
|
310
|
+
await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again
|
|
311
|
+
}
|
|
312
|
+
catch (e) {
|
|
313
|
+
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
|
|
314
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
315
|
+
throw e;
|
|
316
|
+
}
|
|
247
317
|
}
|
|
248
318
|
/**
|
|
249
319
|
* If the previous page called native platform for a token using redirect APIs, send the same request again and return the response
|
|
@@ -276,6 +346,8 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
276
346
|
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
|
|
277
347
|
const reqTimestamp = TimeUtils.nowSeconds();
|
|
278
348
|
try {
|
|
349
|
+
await this.prepareDpopBrokerRequest(request, true);
|
|
350
|
+
this.addDpopBrokerAttemptTelemetry(request);
|
|
279
351
|
this.logger.verbose("003x5a", this.correlationId);
|
|
280
352
|
const response = await this.platformAuthProvider.sendMessage(request);
|
|
281
353
|
const authResult = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(response, request, reqTimestamp, storeInCache);
|
|
@@ -284,7 +356,12 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
284
356
|
return authResult;
|
|
285
357
|
}
|
|
286
358
|
catch (e) {
|
|
359
|
+
if (e instanceof NativeAuthError) {
|
|
360
|
+
const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
361
|
+
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
362
|
+
}
|
|
287
363
|
this.setBrokerErrorTelemetry(e);
|
|
364
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(request);
|
|
288
365
|
throw e;
|
|
289
366
|
}
|
|
290
367
|
}
|
|
@@ -304,6 +381,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
304
381
|
*/
|
|
305
382
|
async handleNativeResponse(response, request, reqTimestamp, storeInCache) {
|
|
306
383
|
this.logger.trace("1bojln", this.correlationId);
|
|
384
|
+
const dpopBrokerOutcome = this.validateDpopBrokerOutcome(response, request);
|
|
307
385
|
// generate identifiers
|
|
308
386
|
const idTokenClaims = AuthToken.extractTokenClaims(response.id_token, base64Decode, this.correlationId);
|
|
309
387
|
const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);
|
|
@@ -329,10 +407,17 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
329
407
|
response.expires_in = Number(response.expires_in);
|
|
330
408
|
// generate authenticationResult
|
|
331
409
|
const result = await invokeAsync(this.generateAuthenticationResult.bind(this), NativeGenerateAuthResult, this.logger, this.performanceClient, this.correlationId)(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
|
|
410
|
+
const isL3DpopResponse = dpopBrokerOutcome === "L3";
|
|
332
411
|
// cache accounts and tokens in the appropriate storage
|
|
333
|
-
|
|
412
|
+
const shouldRemoveGeneratedDpopKey = isL3DpopResponse ||
|
|
413
|
+
(this.isDpopBrokerRequest(request) &&
|
|
414
|
+
storeInCache?.accessToken === false);
|
|
415
|
+
if (shouldRemoveGeneratedDpopKey) {
|
|
416
|
+
await this.resetGeneratedDpopRequestKey(request);
|
|
417
|
+
}
|
|
418
|
+
await invokeAsync(this.cacheAccount.bind(this), PlatformAuthCacheAccount, this.logger, this.performanceClient, this.correlationId)(baseAccount, AuthToken.isKmsi(idTokenClaims), !isL3DpopResponse);
|
|
334
419
|
await invokeAsync(this.cacheNativeTokens.bind(this), PlatformAuthCacheNativeTokens, this.logger, this.performanceClient, this.correlationId)(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
|
|
335
|
-
storeInCache);
|
|
420
|
+
storeInCache, dpopBrokerOutcome);
|
|
336
421
|
return result;
|
|
337
422
|
}
|
|
338
423
|
/**
|
|
@@ -408,7 +493,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
408
493
|
*/
|
|
409
494
|
async generateAuthenticationResult(response, request, idTokenClaims, accountEntity, authority, reqTimestamp) {
|
|
410
495
|
// Add Native Broker fields to Telemetry
|
|
411
|
-
const mats = this.addTelemetryFromNativeResponse(response.properties
|
|
496
|
+
const mats = this.addTelemetryFromNativeResponse(response.properties?.MATS);
|
|
412
497
|
// If scopes not returned in server response, use request scopes
|
|
413
498
|
const responseScopes = this.generateScopes(request.scope, response.scope);
|
|
414
499
|
const accountProperties = response.account.properties || {};
|
|
@@ -434,9 +519,17 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
434
519
|
}
|
|
435
520
|
// generate PoP token as needed
|
|
436
521
|
const responseAccessToken = await this.generatePopAccessToken(response, request);
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
|
|
522
|
+
const isDpopRequest = this.isDpopBrokerRequest(request);
|
|
523
|
+
let tokenType = Constants.AuthenticationScheme.BEARER;
|
|
524
|
+
if (isDpopRequest) {
|
|
525
|
+
tokenType = Constants.AuthenticationScheme.DPOP;
|
|
526
|
+
}
|
|
527
|
+
else if (request.tokenType === Constants.AuthenticationScheme.POP) {
|
|
528
|
+
tokenType = Constants.AuthenticationScheme.POP;
|
|
529
|
+
}
|
|
530
|
+
const dpopProof = isDpopRequest
|
|
531
|
+
? await this.generateDpopProof(response, request)
|
|
532
|
+
: undefined;
|
|
440
533
|
const result = {
|
|
441
534
|
authority: authority,
|
|
442
535
|
uniqueId: uid,
|
|
@@ -450,6 +543,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
450
543
|
// Request timestamp and NativeResponse expires_in are in seconds, converting to Date for AuthenticationResult
|
|
451
544
|
expiresOn: TimeUtils.toDateFromSeconds(reqTimestamp + response.expires_in),
|
|
452
545
|
tokenType: tokenType,
|
|
546
|
+
dpopProof,
|
|
453
547
|
correlationId: this.correlationId,
|
|
454
548
|
state: response.state,
|
|
455
549
|
fromPlatformBroker: true,
|
|
@@ -463,11 +557,13 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
463
557
|
* cache the account entity in browser storage
|
|
464
558
|
* @param accountEntity
|
|
465
559
|
*/
|
|
466
|
-
async cacheAccount(accountEntity, kmsi) {
|
|
560
|
+
async cacheAccount(accountEntity, kmsi, clearExistingTokens = true) {
|
|
467
561
|
// Store the account info and hence `nativeAccountId` in browser cache
|
|
468
562
|
await this.browserStorage.setAccount(accountEntity, this.correlationId, kmsi, this.apiId);
|
|
469
|
-
// Remove
|
|
470
|
-
|
|
563
|
+
// Remove cached web access and refresh tokens, preserving ID tokens.
|
|
564
|
+
if (clearExistingTokens) {
|
|
565
|
+
this.browserStorage.removeAccountContext(AccountEntityUtils.getAccountInfo(accountEntity), this.correlationId);
|
|
566
|
+
}
|
|
471
567
|
}
|
|
472
568
|
/**
|
|
473
569
|
* Stores the access_token and id_token in inmemory storage
|
|
@@ -479,8 +575,18 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
479
575
|
* @param tenantId
|
|
480
576
|
* @param reqTimestamp
|
|
481
577
|
*/
|
|
482
|
-
async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache) {
|
|
578
|
+
async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache, dpopBrokerOutcome = "none") {
|
|
483
579
|
const cachedIdToken = CacheHelpers.createIdTokenEntity(homeAccountIdentifier, environment, response.id_token || "", request.clientId, idTokenClaims.tid || "");
|
|
580
|
+
// save idtoken credential in configured browser storage
|
|
581
|
+
if (!!cachedIdToken && storeInCache?.idToken !== false) {
|
|
582
|
+
await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, AuthToken.isKmsi(idTokenClaims));
|
|
583
|
+
}
|
|
584
|
+
if (dpopBrokerOutcome === "L3") {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (storeInCache?.accessToken === false) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
484
590
|
// cache accessToken in inmemory storage
|
|
485
591
|
const expiresIn = request.tokenType === Constants.AuthenticationScheme.POP
|
|
486
592
|
? Constants.SHR_NONCE_VALIDITY
|
|
@@ -490,18 +596,14 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
490
596
|
const tokenExpirationSeconds = reqTimestamp + expiresIn;
|
|
491
597
|
const responseScopes = this.generateScopes(response.scope, request.scope);
|
|
492
598
|
const additionalCacheKeyComponents = request.attributeTokens
|
|
493
|
-
? {
|
|
494
|
-
attribute_tokens: request.attributeTokens,
|
|
495
|
-
}
|
|
599
|
+
? { attribute_tokens: request.attributeTokens }
|
|
496
600
|
: undefined;
|
|
497
|
-
const cachedAccessToken = CacheHelpers.createAccessTokenEntity(homeAccountIdentifier, environment, response.access_token, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, request.correlationId, undefined,
|
|
601
|
+
const cachedAccessToken = CacheHelpers.createAccessTokenEntity(homeAccountIdentifier, environment, response.access_token, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, request.correlationId, undefined, this.isDpopBrokerRequest(request)
|
|
602
|
+
? Constants.AuthenticationScheme.DPOP
|
|
603
|
+
: request.tokenType, undefined, request.keyId, additionalCacheKeyComponents);
|
|
498
604
|
if (request.extraParameters?.resource) {
|
|
499
605
|
cachedAccessToken.resource = request.extraParameters.resource;
|
|
500
606
|
}
|
|
501
|
-
// save idtoken credential in configured browser storage
|
|
502
|
-
if (!!cachedIdToken && storeInCache?.idToken !== false) {
|
|
503
|
-
await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, AuthToken.isKmsi(idTokenClaims));
|
|
504
|
-
}
|
|
505
607
|
// save access token credential in memory storage
|
|
506
608
|
const nativeCacheRecord = {
|
|
507
609
|
accessToken: cachedAccessToken,
|
|
@@ -578,11 +680,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
578
680
|
const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
|
|
579
681
|
? undefined
|
|
580
682
|
: this.config.auth.clientCapabilities;
|
|
581
|
-
|
|
582
|
-
* scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
|
|
583
|
-
* attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
|
|
584
|
-
*/
|
|
585
|
-
const { scopes, claims, extraParametersNoCache, dpopNonce } = request;
|
|
683
|
+
const { scopes, claims, dpopNonce } = request;
|
|
586
684
|
const scopeSet = new ScopeSet([...(scopes || []), ...Constants.OIDC_DEFAULT_SCOPES], this.correlationId);
|
|
587
685
|
const mergedClaims = RequestParameterBuilder.buildMergedClaims(claims, configClaims?.length ? configClaims : undefined);
|
|
588
686
|
const hasAttributeTokens = !!request.attributeTokens?.length;
|
|
@@ -606,57 +704,391 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
606
704
|
loginHint: request.loginHint,
|
|
607
705
|
extraParameters: {
|
|
608
706
|
...request.extraParameters,
|
|
609
|
-
|
|
707
|
+
// Native broker resource is set for MCP scenarios.
|
|
708
|
+
...(request.resource && { resource: request.resource }),
|
|
610
709
|
},
|
|
611
710
|
extendedExpiryToken: false,
|
|
612
711
|
keyId: request.popKid,
|
|
613
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
614
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
615
|
-
shrClaims: request.shrClaims,
|
|
616
|
-
shrNonce: request.shrNonce,
|
|
617
|
-
extraParametersNoCache: createPlatformAuthExtraParametersNoCache(extraParametersNoCache, isProofOfPossessionTokenType(request.authenticationScheme), request.resourceRequestMethod, request.resourceRequestUri, dpopNonce),
|
|
618
712
|
};
|
|
619
713
|
if (hasAttributeTokens) {
|
|
620
714
|
validatedRequest.attributeTokens =
|
|
621
715
|
CacheHelpers.serializeAttributeTokens(request.attributeTokens);
|
|
622
716
|
}
|
|
623
|
-
// Check for PoP token requests: signPopToken should only be set to true if popKid is not set
|
|
624
|
-
if (validatedRequest.signPopToken && !!request.popKid) {
|
|
625
|
-
throw createBrowserAuthError(invalidPopTokenRequest, this.correlationId);
|
|
626
|
-
}
|
|
627
717
|
this.handleExtraBrokerParams(validatedRequest, request.embeddedClientId);
|
|
628
718
|
validatedRequest.extraParameters =
|
|
629
719
|
validatedRequest.extraParameters || {};
|
|
630
720
|
validatedRequest.extraParameters.telemetry =
|
|
631
721
|
PlatformAuthConstants.MATS_TELEMETRY;
|
|
632
722
|
if (request.authenticationScheme === Constants.AuthenticationScheme.POP) {
|
|
633
|
-
// add POP request type
|
|
634
723
|
const shrParameters = {
|
|
635
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
636
724
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
725
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
637
726
|
shrClaims: request.shrClaims,
|
|
638
727
|
shrNonce: request.shrNonce,
|
|
639
728
|
correlationId: this.correlationId,
|
|
640
729
|
};
|
|
641
730
|
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.tokenBindingKeyManager, this.performanceClient);
|
|
642
|
-
// generate reqCnf if not provided in the request
|
|
643
|
-
let reqCnfData;
|
|
644
731
|
if (!validatedRequest.keyId) {
|
|
645
732
|
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, this.correlationId)(shrParameters, this.logger);
|
|
646
|
-
|
|
733
|
+
validatedRequest.reqCnf = generatedReqCnfData.reqCnfString;
|
|
647
734
|
validatedRequest.keyId = generatedReqCnfData.kid;
|
|
648
735
|
validatedRequest.signPopToken = true;
|
|
649
736
|
}
|
|
650
737
|
else {
|
|
651
|
-
|
|
738
|
+
validatedRequest.reqCnf = this.browserCrypto.base64UrlEncode(JSON.stringify({ kid: validatedRequest.keyId }));
|
|
652
739
|
validatedRequest.signPopToken = false;
|
|
653
740
|
}
|
|
654
|
-
|
|
655
|
-
|
|
741
|
+
validatedRequest.resourceRequestMethod =
|
|
742
|
+
request.resourceRequestMethod;
|
|
743
|
+
validatedRequest.resourceRequestUri = request.resourceRequestUri;
|
|
744
|
+
validatedRequest.shrClaims = request.shrClaims;
|
|
745
|
+
validatedRequest.shrNonce = request.shrNonce;
|
|
746
|
+
}
|
|
747
|
+
else if (request.authenticationScheme === Constants.AuthenticationScheme.DPOP) {
|
|
748
|
+
Object.assign(validatedRequest, this.createDpopRequestParameters(request));
|
|
656
749
|
}
|
|
750
|
+
validatedRequest.extraParametersNoCache =
|
|
751
|
+
createPlatformAuthExtraParametersNoCache(validatedRequest.tokenType, validatedRequest.resourceRequestMethod, validatedRequest.resourceRequestUri, dpopNonce);
|
|
657
752
|
this.addRequestSKUs(validatedRequest);
|
|
658
753
|
return validatedRequest;
|
|
659
754
|
}
|
|
755
|
+
/**
|
|
756
|
+
* Creates and validates the broker-specific parameters for a DPoP request.
|
|
757
|
+
* @param request - Developer-provided token request.
|
|
758
|
+
* @returns Broker parameters for a DPoP token and resource proof.
|
|
759
|
+
*/
|
|
760
|
+
createDpopRequestParameters(request) {
|
|
761
|
+
if (request.popKid) {
|
|
762
|
+
throw createBrowserAuthError(DPOP_POP_KID_NOT_SUPPORTED, this.correlationId);
|
|
763
|
+
}
|
|
764
|
+
if (!request.resourceRequestMethod?.trim() ||
|
|
765
|
+
!request.resourceRequestUri?.trim()) {
|
|
766
|
+
throw createClientConfigurationError(ClientConfigurationErrorCodes.dpopMissingResourceContext, this.correlationId);
|
|
767
|
+
}
|
|
768
|
+
const resourceContext = normalizeDpopResourceRequestContext({
|
|
769
|
+
htm: request.resourceRequestMethod,
|
|
770
|
+
htu: request.resourceRequestUri,
|
|
771
|
+
}, this.correlationId);
|
|
772
|
+
return {
|
|
773
|
+
tokenType: PlatformAuthTokenType.DPOP_WITH_PROOF,
|
|
774
|
+
preferBinding: PlatformAuthBindingPreference.ATTESTED,
|
|
775
|
+
keyId: request.dpopJkt,
|
|
776
|
+
resourceRequestMethod: resourceContext.htm,
|
|
777
|
+
resourceRequestUri: resourceContext.htu,
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Provisions the local key and confirmation data for a DPoP broker request.
|
|
782
|
+
* @param request - Broker request to prepare.
|
|
783
|
+
* @param reuseExistingKey - Whether a complete existing key binding may be reused.
|
|
784
|
+
*/
|
|
785
|
+
async prepareDpopBrokerRequest(request, reuseExistingKey = false) {
|
|
786
|
+
if (request.tokenType !== PlatformAuthTokenType.DPOP_WITH_PROOF) {
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
/*
|
|
790
|
+
* Phase one clears both fields after an L3 response or non-fatal broker
|
|
791
|
+
* error. In that case phase two must provision a replacement. If either
|
|
792
|
+
* field remains, treat it as a retained binding and validate it fully.
|
|
793
|
+
*/
|
|
794
|
+
if (reuseExistingKey && (request.keyId || request.reqCnf)) {
|
|
795
|
+
if (!request.keyId || !request.reqCnf) {
|
|
796
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, "DPoP request key binding is incomplete after redirect.");
|
|
797
|
+
}
|
|
798
|
+
const expectedReqCnf = this.createDpopBrokerReqCnf(request.keyId);
|
|
799
|
+
if (request.reqCnf !== expectedReqCnf) {
|
|
800
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, "DPoP request key binding is invalid after redirect.");
|
|
801
|
+
}
|
|
802
|
+
const hasKey = this.tokenBindingKeyManager.hasTokenBindingKey !== undefined
|
|
803
|
+
? await this.tokenBindingKeyManager.hasTokenBindingKey(request.keyId, this.correlationId)
|
|
804
|
+
: await this.tokenBindingKeyManager
|
|
805
|
+
.getTokenBindingPublicKeyJwk(request.keyId, this.correlationId)
|
|
806
|
+
.then(() => true, () => false);
|
|
807
|
+
if (!hasKey) {
|
|
808
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, "DPoP request key is unavailable after redirect.");
|
|
809
|
+
}
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
if (request.reqCnf) {
|
|
813
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, "Unexpected preexisting DPoP request key.");
|
|
814
|
+
}
|
|
815
|
+
if (!request.keyId) {
|
|
816
|
+
request.keyId =
|
|
817
|
+
await this.tokenBindingKeyManager.provisionTokenBindingKey({
|
|
818
|
+
tokenBindingKeyType: Constants.AuthenticationScheme.DPOP.toLowerCase(),
|
|
819
|
+
tokenBindingKeyAlgorithm: JsonWebTokenAlgorithms.ES256,
|
|
820
|
+
correlationId: this.correlationId,
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
request.reqCnf = this.createDpopBrokerReqCnf(request.keyId);
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Creates the confirmation claim for an MSAL-owned broker DPoP key.
|
|
827
|
+
* @param keyId - Browser-managed DPoP key identifier.
|
|
828
|
+
* @returns Encoded broker confirmation claim.
|
|
829
|
+
*/
|
|
830
|
+
createDpopBrokerReqCnf(keyId) {
|
|
831
|
+
return this.browserCrypto.base64UrlEncode(JSON.stringify({
|
|
832
|
+
kid: keyId,
|
|
833
|
+
xms_ksl: PlatformAuthInteractionClient.MSAL_DPOP_KEY_STORAGE_LOCATION,
|
|
834
|
+
}));
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Ensures an owned DPoP key can survive redirect navigation before the
|
|
838
|
+
* request metadata is persisted for phase two.
|
|
839
|
+
*/
|
|
840
|
+
async ensureRedirectDpopKeyIsPersisted(request) {
|
|
841
|
+
if (!this.isDpopBrokerRequest(request) || !request.keyId) {
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
if (!(await isTokenBindingKeyPersistedForRedirect(request, this.tokenBindingKeyManager))) {
|
|
845
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, "DPoP request key could not be persisted for redirect.");
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Validates and normalizes the DPoP binding outcome returned by the broker.
|
|
850
|
+
* @param response - Broker response to validate.
|
|
851
|
+
* @param request - Broker request associated with the response.
|
|
852
|
+
* @returns The validated DPoP binding level, or `none` for non-DPoP requests.
|
|
853
|
+
*/
|
|
854
|
+
validateDpopBrokerOutcome(response, request) {
|
|
855
|
+
const isDpopRequest = this.isDpopBrokerRequest(request);
|
|
856
|
+
const normalizedResponse = this.normalizeDpopBrokerResponse(response);
|
|
857
|
+
const normalizedRequestTokenType = request.tokenType
|
|
858
|
+
?.trim()
|
|
859
|
+
.toLowerCase();
|
|
860
|
+
const bindingPreferenceSent = request.bindingPreferenceSent ??
|
|
861
|
+
request.preferBinding !== undefined;
|
|
862
|
+
const hasDpopResponse = this.isDpopBrokerTokenType(normalizedResponse.tokenType) ||
|
|
863
|
+
normalizedResponse.proof !== undefined ||
|
|
864
|
+
normalizedResponse.hasBindingAttested;
|
|
865
|
+
if (!isDpopRequest) {
|
|
866
|
+
if (hasDpopResponse) {
|
|
867
|
+
this.throwInvalidDpopResponse("unexpected_response", "Unexpected DPoP broker response.");
|
|
868
|
+
}
|
|
869
|
+
return "none";
|
|
870
|
+
}
|
|
871
|
+
if (!this.isDpopBrokerTokenType(normalizedResponse.tokenType)) {
|
|
872
|
+
this.throwInvalidDpopResponse("unknown_token_type", "Unknown DPoP broker response.");
|
|
873
|
+
}
|
|
874
|
+
this.validateNormalizedDpopBrokerResponse(normalizedResponse, bindingPreferenceSent);
|
|
875
|
+
if (normalizedResponse.tokenType ===
|
|
876
|
+
PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase()) {
|
|
877
|
+
return this.validateDpopBrokerL3Outcome(normalizedRequestTokenType, normalizedResponse);
|
|
878
|
+
}
|
|
879
|
+
return this.validateDpopBrokerL1Outcome(request, normalizedRequestTokenType, normalizedResponse, bindingPreferenceSent);
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Normalizes the canonical DPoP fields returned under response properties.
|
|
883
|
+
*/
|
|
884
|
+
normalizeDpopBrokerResponse(response) {
|
|
885
|
+
const responseProperties = response.properties;
|
|
886
|
+
const rawTokenType = responseProperties?.token_type;
|
|
887
|
+
const tokenType = typeof rawTokenType === "string"
|
|
888
|
+
? rawTokenType.trim().toLowerCase()
|
|
889
|
+
: undefined;
|
|
890
|
+
const rawBindingAttested = responseProperties?.binding_attested;
|
|
891
|
+
let bindingAttested;
|
|
892
|
+
if (typeof rawBindingAttested === "string") {
|
|
893
|
+
const normalizedBindingAttested = rawBindingAttested
|
|
894
|
+
.trim()
|
|
895
|
+
.toLowerCase();
|
|
896
|
+
if (normalizedBindingAttested === "true") {
|
|
897
|
+
bindingAttested = true;
|
|
898
|
+
}
|
|
899
|
+
else if (normalizedBindingAttested === "false") {
|
|
900
|
+
bindingAttested = false;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return {
|
|
904
|
+
tokenType,
|
|
905
|
+
proof: responseProperties?.DPoP,
|
|
906
|
+
bindingAttested,
|
|
907
|
+
hasBindingAttested: rawBindingAttested !== undefined,
|
|
908
|
+
hasMalformedBindingAttested: rawBindingAttested !== undefined &&
|
|
909
|
+
bindingAttested === undefined,
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Validates normalized fields shared by L1 and L3 broker DPoP responses.
|
|
914
|
+
*/
|
|
915
|
+
validateNormalizedDpopBrokerResponse(normalizedResponse, bindingPreferenceSent) {
|
|
916
|
+
if (normalizedResponse.hasMalformedBindingAttested) {
|
|
917
|
+
this.throwInvalidDpopResponse("invalid_attestation", "Conflicting DPoP broker response.");
|
|
918
|
+
}
|
|
919
|
+
if (bindingPreferenceSent &&
|
|
920
|
+
normalizedResponse.bindingAttested === undefined) {
|
|
921
|
+
this.throwInvalidDpopResponse("missing_attestation", "Conflicting DPoP broker response.");
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* Validates a broker-returned L3 DPoP proof outcome.
|
|
926
|
+
*/
|
|
927
|
+
validateDpopBrokerL3Outcome(normalizedRequestTokenType, normalizedResponse) {
|
|
928
|
+
const dpopWithProofTokenType = PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase();
|
|
929
|
+
if (typeof normalizedResponse.proof !== "string" ||
|
|
930
|
+
normalizedResponse.proof.trim().length === 0) {
|
|
931
|
+
this.throwInvalidDpopResponse("missing_proof", "Malformed DPoP broker response.");
|
|
932
|
+
}
|
|
933
|
+
if (normalizedResponse.bindingAttested !== true) {
|
|
934
|
+
this.throwInvalidDpopResponse("invalid_attestation", "Malformed DPoP broker response.");
|
|
935
|
+
}
|
|
936
|
+
if (normalizedRequestTokenType !== dpopWithProofTokenType ||
|
|
937
|
+
normalizedResponse.tokenType !== dpopWithProofTokenType) {
|
|
938
|
+
this.throwInvalidDpopResponse("conflicting_fields", "Malformed DPoP broker response.");
|
|
939
|
+
}
|
|
940
|
+
this.performanceClient.addFields({
|
|
941
|
+
"ext.brokerDpopOutcome": "l3",
|
|
942
|
+
"ext.brokerDpopBindingLevel": "L3",
|
|
943
|
+
}, this.correlationId);
|
|
944
|
+
return "L3";
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Validates an L1 DPoP outcome that MSAL will sign with its local key.
|
|
948
|
+
*/
|
|
949
|
+
validateDpopBrokerL1Outcome(request, normalizedRequestTokenType, normalizedResponse, bindingPreferenceSent) {
|
|
950
|
+
if (normalizedResponse.proof !== undefined) {
|
|
951
|
+
this.throwInvalidDpopResponse("conflicting_fields", "Malformed DPoP broker L1 response.");
|
|
952
|
+
}
|
|
953
|
+
if (normalizedRequestTokenType !==
|
|
954
|
+
PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase()) {
|
|
955
|
+
this.throwInvalidDpopResponse("conflicting_fields", "Malformed DPoP broker L1 response.");
|
|
956
|
+
}
|
|
957
|
+
if (normalizedResponse.bindingAttested !== false &&
|
|
958
|
+
!(!bindingPreferenceSent &&
|
|
959
|
+
normalizedResponse.bindingAttested === undefined)) {
|
|
960
|
+
this.throwInvalidDpopResponse("invalid_attestation", "Malformed DPoP broker L1 response.");
|
|
961
|
+
}
|
|
962
|
+
if (!request.reqCnf || !request.keyId) {
|
|
963
|
+
this.throwInvalidDpopResponse("missing_l1_binding", "Malformed DPoP broker L1 response.");
|
|
964
|
+
}
|
|
965
|
+
this.performanceClient.addFields({
|
|
966
|
+
"ext.brokerDpopOutcome": "l1",
|
|
967
|
+
"ext.brokerDpopBindingLevel": "L1",
|
|
968
|
+
}, this.correlationId);
|
|
969
|
+
return "L1";
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Emits bounded failure telemetry and rejects an invalid DPoP response.
|
|
973
|
+
*/
|
|
974
|
+
throwInvalidDpopResponse(failureReason, message) {
|
|
975
|
+
this.performanceClient.addFields({
|
|
976
|
+
"ext.brokerDpopOutcome": "invalid_response",
|
|
977
|
+
"ext.brokerDpopFailureReason": failureReason,
|
|
978
|
+
}, this.correlationId);
|
|
979
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, message);
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Returns the broker proof or signs an L1 resource proof with the local key.
|
|
983
|
+
* @param response - Broker response containing the access token and optional proof.
|
|
984
|
+
* @param request - Broker request containing the proof context and local key.
|
|
985
|
+
* @returns The resource proof for the broker access token.
|
|
986
|
+
*/
|
|
987
|
+
async generateDpopProof(response, request) {
|
|
988
|
+
const brokerProof = response.properties?.DPoP;
|
|
989
|
+
if (brokerProof !== undefined) {
|
|
990
|
+
return brokerProof;
|
|
991
|
+
}
|
|
992
|
+
const dpopProofGenerator = new DpopProofGenerator(this.browserCrypto, this.tokenBindingKeyManager);
|
|
993
|
+
return dpopProofGenerator.generateResourceProof({
|
|
994
|
+
htu: request.resourceRequestUri,
|
|
995
|
+
htm: request.resourceRequestMethod,
|
|
996
|
+
accessToken: response.access_token,
|
|
997
|
+
nonce: request.extraParametersNoCache?.pop_nonce,
|
|
998
|
+
}, request.keyId, this.correlationId);
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Removes a generated DPoP request key and clears its request metadata.
|
|
1002
|
+
* @param request - Broker request whose generated key should be removed.
|
|
1003
|
+
*/
|
|
1004
|
+
async resetGeneratedDpopRequestKey(request) {
|
|
1005
|
+
if (!this.isDpopBrokerRequest(request) || !request.keyId) {
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
const cleanupMeasurement = this.performanceClient.startMeasurement(PlatformAuthDpopKeyCleanup, this.correlationId);
|
|
1009
|
+
this.performanceClient.incrementFields({ "ext.brokerDpopKeyCleanupAttemptCount": 1 }, this.correlationId);
|
|
1010
|
+
try {
|
|
1011
|
+
if (request.keyId && !(await this.removeDpopKey(request.keyId))) {
|
|
1012
|
+
throw createAuthError(AuthErrorCodes.unexpectedError, this.correlationId, "Failed to remove generated DPoP request key.");
|
|
1013
|
+
}
|
|
1014
|
+
this.performanceClient.addFields({
|
|
1015
|
+
"ext.brokerDpopKeyCleanupOutcome": "succeeded",
|
|
1016
|
+
}, this.correlationId);
|
|
1017
|
+
cleanupMeasurement.end({ success: true });
|
|
1018
|
+
request.keyId = undefined;
|
|
1019
|
+
request.reqCnf = undefined;
|
|
1020
|
+
}
|
|
1021
|
+
catch (error) {
|
|
1022
|
+
this.performanceClient.addFields({
|
|
1023
|
+
"ext.brokerDpopKeyCleanupOutcome": "failed",
|
|
1024
|
+
}, this.correlationId);
|
|
1025
|
+
this.performanceClient.incrementFields({ "ext.brokerDpopKeyCleanupFailureCount": 1 }, this.correlationId);
|
|
1026
|
+
cleanupMeasurement.end({ success: false }, error);
|
|
1027
|
+
throw error;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Attempts to remove a generated DPoP request key without replacing an
|
|
1032
|
+
* existing operation error with a cleanup failure.
|
|
1033
|
+
* @param request - Broker request whose generated key should be removed.
|
|
1034
|
+
*/
|
|
1035
|
+
async resetGeneratedDpopRequestKeyBestEffort(request) {
|
|
1036
|
+
try {
|
|
1037
|
+
await this.resetGeneratedDpopRequestKey(request);
|
|
1038
|
+
}
|
|
1039
|
+
catch {
|
|
1040
|
+
this.logger.error("1kxxak", this.correlationId);
|
|
1041
|
+
this.performanceClient.incrementFields({ removeTokenBindingKeyFailure: 1 }, this.correlationId);
|
|
1042
|
+
request.keyId = undefined;
|
|
1043
|
+
request.reqCnf = undefined;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Records that a DPoP request is about to be dispatched to the platform broker.
|
|
1048
|
+
* @param request - Broker request about to cross the provider boundary.
|
|
1049
|
+
*/
|
|
1050
|
+
addDpopBrokerAttemptTelemetry(request) {
|
|
1051
|
+
if (!this.isDpopBrokerRequest(request)) {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
this.performanceClient.addFields({
|
|
1055
|
+
"ext.brokerDpopAttempted": 1,
|
|
1056
|
+
}, this.correlationId);
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Determines whether a request uses the DPoP broker protocol.
|
|
1060
|
+
* @param request - Broker request to inspect.
|
|
1061
|
+
* @returns Whether the request uses a DPoP token type.
|
|
1062
|
+
*/
|
|
1063
|
+
isDpopBrokerRequest(request) {
|
|
1064
|
+
return this.isDpopBrokerTokenType(request.tokenType);
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Determines whether a token type represents a DPoP broker request.
|
|
1068
|
+
* @param tokenType - Token type to inspect.
|
|
1069
|
+
* @returns Whether the token type is a supported DPoP broker token type.
|
|
1070
|
+
*/
|
|
1071
|
+
isDpopBrokerTokenType(tokenType) {
|
|
1072
|
+
const normalizedTokenType = tokenType?.trim().toLowerCase();
|
|
1073
|
+
return (normalizedTokenType === PlatformAuthTokenType.DPOP_WITH_PROOF ||
|
|
1074
|
+
normalizedTokenType ===
|
|
1075
|
+
Constants.AuthenticationScheme.DPOP.toLowerCase());
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Removes a DPoP key while reporting cleanup failures.
|
|
1079
|
+
* @param keyId - Identifier of the DPoP key to remove.
|
|
1080
|
+
* @returns Whether the key was removed successfully.
|
|
1081
|
+
*/
|
|
1082
|
+
async removeDpopKey(keyId) {
|
|
1083
|
+
try {
|
|
1084
|
+
await this.tokenBindingKeyManager.removeTokenBindingKey(keyId, this.correlationId);
|
|
1085
|
+
return true;
|
|
1086
|
+
}
|
|
1087
|
+
catch {
|
|
1088
|
+
this.logger.error("1w60e4", this.correlationId);
|
|
1089
|
+
return false;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
660
1092
|
async getCanonicalAuthority(request) {
|
|
661
1093
|
const requestAuthority = request.authority || this.config.auth.authority;
|
|
662
1094
|
const { azureCloudOptions, account } = request;
|
|
@@ -695,29 +1127,28 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
695
1127
|
}
|
|
696
1128
|
}
|
|
697
1129
|
/**
|
|
698
|
-
* Handles extra broker request parameters
|
|
699
|
-
* @param request
|
|
700
|
-
* @
|
|
1130
|
+
* Handles extra broker request parameters.
|
|
1131
|
+
* @param request - Platform broker request.
|
|
1132
|
+
* @param embeddedClientId - Embedded application client identifier.
|
|
701
1133
|
*/
|
|
702
1134
|
handleExtraBrokerParams(request, embeddedClientId) {
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
1135
|
+
const hasOwnParameter = (parameter) => Object.prototype.hasOwnProperty.call(request.extraParameters, parameter);
|
|
1136
|
+
const hasExtraBrokerParams = hasOwnParameter(AADServerParamKeys.BROKER_CLIENT_ID) &&
|
|
1137
|
+
hasOwnParameter(AADServerParamKeys.BROKER_REDIRECT_URI) &&
|
|
1138
|
+
hasOwnParameter(AADServerParamKeys.CLIENT_ID);
|
|
707
1139
|
if (!embeddedClientId && !hasExtraBrokerParams) {
|
|
708
1140
|
return;
|
|
709
1141
|
}
|
|
710
|
-
|
|
711
|
-
const
|
|
1142
|
+
const childRedirectUri = request.redirectUri;
|
|
1143
|
+
const childClientId = embeddedClientId ||
|
|
1144
|
+
request.extraParameters?.[AADServerParamKeys.CLIENT_ID] ||
|
|
1145
|
+
"";
|
|
712
1146
|
if (embeddedClientId) {
|
|
713
1147
|
request.redirectUri = this.config.auth.redirectUri;
|
|
714
|
-
child_client_id = embeddedClientId;
|
|
715
1148
|
}
|
|
716
1149
|
else if (request.extraParameters) {
|
|
717
1150
|
request.redirectUri =
|
|
718
1151
|
request.extraParameters[AADServerParamKeys.BROKER_REDIRECT_URI];
|
|
719
|
-
child_client_id =
|
|
720
|
-
request.extraParameters[AADServerParamKeys.CLIENT_ID];
|
|
721
1152
|
}
|
|
722
1153
|
const {
|
|
723
1154
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -728,15 +1159,20 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
728
1159
|
[AADServerParamKeys.CLIENT_ID]: _clientId, ...remainingExtraParameters } = request.extraParameters || {};
|
|
729
1160
|
request.extraParameters = {
|
|
730
1161
|
...remainingExtraParameters,
|
|
731
|
-
child_client_id,
|
|
732
|
-
child_redirect_uri,
|
|
1162
|
+
child_client_id: childClientId,
|
|
1163
|
+
child_redirect_uri: childRedirectUri,
|
|
733
1164
|
};
|
|
734
1165
|
this.performanceClient?.addFields({
|
|
735
|
-
embeddedClientId:
|
|
736
|
-
embeddedRedirectUri:
|
|
1166
|
+
embeddedClientId: childClientId,
|
|
1167
|
+
embeddedRedirectUri: childRedirectUri,
|
|
737
1168
|
}, this.correlationId);
|
|
738
1169
|
}
|
|
739
|
-
}
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Storage location reported for MSAL-owned browser DPoP keys in reqCnf.
|
|
1173
|
+
* This does not constrain the binding selected by the platform broker.
|
|
1174
|
+
*/
|
|
1175
|
+
PlatformAuthInteractionClient.MSAL_DPOP_KEY_STORAGE_LOCATION = PlatformAuthEnclave.SOFTWARE;
|
|
740
1176
|
|
|
741
1177
|
export { PlatformAuthInteractionClient };
|
|
742
1178
|
//# sourceMappingURL=PlatformAuthInteractionClient.mjs.map
|