@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
|
@@ -5,22 +5,25 @@
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
AADServerParamKeys,
|
|
8
|
-
AccessTokenEntity,
|
|
9
8
|
AccountEntity,
|
|
10
9
|
AccountEntityUtils,
|
|
11
10
|
AccountInfo,
|
|
12
11
|
AuthError,
|
|
12
|
+
AuthErrorCodes,
|
|
13
13
|
AuthToken,
|
|
14
14
|
AuthorityType,
|
|
15
15
|
CacheHelpers,
|
|
16
16
|
ClientAuthErrorCodes,
|
|
17
|
+
ClientConfigurationErrorCodes,
|
|
17
18
|
CommonSilentFlowRequest,
|
|
18
19
|
Constants,
|
|
20
|
+
DpopProofGenerator,
|
|
19
21
|
ICrypto,
|
|
20
22
|
IPerformanceClient,
|
|
21
23
|
IdTokenEntity,
|
|
22
24
|
InProgressPerformanceEvent,
|
|
23
25
|
Logger,
|
|
26
|
+
JsonWebTokenAlgorithms,
|
|
24
27
|
PerformanceEvents,
|
|
25
28
|
PopTokenGenerator,
|
|
26
29
|
RequestParameterBuilder,
|
|
@@ -33,19 +36,27 @@ import {
|
|
|
33
36
|
ITokenBindingKeyManager,
|
|
34
37
|
UrlString,
|
|
35
38
|
buildAccountToCache,
|
|
39
|
+
createAuthError,
|
|
36
40
|
createClientAuthError,
|
|
41
|
+
createClientConfigurationError,
|
|
37
42
|
invokeAsync,
|
|
43
|
+
normalizeDpopResourceRequestContext,
|
|
38
44
|
updateAccountTenantProfileData,
|
|
39
45
|
} from "@azure/msal-common/browser";
|
|
40
46
|
import { IPlatformAuthHandler } from "../broker/nativeBroker/IPlatformAuthHandler.js";
|
|
41
47
|
import {
|
|
42
48
|
createPlatformAuthExtraParametersNoCache,
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
PlatformAuthBindingPreference,
|
|
50
|
+
PlatformAuthEnclave,
|
|
45
51
|
PlatformAuthRequest,
|
|
52
|
+
PlatformAuthTokenType,
|
|
46
53
|
} from "../broker/nativeBroker/PlatformAuthRequest.js";
|
|
47
54
|
import {
|
|
55
|
+
BrokerDpopFailureReason,
|
|
56
|
+
BrokerDpopOutcome,
|
|
48
57
|
MATS,
|
|
58
|
+
NativeResponseProperties,
|
|
59
|
+
NormalizedDpopBrokerResponse,
|
|
49
60
|
PlatformAuthResponse,
|
|
50
61
|
} from "../broker/nativeBroker/PlatformAuthResponse.js";
|
|
51
62
|
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
|
@@ -70,6 +81,7 @@ import { PopupRequest } from "../request/PopupRequest.js";
|
|
|
70
81
|
import { RedirectRequest } from "../request/RedirectRequest.js";
|
|
71
82
|
import { SilentRequest } from "../request/SilentRequest.js";
|
|
72
83
|
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
|
84
|
+
import { isTokenBindingKeyPersistedForRedirect } from "../request/RequestHelpers.js";
|
|
73
85
|
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
|
74
86
|
import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
|
|
75
87
|
import {
|
|
@@ -88,6 +100,8 @@ import {
|
|
|
88
100
|
} from "./BaseInteractionClient.js";
|
|
89
101
|
import { SilentCacheClient } from "./SilentCacheClient.js";
|
|
90
102
|
|
|
103
|
+
const DPOP_POP_KID_NOT_SUPPORTED = "dpop_pop_kid_not_supported";
|
|
104
|
+
|
|
91
105
|
export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
92
106
|
protected apiId: ApiId;
|
|
93
107
|
protected accountId: string;
|
|
@@ -96,6 +110,13 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
96
110
|
protected nativeStorageManager: BrowserCacheManager;
|
|
97
111
|
protected skus: string;
|
|
98
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Storage location reported for MSAL-owned browser DPoP keys in reqCnf.
|
|
115
|
+
* This does not constrain the binding selected by the platform broker.
|
|
116
|
+
*/
|
|
117
|
+
private static readonly MSAL_DPOP_KEY_STORAGE_LOCATION =
|
|
118
|
+
PlatformAuthEnclave.SOFTWARE;
|
|
119
|
+
|
|
99
120
|
constructor(
|
|
100
121
|
config: BrowserConfiguration,
|
|
101
122
|
browserStorage: BrowserCacheManager,
|
|
@@ -221,44 +242,56 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
221
242
|
throw e;
|
|
222
243
|
}
|
|
223
244
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
245
|
+
if (this.apiId === ApiId.acquireTokenSilent_silentFlow) {
|
|
246
|
+
let cachedResult: AuthenticationResult | undefined;
|
|
247
|
+
try {
|
|
248
|
+
cachedResult = await this.acquireTokensFromCache(
|
|
249
|
+
this.accountId,
|
|
250
|
+
nativeRequest,
|
|
251
|
+
cacheLookupPolicy
|
|
252
|
+
);
|
|
253
|
+
} catch (e) {
|
|
254
|
+
if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
|
|
255
|
+
this.logger.info(
|
|
256
|
+
"MSAL internal Cache does not contain tokens, return error as per cache policy",
|
|
257
|
+
this.correlationId
|
|
258
|
+
);
|
|
259
|
+
nativeATMeasurement.add({
|
|
260
|
+
isNativeBroker: false,
|
|
261
|
+
});
|
|
262
|
+
nativeATMeasurement.end({
|
|
263
|
+
success: false,
|
|
264
|
+
});
|
|
265
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(
|
|
266
|
+
nativeRequest
|
|
267
|
+
);
|
|
268
|
+
throw e;
|
|
269
|
+
}
|
|
270
|
+
// continue with a native call for any and all errors
|
|
241
271
|
this.logger.info(
|
|
242
|
-
"MSAL internal Cache does not contain tokens,
|
|
272
|
+
"MSAL internal Cache does not contain tokens, proceed to make a native call",
|
|
243
273
|
this.correlationId
|
|
244
274
|
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (cachedResult) {
|
|
278
|
+
// Served from the native internal cache; token did not come directly from the broker
|
|
245
279
|
nativeATMeasurement.add({
|
|
246
280
|
isNativeBroker: false,
|
|
247
281
|
});
|
|
248
282
|
nativeATMeasurement.end({
|
|
249
|
-
success:
|
|
283
|
+
success: true,
|
|
284
|
+
fromCache: true,
|
|
250
285
|
});
|
|
251
|
-
|
|
286
|
+
await this.resetGeneratedDpopRequestKey(nativeRequest);
|
|
287
|
+
return cachedResult;
|
|
252
288
|
}
|
|
253
|
-
// continue with a native call for any and all errors
|
|
254
|
-
this.logger.info(
|
|
255
|
-
"MSAL internal Cache does not contain tokens, proceed to make a native call",
|
|
256
|
-
this.correlationId
|
|
257
|
-
);
|
|
258
289
|
}
|
|
259
290
|
|
|
260
291
|
// dispatch the request to the broker
|
|
261
292
|
try {
|
|
293
|
+
await this.prepareDpopBrokerRequest(nativeRequest);
|
|
294
|
+
this.addDpopBrokerAttemptTelemetry(nativeRequest);
|
|
262
295
|
const validatedResponse: PlatformAuthResponse =
|
|
263
296
|
await this.platformAuthProvider.sendMessage(nativeRequest);
|
|
264
297
|
|
|
@@ -291,6 +324,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
291
324
|
e
|
|
292
325
|
);
|
|
293
326
|
this.setBrokerErrorTelemetry(e);
|
|
327
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
294
328
|
throw e;
|
|
295
329
|
}
|
|
296
330
|
}
|
|
@@ -336,6 +370,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
336
370
|
).asArray(),
|
|
337
371
|
account: cachedAccount,
|
|
338
372
|
forceRefresh: false,
|
|
373
|
+
...this.createSilentCacheTokenBindingParameters(request),
|
|
339
374
|
resource: request.extraParameters?.resource,
|
|
340
375
|
};
|
|
341
376
|
|
|
@@ -348,15 +383,65 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
348
383
|
}
|
|
349
384
|
|
|
350
385
|
/**
|
|
351
|
-
*
|
|
386
|
+
* Maps platform-broker token-binding state to silent-cache request fields.
|
|
387
|
+
* @param request
|
|
388
|
+
*/
|
|
389
|
+
private createSilentCacheTokenBindingParameters(
|
|
390
|
+
request: PlatformAuthRequest
|
|
391
|
+
): Pick<
|
|
392
|
+
CommonSilentFlowRequest,
|
|
393
|
+
| "authenticationScheme"
|
|
394
|
+
| "popKid"
|
|
395
|
+
| "dpopJkt"
|
|
396
|
+
| "resourceRequestMethod"
|
|
397
|
+
| "resourceRequestUri"
|
|
398
|
+
> {
|
|
399
|
+
const authenticationScheme = this.isDpopBrokerRequest(request)
|
|
400
|
+
? Constants.AuthenticationScheme.DPOP
|
|
401
|
+
: (request.tokenType as Constants.AuthenticationScheme);
|
|
402
|
+
|
|
403
|
+
if (
|
|
404
|
+
authenticationScheme !== Constants.AuthenticationScheme.DPOP &&
|
|
405
|
+
authenticationScheme !== Constants.AuthenticationScheme.POP
|
|
406
|
+
) {
|
|
407
|
+
return { authenticationScheme };
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return {
|
|
411
|
+
authenticationScheme,
|
|
412
|
+
...(authenticationScheme === Constants.AuthenticationScheme.DPOP &&
|
|
413
|
+
request.keyId && { dpopJkt: request.keyId }),
|
|
414
|
+
...(authenticationScheme === Constants.AuthenticationScheme.POP &&
|
|
415
|
+
request.signPopToken === false &&
|
|
416
|
+
request.keyId && { popKid: request.keyId }),
|
|
417
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
418
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Fetches unexpired tokens when allowed by cache policy.
|
|
352
424
|
* @param nativeAccountId
|
|
353
425
|
* @param request
|
|
354
|
-
* @
|
|
426
|
+
* @param cacheLookupPolicy
|
|
427
|
+
* @returns Cached result, or undefined when cache policy bypasses lookup.
|
|
355
428
|
*/
|
|
356
429
|
protected async acquireTokensFromCache(
|
|
357
430
|
nativeAccountId: string,
|
|
358
|
-
request: PlatformAuthRequest
|
|
359
|
-
|
|
431
|
+
request: PlatformAuthRequest,
|
|
432
|
+
cacheLookupPolicy: CacheLookupPolicy = CacheLookupPolicy.Default
|
|
433
|
+
): Promise<AuthenticationResult | undefined> {
|
|
434
|
+
if (
|
|
435
|
+
cacheLookupPolicy === CacheLookupPolicy.RefreshTokenAndNetwork ||
|
|
436
|
+
cacheLookupPolicy === CacheLookupPolicy.Skip
|
|
437
|
+
) {
|
|
438
|
+
this.logger.verbose(
|
|
439
|
+
"Native cache lookup bypassed for cache policy",
|
|
440
|
+
this.correlationId
|
|
441
|
+
);
|
|
442
|
+
return undefined;
|
|
443
|
+
}
|
|
444
|
+
|
|
360
445
|
if (!nativeAccountId) {
|
|
361
446
|
this.logger.warning(
|
|
362
447
|
"NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided",
|
|
@@ -450,9 +535,26 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
450
535
|
options?.navigateToLoginRequestUrl ?? true;
|
|
451
536
|
|
|
452
537
|
try {
|
|
453
|
-
await this.
|
|
538
|
+
await this.prepareDpopBrokerRequest(nativeRequest);
|
|
539
|
+
this.addDpopBrokerAttemptTelemetry(nativeRequest);
|
|
540
|
+
const response = await this.platformAuthProvider.sendMessage(
|
|
541
|
+
nativeRequest
|
|
542
|
+
);
|
|
543
|
+
const dpopBrokerOutcome = this.validateDpopBrokerOutcome(
|
|
544
|
+
response,
|
|
545
|
+
nativeRequest
|
|
546
|
+
);
|
|
547
|
+
if (dpopBrokerOutcome === "L3") {
|
|
548
|
+
await this.resetGeneratedDpopRequestKey(nativeRequest);
|
|
549
|
+
}
|
|
454
550
|
} catch (e) {
|
|
455
|
-
|
|
551
|
+
/*
|
|
552
|
+
* Raw persistent/transient broker errors are retrieved again in
|
|
553
|
+
* phase two. Availability errors are thrown for controller-managed
|
|
554
|
+
* web fallback, while translated cancellation, network, and
|
|
555
|
+
* interaction-required errors are surfaced without being swallowed.
|
|
556
|
+
*/
|
|
557
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
456
558
|
if (e instanceof NativeAuthError) {
|
|
457
559
|
const serverTelemetryManager = initializeServerTelemetryManager(
|
|
458
560
|
this.apiId,
|
|
@@ -474,8 +576,16 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
474
576
|
this.setBrokerErrorTelemetry(e);
|
|
475
577
|
throw e;
|
|
476
578
|
}
|
|
579
|
+
} else if (this.isDpopBrokerRequest(nativeRequest)) {
|
|
580
|
+
throw e;
|
|
477
581
|
}
|
|
478
582
|
}
|
|
583
|
+
try {
|
|
584
|
+
await this.ensureRedirectDpopKeyIsPersisted(nativeRequest);
|
|
585
|
+
} catch (e) {
|
|
586
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
587
|
+
throw e;
|
|
588
|
+
}
|
|
479
589
|
this.browserStorage.setTemporaryCache(
|
|
480
590
|
TemporaryCacheKeys.NATIVE_REQUEST,
|
|
481
591
|
JSON.stringify({
|
|
@@ -503,10 +613,20 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
503
613
|
this.correlationId
|
|
504
614
|
);
|
|
505
615
|
rootMeasurement.end({ success: true });
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
616
|
+
try {
|
|
617
|
+
await this.navigationClient.navigateExternal(
|
|
618
|
+
redirectUri,
|
|
619
|
+
navigationOptions
|
|
620
|
+
); // Need to treat this as external to ensure handleRedirectPromise is run again
|
|
621
|
+
} catch (e) {
|
|
622
|
+
this.browserStorage.removeItem(
|
|
623
|
+
this.browserStorage.generateCacheKey(
|
|
624
|
+
TemporaryCacheKeys.NATIVE_REQUEST
|
|
625
|
+
)
|
|
626
|
+
);
|
|
627
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(nativeRequest);
|
|
628
|
+
throw e;
|
|
629
|
+
}
|
|
510
630
|
}
|
|
511
631
|
|
|
512
632
|
/**
|
|
@@ -567,6 +687,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
567
687
|
const reqTimestamp = TimeUtils.nowSeconds();
|
|
568
688
|
|
|
569
689
|
try {
|
|
690
|
+
await this.prepareDpopBrokerRequest(request, true);
|
|
691
|
+
this.addDpopBrokerAttemptTelemetry(request);
|
|
570
692
|
this.logger.verbose(
|
|
571
693
|
"NativeInteractionClient - handleRedirectPromise sending message to native broker.",
|
|
572
694
|
this.correlationId
|
|
@@ -593,7 +715,20 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
593
715
|
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
594
716
|
return authResult;
|
|
595
717
|
} catch (e) {
|
|
718
|
+
if (e instanceof NativeAuthError) {
|
|
719
|
+
const serverTelemetryManager = initializeServerTelemetryManager(
|
|
720
|
+
this.apiId,
|
|
721
|
+
this.config.auth.clientId,
|
|
722
|
+
this.correlationId,
|
|
723
|
+
this.browserStorage,
|
|
724
|
+
this.logger,
|
|
725
|
+
undefined,
|
|
726
|
+
this.config.system.serverTelemetryEnabled
|
|
727
|
+
);
|
|
728
|
+
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
729
|
+
}
|
|
596
730
|
this.setBrokerErrorTelemetry(e);
|
|
731
|
+
await this.resetGeneratedDpopRequestKeyBestEffort(request);
|
|
597
732
|
throw e;
|
|
598
733
|
}
|
|
599
734
|
}
|
|
@@ -627,6 +762,11 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
627
762
|
this.correlationId
|
|
628
763
|
);
|
|
629
764
|
|
|
765
|
+
const dpopBrokerOutcome = this.validateDpopBrokerOutcome(
|
|
766
|
+
response,
|
|
767
|
+
request
|
|
768
|
+
);
|
|
769
|
+
|
|
630
770
|
// generate identifiers
|
|
631
771
|
const idTokenClaims = AuthToken.extractTokenClaims(
|
|
632
772
|
response.id_token,
|
|
@@ -712,14 +852,23 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
712
852
|
reqTimestamp
|
|
713
853
|
);
|
|
714
854
|
|
|
855
|
+
const isL3DpopResponse = dpopBrokerOutcome === "L3";
|
|
715
856
|
// cache accounts and tokens in the appropriate storage
|
|
857
|
+
const shouldRemoveGeneratedDpopKey =
|
|
858
|
+
isL3DpopResponse ||
|
|
859
|
+
(this.isDpopBrokerRequest(request) &&
|
|
860
|
+
storeInCache?.accessToken === false);
|
|
861
|
+
if (shouldRemoveGeneratedDpopKey) {
|
|
862
|
+
await this.resetGeneratedDpopRequestKey(request);
|
|
863
|
+
}
|
|
864
|
+
|
|
716
865
|
await invokeAsync(
|
|
717
866
|
this.cacheAccount.bind(this),
|
|
718
867
|
BrowserPerformanceEvents.PlatformAuthCacheAccount,
|
|
719
868
|
this.logger,
|
|
720
869
|
this.performanceClient,
|
|
721
870
|
this.correlationId
|
|
722
|
-
)(baseAccount, AuthToken.isKmsi(idTokenClaims));
|
|
871
|
+
)(baseAccount, AuthToken.isKmsi(idTokenClaims), !isL3DpopResponse);
|
|
723
872
|
await invokeAsync(
|
|
724
873
|
this.cacheNativeTokens.bind(this),
|
|
725
874
|
BrowserPerformanceEvents.PlatformAuthCacheNativeTokens,
|
|
@@ -734,7 +883,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
734
883
|
result.tenantId,
|
|
735
884
|
reqTimestamp,
|
|
736
885
|
authority.getPreferredCache(), // environment
|
|
737
|
-
storeInCache
|
|
886
|
+
storeInCache,
|
|
887
|
+
dpopBrokerOutcome
|
|
738
888
|
);
|
|
739
889
|
|
|
740
890
|
return result;
|
|
@@ -856,7 +1006,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
856
1006
|
): Promise<AuthenticationResult> {
|
|
857
1007
|
// Add Native Broker fields to Telemetry
|
|
858
1008
|
const mats = this.addTelemetryFromNativeResponse(
|
|
859
|
-
response.properties
|
|
1009
|
+
response.properties?.MATS
|
|
860
1010
|
);
|
|
861
1011
|
|
|
862
1012
|
// If scopes not returned in server response, use request scopes
|
|
@@ -900,10 +1050,17 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
900
1050
|
response,
|
|
901
1051
|
request
|
|
902
1052
|
);
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1053
|
+
const isDpopRequest = this.isDpopBrokerRequest(request);
|
|
1054
|
+
let tokenType: Constants.AuthenticationScheme =
|
|
1055
|
+
Constants.AuthenticationScheme.BEARER;
|
|
1056
|
+
if (isDpopRequest) {
|
|
1057
|
+
tokenType = Constants.AuthenticationScheme.DPOP;
|
|
1058
|
+
} else if (request.tokenType === Constants.AuthenticationScheme.POP) {
|
|
1059
|
+
tokenType = Constants.AuthenticationScheme.POP;
|
|
1060
|
+
}
|
|
1061
|
+
const dpopProof = isDpopRequest
|
|
1062
|
+
? await this.generateDpopProof(response, request)
|
|
1063
|
+
: undefined;
|
|
907
1064
|
|
|
908
1065
|
const result: AuthenticationResult = {
|
|
909
1066
|
authority: authority,
|
|
@@ -920,6 +1077,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
920
1077
|
reqTimestamp + response.expires_in
|
|
921
1078
|
),
|
|
922
1079
|
tokenType: tokenType,
|
|
1080
|
+
dpopProof,
|
|
923
1081
|
correlationId: this.correlationId,
|
|
924
1082
|
state: response.state,
|
|
925
1083
|
fromPlatformBroker: true,
|
|
@@ -937,7 +1095,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
937
1095
|
*/
|
|
938
1096
|
async cacheAccount(
|
|
939
1097
|
accountEntity: AccountEntity,
|
|
940
|
-
kmsi: boolean
|
|
1098
|
+
kmsi: boolean,
|
|
1099
|
+
clearExistingTokens: boolean = true
|
|
941
1100
|
): Promise<void> {
|
|
942
1101
|
// Store the account info and hence `nativeAccountId` in browser cache
|
|
943
1102
|
await this.browserStorage.setAccount(
|
|
@@ -946,11 +1105,13 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
946
1105
|
kmsi,
|
|
947
1106
|
this.apiId
|
|
948
1107
|
);
|
|
949
|
-
// Remove
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1108
|
+
// Remove cached web access and refresh tokens, preserving ID tokens.
|
|
1109
|
+
if (clearExistingTokens) {
|
|
1110
|
+
this.browserStorage.removeAccountContext(
|
|
1111
|
+
AccountEntityUtils.getAccountInfo(accountEntity),
|
|
1112
|
+
this.correlationId
|
|
1113
|
+
);
|
|
1114
|
+
}
|
|
954
1115
|
}
|
|
955
1116
|
|
|
956
1117
|
/**
|
|
@@ -971,7 +1132,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
971
1132
|
tenantId: string,
|
|
972
1133
|
reqTimestamp: number,
|
|
973
1134
|
environment: string,
|
|
974
|
-
storeInCache?: StoreInCache
|
|
1135
|
+
storeInCache?: StoreInCache,
|
|
1136
|
+
dpopBrokerOutcome: "none" | "L1" | "L3" = "none"
|
|
975
1137
|
): Promise<void> {
|
|
976
1138
|
const cachedIdToken: IdTokenEntity | null =
|
|
977
1139
|
CacheHelpers.createIdTokenEntity(
|
|
@@ -982,6 +1144,23 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
982
1144
|
idTokenClaims.tid || ""
|
|
983
1145
|
);
|
|
984
1146
|
|
|
1147
|
+
// save idtoken credential in configured browser storage
|
|
1148
|
+
if (!!cachedIdToken && storeInCache?.idToken !== false) {
|
|
1149
|
+
await this.browserStorage.setIdTokenCredential(
|
|
1150
|
+
cachedIdToken,
|
|
1151
|
+
this.correlationId,
|
|
1152
|
+
AuthToken.isKmsi(idTokenClaims)
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
if (dpopBrokerOutcome === "L3") {
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
if (storeInCache?.accessToken === false) {
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
985
1164
|
// cache accessToken in inmemory storage
|
|
986
1165
|
const expiresIn: number =
|
|
987
1166
|
request.tokenType === Constants.AuthenticationScheme.POP
|
|
@@ -994,45 +1173,32 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
994
1173
|
response.scope,
|
|
995
1174
|
request.scope
|
|
996
1175
|
);
|
|
997
|
-
|
|
998
1176
|
const additionalCacheKeyComponents = request.attributeTokens
|
|
999
|
-
? {
|
|
1000
|
-
attribute_tokens: request.attributeTokens,
|
|
1001
|
-
}
|
|
1177
|
+
? { attribute_tokens: request.attributeTokens }
|
|
1002
1178
|
: undefined;
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
request.tokenType as Constants.AuthenticationScheme,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1179
|
+
const cachedAccessToken = CacheHelpers.createAccessTokenEntity(
|
|
1180
|
+
homeAccountIdentifier,
|
|
1181
|
+
environment,
|
|
1182
|
+
response.access_token,
|
|
1183
|
+
request.clientId,
|
|
1184
|
+
idTokenClaims.tid || tenantId,
|
|
1185
|
+
responseScopes.printScopes(),
|
|
1186
|
+
tokenExpirationSeconds,
|
|
1187
|
+
0,
|
|
1188
|
+
base64Decode,
|
|
1189
|
+
request.correlationId,
|
|
1190
|
+
undefined,
|
|
1191
|
+
this.isDpopBrokerRequest(request)
|
|
1192
|
+
? Constants.AuthenticationScheme.DPOP
|
|
1193
|
+
: (request.tokenType as Constants.AuthenticationScheme),
|
|
1194
|
+
undefined,
|
|
1195
|
+
request.keyId,
|
|
1196
|
+
additionalCacheKeyComponents
|
|
1197
|
+
);
|
|
1023
1198
|
if (request.extraParameters?.resource) {
|
|
1024
1199
|
cachedAccessToken.resource = request.extraParameters.resource;
|
|
1025
1200
|
}
|
|
1026
1201
|
|
|
1027
|
-
// save idtoken credential in configured browser storage
|
|
1028
|
-
if (!!cachedIdToken && storeInCache?.idToken !== false) {
|
|
1029
|
-
await this.browserStorage.setIdTokenCredential(
|
|
1030
|
-
cachedIdToken,
|
|
1031
|
-
this.correlationId,
|
|
1032
|
-
AuthToken.isKmsi(idTokenClaims)
|
|
1033
|
-
);
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
1202
|
// save access token credential in memory storage
|
|
1037
1203
|
const nativeCacheRecord = {
|
|
1038
1204
|
accessToken: cachedAccessToken,
|
|
@@ -1149,15 +1315,12 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1149
1315
|
? undefined
|
|
1150
1316
|
: this.config.auth.clientCapabilities;
|
|
1151
1317
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
extraParametersNoCache?: PlatformAuthExtraParametersNoCache;
|
|
1159
|
-
dpopNonce?: string;
|
|
1160
|
-
};
|
|
1318
|
+
const { scopes, claims, dpopNonce } = request as (
|
|
1319
|
+
| PopupRequest
|
|
1320
|
+
| SsoSilentRequest
|
|
1321
|
+
) & {
|
|
1322
|
+
dpopNonce?: string;
|
|
1323
|
+
};
|
|
1161
1324
|
const scopeSet = new ScopeSet(
|
|
1162
1325
|
[...(scopes || []), ...Constants.OIDC_DEFAULT_SCOPES],
|
|
1163
1326
|
this.correlationId
|
|
@@ -1198,36 +1361,16 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1198
1361
|
loginHint: request.loginHint,
|
|
1199
1362
|
extraParameters: {
|
|
1200
1363
|
...request.extraParameters,
|
|
1201
|
-
|
|
1364
|
+
// Native broker resource is set for MCP scenarios.
|
|
1365
|
+
...(request.resource && { resource: request.resource }),
|
|
1202
1366
|
},
|
|
1203
1367
|
extendedExpiryToken: false, // Make this configurable?
|
|
1204
1368
|
keyId: request.popKid,
|
|
1205
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
1206
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
1207
|
-
shrClaims: request.shrClaims,
|
|
1208
|
-
shrNonce: request.shrNonce,
|
|
1209
|
-
extraParametersNoCache: createPlatformAuthExtraParametersNoCache(
|
|
1210
|
-
extraParametersNoCache,
|
|
1211
|
-
isProofOfPossessionTokenType(request.authenticationScheme),
|
|
1212
|
-
request.resourceRequestMethod,
|
|
1213
|
-
request.resourceRequestUri,
|
|
1214
|
-
dpopNonce
|
|
1215
|
-
),
|
|
1216
1369
|
};
|
|
1217
1370
|
|
|
1218
1371
|
if (hasAttributeTokens) {
|
|
1219
1372
|
validatedRequest.attributeTokens =
|
|
1220
|
-
CacheHelpers.serializeAttributeTokens(
|
|
1221
|
-
request.attributeTokens as Array<string>
|
|
1222
|
-
);
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
// Check for PoP token requests: signPopToken should only be set to true if popKid is not set
|
|
1226
|
-
if (validatedRequest.signPopToken && !!request.popKid) {
|
|
1227
|
-
throw createBrowserAuthError(
|
|
1228
|
-
BrowserAuthErrorCodes.invalidPopTokenRequest,
|
|
1229
|
-
this.correlationId
|
|
1230
|
-
);
|
|
1373
|
+
CacheHelpers.serializeAttributeTokens(request.attributeTokens);
|
|
1231
1374
|
}
|
|
1232
1375
|
|
|
1233
1376
|
this.handleExtraBrokerParams(
|
|
@@ -1242,23 +1385,19 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1242
1385
|
if (
|
|
1243
1386
|
request.authenticationScheme === Constants.AuthenticationScheme.POP
|
|
1244
1387
|
) {
|
|
1245
|
-
// add POP request type
|
|
1246
1388
|
const shrParameters: SignedHttpRequestParameters = {
|
|
1247
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
1248
1389
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
1390
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
1249
1391
|
shrClaims: request.shrClaims,
|
|
1250
1392
|
shrNonce: request.shrNonce,
|
|
1251
1393
|
correlationId: this.correlationId,
|
|
1252
1394
|
};
|
|
1253
|
-
|
|
1254
1395
|
const popTokenGenerator = new PopTokenGenerator(
|
|
1255
1396
|
this.browserCrypto,
|
|
1256
1397
|
this.tokenBindingKeyManager,
|
|
1257
1398
|
this.performanceClient
|
|
1258
1399
|
);
|
|
1259
1400
|
|
|
1260
|
-
// generate reqCnf if not provided in the request
|
|
1261
|
-
let reqCnfData;
|
|
1262
1401
|
if (!validatedRequest.keyId) {
|
|
1263
1402
|
const generatedReqCnfData = await invokeAsync(
|
|
1264
1403
|
popTokenGenerator.generateCnf.bind(popTokenGenerator),
|
|
@@ -1267,24 +1406,625 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1267
1406
|
this.performanceClient,
|
|
1268
1407
|
this.correlationId
|
|
1269
1408
|
)(shrParameters, this.logger);
|
|
1270
|
-
|
|
1409
|
+
validatedRequest.reqCnf = generatedReqCnfData.reqCnfString;
|
|
1271
1410
|
validatedRequest.keyId = generatedReqCnfData.kid;
|
|
1272
1411
|
validatedRequest.signPopToken = true;
|
|
1273
1412
|
} else {
|
|
1274
|
-
|
|
1413
|
+
validatedRequest.reqCnf = this.browserCrypto.base64UrlEncode(
|
|
1275
1414
|
JSON.stringify({ kid: validatedRequest.keyId })
|
|
1276
1415
|
);
|
|
1277
1416
|
validatedRequest.signPopToken = false;
|
|
1278
1417
|
}
|
|
1279
1418
|
|
|
1280
|
-
|
|
1281
|
-
|
|
1419
|
+
validatedRequest.resourceRequestMethod =
|
|
1420
|
+
request.resourceRequestMethod;
|
|
1421
|
+
validatedRequest.resourceRequestUri = request.resourceRequestUri;
|
|
1422
|
+
validatedRequest.shrClaims = request.shrClaims;
|
|
1423
|
+
validatedRequest.shrNonce = request.shrNonce;
|
|
1424
|
+
} else if (
|
|
1425
|
+
request.authenticationScheme === Constants.AuthenticationScheme.DPOP
|
|
1426
|
+
) {
|
|
1427
|
+
Object.assign(
|
|
1428
|
+
validatedRequest,
|
|
1429
|
+
this.createDpopRequestParameters(request)
|
|
1430
|
+
);
|
|
1282
1431
|
}
|
|
1432
|
+
|
|
1433
|
+
validatedRequest.extraParametersNoCache =
|
|
1434
|
+
createPlatformAuthExtraParametersNoCache(
|
|
1435
|
+
validatedRequest.tokenType,
|
|
1436
|
+
validatedRequest.resourceRequestMethod,
|
|
1437
|
+
validatedRequest.resourceRequestUri,
|
|
1438
|
+
dpopNonce
|
|
1439
|
+
);
|
|
1283
1440
|
this.addRequestSKUs(validatedRequest);
|
|
1284
1441
|
|
|
1285
1442
|
return validatedRequest;
|
|
1286
1443
|
}
|
|
1287
1444
|
|
|
1445
|
+
/**
|
|
1446
|
+
* Creates and validates the broker-specific parameters for a DPoP request.
|
|
1447
|
+
* @param request - Developer-provided token request.
|
|
1448
|
+
* @returns Broker parameters for a DPoP token and resource proof.
|
|
1449
|
+
*/
|
|
1450
|
+
private createDpopRequestParameters(
|
|
1451
|
+
request: PopupRequest | SsoSilentRequest
|
|
1452
|
+
): Partial<PlatformAuthRequest> {
|
|
1453
|
+
if (request.popKid) {
|
|
1454
|
+
throw createBrowserAuthError(
|
|
1455
|
+
DPOP_POP_KID_NOT_SUPPORTED,
|
|
1456
|
+
this.correlationId
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
if (
|
|
1461
|
+
!request.resourceRequestMethod?.trim() ||
|
|
1462
|
+
!request.resourceRequestUri?.trim()
|
|
1463
|
+
) {
|
|
1464
|
+
throw createClientConfigurationError(
|
|
1465
|
+
ClientConfigurationErrorCodes.dpopMissingResourceContext,
|
|
1466
|
+
this.correlationId
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
const resourceContext = normalizeDpopResourceRequestContext(
|
|
1471
|
+
{
|
|
1472
|
+
htm: request.resourceRequestMethod,
|
|
1473
|
+
htu: request.resourceRequestUri,
|
|
1474
|
+
},
|
|
1475
|
+
this.correlationId
|
|
1476
|
+
);
|
|
1477
|
+
|
|
1478
|
+
return {
|
|
1479
|
+
tokenType: PlatformAuthTokenType.DPOP_WITH_PROOF,
|
|
1480
|
+
preferBinding: PlatformAuthBindingPreference.ATTESTED,
|
|
1481
|
+
keyId: request.dpopJkt,
|
|
1482
|
+
resourceRequestMethod: resourceContext.htm,
|
|
1483
|
+
resourceRequestUri: resourceContext.htu,
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* Provisions the local key and confirmation data for a DPoP broker request.
|
|
1489
|
+
* @param request - Broker request to prepare.
|
|
1490
|
+
* @param reuseExistingKey - Whether a complete existing key binding may be reused.
|
|
1491
|
+
*/
|
|
1492
|
+
private async prepareDpopBrokerRequest(
|
|
1493
|
+
request: PlatformAuthRequest,
|
|
1494
|
+
reuseExistingKey: boolean = false
|
|
1495
|
+
): Promise<void> {
|
|
1496
|
+
if (request.tokenType !== PlatformAuthTokenType.DPOP_WITH_PROOF) {
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
/*
|
|
1501
|
+
* Phase one clears both fields after an L3 response or non-fatal broker
|
|
1502
|
+
* error. In that case phase two must provision a replacement. If either
|
|
1503
|
+
* field remains, treat it as a retained binding and validate it fully.
|
|
1504
|
+
*/
|
|
1505
|
+
if (reuseExistingKey && (request.keyId || request.reqCnf)) {
|
|
1506
|
+
if (!request.keyId || !request.reqCnf) {
|
|
1507
|
+
throw createAuthError(
|
|
1508
|
+
AuthErrorCodes.unexpectedError,
|
|
1509
|
+
this.correlationId,
|
|
1510
|
+
"DPoP request key binding is incomplete after redirect."
|
|
1511
|
+
);
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
const expectedReqCnf = this.createDpopBrokerReqCnf(request.keyId);
|
|
1515
|
+
if (request.reqCnf !== expectedReqCnf) {
|
|
1516
|
+
throw createAuthError(
|
|
1517
|
+
AuthErrorCodes.unexpectedError,
|
|
1518
|
+
this.correlationId,
|
|
1519
|
+
"DPoP request key binding is invalid after redirect."
|
|
1520
|
+
);
|
|
1521
|
+
}
|
|
1522
|
+
const hasKey =
|
|
1523
|
+
this.tokenBindingKeyManager.hasTokenBindingKey !== undefined
|
|
1524
|
+
? await this.tokenBindingKeyManager.hasTokenBindingKey(
|
|
1525
|
+
request.keyId,
|
|
1526
|
+
this.correlationId
|
|
1527
|
+
)
|
|
1528
|
+
: await this.tokenBindingKeyManager
|
|
1529
|
+
.getTokenBindingPublicKeyJwk(
|
|
1530
|
+
request.keyId,
|
|
1531
|
+
this.correlationId
|
|
1532
|
+
)
|
|
1533
|
+
.then(
|
|
1534
|
+
() => true,
|
|
1535
|
+
() => false
|
|
1536
|
+
);
|
|
1537
|
+
if (!hasKey) {
|
|
1538
|
+
throw createAuthError(
|
|
1539
|
+
AuthErrorCodes.unexpectedError,
|
|
1540
|
+
this.correlationId,
|
|
1541
|
+
"DPoP request key is unavailable after redirect."
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
if (request.reqCnf) {
|
|
1548
|
+
throw createAuthError(
|
|
1549
|
+
AuthErrorCodes.unexpectedError,
|
|
1550
|
+
this.correlationId,
|
|
1551
|
+
"Unexpected preexisting DPoP request key."
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
if (!request.keyId) {
|
|
1556
|
+
request.keyId =
|
|
1557
|
+
await this.tokenBindingKeyManager.provisionTokenBindingKey({
|
|
1558
|
+
tokenBindingKeyType:
|
|
1559
|
+
Constants.AuthenticationScheme.DPOP.toLowerCase(),
|
|
1560
|
+
tokenBindingKeyAlgorithm: JsonWebTokenAlgorithms.ES256,
|
|
1561
|
+
correlationId: this.correlationId,
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
request.reqCnf = this.createDpopBrokerReqCnf(request.keyId);
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Creates the confirmation claim for an MSAL-owned broker DPoP key.
|
|
1569
|
+
* @param keyId - Browser-managed DPoP key identifier.
|
|
1570
|
+
* @returns Encoded broker confirmation claim.
|
|
1571
|
+
*/
|
|
1572
|
+
private createDpopBrokerReqCnf(keyId: string): string {
|
|
1573
|
+
return this.browserCrypto.base64UrlEncode(
|
|
1574
|
+
JSON.stringify({
|
|
1575
|
+
kid: keyId,
|
|
1576
|
+
xms_ksl:
|
|
1577
|
+
PlatformAuthInteractionClient.MSAL_DPOP_KEY_STORAGE_LOCATION,
|
|
1578
|
+
})
|
|
1579
|
+
);
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Ensures an owned DPoP key can survive redirect navigation before the
|
|
1584
|
+
* request metadata is persisted for phase two.
|
|
1585
|
+
*/
|
|
1586
|
+
private async ensureRedirectDpopKeyIsPersisted(
|
|
1587
|
+
request: PlatformAuthRequest
|
|
1588
|
+
): Promise<void> {
|
|
1589
|
+
if (!this.isDpopBrokerRequest(request) || !request.keyId) {
|
|
1590
|
+
return;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
if (
|
|
1594
|
+
!(await isTokenBindingKeyPersistedForRedirect(
|
|
1595
|
+
request,
|
|
1596
|
+
this.tokenBindingKeyManager
|
|
1597
|
+
))
|
|
1598
|
+
) {
|
|
1599
|
+
throw createAuthError(
|
|
1600
|
+
AuthErrorCodes.unexpectedError,
|
|
1601
|
+
this.correlationId,
|
|
1602
|
+
"DPoP request key could not be persisted for redirect."
|
|
1603
|
+
);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* Validates and normalizes the DPoP binding outcome returned by the broker.
|
|
1609
|
+
* @param response - Broker response to validate.
|
|
1610
|
+
* @param request - Broker request associated with the response.
|
|
1611
|
+
* @returns The validated DPoP binding level, or `none` for non-DPoP requests.
|
|
1612
|
+
*/
|
|
1613
|
+
private validateDpopBrokerOutcome(
|
|
1614
|
+
response: PlatformAuthResponse,
|
|
1615
|
+
request: PlatformAuthRequest
|
|
1616
|
+
): BrokerDpopOutcome {
|
|
1617
|
+
const isDpopRequest = this.isDpopBrokerRequest(request);
|
|
1618
|
+
const normalizedResponse = this.normalizeDpopBrokerResponse(response);
|
|
1619
|
+
const normalizedRequestTokenType = request.tokenType
|
|
1620
|
+
?.trim()
|
|
1621
|
+
.toLowerCase();
|
|
1622
|
+
const bindingPreferenceSent =
|
|
1623
|
+
request.bindingPreferenceSent ??
|
|
1624
|
+
request.preferBinding !== undefined;
|
|
1625
|
+
const hasDpopResponse =
|
|
1626
|
+
this.isDpopBrokerTokenType(normalizedResponse.tokenType) ||
|
|
1627
|
+
normalizedResponse.proof !== undefined ||
|
|
1628
|
+
normalizedResponse.hasBindingAttested;
|
|
1629
|
+
|
|
1630
|
+
if (!isDpopRequest) {
|
|
1631
|
+
if (hasDpopResponse) {
|
|
1632
|
+
this.throwInvalidDpopResponse(
|
|
1633
|
+
"unexpected_response",
|
|
1634
|
+
"Unexpected DPoP broker response."
|
|
1635
|
+
);
|
|
1636
|
+
}
|
|
1637
|
+
return "none";
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
if (!this.isDpopBrokerTokenType(normalizedResponse.tokenType)) {
|
|
1641
|
+
this.throwInvalidDpopResponse(
|
|
1642
|
+
"unknown_token_type",
|
|
1643
|
+
"Unknown DPoP broker response."
|
|
1644
|
+
);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
this.validateNormalizedDpopBrokerResponse(
|
|
1648
|
+
normalizedResponse,
|
|
1649
|
+
bindingPreferenceSent
|
|
1650
|
+
);
|
|
1651
|
+
|
|
1652
|
+
if (
|
|
1653
|
+
normalizedResponse.tokenType ===
|
|
1654
|
+
PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase()
|
|
1655
|
+
) {
|
|
1656
|
+
return this.validateDpopBrokerL3Outcome(
|
|
1657
|
+
normalizedRequestTokenType,
|
|
1658
|
+
normalizedResponse
|
|
1659
|
+
);
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
return this.validateDpopBrokerL1Outcome(
|
|
1663
|
+
request,
|
|
1664
|
+
normalizedRequestTokenType,
|
|
1665
|
+
normalizedResponse,
|
|
1666
|
+
bindingPreferenceSent
|
|
1667
|
+
);
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
/**
|
|
1671
|
+
* Normalizes the canonical DPoP fields returned under response properties.
|
|
1672
|
+
*/
|
|
1673
|
+
private normalizeDpopBrokerResponse(
|
|
1674
|
+
response: PlatformAuthResponse
|
|
1675
|
+
): NormalizedDpopBrokerResponse {
|
|
1676
|
+
const responseProperties = response.properties as
|
|
1677
|
+
| NativeResponseProperties
|
|
1678
|
+
| undefined;
|
|
1679
|
+
const rawTokenType = responseProperties?.token_type;
|
|
1680
|
+
const tokenType =
|
|
1681
|
+
typeof rawTokenType === "string"
|
|
1682
|
+
? rawTokenType.trim().toLowerCase()
|
|
1683
|
+
: undefined;
|
|
1684
|
+
const rawBindingAttested = responseProperties?.binding_attested;
|
|
1685
|
+
let bindingAttested: boolean | undefined;
|
|
1686
|
+
|
|
1687
|
+
if (typeof rawBindingAttested === "string") {
|
|
1688
|
+
const normalizedBindingAttested = rawBindingAttested
|
|
1689
|
+
.trim()
|
|
1690
|
+
.toLowerCase();
|
|
1691
|
+
if (normalizedBindingAttested === "true") {
|
|
1692
|
+
bindingAttested = true;
|
|
1693
|
+
} else if (normalizedBindingAttested === "false") {
|
|
1694
|
+
bindingAttested = false;
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
return {
|
|
1699
|
+
tokenType,
|
|
1700
|
+
proof: responseProperties?.DPoP,
|
|
1701
|
+
bindingAttested,
|
|
1702
|
+
hasBindingAttested: rawBindingAttested !== undefined,
|
|
1703
|
+
hasMalformedBindingAttested:
|
|
1704
|
+
rawBindingAttested !== undefined &&
|
|
1705
|
+
bindingAttested === undefined,
|
|
1706
|
+
};
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* Validates normalized fields shared by L1 and L3 broker DPoP responses.
|
|
1711
|
+
*/
|
|
1712
|
+
private validateNormalizedDpopBrokerResponse(
|
|
1713
|
+
normalizedResponse: NormalizedDpopBrokerResponse,
|
|
1714
|
+
bindingPreferenceSent: boolean
|
|
1715
|
+
): void {
|
|
1716
|
+
if (normalizedResponse.hasMalformedBindingAttested) {
|
|
1717
|
+
this.throwInvalidDpopResponse(
|
|
1718
|
+
"invalid_attestation",
|
|
1719
|
+
"Conflicting DPoP broker response."
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
if (
|
|
1724
|
+
bindingPreferenceSent &&
|
|
1725
|
+
normalizedResponse.bindingAttested === undefined
|
|
1726
|
+
) {
|
|
1727
|
+
this.throwInvalidDpopResponse(
|
|
1728
|
+
"missing_attestation",
|
|
1729
|
+
"Conflicting DPoP broker response."
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Validates a broker-returned L3 DPoP proof outcome.
|
|
1736
|
+
*/
|
|
1737
|
+
private validateDpopBrokerL3Outcome(
|
|
1738
|
+
normalizedRequestTokenType: string | undefined,
|
|
1739
|
+
normalizedResponse: NormalizedDpopBrokerResponse
|
|
1740
|
+
): "L3" {
|
|
1741
|
+
const dpopWithProofTokenType =
|
|
1742
|
+
PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase();
|
|
1743
|
+
|
|
1744
|
+
if (
|
|
1745
|
+
typeof normalizedResponse.proof !== "string" ||
|
|
1746
|
+
normalizedResponse.proof.trim().length === 0
|
|
1747
|
+
) {
|
|
1748
|
+
this.throwInvalidDpopResponse(
|
|
1749
|
+
"missing_proof",
|
|
1750
|
+
"Malformed DPoP broker response."
|
|
1751
|
+
);
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
if (normalizedResponse.bindingAttested !== true) {
|
|
1755
|
+
this.throwInvalidDpopResponse(
|
|
1756
|
+
"invalid_attestation",
|
|
1757
|
+
"Malformed DPoP broker response."
|
|
1758
|
+
);
|
|
1759
|
+
}
|
|
1760
|
+
if (
|
|
1761
|
+
normalizedRequestTokenType !== dpopWithProofTokenType ||
|
|
1762
|
+
normalizedResponse.tokenType !== dpopWithProofTokenType
|
|
1763
|
+
) {
|
|
1764
|
+
this.throwInvalidDpopResponse(
|
|
1765
|
+
"conflicting_fields",
|
|
1766
|
+
"Malformed DPoP broker response."
|
|
1767
|
+
);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
this.performanceClient.addFields(
|
|
1771
|
+
{
|
|
1772
|
+
"ext.brokerDpopOutcome": "l3",
|
|
1773
|
+
"ext.brokerDpopBindingLevel": "L3",
|
|
1774
|
+
},
|
|
1775
|
+
this.correlationId
|
|
1776
|
+
);
|
|
1777
|
+
return "L3";
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Validates an L1 DPoP outcome that MSAL will sign with its local key.
|
|
1782
|
+
*/
|
|
1783
|
+
private validateDpopBrokerL1Outcome(
|
|
1784
|
+
request: PlatformAuthRequest,
|
|
1785
|
+
normalizedRequestTokenType: string | undefined,
|
|
1786
|
+
normalizedResponse: NormalizedDpopBrokerResponse,
|
|
1787
|
+
bindingPreferenceSent: boolean
|
|
1788
|
+
): "L1" {
|
|
1789
|
+
if (normalizedResponse.proof !== undefined) {
|
|
1790
|
+
this.throwInvalidDpopResponse(
|
|
1791
|
+
"conflicting_fields",
|
|
1792
|
+
"Malformed DPoP broker L1 response."
|
|
1793
|
+
);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
if (
|
|
1797
|
+
normalizedRequestTokenType !==
|
|
1798
|
+
PlatformAuthTokenType.DPOP_WITH_PROOF.toLowerCase()
|
|
1799
|
+
) {
|
|
1800
|
+
this.throwInvalidDpopResponse(
|
|
1801
|
+
"conflicting_fields",
|
|
1802
|
+
"Malformed DPoP broker L1 response."
|
|
1803
|
+
);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
if (
|
|
1807
|
+
normalizedResponse.bindingAttested !== false &&
|
|
1808
|
+
!(
|
|
1809
|
+
!bindingPreferenceSent &&
|
|
1810
|
+
normalizedResponse.bindingAttested === undefined
|
|
1811
|
+
)
|
|
1812
|
+
) {
|
|
1813
|
+
this.throwInvalidDpopResponse(
|
|
1814
|
+
"invalid_attestation",
|
|
1815
|
+
"Malformed DPoP broker L1 response."
|
|
1816
|
+
);
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
if (!request.reqCnf || !request.keyId) {
|
|
1820
|
+
this.throwInvalidDpopResponse(
|
|
1821
|
+
"missing_l1_binding",
|
|
1822
|
+
"Malformed DPoP broker L1 response."
|
|
1823
|
+
);
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
this.performanceClient.addFields(
|
|
1827
|
+
{
|
|
1828
|
+
"ext.brokerDpopOutcome": "l1",
|
|
1829
|
+
"ext.brokerDpopBindingLevel": "L1",
|
|
1830
|
+
},
|
|
1831
|
+
this.correlationId
|
|
1832
|
+
);
|
|
1833
|
+
return "L1";
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* Emits bounded failure telemetry and rejects an invalid DPoP response.
|
|
1838
|
+
*/
|
|
1839
|
+
private throwInvalidDpopResponse(
|
|
1840
|
+
failureReason: BrokerDpopFailureReason,
|
|
1841
|
+
message: string
|
|
1842
|
+
): never {
|
|
1843
|
+
this.performanceClient.addFields(
|
|
1844
|
+
{
|
|
1845
|
+
"ext.brokerDpopOutcome": "invalid_response",
|
|
1846
|
+
"ext.brokerDpopFailureReason": failureReason,
|
|
1847
|
+
},
|
|
1848
|
+
this.correlationId
|
|
1849
|
+
);
|
|
1850
|
+
throw createAuthError(
|
|
1851
|
+
AuthErrorCodes.unexpectedError,
|
|
1852
|
+
this.correlationId,
|
|
1853
|
+
message
|
|
1854
|
+
);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* Returns the broker proof or signs an L1 resource proof with the local key.
|
|
1859
|
+
* @param response - Broker response containing the access token and optional proof.
|
|
1860
|
+
* @param request - Broker request containing the proof context and local key.
|
|
1861
|
+
* @returns The resource proof for the broker access token.
|
|
1862
|
+
*/
|
|
1863
|
+
private async generateDpopProof(
|
|
1864
|
+
response: PlatformAuthResponse,
|
|
1865
|
+
request: PlatformAuthRequest
|
|
1866
|
+
): Promise<string> {
|
|
1867
|
+
const brokerProof = response.properties?.DPoP;
|
|
1868
|
+
if (brokerProof !== undefined) {
|
|
1869
|
+
return brokerProof;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
const dpopProofGenerator = new DpopProofGenerator(
|
|
1873
|
+
this.browserCrypto,
|
|
1874
|
+
this.tokenBindingKeyManager
|
|
1875
|
+
);
|
|
1876
|
+
return dpopProofGenerator.generateResourceProof(
|
|
1877
|
+
{
|
|
1878
|
+
htu: request.resourceRequestUri,
|
|
1879
|
+
htm: request.resourceRequestMethod,
|
|
1880
|
+
accessToken: response.access_token,
|
|
1881
|
+
nonce: request.extraParametersNoCache?.pop_nonce,
|
|
1882
|
+
},
|
|
1883
|
+
request.keyId as string,
|
|
1884
|
+
this.correlationId
|
|
1885
|
+
);
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* Removes a generated DPoP request key and clears its request metadata.
|
|
1890
|
+
* @param request - Broker request whose generated key should be removed.
|
|
1891
|
+
*/
|
|
1892
|
+
private async resetGeneratedDpopRequestKey(
|
|
1893
|
+
request: PlatformAuthRequest
|
|
1894
|
+
): Promise<void> {
|
|
1895
|
+
if (!this.isDpopBrokerRequest(request) || !request.keyId) {
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
const cleanupMeasurement = this.performanceClient.startMeasurement(
|
|
1900
|
+
BrowserPerformanceEvents.PlatformAuthDpopKeyCleanup,
|
|
1901
|
+
this.correlationId
|
|
1902
|
+
);
|
|
1903
|
+
this.performanceClient.incrementFields(
|
|
1904
|
+
{ "ext.brokerDpopKeyCleanupAttemptCount": 1 },
|
|
1905
|
+
this.correlationId
|
|
1906
|
+
);
|
|
1907
|
+
|
|
1908
|
+
try {
|
|
1909
|
+
if (request.keyId && !(await this.removeDpopKey(request.keyId))) {
|
|
1910
|
+
throw createAuthError(
|
|
1911
|
+
AuthErrorCodes.unexpectedError,
|
|
1912
|
+
this.correlationId,
|
|
1913
|
+
"Failed to remove generated DPoP request key."
|
|
1914
|
+
);
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
this.performanceClient.addFields(
|
|
1918
|
+
{
|
|
1919
|
+
"ext.brokerDpopKeyCleanupOutcome": "succeeded",
|
|
1920
|
+
},
|
|
1921
|
+
this.correlationId
|
|
1922
|
+
);
|
|
1923
|
+
cleanupMeasurement.end({ success: true });
|
|
1924
|
+
request.keyId = undefined;
|
|
1925
|
+
request.reqCnf = undefined;
|
|
1926
|
+
} catch (error) {
|
|
1927
|
+
this.performanceClient.addFields(
|
|
1928
|
+
{
|
|
1929
|
+
"ext.brokerDpopKeyCleanupOutcome": "failed",
|
|
1930
|
+
},
|
|
1931
|
+
this.correlationId
|
|
1932
|
+
);
|
|
1933
|
+
this.performanceClient.incrementFields(
|
|
1934
|
+
{ "ext.brokerDpopKeyCleanupFailureCount": 1 },
|
|
1935
|
+
this.correlationId
|
|
1936
|
+
);
|
|
1937
|
+
cleanupMeasurement.end({ success: false }, error);
|
|
1938
|
+
throw error;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
/**
|
|
1943
|
+
* Attempts to remove a generated DPoP request key without replacing an
|
|
1944
|
+
* existing operation error with a cleanup failure.
|
|
1945
|
+
* @param request - Broker request whose generated key should be removed.
|
|
1946
|
+
*/
|
|
1947
|
+
private async resetGeneratedDpopRequestKeyBestEffort(
|
|
1948
|
+
request: PlatformAuthRequest
|
|
1949
|
+
): Promise<void> {
|
|
1950
|
+
try {
|
|
1951
|
+
await this.resetGeneratedDpopRequestKey(request);
|
|
1952
|
+
} catch {
|
|
1953
|
+
this.logger.error(
|
|
1954
|
+
"Failed to remove generated DPoP request key after an operation error.",
|
|
1955
|
+
this.correlationId
|
|
1956
|
+
);
|
|
1957
|
+
this.performanceClient.incrementFields(
|
|
1958
|
+
{ removeTokenBindingKeyFailure: 1 },
|
|
1959
|
+
this.correlationId
|
|
1960
|
+
);
|
|
1961
|
+
|
|
1962
|
+
request.keyId = undefined;
|
|
1963
|
+
request.reqCnf = undefined;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* Records that a DPoP request is about to be dispatched to the platform broker.
|
|
1969
|
+
* @param request - Broker request about to cross the provider boundary.
|
|
1970
|
+
*/
|
|
1971
|
+
private addDpopBrokerAttemptTelemetry(request: PlatformAuthRequest): void {
|
|
1972
|
+
if (!this.isDpopBrokerRequest(request)) {
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
this.performanceClient.addFields(
|
|
1977
|
+
{
|
|
1978
|
+
"ext.brokerDpopAttempted": 1,
|
|
1979
|
+
},
|
|
1980
|
+
this.correlationId
|
|
1981
|
+
);
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
/**
|
|
1985
|
+
* Determines whether a request uses the DPoP broker protocol.
|
|
1986
|
+
* @param request - Broker request to inspect.
|
|
1987
|
+
* @returns Whether the request uses a DPoP token type.
|
|
1988
|
+
*/
|
|
1989
|
+
private isDpopBrokerRequest(request: PlatformAuthRequest): boolean {
|
|
1990
|
+
return this.isDpopBrokerTokenType(request.tokenType);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
/**
|
|
1994
|
+
* Determines whether a token type represents a DPoP broker request.
|
|
1995
|
+
* @param tokenType - Token type to inspect.
|
|
1996
|
+
* @returns Whether the token type is a supported DPoP broker token type.
|
|
1997
|
+
*/
|
|
1998
|
+
private isDpopBrokerTokenType(tokenType: string | undefined): boolean {
|
|
1999
|
+
const normalizedTokenType = tokenType?.trim().toLowerCase();
|
|
2000
|
+
return (
|
|
2001
|
+
normalizedTokenType === PlatformAuthTokenType.DPOP_WITH_PROOF ||
|
|
2002
|
+
normalizedTokenType ===
|
|
2003
|
+
Constants.AuthenticationScheme.DPOP.toLowerCase()
|
|
2004
|
+
);
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
/**
|
|
2008
|
+
* Removes a DPoP key while reporting cleanup failures.
|
|
2009
|
+
* @param keyId - Identifier of the DPoP key to remove.
|
|
2010
|
+
* @returns Whether the key was removed successfully.
|
|
2011
|
+
*/
|
|
2012
|
+
private async removeDpopKey(keyId: string): Promise<boolean> {
|
|
2013
|
+
try {
|
|
2014
|
+
await this.tokenBindingKeyManager.removeTokenBindingKey(
|
|
2015
|
+
keyId,
|
|
2016
|
+
this.correlationId
|
|
2017
|
+
);
|
|
2018
|
+
return true;
|
|
2019
|
+
} catch {
|
|
2020
|
+
this.logger.error(
|
|
2021
|
+
"Failed to remove unused DPoP key",
|
|
2022
|
+
this.correlationId
|
|
2023
|
+
);
|
|
2024
|
+
return false;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
|
|
1288
2028
|
private async getCanonicalAuthority(
|
|
1289
2029
|
request: PopupRequest | SsoSilentRequest
|
|
1290
2030
|
): Promise<UrlString> {
|
|
@@ -1362,41 +2102,39 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1362
2102
|
}
|
|
1363
2103
|
|
|
1364
2104
|
/**
|
|
1365
|
-
* Handles extra broker request parameters
|
|
1366
|
-
* @param request
|
|
1367
|
-
* @
|
|
2105
|
+
* Handles extra broker request parameters.
|
|
2106
|
+
* @param request - Platform broker request.
|
|
2107
|
+
* @param embeddedClientId - Embedded application client identifier.
|
|
1368
2108
|
*/
|
|
1369
2109
|
private handleExtraBrokerParams(
|
|
1370
2110
|
request: PlatformAuthRequest,
|
|
1371
2111
|
embeddedClientId?: string
|
|
1372
2112
|
): void {
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
) &&
|
|
1378
|
-
request.extraParameters.hasOwnProperty(
|
|
1379
|
-
AADServerParamKeys.BROKER_REDIRECT_URI
|
|
1380
|
-
) &&
|
|
1381
|
-
request.extraParameters.hasOwnProperty(
|
|
1382
|
-
AADServerParamKeys.CLIENT_ID
|
|
2113
|
+
const hasOwnParameter = (parameter: string): boolean =>
|
|
2114
|
+
Object.prototype.hasOwnProperty.call(
|
|
2115
|
+
request.extraParameters,
|
|
2116
|
+
parameter
|
|
1383
2117
|
);
|
|
2118
|
+
const hasExtraBrokerParams =
|
|
2119
|
+
hasOwnParameter(AADServerParamKeys.BROKER_CLIENT_ID) &&
|
|
2120
|
+
hasOwnParameter(AADServerParamKeys.BROKER_REDIRECT_URI) &&
|
|
2121
|
+
hasOwnParameter(AADServerParamKeys.CLIENT_ID);
|
|
1384
2122
|
|
|
1385
2123
|
if (!embeddedClientId && !hasExtraBrokerParams) {
|
|
1386
2124
|
return;
|
|
1387
2125
|
}
|
|
1388
2126
|
|
|
1389
|
-
|
|
1390
|
-
const
|
|
2127
|
+
const childRedirectUri = request.redirectUri;
|
|
2128
|
+
const childClientId =
|
|
2129
|
+
embeddedClientId ||
|
|
2130
|
+
request.extraParameters?.[AADServerParamKeys.CLIENT_ID] ||
|
|
2131
|
+
"";
|
|
1391
2132
|
|
|
1392
2133
|
if (embeddedClientId) {
|
|
1393
2134
|
request.redirectUri = this.config.auth.redirectUri;
|
|
1394
|
-
child_client_id = embeddedClientId;
|
|
1395
2135
|
} else if (request.extraParameters) {
|
|
1396
2136
|
request.redirectUri =
|
|
1397
2137
|
request.extraParameters[AADServerParamKeys.BROKER_REDIRECT_URI];
|
|
1398
|
-
child_client_id =
|
|
1399
|
-
request.extraParameters[AADServerParamKeys.CLIENT_ID];
|
|
1400
2138
|
}
|
|
1401
2139
|
|
|
1402
2140
|
const {
|
|
@@ -1411,14 +2149,14 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1411
2149
|
|
|
1412
2150
|
request.extraParameters = {
|
|
1413
2151
|
...remainingExtraParameters,
|
|
1414
|
-
child_client_id,
|
|
1415
|
-
child_redirect_uri,
|
|
2152
|
+
child_client_id: childClientId,
|
|
2153
|
+
child_redirect_uri: childRedirectUri,
|
|
1416
2154
|
};
|
|
1417
2155
|
|
|
1418
2156
|
this.performanceClient?.addFields(
|
|
1419
2157
|
{
|
|
1420
|
-
embeddedClientId:
|
|
1421
|
-
embeddedRedirectUri:
|
|
2158
|
+
embeddedClientId: childClientId,
|
|
2159
|
+
embeddedRedirectUri: childRedirectUri,
|
|
1422
2160
|
},
|
|
1423
2161
|
this.correlationId
|
|
1424
2162
|
);
|