@azure/msal-browser 5.29.1 → 5.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/app/IPublicClientApplication.mjs +4 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.mjs +14 -2
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +10 -23
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +2 -3
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +40 -4
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +11 -2
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +26 -5
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +44 -11
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +189 -5
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -4
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +11 -4
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +3 -3
- package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -4
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -3
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -8
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -3
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -3
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -7
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +2 -5
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +2 -3
- package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
- package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
- package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +32 -27
- package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +6 -2
- package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +7 -5
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +12 -3
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +9 -39
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
- package/dist/custom_auth/index.mjs +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -3
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -3
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -3
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -2
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -2
- package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +4 -2
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +18 -5
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +27 -21
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +8 -10
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +5 -8
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +2 -1
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +13 -9
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +24 -6
- package/dist/popup_relay/constants.mjs.map +1 -1
- package/dist/popup_relay/index.mjs +142 -44
- package/dist/popup_relay/index.mjs.map +1 -1
- package/dist/popup_relay/relayClient.mjs +66 -23
- package/dist/popup_relay/relayClient.mjs.map +1 -1
- package/dist/protocol/Authorize.mjs +71 -13
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +2 -1
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/request/SilentRequestHelpers.mjs +7 -4
- package/dist/request/SilentRequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +14 -2
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserDetection.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/IframeMonitor.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/utils/PopupMonitor.mjs +1 -1
- package/dist/utils/PopupOriginCheck.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
- package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
- package/dist/webBrokerBridge/index.mjs +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +13 -9
- package/lib/custom-auth-path/msal-custom-auth.cjs +764 -314
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +764 -314
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +13 -9
- package/lib/msal-browser.cjs +791 -215
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +791 -215
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +231 -60
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +231 -60
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +2 -2
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
- package/package.json +2 -2
- package/src/app/IPublicClientApplication.ts +16 -0
- package/src/app/PublicClientApplication.ts +22 -0
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +11 -44
- package/src/broker/nativeBroker/PlatformAuthProvider.ts +1 -2
- package/src/broker/nativeBroker/PlatformAuthResponse.ts +2 -6
- package/src/cache/BrowserCacheManager.ts +66 -6
- package/src/config/Configuration.ts +35 -0
- package/src/controllers/NestedAppAuthController.ts +35 -2
- package/src/controllers/StandardController.ts +76 -12
- package/src/controllers/UnknownOperatingContextController.ts +10 -0
- package/src/crypto/BrowserCrypto.ts +367 -2
- package/src/custom_auth/CustomAuthActionInputs.ts +0 -9
- package/src/custom_auth/CustomAuthPublicClientApplication.ts +0 -3
- package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +0 -3
- package/src/custom_auth/controller/CustomAuthStandardController.ts +15 -2
- package/src/custom_auth/core/CustomAuthAuthority.ts +2 -1
- package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.ts +0 -3
- package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.ts +0 -2
- package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.ts +0 -7
- package/src/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.ts +0 -2
- package/src/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.ts +0 -2
- package/src/custom_auth/core/auth_flow/mfa/state/MfaState.ts +0 -6
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +0 -4
- package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +0 -2
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +0 -3
- package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +0 -1
- package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +8 -6
- package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +1 -0
- package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +43 -29
- package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +21 -2
- package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +12 -8
- package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +35 -4
- package/src/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.ts +10 -47
- package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +1 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +9 -0
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +5 -5
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +2 -5
- package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +2 -4
- package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
- package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +0 -2
- package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +0 -1
- package/src/custom_auth/sign_in/auth_flow/result/SignInResult.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +0 -2
- package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +0 -1
- package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +0 -2
- package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +0 -2
- package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +0 -1
- package/src/error/AsymmetricEarSubErrors.ts +18 -0
- package/src/error/BrowserAuthErrorCodes.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +6 -1
- package/src/interaction_client/PlatformAuthInteractionClient.ts +28 -8
- package/src/interaction_client/PopupClient.ts +59 -29
- package/src/interaction_client/RedirectClient.ts +10 -13
- package/src/interaction_client/SilentIframeClient.ts +9 -13
- package/src/interaction_client/StandardInteractionClient.ts +1 -0
- package/src/packageMetadata.ts +1 -1
- package/src/popup_relay/constants.ts +34 -3
- package/src/popup_relay/index.ts +200 -45
- package/src/popup_relay/relayClient.ts +108 -24
- package/src/protocol/Authorize.ts +123 -11
- package/src/request/EndSessionPopupRequest.ts +3 -0
- package/src/request/PopupRequest.ts +1 -0
- package/src/request/RedirectRequest.ts +4 -0
- package/src/request/RequestHelpers.ts +5 -0
- package/src/request/SilentRequestHelpers.ts +10 -4
- package/src/request/SsoSilentRequest.ts +1 -0
- package/src/telemetry/BrowserPerformanceEvents.ts +14 -0
- package/types/app/IPublicClientApplication.d.ts +8 -0
- package/types/app/IPublicClientApplication.d.ts.map +1 -1
- package/types/app/PublicClientApplication.d.ts +6 -1
- package/types/app/PublicClientApplication.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +0 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +2 -6
- package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +20 -2
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/config/Configuration.d.ts +14 -0
- package/types/config/Configuration.d.ts.map +1 -1
- package/types/controllers/NestedAppAuthController.d.ts +5 -0
- package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +4 -0
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/controllers/UnknownOperatingContextController.d.ts +5 -0
- package/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/types/crypto/BrowserCrypto.d.ts +34 -0
- package/types/crypto/BrowserCrypto.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthActionInputs.d.ts +0 -9
- package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +0 -3
- package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +0 -3
- package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +0 -3
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +0 -7
- package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +0 -6
- package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +0 -4
- package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +0 -2
- package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +1 -0
- package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +3 -2
- package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +10 -1
- package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +8 -0
- package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +4 -5
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +3 -6
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +2 -5
- package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
- package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +0 -2
- package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +0 -2
- package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +0 -1
- package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +0 -2
- package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +0 -2
- package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +0 -1
- package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
- package/types/error/AsymmetricEarSubErrors.d.ts +14 -0
- package/types/error/AsymmetricEarSubErrors.d.ts.map +1 -0
- package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
- package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/types/interaction_client/BaseInteractionClient.d.ts +3 -2
- package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts +3 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts +0 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/popup_relay/constants.d.ts +10 -3
- package/types/popup_relay/constants.d.ts.map +1 -1
- package/types/popup_relay/index.d.ts +27 -11
- package/types/popup_relay/index.d.ts.map +1 -1
- package/types/popup_relay/relayClient.d.ts +9 -11
- package/types/popup_relay/relayClient.d.ts.map +1 -1
- package/types/protocol/Authorize.d.ts +5 -0
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/EndSessionPopupRequest.d.ts +3 -0
- package/types/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/types/request/PopupRequest.d.ts +1 -1
- package/types/request/PopupRequest.d.ts.map +1 -1
- package/types/request/RedirectRequest.d.ts +4 -1
- package/types/request/RedirectRequest.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/request/SilentRequestHelpers.d.ts +1 -1
- package/types/request/SilentRequestHelpers.d.ts.map +1 -1
- package/types/request/SsoSilentRequest.d.ts +1 -1
- package/types/request/SsoSilentRequest.d.ts.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +12 -0
- package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.31.0 2026-12-02 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msalCustomAuth = {}));
|
|
7
7
|
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
|
-
/*! @azure/msal-common v16.
|
|
9
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
10
10
|
/*
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
12
|
* Licensed under the MIT License.
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
*/
|
|
67
67
|
const POPUP_ORIGIN_CHECK_DONE = "pocd";
|
|
68
68
|
|
|
69
|
-
/*! @azure/msal-common v16.
|
|
69
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
70
70
|
/*
|
|
71
71
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
72
72
|
* Licensed under the MIT License.
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
// Token renewal offset default in seconds
|
|
301
301
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
302
302
|
|
|
303
|
-
/*! @azure/msal-common v16.
|
|
303
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
304
304
|
/*
|
|
305
305
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
306
306
|
* Licensed under the MIT License.
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
/*! @azure/msal-common v16.
|
|
332
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
333
333
|
|
|
334
334
|
/*
|
|
335
335
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
return new ClientAuthError(errorCode, correlationId, additionalMessage);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
/*! @azure/msal-common v16.
|
|
355
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
356
356
|
/*
|
|
357
357
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
358
358
|
* Licensed under the MIT License.
|
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
const resourceParameterRequired = "resource_parameter_required";
|
|
391
391
|
const misplacedResourceParam = "misplaced_resource_parameter";
|
|
392
392
|
|
|
393
|
-
/*! @azure/msal-common v16.
|
|
393
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
394
394
|
|
|
395
395
|
/*
|
|
396
396
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
/*! @azure/msal-common v16.
|
|
431
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
432
432
|
|
|
433
433
|
/*
|
|
434
434
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -494,7 +494,7 @@
|
|
|
494
494
|
return matches[2];
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
/*! @azure/msal-common v16.
|
|
497
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
498
498
|
|
|
499
499
|
/*
|
|
500
500
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -582,7 +582,7 @@
|
|
|
582
582
|
return updatedAccountInfo;
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
-
/*! @azure/msal-common v16.
|
|
585
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
586
586
|
/*
|
|
587
587
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
588
588
|
* Licensed under the MIT License.
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
Ciam: 3,
|
|
597
597
|
};
|
|
598
598
|
|
|
599
|
-
/*! @azure/msal-common v16.
|
|
599
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
600
600
|
/*
|
|
601
601
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
602
602
|
* Licensed under the MIT License.
|
|
@@ -618,7 +618,7 @@
|
|
|
618
618
|
return null;
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
-
/*! @azure/msal-common v16.
|
|
621
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
622
622
|
/*
|
|
623
623
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
624
624
|
* Licensed under the MIT License.
|
|
@@ -642,7 +642,7 @@
|
|
|
642
642
|
EAR: "EAR",
|
|
643
643
|
};
|
|
644
644
|
|
|
645
|
-
/*! @azure/msal-common v16.
|
|
645
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
646
646
|
/**
|
|
647
647
|
* Returns the AccountInfo interface for this account.
|
|
648
648
|
* @internal
|
|
@@ -831,7 +831,7 @@
|
|
|
831
831
|
entity.hasOwnProperty("authorityType"));
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
-
/*! @azure/msal-common v16.
|
|
834
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
835
835
|
/*
|
|
836
836
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
837
837
|
* Licensed under the MIT License.
|
|
@@ -841,7 +841,7 @@
|
|
|
841
841
|
*/
|
|
842
842
|
const unexpectedError = "unexpected_error";
|
|
843
843
|
|
|
844
|
-
/*! @azure/msal-common v16.
|
|
844
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
845
845
|
|
|
846
846
|
/*
|
|
847
847
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
return new ClientConfigurationError(errorCode, correlationId);
|
|
862
862
|
}
|
|
863
863
|
|
|
864
|
-
/*! @azure/msal-common v16.
|
|
864
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
865
865
|
/*
|
|
866
866
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
867
867
|
* Licensed under the MIT License.
|
|
@@ -901,7 +901,7 @@
|
|
|
901
901
|
return headerName === undefined ? undefined : headers[headerName];
|
|
902
902
|
}
|
|
903
903
|
|
|
904
|
-
/*! @azure/msal-common v16.
|
|
904
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
905
905
|
/*
|
|
906
906
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
907
907
|
* Licensed under the MIT License.
|
|
@@ -932,7 +932,7 @@
|
|
|
932
932
|
const invalidDpopNonce = "invalid_dpop_nonce";
|
|
933
933
|
const dpopMissingResourceContext = "dpop_missing_resource_context";
|
|
934
934
|
|
|
935
|
-
/*! @azure/msal-common v16.
|
|
935
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
936
936
|
/*
|
|
937
937
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
938
938
|
* Licensed under the MIT License.
|
|
@@ -944,7 +944,7 @@
|
|
|
944
944
|
response.hasOwnProperty("jwks_uri"));
|
|
945
945
|
}
|
|
946
946
|
|
|
947
|
-
/*! @azure/msal-common v16.
|
|
947
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
948
948
|
/*
|
|
949
949
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
950
950
|
* Licensed under the MIT License.
|
|
@@ -1024,7 +1024,7 @@
|
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
|
-
/*! @azure/msal-common v16.
|
|
1027
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1028
1028
|
|
|
1029
1029
|
/*
|
|
1030
1030
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1211,7 +1211,7 @@
|
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
1213
|
|
|
1214
|
-
/*! @azure/msal-common v16.
|
|
1214
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1215
1215
|
|
|
1216
1216
|
/*
|
|
1217
1217
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1365,7 +1365,7 @@
|
|
|
1365
1365
|
return null;
|
|
1366
1366
|
}
|
|
1367
1367
|
|
|
1368
|
-
/*! @azure/msal-common v16.
|
|
1368
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1369
1369
|
/*
|
|
1370
1370
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1371
1371
|
* Licensed under the MIT License.
|
|
@@ -1374,7 +1374,7 @@
|
|
|
1374
1374
|
// AzureCloudInstance is not specified.
|
|
1375
1375
|
None: "none"};
|
|
1376
1376
|
|
|
1377
|
-
/*! @azure/msal-common v16.
|
|
1377
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1378
1378
|
/*
|
|
1379
1379
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1380
1380
|
* Licensed under the MIT License.
|
|
@@ -1384,7 +1384,7 @@
|
|
|
1384
1384
|
response.hasOwnProperty("metadata"));
|
|
1385
1385
|
}
|
|
1386
1386
|
|
|
1387
|
-
/*! @azure/msal-common v16.
|
|
1387
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1388
1388
|
/*
|
|
1389
1389
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1390
1390
|
* Licensed under the MIT License.
|
|
@@ -1394,7 +1394,7 @@
|
|
|
1394
1394
|
response.hasOwnProperty("error_description"));
|
|
1395
1395
|
}
|
|
1396
1396
|
|
|
1397
|
-
/*! @azure/msal-common v16.
|
|
1397
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1398
1398
|
/*
|
|
1399
1399
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1400
1400
|
* Licensed under the MIT License.
|
|
@@ -1465,7 +1465,7 @@
|
|
|
1465
1465
|
const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
|
|
1466
1466
|
const SetUserData = "setUserData";
|
|
1467
1467
|
|
|
1468
|
-
/*! @azure/msal-common v16.
|
|
1468
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1469
1469
|
/*
|
|
1470
1470
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1471
1471
|
* Licensed under the MIT License.
|
|
@@ -1559,7 +1559,7 @@
|
|
|
1559
1559
|
};
|
|
1560
1560
|
};
|
|
1561
1561
|
|
|
1562
|
-
/*! @azure/msal-common v16.
|
|
1562
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1563
1563
|
|
|
1564
1564
|
/*
|
|
1565
1565
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1688,7 +1688,7 @@
|
|
|
1688
1688
|
},
|
|
1689
1689
|
};
|
|
1690
1690
|
|
|
1691
|
-
/*! @azure/msal-common v16.
|
|
1691
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1692
1692
|
/*
|
|
1693
1693
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1694
1694
|
* Licensed under the MIT License.
|
|
@@ -1753,7 +1753,7 @@
|
|
|
1753
1753
|
return cachedAtSec > nowSeconds();
|
|
1754
1754
|
}
|
|
1755
1755
|
|
|
1756
|
-
/*! @azure/msal-common v16.
|
|
1756
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
1757
1757
|
|
|
1758
1758
|
/*
|
|
1759
1759
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2040,7 +2040,7 @@
|
|
|
2040
2040
|
return [...attributeTokens].sort().join(" ");
|
|
2041
2041
|
}
|
|
2042
2042
|
|
|
2043
|
-
/*! @azure/msal-common v16.
|
|
2043
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
2044
2044
|
|
|
2045
2045
|
/*
|
|
2046
2046
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3011,7 +3011,7 @@
|
|
|
3011
3011
|
};
|
|
3012
3012
|
}
|
|
3013
3013
|
|
|
3014
|
-
/*! @azure/msal-common v16.
|
|
3014
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3015
3015
|
|
|
3016
3016
|
/*
|
|
3017
3017
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3045,7 +3045,7 @@
|
|
|
3045
3045
|
}
|
|
3046
3046
|
}
|
|
3047
3047
|
|
|
3048
|
-
/*! @azure/msal-common v16.
|
|
3048
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3049
3049
|
|
|
3050
3050
|
/*
|
|
3051
3051
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3241,7 +3241,7 @@
|
|
|
3241
3241
|
}
|
|
3242
3242
|
}
|
|
3243
3243
|
|
|
3244
|
-
/*! @azure/msal-common v16.
|
|
3244
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3245
3245
|
|
|
3246
3246
|
/*
|
|
3247
3247
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3709,12 +3709,13 @@
|
|
|
3709
3709
|
* Add EAR (Encrypted Authorize Response) request parameters
|
|
3710
3710
|
* @param parameters
|
|
3711
3711
|
* @param jwk
|
|
3712
|
+
* @param jweCrypto - Base64-encoded encryption metadata; defaults to symmetric EAR.
|
|
3712
3713
|
*/
|
|
3713
|
-
function addEARParameters(parameters, jwk) {
|
|
3714
|
+
function addEARParameters(parameters, jwk, jweCrypto) {
|
|
3714
3715
|
parameters.set(EAR_JWK, encodeURIComponent(jwk));
|
|
3715
|
-
//
|
|
3716
|
+
// Default symmetric EAR metadata; asymmetric requests supply their APV.
|
|
3716
3717
|
const jweCryptoB64Encoded = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0";
|
|
3717
|
-
parameters.set(EAR_JWE_CRYPTO, jweCryptoB64Encoded);
|
|
3718
|
+
parameters.set(EAR_JWE_CRYPTO, jweCrypto ?? jweCryptoB64Encoded);
|
|
3718
3719
|
}
|
|
3719
3720
|
function addResource(parameters, resource) {
|
|
3720
3721
|
if (resource) {
|
|
@@ -3741,7 +3742,7 @@
|
|
|
3741
3742
|
}
|
|
3742
3743
|
}
|
|
3743
3744
|
|
|
3744
|
-
/*! @azure/msal-common v16.
|
|
3745
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3745
3746
|
|
|
3746
3747
|
/*
|
|
3747
3748
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3872,7 +3873,7 @@
|
|
|
3872
3873
|
}
|
|
3873
3874
|
}
|
|
3874
3875
|
|
|
3875
|
-
/*! @azure/msal-common v16.
|
|
3876
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3876
3877
|
|
|
3877
3878
|
/*
|
|
3878
3879
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3920,7 +3921,7 @@
|
|
|
3920
3921
|
},
|
|
3921
3922
|
};
|
|
3922
3923
|
|
|
3923
|
-
/*! @azure/msal-common v16.
|
|
3924
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3924
3925
|
|
|
3925
3926
|
/*
|
|
3926
3927
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3943,7 +3944,7 @@
|
|
|
3943
3944
|
},
|
|
3944
3945
|
};
|
|
3945
3946
|
|
|
3946
|
-
/*! @azure/msal-common v16.
|
|
3947
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
3947
3948
|
/*
|
|
3948
3949
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3949
3950
|
* Licensed under the MIT License.
|
|
@@ -4218,12 +4219,12 @@
|
|
|
4218
4219
|
}
|
|
4219
4220
|
}
|
|
4220
4221
|
|
|
4221
|
-
/*! @azure/msal-common v16.
|
|
4222
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
4222
4223
|
/* eslint-disable header/header */
|
|
4223
4224
|
const name$1 = "@azure/msal-common";
|
|
4224
|
-
const version$1 = "16.
|
|
4225
|
+
const version$1 = "16.18.0";
|
|
4225
4226
|
|
|
4226
|
-
/*! @azure/msal-common v16.
|
|
4227
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
4227
4228
|
/*
|
|
4228
4229
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4229
4230
|
* Licensed under the MIT License.
|
|
@@ -4231,7 +4232,7 @@
|
|
|
4231
4232
|
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
4232
4233
|
const cacheErrorUnknown = "cache_error_unknown";
|
|
4233
4234
|
|
|
4234
|
-
/*! @azure/msal-common v16.
|
|
4235
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
4235
4236
|
|
|
4236
4237
|
/*
|
|
4237
4238
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4269,7 +4270,7 @@
|
|
|
4269
4270
|
}
|
|
4270
4271
|
}
|
|
4271
4272
|
|
|
4272
|
-
/*! @azure/msal-common v16.
|
|
4273
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
4273
4274
|
|
|
4274
4275
|
/*
|
|
4275
4276
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5496,7 +5497,7 @@
|
|
|
5496
5497
|
}
|
|
5497
5498
|
}
|
|
5498
5499
|
|
|
5499
|
-
/*! @azure/msal-common v16.
|
|
5500
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5500
5501
|
/*
|
|
5501
5502
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5502
5503
|
* Licensed under the MIT License.
|
|
@@ -5510,7 +5511,7 @@
|
|
|
5510
5511
|
const PerformanceEventStatus = {
|
|
5511
5512
|
InProgress: 1};
|
|
5512
5513
|
|
|
5513
|
-
/*! @azure/msal-common v16.
|
|
5514
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5514
5515
|
|
|
5515
5516
|
/*
|
|
5516
5517
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5568,7 +5569,7 @@
|
|
|
5568
5569
|
}
|
|
5569
5570
|
}
|
|
5570
5571
|
|
|
5571
|
-
/*! @azure/msal-common v16.
|
|
5572
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5572
5573
|
|
|
5573
5574
|
/*
|
|
5574
5575
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5622,7 +5623,7 @@
|
|
|
5622
5623
|
* @returns Configuration
|
|
5623
5624
|
* @internal
|
|
5624
5625
|
*/
|
|
5625
|
-
function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, tokenBindingKeyManager: tokenBindingKeyManager, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
|
|
5626
|
+
function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, tokenBindingKeyManager: tokenBindingKeyManager, dpopNonceProvider: dpopNonceProvider, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
|
|
5626
5627
|
const loggerOptions = {
|
|
5627
5628
|
...DEFAULT_LOGGER_IMPLEMENTATION,
|
|
5628
5629
|
...userLoggerOption,
|
|
@@ -5637,6 +5638,7 @@
|
|
|
5637
5638
|
networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
|
|
5638
5639
|
cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
|
|
5639
5640
|
tokenBindingKeyManager: resolvedTokenBindingKeyManager,
|
|
5641
|
+
dpopNonceProvider,
|
|
5640
5642
|
clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
|
|
5641
5643
|
libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
|
|
5642
5644
|
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
|
|
@@ -5666,7 +5668,7 @@
|
|
|
5666
5668
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
5667
5669
|
}
|
|
5668
5670
|
|
|
5669
|
-
/*! @azure/msal-common v16.
|
|
5671
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5670
5672
|
/*
|
|
5671
5673
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5672
5674
|
* Licensed under the MIT License.
|
|
@@ -5693,7 +5695,7 @@
|
|
|
5693
5695
|
}
|
|
5694
5696
|
}
|
|
5695
5697
|
|
|
5696
|
-
/*! @azure/msal-common v16.
|
|
5698
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5697
5699
|
|
|
5698
5700
|
/*
|
|
5699
5701
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5714,7 +5716,7 @@
|
|
|
5714
5716
|
return new JoseHeaderError(code, correlationId);
|
|
5715
5717
|
}
|
|
5716
5718
|
|
|
5717
|
-
/*! @azure/msal-common v16.
|
|
5719
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5718
5720
|
/*
|
|
5719
5721
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5720
5722
|
* Licensed under the MIT License.
|
|
@@ -5739,7 +5741,7 @@
|
|
|
5739
5741
|
return Object.getPrototypeOf(value) === proto;
|
|
5740
5742
|
}
|
|
5741
5743
|
|
|
5742
|
-
/*! @azure/msal-common v16.
|
|
5744
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5743
5745
|
/*
|
|
5744
5746
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5745
5747
|
* Licensed under the MIT License.
|
|
@@ -5749,7 +5751,7 @@
|
|
|
5749
5751
|
const missingJwkError = "missing_jwk_error";
|
|
5750
5752
|
const invalidJwkError = "invalid_jwk_error";
|
|
5751
5753
|
|
|
5752
|
-
/*! @azure/msal-common v16.
|
|
5754
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5753
5755
|
|
|
5754
5756
|
/*
|
|
5755
5757
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5815,7 +5817,7 @@
|
|
|
5815
5817
|
}
|
|
5816
5818
|
}
|
|
5817
5819
|
|
|
5818
|
-
/*! @azure/msal-common v16.
|
|
5820
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5819
5821
|
|
|
5820
5822
|
/*
|
|
5821
5823
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5916,7 +5918,50 @@
|
|
|
5916
5918
|
}
|
|
5917
5919
|
}
|
|
5918
5920
|
|
|
5919
|
-
/*! @azure/msal-common v16.
|
|
5921
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5922
|
+
|
|
5923
|
+
/*
|
|
5924
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5925
|
+
* Licensed under the MIT License.
|
|
5926
|
+
*/
|
|
5927
|
+
/**
|
|
5928
|
+
* Validates that a DPoP nonce is a non-empty string and returns the opaque
|
|
5929
|
+
* value unchanged.
|
|
5930
|
+
* @internal
|
|
5931
|
+
*/
|
|
5932
|
+
function validateDpopNonce(nonce, correlationId = "") {
|
|
5933
|
+
if (typeof nonce !== "string" || nonce.length === 0) {
|
|
5934
|
+
throw createClientConfigurationError(invalidDpopNonce, correlationId);
|
|
5935
|
+
}
|
|
5936
|
+
return nonce;
|
|
5937
|
+
}
|
|
5938
|
+
/**
|
|
5939
|
+
* Returns the normalized HTTPS origin used to scope a resource-server nonce.
|
|
5940
|
+
* @internal
|
|
5941
|
+
*/
|
|
5942
|
+
function canonicalizeDpopResourceServer(resourceRequestUri, correlationId = "") {
|
|
5943
|
+
if (typeof resourceRequestUri !== "string" ||
|
|
5944
|
+
!/^https:\/\//i.test(resourceRequestUri)) {
|
|
5945
|
+
throw createClientConfigurationError(invalidDpopHtu, correlationId);
|
|
5946
|
+
}
|
|
5947
|
+
let parsedUrl;
|
|
5948
|
+
try {
|
|
5949
|
+
parsedUrl = new URL(resourceRequestUri);
|
|
5950
|
+
}
|
|
5951
|
+
catch {
|
|
5952
|
+
throw createClientConfigurationError(invalidDpopHtu, correlationId);
|
|
5953
|
+
}
|
|
5954
|
+
if (parsedUrl.protocol !== "https:" ||
|
|
5955
|
+
parsedUrl.origin === "null" ||
|
|
5956
|
+
!parsedUrl.hostname ||
|
|
5957
|
+
parsedUrl.username ||
|
|
5958
|
+
parsedUrl.password) {
|
|
5959
|
+
throw createClientConfigurationError(invalidDpopHtu, correlationId);
|
|
5960
|
+
}
|
|
5961
|
+
return parsedUrl.origin;
|
|
5962
|
+
}
|
|
5963
|
+
|
|
5964
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
5920
5965
|
|
|
5921
5966
|
/*
|
|
5922
5967
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5961,11 +6006,6 @@
|
|
|
5961
6006
|
parsedUrl.hash = "";
|
|
5962
6007
|
return parsedUrl.href;
|
|
5963
6008
|
}
|
|
5964
|
-
function validateDpopNonce(nonce, correlationId) {
|
|
5965
|
-
if (nonce !== undefined && nonce.trim().length === 0) {
|
|
5966
|
-
throw createClientConfigurationError(invalidDpopNonce, correlationId);
|
|
5967
|
-
}
|
|
5968
|
-
}
|
|
5969
6009
|
/**
|
|
5970
6010
|
* Validates and normalizes the HTTP resource context for a DPoP-bound request.
|
|
5971
6011
|
* @internal
|
|
@@ -6009,7 +6049,6 @@
|
|
|
6009
6049
|
* - jti is a fresh CSPRNG-backed unique identifier for every proof.
|
|
6010
6050
|
*/
|
|
6011
6051
|
buildTokenProofClaims(params, correlationId = "") {
|
|
6012
|
-
validateDpopNonce(params.nonce, correlationId);
|
|
6013
6052
|
const claims = {
|
|
6014
6053
|
jti: this.cryptoUtils.createNewGuid(),
|
|
6015
6054
|
htm: "POST",
|
|
@@ -6017,7 +6056,7 @@
|
|
|
6017
6056
|
iat: nowSeconds(),
|
|
6018
6057
|
};
|
|
6019
6058
|
if (params.nonce !== undefined) {
|
|
6020
|
-
claims.nonce = params.nonce;
|
|
6059
|
+
claims.nonce = validateDpopNonce(params.nonce, correlationId);
|
|
6021
6060
|
}
|
|
6022
6061
|
return claims;
|
|
6023
6062
|
}
|
|
@@ -6035,7 +6074,6 @@
|
|
|
6035
6074
|
* - jti is a fresh CSPRNG-backed unique identifier for every proof.
|
|
6036
6075
|
*/
|
|
6037
6076
|
buildResourceProofClaims(params, correlationId = "") {
|
|
6038
|
-
validateDpopNonce(params.nonce, correlationId);
|
|
6039
6077
|
const resourceContext = normalizeDpopResourceRequestContext(params, correlationId);
|
|
6040
6078
|
const claims = {
|
|
6041
6079
|
jti: this.cryptoUtils.createNewGuid(),
|
|
@@ -6045,7 +6083,7 @@
|
|
|
6045
6083
|
iat: nowSeconds(),
|
|
6046
6084
|
};
|
|
6047
6085
|
if (params.nonce !== undefined) {
|
|
6048
|
-
claims.nonce = params.nonce;
|
|
6086
|
+
claims.nonce = validateDpopNonce(params.nonce, correlationId);
|
|
6049
6087
|
}
|
|
6050
6088
|
return claims;
|
|
6051
6089
|
}
|
|
@@ -6071,7 +6109,7 @@
|
|
|
6071
6109
|
}
|
|
6072
6110
|
}
|
|
6073
6111
|
|
|
6074
|
-
/*! @azure/msal-common v16.
|
|
6112
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6075
6113
|
/*
|
|
6076
6114
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6077
6115
|
* Licensed under the MIT License.
|
|
@@ -6122,7 +6160,7 @@
|
|
|
6122
6160
|
*/
|
|
6123
6161
|
const interruptedUser = "interrupted_user";
|
|
6124
6162
|
|
|
6125
|
-
/*! @azure/msal-common v16.
|
|
6163
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6126
6164
|
|
|
6127
6165
|
/*
|
|
6128
6166
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6189,7 +6227,7 @@
|
|
|
6189
6227
|
return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
|
|
6190
6228
|
}
|
|
6191
6229
|
|
|
6192
|
-
/*! @azure/msal-common v16.
|
|
6230
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6193
6231
|
|
|
6194
6232
|
/*
|
|
6195
6233
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6208,7 +6246,7 @@
|
|
|
6208
6246
|
}
|
|
6209
6247
|
}
|
|
6210
6248
|
|
|
6211
|
-
/*! @azure/msal-common v16.
|
|
6249
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6212
6250
|
|
|
6213
6251
|
/*
|
|
6214
6252
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6279,18 +6317,29 @@
|
|
|
6279
6317
|
}
|
|
6280
6318
|
}
|
|
6281
6319
|
|
|
6282
|
-
/*! @azure/msal-common v16.
|
|
6320
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6283
6321
|
|
|
6284
6322
|
/*
|
|
6285
6323
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6286
6324
|
* Licensed under the MIT License.
|
|
6287
6325
|
*/
|
|
6326
|
+
/*
|
|
6327
|
+
* Retains the signing key for fresh proofs on deduplicated calls without
|
|
6328
|
+
* exposing it on the public AuthenticationResult.
|
|
6329
|
+
*/
|
|
6330
|
+
const dpopKeyIdByAuthenticationResult = new WeakMap();
|
|
6331
|
+
function getDpopNonceForRequest(dpopNonceProvider, request) {
|
|
6332
|
+
if (!request.resourceRequestUri || !dpopNonceProvider) {
|
|
6333
|
+
return undefined;
|
|
6334
|
+
}
|
|
6335
|
+
return dpopNonceProvider.getDpopNonce(request.resourceRequestUri, request.correlationId);
|
|
6336
|
+
}
|
|
6288
6337
|
/**
|
|
6289
6338
|
* Class that handles response parsing.
|
|
6290
6339
|
* @internal
|
|
6291
6340
|
*/
|
|
6292
6341
|
class ResponseHandler {
|
|
6293
|
-
constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
|
|
6342
|
+
constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, dpopNonceProvider) {
|
|
6294
6343
|
this.clientId = clientId;
|
|
6295
6344
|
this.cacheStorage = cacheStorage;
|
|
6296
6345
|
this.cryptoObj = cryptoObj;
|
|
@@ -6299,6 +6348,7 @@
|
|
|
6299
6348
|
this.performanceClient = performanceClient;
|
|
6300
6349
|
this.serializableCache = serializableCache;
|
|
6301
6350
|
this.persistencePlugin = persistencePlugin;
|
|
6351
|
+
this.dpopNonceProvider = dpopNonceProvider;
|
|
6302
6352
|
}
|
|
6303
6353
|
/**
|
|
6304
6354
|
* Function which validates server authorization token response.
|
|
@@ -6437,6 +6487,7 @@
|
|
|
6437
6487
|
requestState: requestStateObj,
|
|
6438
6488
|
requestId: serverRequestId,
|
|
6439
6489
|
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
6490
|
+
dpopNonceProvider: this.dpopNonceProvider,
|
|
6440
6491
|
});
|
|
6441
6492
|
}
|
|
6442
6493
|
}
|
|
@@ -6456,6 +6507,7 @@
|
|
|
6456
6507
|
serverTokenResponse,
|
|
6457
6508
|
requestId: serverRequestId,
|
|
6458
6509
|
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
6510
|
+
dpopNonceProvider: this.dpopNonceProvider,
|
|
6459
6511
|
});
|
|
6460
6512
|
}
|
|
6461
6513
|
/**
|
|
@@ -6553,7 +6605,7 @@
|
|
|
6553
6605
|
* @param stateString
|
|
6554
6606
|
*/
|
|
6555
6607
|
static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient, options = {}) {
|
|
6556
|
-
const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, } = options;
|
|
6608
|
+
const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, dpopNonceProvider, } = options;
|
|
6557
6609
|
let accessToken = "";
|
|
6558
6610
|
let responseScopes = [];
|
|
6559
6611
|
let expiresOn = null;
|
|
@@ -6561,8 +6613,13 @@
|
|
|
6561
6613
|
let refreshOn;
|
|
6562
6614
|
let familyId = "";
|
|
6563
6615
|
let dpopProof;
|
|
6616
|
+
const cachedAccessTokenType = cacheRecord.accessToken?.tokenType || "";
|
|
6617
|
+
const isDpopAccessToken = cachedAccessTokenType.toLowerCase() ===
|
|
6618
|
+
AuthenticationScheme.DPOP.toLowerCase();
|
|
6619
|
+
const resultTokenType = isDpopAccessToken
|
|
6620
|
+
? AuthenticationScheme.DPOP
|
|
6621
|
+
: cachedAccessTokenType;
|
|
6564
6622
|
if (cacheRecord.accessToken) {
|
|
6565
|
-
const accessTokenType = cacheRecord.accessToken.tokenType?.toLowerCase();
|
|
6566
6623
|
/*
|
|
6567
6624
|
* if the request object has `popKid` property, `signPopToken` will be set to false and
|
|
6568
6625
|
* the token will be returned unsigned
|
|
@@ -6580,15 +6637,17 @@
|
|
|
6580
6637
|
else {
|
|
6581
6638
|
accessToken = cacheRecord.accessToken.secret;
|
|
6582
6639
|
}
|
|
6583
|
-
if (
|
|
6584
|
-
AuthenticationScheme.DPOP.toLowerCase()) {
|
|
6640
|
+
if (isDpopAccessToken) {
|
|
6585
6641
|
if (!cacheRecord.accessToken.keyId) {
|
|
6586
6642
|
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
6587
6643
|
}
|
|
6588
6644
|
const dpopProofGenerator = new DpopProofGenerator(cryptoObj, tokenBindingKeyManager);
|
|
6645
|
+
const dpopNonce = getDpopNonceForRequest(dpopNonceProvider, request);
|
|
6646
|
+
performanceClient?.addFields({ dpopNonceAppliedToProof: Boolean(dpopNonce) }, request.correlationId);
|
|
6589
6647
|
dpopProof = await dpopProofGenerator.generateResourceProof({
|
|
6590
6648
|
htu: request.resourceRequestUri,
|
|
6591
6649
|
htm: request.resourceRequestMethod,
|
|
6650
|
+
nonce: dpopNonce,
|
|
6592
6651
|
accessToken: cacheRecord.accessToken.secret,
|
|
6593
6652
|
}, cacheRecord.accessToken.keyId, request.correlationId);
|
|
6594
6653
|
}
|
|
@@ -6636,7 +6695,7 @@
|
|
|
6636
6695
|
? updateAccountTenantProfileData(getAccountInfo(cacheRecord.account), undefined, // tenantProfile optional
|
|
6637
6696
|
idTokenClaims, cacheRecord.idToken?.secret)
|
|
6638
6697
|
: null;
|
|
6639
|
-
|
|
6698
|
+
const authenticationResult = {
|
|
6640
6699
|
authority: authority.canonicalAuthority,
|
|
6641
6700
|
uniqueId: uid,
|
|
6642
6701
|
tenantId: tid,
|
|
@@ -6653,16 +6712,49 @@
|
|
|
6653
6712
|
correlationId: request.correlationId,
|
|
6654
6713
|
requestId: requestId || "",
|
|
6655
6714
|
familyId: familyId,
|
|
6656
|
-
tokenType:
|
|
6657
|
-
AuthenticationScheme.DPOP.toLowerCase()
|
|
6658
|
-
? AuthenticationScheme.DPOP
|
|
6659
|
-
: cacheRecord.accessToken?.tokenType || "",
|
|
6715
|
+
tokenType: resultTokenType,
|
|
6660
6716
|
state: requestState ? requestState.userRequestState : "",
|
|
6661
6717
|
cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || "",
|
|
6662
6718
|
msGraphHost: cacheRecord.account?.msGraphHost || "",
|
|
6663
6719
|
code: serverTokenResponse?.spa_code,
|
|
6664
6720
|
fromPlatformBroker: false,
|
|
6665
6721
|
};
|
|
6722
|
+
if (isDpopAccessToken && cacheRecord.accessToken?.keyId) {
|
|
6723
|
+
ResponseHandler.setDpopKeyId(authenticationResult, cacheRecord.accessToken.keyId);
|
|
6724
|
+
}
|
|
6725
|
+
return authenticationResult;
|
|
6726
|
+
}
|
|
6727
|
+
/**
|
|
6728
|
+
* Retains an MSAL-owned DPoP key for fresh proofs on deduplicated calls.
|
|
6729
|
+
* @internal
|
|
6730
|
+
*/
|
|
6731
|
+
static setDpopKeyId(authenticationResult, keyId) {
|
|
6732
|
+
dpopKeyIdByAuthenticationResult.set(authenticationResult, keyId);
|
|
6733
|
+
}
|
|
6734
|
+
/**
|
|
6735
|
+
* Returns whether MSAL can generate another proof for this result.
|
|
6736
|
+
* @internal
|
|
6737
|
+
*/
|
|
6738
|
+
static hasDpopKeyId(authenticationResult) {
|
|
6739
|
+
return dpopKeyIdByAuthenticationResult.has(authenticationResult);
|
|
6740
|
+
}
|
|
6741
|
+
/**
|
|
6742
|
+
* Generates a fresh resource proof for a previously constructed DPoP result.
|
|
6743
|
+
* @internal
|
|
6744
|
+
*/
|
|
6745
|
+
static async generateDpopResourceProof(cryptoObj, authenticationResult, request, performanceClient, options = {}) {
|
|
6746
|
+
const keyId = dpopKeyIdByAuthenticationResult.get(authenticationResult);
|
|
6747
|
+
if (!keyId) {
|
|
6748
|
+
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
6749
|
+
}
|
|
6750
|
+
const dpopNonce = getDpopNonceForRequest(options.dpopNonceProvider, request);
|
|
6751
|
+
performanceClient.addFields({ dpopNonceAppliedToProof: Boolean(dpopNonce) }, request.correlationId);
|
|
6752
|
+
return new DpopProofGenerator(cryptoObj, options.tokenBindingKeyManager ?? DEFAULT_TOKEN_BINDING_KEY_MANAGER).generateResourceProof({
|
|
6753
|
+
htu: request.resourceRequestUri,
|
|
6754
|
+
htm: request.resourceRequestMethod,
|
|
6755
|
+
nonce: dpopNonce,
|
|
6756
|
+
accessToken: authenticationResult.accessToken,
|
|
6757
|
+
}, keyId, request.correlationId);
|
|
6666
6758
|
}
|
|
6667
6759
|
}
|
|
6668
6760
|
/** @internal */
|
|
@@ -6707,7 +6799,7 @@
|
|
|
6707
6799
|
return baseAccount;
|
|
6708
6800
|
}
|
|
6709
6801
|
|
|
6710
|
-
/*! @azure/msal-common v16.
|
|
6802
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6711
6803
|
/*
|
|
6712
6804
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6713
6805
|
* Licensed under the MIT License.
|
|
@@ -6717,7 +6809,7 @@
|
|
|
6717
6809
|
UPN: "UPN",
|
|
6718
6810
|
};
|
|
6719
6811
|
|
|
6720
|
-
/*! @azure/msal-common v16.
|
|
6812
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6721
6813
|
/*
|
|
6722
6814
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6723
6815
|
* Licensed under the MIT License.
|
|
@@ -6736,7 +6828,7 @@
|
|
|
6736
6828
|
}
|
|
6737
6829
|
}
|
|
6738
6830
|
|
|
6739
|
-
/*! @azure/msal-common v16.
|
|
6831
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6740
6832
|
|
|
6741
6833
|
/*
|
|
6742
6834
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6760,7 +6852,7 @@
|
|
|
6760
6852
|
};
|
|
6761
6853
|
}
|
|
6762
6854
|
|
|
6763
|
-
/*! @azure/msal-common v16.
|
|
6855
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6764
6856
|
|
|
6765
6857
|
/*
|
|
6766
6858
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6850,7 +6942,7 @@
|
|
|
6850
6942
|
return undefined;
|
|
6851
6943
|
}
|
|
6852
6944
|
|
|
6853
|
-
/*! @azure/msal-common v16.
|
|
6945
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6854
6946
|
|
|
6855
6947
|
/*
|
|
6856
6948
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6881,7 +6973,7 @@
|
|
|
6881
6973
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6882
6974
|
}
|
|
6883
6975
|
|
|
6884
|
-
/*! @azure/msal-common v16.
|
|
6976
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
6885
6977
|
|
|
6886
6978
|
/*
|
|
6887
6979
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7015,7 +7107,7 @@
|
|
|
7015
7107
|
return response;
|
|
7016
7108
|
}
|
|
7017
7109
|
|
|
7018
|
-
/*! @azure/msal-common v16.
|
|
7110
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
7019
7111
|
|
|
7020
7112
|
/*
|
|
7021
7113
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7066,7 +7158,7 @@
|
|
|
7066
7158
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request, this.serverTelemetryManager);
|
|
7067
7159
|
// Retrieve requestId from response headers
|
|
7068
7160
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
7069
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
|
|
7161
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager, this.config.dpopNonceProvider);
|
|
7070
7162
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
7071
7163
|
responseHandler.validateTokenResponse(response.body, request.correlationId);
|
|
7072
7164
|
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, authCodePayload, undefined, undefined, undefined, requestId);
|
|
@@ -7283,7 +7375,7 @@
|
|
|
7283
7375
|
}
|
|
7284
7376
|
}
|
|
7285
7377
|
|
|
7286
|
-
/*! @azure/msal-common v16.
|
|
7378
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
7287
7379
|
|
|
7288
7380
|
/*
|
|
7289
7381
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7513,7 +7605,7 @@
|
|
|
7513
7605
|
return account.loginHint || account.idTokenClaims?.login_hint || null;
|
|
7514
7606
|
}
|
|
7515
7607
|
|
|
7516
|
-
/*! @azure/msal-common v16.
|
|
7608
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
7517
7609
|
|
|
7518
7610
|
/*
|
|
7519
7611
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7548,7 +7640,7 @@
|
|
|
7548
7640
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
|
|
7549
7641
|
// Retrieve requestId from response headers
|
|
7550
7642
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
7551
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
|
|
7643
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager, this.config.dpopNonceProvider);
|
|
7552
7644
|
responseHandler.validateTokenResponse(response.body, request.correlationId);
|
|
7553
7645
|
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, undefined, undefined, true, request.forceCache, requestId);
|
|
7554
7646
|
}
|
|
@@ -7748,7 +7840,7 @@
|
|
|
7748
7840
|
}
|
|
7749
7841
|
}
|
|
7750
7842
|
|
|
7751
|
-
/*! @azure/msal-common v16.
|
|
7843
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
7752
7844
|
|
|
7753
7845
|
/*
|
|
7754
7846
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8041,7 +8133,7 @@
|
|
|
8041
8133
|
clearNativeBrokerErrorCode() { }
|
|
8042
8134
|
}
|
|
8043
8135
|
|
|
8044
|
-
/*! @azure/msal-common v16.
|
|
8136
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
8045
8137
|
|
|
8046
8138
|
/*
|
|
8047
8139
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8164,11 +8256,12 @@
|
|
|
8164
8256
|
return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient, {
|
|
8165
8257
|
idTokenClaims,
|
|
8166
8258
|
tokenBindingKeyManager: this.config.tokenBindingKeyManager,
|
|
8259
|
+
dpopNonceProvider: this.config.dpopNonceProvider,
|
|
8167
8260
|
});
|
|
8168
8261
|
}
|
|
8169
8262
|
}
|
|
8170
8263
|
|
|
8171
|
-
/*! @azure/msal-common v16.
|
|
8264
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
8172
8265
|
|
|
8173
8266
|
/*
|
|
8174
8267
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8184,7 +8277,7 @@
|
|
|
8184
8277
|
},
|
|
8185
8278
|
};
|
|
8186
8279
|
|
|
8187
|
-
/*! @azure/msal-common v16.
|
|
8280
|
+
/*! @azure/msal-common v16.18.0 2026-12-02 */
|
|
8188
8281
|
|
|
8189
8282
|
/*
|
|
8190
8283
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8636,7 +8729,7 @@
|
|
|
8636
8729
|
|
|
8637
8730
|
/* eslint-disable header/header */
|
|
8638
8731
|
const name = "@azure/msal-browser";
|
|
8639
|
-
const version = "5.
|
|
8732
|
+
const version = "5.31.0";
|
|
8640
8733
|
|
|
8641
8734
|
/*
|
|
8642
8735
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8966,7 +9059,6 @@
|
|
|
8966
9059
|
}
|
|
8967
9060
|
/**
|
|
8968
9061
|
* Checks if the result requires authentication method registration.
|
|
8969
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
8970
9062
|
*/
|
|
8971
9063
|
isAuthMethodRegistrationRequired() {
|
|
8972
9064
|
return (this.state.stateType ===
|
|
@@ -8974,7 +9066,6 @@
|
|
|
8974
9066
|
}
|
|
8975
9067
|
/**
|
|
8976
9068
|
* Checks if the result requires MFA.
|
|
8977
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
8978
9069
|
*/
|
|
8979
9070
|
isMfaRequired() {
|
|
8980
9071
|
return this.state.stateType === MFA_AWAITING_STATE_TYPE;
|
|
@@ -9165,6 +9256,11 @@
|
|
|
9165
9256
|
* Internal API for acquireTokenSilent.
|
|
9166
9257
|
*/
|
|
9167
9258
|
const AcquireTokenSilentAsync = "acquireTokenSilentAsync";
|
|
9259
|
+
/**
|
|
9260
|
+
* loadDpopNonce API in StandardController (msal-browser).
|
|
9261
|
+
* Stores a resource-server DPoP nonce in controller-owned memory.
|
|
9262
|
+
*/
|
|
9263
|
+
const StandardControllerLoadDpopNonce = "standardControllerLoadDpopNonce";
|
|
9168
9264
|
/**
|
|
9169
9265
|
* provisionTokenBindingKey API in TokenBindingKeyManager class (msal-browser).
|
|
9170
9266
|
* Used to provision token-binding key material and return a key identifier.
|
|
@@ -9280,6 +9376,13 @@
|
|
|
9280
9376
|
const Encrypt = "encrypt";
|
|
9281
9377
|
const Decrypt = "decrypt";
|
|
9282
9378
|
const GenerateEarKey = "generateEarKey";
|
|
9379
|
+
const GenerateAsymmetricEarKey = "generateAsymmetricEarKey";
|
|
9380
|
+
const ImportAsymmetricEarKey = "importAsymmetricEarKey";
|
|
9381
|
+
const ImportAsymmetricEarPublicKey = "importAsymmetricEarPublicKey";
|
|
9382
|
+
const DeriveAsymmetricEarSecret = "deriveAsymmetricEarSecret";
|
|
9383
|
+
const AsymmetricEarConcatKdf = "asymmetricEarConcatKdf";
|
|
9384
|
+
const ImportAsymmetricEarContentKey = "importAsymmetricEarContentKey";
|
|
9385
|
+
const DecryptAsymmetricEarResponse = "decryptAsymmetricEarResponse";
|
|
9283
9386
|
const DecryptEarResponse = "decryptEarResponse";
|
|
9284
9387
|
/**
|
|
9285
9388
|
* Background telemetry measurement that tracks whether a late bridge response
|
|
@@ -9340,6 +9443,7 @@
|
|
|
9340
9443
|
const failedToBuildHeaders = "failed_to_build_headers";
|
|
9341
9444
|
const failedToParseHeaders = "failed_to_parse_headers";
|
|
9342
9445
|
const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
|
|
9446
|
+
const asymmetricEarKeyError = "asymmetric_ear_key_error";
|
|
9343
9447
|
const timedOut = "timed_out";
|
|
9344
9448
|
const emptyResponse = "empty_response";
|
|
9345
9449
|
|
|
@@ -9648,6 +9752,10 @@
|
|
|
9648
9752
|
const S256_HASH_ALG = "SHA-256";
|
|
9649
9753
|
// JWK values used by browser-internal WebCrypto helpers.
|
|
9650
9754
|
const JSON_WEB_KEY_CURVE_P256 = "P-256";
|
|
9755
|
+
const ECDH_P384_ALGORITHM = {
|
|
9756
|
+
name: "ECDH",
|
|
9757
|
+
namedCurve: "P-384",
|
|
9758
|
+
};
|
|
9651
9759
|
const JSON_WEB_KEY_TYPE_EC = "EC";
|
|
9652
9760
|
const JSON_WEB_KEY_TYPE_RSA = "RSA";
|
|
9653
9761
|
const MISSING_JWK_KTY_SUBERROR = "missing_jwk_kty";
|
|
@@ -9785,6 +9893,16 @@
|
|
|
9785
9893
|
async function exportJwk(key) {
|
|
9786
9894
|
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
|
9787
9895
|
}
|
|
9896
|
+
/**
|
|
9897
|
+
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
|
9898
|
+
* @param key
|
|
9899
|
+
* @param extractable
|
|
9900
|
+
* @param usages
|
|
9901
|
+
* @param algorithm
|
|
9902
|
+
*/
|
|
9903
|
+
async function importJwk(key, extractable, usages, algorithm) {
|
|
9904
|
+
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, algorithm, extractable, usages);
|
|
9905
|
+
}
|
|
9788
9906
|
/**
|
|
9789
9907
|
* Signs given data with given key.
|
|
9790
9908
|
* @param key
|
|
@@ -9807,6 +9925,172 @@
|
|
|
9807
9925
|
};
|
|
9808
9926
|
return base64Encode(JSON.stringify(jwk));
|
|
9809
9927
|
}
|
|
9928
|
+
/**
|
|
9929
|
+
* Generates P-384 ECDH keys for request-scoped private sessionStorage and public wire metadata.
|
|
9930
|
+
* @internal
|
|
9931
|
+
*/
|
|
9932
|
+
async function generateAsymmetricEarKey() {
|
|
9933
|
+
const keyPair = await generateKeyPair(true, ["deriveBits"], ECDH_P384_ALGORITHM);
|
|
9934
|
+
const publicJwk = await exportJwk(keyPair.publicKey);
|
|
9935
|
+
const privateJwk = await exportJwk(keyPair.privateKey);
|
|
9936
|
+
return {
|
|
9937
|
+
privateJwk,
|
|
9938
|
+
publicJwk,
|
|
9939
|
+
};
|
|
9940
|
+
}
|
|
9941
|
+
/**
|
|
9942
|
+
* Restores a private EAR key as non-exportable. The serialized sessionStorage copy remains exportable.
|
|
9943
|
+
* @internal
|
|
9944
|
+
*/
|
|
9945
|
+
async function importAsymmetricEarKey(privateJwk, correlationId = "") {
|
|
9946
|
+
if (privateJwk?.kty !== "EC" ||
|
|
9947
|
+
privateJwk.crv !== "P-384" ||
|
|
9948
|
+
!privateJwk.d) {
|
|
9949
|
+
throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "invalid_private_key" /* AsymmetricEarSubErrors.InvalidPrivateKey */);
|
|
9950
|
+
}
|
|
9951
|
+
try {
|
|
9952
|
+
return await importJwk(privateJwk, false, ["deriveBits"], ECDH_P384_ALGORITHM);
|
|
9953
|
+
}
|
|
9954
|
+
catch {
|
|
9955
|
+
throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "private_key_import_failed" /* AsymmetricEarSubErrors.PrivateKeyImportFailed */);
|
|
9956
|
+
}
|
|
9957
|
+
}
|
|
9958
|
+
/**
|
|
9959
|
+
* Encodes the EAR client party information with a fresh 192-bit nonce.
|
|
9960
|
+
* @internal
|
|
9961
|
+
*/
|
|
9962
|
+
function generateAsymmetricEarApv(publicJwk) {
|
|
9963
|
+
const point = new Uint8Array(concatEarBytes(new Uint8Array([4]), decodeEarBase64Url(publicJwk.x || ""), decodeEarBase64Url(publicJwk.y || "")));
|
|
9964
|
+
if (point.length !== 97) {
|
|
9965
|
+
throw createBrowserAuthError(asymmetricEarKeyError, "", "invalid_public_key_coordinates" /* AsymmetricEarSubErrors.InvalidPublicKeyCoordinates */);
|
|
9966
|
+
}
|
|
9967
|
+
const nonce = new Uint8Array(24);
|
|
9968
|
+
window.crypto.getRandomValues(nonce);
|
|
9969
|
+
return urlEncodeArr(new Uint8Array(concatEarBytes(lengthPrefixEarBytes(new TextEncoder().encode("EarClient")), lengthPrefixEarBytes(point), lengthPrefixEarBytes(nonce))));
|
|
9970
|
+
}
|
|
9971
|
+
/**
|
|
9972
|
+
* Authenticates and decrypts direct ECDH-ES/P-384/A256GCM using JOSE Concat KDF.
|
|
9973
|
+
* Party information is used byte-for-byte; the service need not echo the request APV.
|
|
9974
|
+
* @internal
|
|
9975
|
+
*/
|
|
9976
|
+
async function decryptAsymmetricEarResponse(privateJwk, apv, earJwe, requestApv = apv, telemetry) {
|
|
9977
|
+
const correlationId = telemetry?.correlationId || "";
|
|
9978
|
+
const measure = (eventName, operation) => telemetry
|
|
9979
|
+
? invokeAsync(operation, eventName, telemetry.logger, telemetry.performanceClient, correlationId)()
|
|
9980
|
+
: operation();
|
|
9981
|
+
if (apv !== requestApv) {
|
|
9982
|
+
throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "request_apv_mismatch" /* AsymmetricEarSubErrors.RequestApvMismatch */);
|
|
9983
|
+
}
|
|
9984
|
+
const parts = earJwe.split(".");
|
|
9985
|
+
if (parts.length !== 5 || parts[1] !== "") {
|
|
9986
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
|
|
9987
|
+
}
|
|
9988
|
+
let header;
|
|
9989
|
+
try {
|
|
9990
|
+
header = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(decodeEarBase64Url(parts[0], correlationId)));
|
|
9991
|
+
}
|
|
9992
|
+
catch {
|
|
9993
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
|
|
9994
|
+
}
|
|
9995
|
+
if (!header ||
|
|
9996
|
+
header.alg !== "ECDH-ES" ||
|
|
9997
|
+
header.enc !== "A256GCM" ||
|
|
9998
|
+
header.crit !== undefined ||
|
|
9999
|
+
header.zip !== undefined ||
|
|
10000
|
+
header.epk?.kty !== "EC" ||
|
|
10001
|
+
header.epk.crv !== "P-384" ||
|
|
10002
|
+
header.epk.d !== undefined ||
|
|
10003
|
+
(header.apv !== undefined && header.apv !== apv)) {
|
|
10004
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
|
|
10005
|
+
}
|
|
10006
|
+
const x = decodeEarBase64Url(header.epk.x, correlationId);
|
|
10007
|
+
const y = decodeEarBase64Url(header.epk.y, correlationId);
|
|
10008
|
+
const apuBytes = decodeEarBase64Url(header.apu, correlationId);
|
|
10009
|
+
const apvBytes = decodeEarBase64Url(apv, correlationId);
|
|
10010
|
+
const iv = decodeEarBase64Url(parts[2], correlationId);
|
|
10011
|
+
const ciphertext = decodeEarBase64Url(parts[3], correlationId);
|
|
10012
|
+
const tag = decodeEarBase64Url(parts[4], correlationId);
|
|
10013
|
+
if (x.length !== 48 ||
|
|
10014
|
+
y.length !== 48 ||
|
|
10015
|
+
iv.length !== 12 ||
|
|
10016
|
+
tag.length !== 16) {
|
|
10017
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
|
|
10018
|
+
}
|
|
10019
|
+
let key;
|
|
10020
|
+
try {
|
|
10021
|
+
const privateKey = await measure(ImportAsymmetricEarKey, () => importAsymmetricEarKey(privateJwk, correlationId));
|
|
10022
|
+
const publicKey = await measure(ImportAsymmetricEarPublicKey, () => importJwk({
|
|
10023
|
+
kty: "EC",
|
|
10024
|
+
crv: "P-384",
|
|
10025
|
+
x: header.epk.x,
|
|
10026
|
+
y: header.epk.y,
|
|
10027
|
+
}, false, [], ECDH_P384_ALGORITHM));
|
|
10028
|
+
const secret = new Uint8Array(await measure(DeriveAsymmetricEarSecret, () => window.crypto.subtle.deriveBits({ name: "ECDH", public: publicKey }, privateKey, 384)));
|
|
10029
|
+
// RFC 7518 section 4.6.2: one SHA-256 round produces the 256-bit content key.
|
|
10030
|
+
const input = new Uint8Array(concatEarBytes(earUint32(1), secret, lengthPrefixEarBytes(new TextEncoder().encode("A256GCM")), lengthPrefixEarBytes(apuBytes), lengthPrefixEarBytes(apvBytes), earUint32(256)));
|
|
10031
|
+
let derivedKey;
|
|
10032
|
+
try {
|
|
10033
|
+
derivedKey = await measure(AsymmetricEarConcatKdf, () => window.crypto.subtle.digest(S256_HASH_ALG, input));
|
|
10034
|
+
}
|
|
10035
|
+
finally {
|
|
10036
|
+
secret.fill(0);
|
|
10037
|
+
input.fill(0);
|
|
10038
|
+
}
|
|
10039
|
+
try {
|
|
10040
|
+
key = await measure(ImportAsymmetricEarContentKey, () => window.crypto.subtle.importKey(RAW, derivedKey, AES_GCM, false, [DECRYPT]));
|
|
10041
|
+
}
|
|
10042
|
+
finally {
|
|
10043
|
+
new Uint8Array(derivedKey).fill(0);
|
|
10044
|
+
}
|
|
10045
|
+
}
|
|
10046
|
+
catch (error) {
|
|
10047
|
+
if (error instanceof AuthError) {
|
|
10048
|
+
throw error;
|
|
10049
|
+
}
|
|
10050
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "content_encryption_key_derivation_failed" /* AsymmetricEarSubErrors.ContentEncryptionKeyDerivationFailed */);
|
|
10051
|
+
}
|
|
10052
|
+
try {
|
|
10053
|
+
const plaintext = await measure(DecryptAsymmetricEarResponse, () => window.crypto.subtle.decrypt({
|
|
10054
|
+
name: AES_GCM,
|
|
10055
|
+
iv,
|
|
10056
|
+
tagLength: 128,
|
|
10057
|
+
additionalData: new TextEncoder().encode(parts[0]),
|
|
10058
|
+
}, key, concatEarBytes(ciphertext, tag)));
|
|
10059
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(plaintext);
|
|
10060
|
+
}
|
|
10061
|
+
catch {
|
|
10062
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "jwe_decryption_failed" /* AsymmetricEarSubErrors.JweDecryptionFailed */);
|
|
10063
|
+
}
|
|
10064
|
+
}
|
|
10065
|
+
/** Decodes canonical, unpadded JOSE base64url for asymmetric EAR only. */
|
|
10066
|
+
function decodeEarBase64Url(value, correlationId = "") {
|
|
10067
|
+
// Match the unpadded base64url alphabet only: letters, digits, '-' and '_'.
|
|
10068
|
+
if (typeof value !== "string" || !/^[A-Za-z0-9_-]+$/.test(value)) {
|
|
10069
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
|
|
10070
|
+
}
|
|
10071
|
+
const bytes = new Uint8Array(base64DecToArr(value));
|
|
10072
|
+
if (urlEncodeArr(bytes) !== value) {
|
|
10073
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
|
|
10074
|
+
}
|
|
10075
|
+
return bytes;
|
|
10076
|
+
}
|
|
10077
|
+
function earUint32(value) {
|
|
10078
|
+
const bytes = new Uint8Array(4);
|
|
10079
|
+
new DataView(bytes.buffer).setUint32(0, value);
|
|
10080
|
+
return bytes;
|
|
10081
|
+
}
|
|
10082
|
+
function concatEarBytes(...parts) {
|
|
10083
|
+
const bytes = new Uint8Array(parts.reduce((length, part) => length + part.length, 0));
|
|
10084
|
+
let offset = 0;
|
|
10085
|
+
for (const part of parts) {
|
|
10086
|
+
bytes.set(part, offset);
|
|
10087
|
+
offset += part.length;
|
|
10088
|
+
}
|
|
10089
|
+
return bytes.buffer;
|
|
10090
|
+
}
|
|
10091
|
+
function lengthPrefixEarBytes(bytes) {
|
|
10092
|
+
return new Uint8Array(concatEarBytes(earUint32(bytes.length), bytes));
|
|
10093
|
+
}
|
|
9810
10094
|
/**
|
|
9811
10095
|
* Parses earJwk for encryption key and returns CryptoKey object
|
|
9812
10096
|
* @param earJwk
|
|
@@ -9840,7 +10124,9 @@
|
|
|
9840
10124
|
const iv = base64DecToArr(earJweParts[2]);
|
|
9841
10125
|
const ciphertext = base64DecToArr(earJweParts[3]);
|
|
9842
10126
|
const tag = base64DecToArr(earJweParts[4]);
|
|
9843
|
-
|
|
10127
|
+
if (tag.byteLength !== 16) {
|
|
10128
|
+
throw new Error("Invalid AES-GCM authentication tag length");
|
|
10129
|
+
}
|
|
9844
10130
|
// Concat ciphertext and tag
|
|
9845
10131
|
const encryptedData = new Uint8Array(ciphertext.length + tag.length);
|
|
9846
10132
|
encryptedData.set(ciphertext);
|
|
@@ -9848,7 +10134,7 @@
|
|
|
9848
10134
|
const decryptedData = await window.crypto.subtle.decrypt({
|
|
9849
10135
|
name: AES_GCM,
|
|
9850
10136
|
iv: iv,
|
|
9851
|
-
tagLength:
|
|
10137
|
+
tagLength: 128,
|
|
9852
10138
|
additionalData: header,
|
|
9853
10139
|
}, key, encryptedData);
|
|
9854
10140
|
return new TextDecoder().decode(decryptedData);
|
|
@@ -10912,7 +11198,7 @@
|
|
|
10912
11198
|
* Licensed under the MIT License.
|
|
10913
11199
|
*/
|
|
10914
11200
|
class BaseInteractionClient {
|
|
10915
|
-
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager) {
|
|
11201
|
+
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager, dpopNonceProvider) {
|
|
10916
11202
|
this.config = config;
|
|
10917
11203
|
this.browserStorage = storageImpl;
|
|
10918
11204
|
this.browserCrypto = browserCrypto;
|
|
@@ -10926,6 +11212,7 @@
|
|
|
10926
11212
|
this.tokenBindingKeyManager =
|
|
10927
11213
|
tokenBindingKeyManager ||
|
|
10928
11214
|
new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
11215
|
+
this.dpopNonceProvider = dpopNonceProvider ?? storageImpl;
|
|
10929
11216
|
}
|
|
10930
11217
|
}
|
|
10931
11218
|
/**
|
|
@@ -11024,6 +11311,7 @@
|
|
|
11024
11311
|
* @returns A promise that resolves when the cache has been cleared.
|
|
11025
11312
|
*/
|
|
11026
11313
|
async function clearCacheOnLogout(browserStorage, browserCrypto, logger, correlationId, account) {
|
|
11314
|
+
browserStorage.clearDpopNonces();
|
|
11027
11315
|
if (account) {
|
|
11028
11316
|
// Clear given account.
|
|
11029
11317
|
try {
|
|
@@ -11305,6 +11593,7 @@
|
|
|
11305
11593
|
}
|
|
11306
11594
|
logger.verbose(`Authentication Scheme set to "'${validatedRequest.authenticationScheme}'" as configured in Auth request`, correlationId);
|
|
11307
11595
|
}
|
|
11596
|
+
performanceClient.addFields({ authenticationScheme: validatedRequest.authenticationScheme }, correlationId);
|
|
11308
11597
|
return validatedRequest;
|
|
11309
11598
|
}
|
|
11310
11599
|
async function initializeSilentRequest(request, account, config, performanceClient, logger) {
|
|
@@ -11579,6 +11868,7 @@
|
|
|
11579
11868
|
},
|
|
11580
11869
|
cryptoInterface: this.browserCrypto,
|
|
11581
11870
|
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
11871
|
+
dpopNonceProvider: this.dpopNonceProvider,
|
|
11582
11872
|
networkInterface: this.networkClient,
|
|
11583
11873
|
storageInterface: this.browserStorage,
|
|
11584
11874
|
serverTelemetryManager: serverTelemetryManager,
|
|
@@ -12686,27 +12976,21 @@
|
|
|
12686
12976
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12687
12977
|
* Licensed under the MIT License.
|
|
12688
12978
|
*/
|
|
12689
|
-
const API_MARKERS = ["/api/", "/oauth2/"];
|
|
12690
|
-
/*
|
|
12691
|
-
* Resolves a HAL href against the configured authority. Absolute HTTP(S) URLs
|
|
12692
|
-
* pass through; relative URLs retain their API path and query while using the
|
|
12693
|
-
* configured tenant path.
|
|
12694
|
-
*
|
|
12695
|
-
* TODO: Remove tenant-path rewriting once the service consistently returns links that can be
|
|
12696
|
-
* resolved directly against the configured authority.
|
|
12697
|
-
*/
|
|
12698
12979
|
function resolveHrefV2(base, href) {
|
|
12699
12980
|
const trimmed = href.trim();
|
|
12700
12981
|
if (!trimmed) {
|
|
12701
12982
|
throw new ParsedUrlError(InvalidUrl, "The HAL href cannot be empty");
|
|
12702
12983
|
}
|
|
12703
|
-
const absolute = tryParseAbsolute(trimmed);
|
|
12704
|
-
if (absolute) {
|
|
12705
|
-
return absolute;
|
|
12706
|
-
}
|
|
12707
12984
|
let resolved;
|
|
12708
12985
|
try {
|
|
12709
|
-
|
|
12986
|
+
let path = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
12987
|
+
const lowerHref = trimmed.toLowerCase();
|
|
12988
|
+
if (lowerHref.startsWith("https://") ||
|
|
12989
|
+
lowerHref.startsWith("http://")) {
|
|
12990
|
+
const absoluteHref = new URL(trimmed);
|
|
12991
|
+
path = `${absoluteHref.pathname}${absoluteHref.search}${absoluteHref.hash}`;
|
|
12992
|
+
}
|
|
12993
|
+
resolved = new URL(`${base.origin}${path}`);
|
|
12710
12994
|
}
|
|
12711
12995
|
catch (e) {
|
|
12712
12996
|
throw new ParsedUrlError(InvalidUrl, `The HAL href "${href}" could not be resolved: ${e}`);
|
|
@@ -12714,31 +12998,7 @@
|
|
|
12714
12998
|
if (resolved.protocol !== "http:" && resolved.protocol !== "https:") {
|
|
12715
12999
|
throw new ParsedUrlError(InvalidUrl, `The HAL href "${href}" must use the HTTP or HTTPS protocol`);
|
|
12716
13000
|
}
|
|
12717
|
-
const tenantPath = base.pathname.endsWith("/")
|
|
12718
|
-
? base.pathname.slice(0, -1)
|
|
12719
|
-
: base.pathname;
|
|
12720
|
-
resolved.pathname = tenantPath + apiPath(resolved.pathname);
|
|
12721
13001
|
return resolved;
|
|
12722
|
-
}
|
|
12723
|
-
function tryParseAbsolute(href) {
|
|
12724
|
-
try {
|
|
12725
|
-
const url = new URL(href);
|
|
12726
|
-
return url.protocol === "http:" || url.protocol === "https:"
|
|
12727
|
-
? url
|
|
12728
|
-
: undefined;
|
|
12729
|
-
}
|
|
12730
|
-
catch {
|
|
12731
|
-
return undefined;
|
|
12732
|
-
}
|
|
12733
|
-
}
|
|
12734
|
-
function apiPath(path) {
|
|
12735
|
-
for (const marker of API_MARKERS) {
|
|
12736
|
-
const index = path.indexOf(marker);
|
|
12737
|
-
if (index >= 0) {
|
|
12738
|
-
return path.slice(index);
|
|
12739
|
-
}
|
|
12740
|
-
}
|
|
12741
|
-
return path.startsWith("/") ? path : `/${path}`;
|
|
12742
13002
|
}
|
|
12743
13003
|
|
|
12744
13004
|
/*
|
|
@@ -12845,17 +13105,17 @@
|
|
|
12845
13105
|
* Redeems a continuation token for an authorization code and then tokens.
|
|
12846
13106
|
*/
|
|
12847
13107
|
async completeWithTokens(request, context) {
|
|
12848
|
-
const code = await this.authorizeChallengeContinue(request.continuationToken, context);
|
|
13108
|
+
const code = await this.authorizeChallengeContinue(request.continueHref, request.continuationToken, context);
|
|
12849
13109
|
return this.token(code, context);
|
|
12850
13110
|
}
|
|
12851
13111
|
/*
|
|
12852
13112
|
* Redeems a continuation token for an authorization code.
|
|
12853
13113
|
*/
|
|
12854
|
-
async authorizeChallengeContinue(continuationToken, context) {
|
|
13114
|
+
async authorizeChallengeContinue(continueHref, continuationToken, context) {
|
|
12855
13115
|
const request = {
|
|
12856
13116
|
continuation_token: continuationToken,
|
|
12857
13117
|
};
|
|
12858
|
-
const parsedResponse = await this.postOAuthForm(
|
|
13118
|
+
const parsedResponse = await this.postOAuthForm(resolveHrefV2(this.baseRequestUrl, continueHref), request, context);
|
|
12859
13119
|
this.throwOnApiError(parsedResponse);
|
|
12860
13120
|
const code = parsedResponse.body.code;
|
|
12861
13121
|
if (!code) {
|
|
@@ -12904,7 +13164,9 @@
|
|
|
12904
13164
|
}
|
|
12905
13165
|
async postOAuthForm(endpoint, data, context) {
|
|
12906
13166
|
const formData = new URLSearchParams(Object.entries(data));
|
|
12907
|
-
const url =
|
|
13167
|
+
const url = typeof endpoint === "string"
|
|
13168
|
+
? buildUrl(this.baseRequestUrl.href, endpoint, this.customAuthApiQueryParams)
|
|
13169
|
+
: endpoint;
|
|
12908
13170
|
const response = await this.sendRequest(url, HttpMethod.POST, formData, URL_FORM_CONTENT_TYPE, context);
|
|
12909
13171
|
const parsedResponse = await this.handler.parseResponse(response, context.correlationId);
|
|
12910
13172
|
this.throwOnWebFallback(parsedResponse);
|
|
@@ -13046,6 +13308,7 @@
|
|
|
13046
13308
|
return {
|
|
13047
13309
|
nextAction: SignUpSubmitAttributesNextActionV2.CONTINUE,
|
|
13048
13310
|
continuationToken,
|
|
13311
|
+
continueHref: this.handler.requireHref(parsedResponse.body._links?.continue?.href, ResponseStateV2.CONTINUE, correlationId),
|
|
13049
13312
|
};
|
|
13050
13313
|
}
|
|
13051
13314
|
if (parsedResponse.body.action === COLLECT_ATTRIBUTES_RELATION) {
|
|
@@ -13123,6 +13386,7 @@
|
|
|
13123
13386
|
return {
|
|
13124
13387
|
nextAction: ResponseStateV2.CONTINUE,
|
|
13125
13388
|
continuationToken: this.handler.requireContinuationToken(parsedResponse.continuationToken, parsedResponse.correlationId),
|
|
13389
|
+
continueHref: this.handler.requireHref(parsedResponse.body._links?.continue?.href, ResponseStateV2.CONTINUE, parsedResponse.correlationId),
|
|
13126
13390
|
};
|
|
13127
13391
|
}
|
|
13128
13392
|
/*
|
|
@@ -13170,6 +13434,7 @@
|
|
|
13170
13434
|
return {
|
|
13171
13435
|
nextAction,
|
|
13172
13436
|
continuationToken,
|
|
13437
|
+
continueHref: this.handler.requireHref(parsedResponse.body._links?.continue?.href, ResponseStateV2.CONTINUE, correlationId),
|
|
13173
13438
|
};
|
|
13174
13439
|
}
|
|
13175
13440
|
const message = `Password reset poll next action '${nextAction}' is not supported.`;
|
|
@@ -13193,6 +13458,7 @@
|
|
|
13193
13458
|
return {
|
|
13194
13459
|
nextAction: ResponseStateV2.CONTINUE,
|
|
13195
13460
|
continuationToken,
|
|
13461
|
+
continueHref: this.handler.requireHref(parsedResponse.body._links?.continue?.href, ResponseStateV2.CONTINUE, correlationId),
|
|
13196
13462
|
};
|
|
13197
13463
|
}
|
|
13198
13464
|
if (parsedResponse.body.action === COLLECT_ATTRIBUTES_RELATION) {
|
|
@@ -13301,11 +13567,16 @@
|
|
|
13301
13567
|
}
|
|
13302
13568
|
resolveMethods(methods, correlationId) {
|
|
13303
13569
|
const resolved = [];
|
|
13304
|
-
methods.forEach((method
|
|
13570
|
+
methods.forEach((method) => {
|
|
13305
13571
|
const href = method._links?.challenge?.href;
|
|
13306
13572
|
if (href) {
|
|
13573
|
+
if (typeof method.id !== "string" || !method.id.trim()) {
|
|
13574
|
+
const message = "Invalid HAL response: authentication method ID is missing or malformed";
|
|
13575
|
+
this.logger?.error(message, correlationId);
|
|
13576
|
+
throw new CustomAuthApiError(INVALID_HAL_RESPONSE, message, correlationId);
|
|
13577
|
+
}
|
|
13307
13578
|
resolved.push({
|
|
13308
|
-
id: method.id
|
|
13579
|
+
id: method.id,
|
|
13309
13580
|
type: method.type,
|
|
13310
13581
|
hint: method.hint,
|
|
13311
13582
|
challengeHref: href,
|
|
@@ -13385,6 +13656,7 @@
|
|
|
13385
13656
|
const FLOW_CODE_REQUIRED_V2 = "FlowCodeRequiredResultV2";
|
|
13386
13657
|
const FLOW_EXISTING_ACCOUNT_CODE_REQUIRED_V2 = "FlowExistingAccountCodeRequiredResultV2";
|
|
13387
13658
|
const FLOW_EXISTING_ACCOUNT_PASSWORD_REQUIRED_V2 = "FlowExistingAccountPasswordRequiredResultV2";
|
|
13659
|
+
const FLOW_EXISTING_ACCOUNT_START_V2 = "FlowExistingAccountStartResultV2";
|
|
13388
13660
|
const FLOW_PASSWORD_REQUIRED_V2 = "FlowPasswordRequiredResultV2";
|
|
13389
13661
|
const FLOW_SIGN_UP_PASSWORD_REQUIRED_V2 = "FlowSignUpPasswordRequiredResultV2";
|
|
13390
13662
|
const FLOW_MFA_REQUIRED_V2 = "FlowMFARequiredResultV2";
|
|
@@ -13406,6 +13678,9 @@
|
|
|
13406
13678
|
function createFlowExistingAccountPasswordRequiredResultV2(input) {
|
|
13407
13679
|
return { type: FLOW_EXISTING_ACCOUNT_PASSWORD_REQUIRED_V2, ...input };
|
|
13408
13680
|
}
|
|
13681
|
+
function createFlowExistingAccountStartResultV2(input) {
|
|
13682
|
+
return { type: FLOW_EXISTING_ACCOUNT_START_V2, ...input };
|
|
13683
|
+
}
|
|
13409
13684
|
function createFlowPasswordRequiredResultV2(input) {
|
|
13410
13685
|
return { type: FLOW_PASSWORD_REQUIRED_V2, ...input };
|
|
13411
13686
|
}
|
|
@@ -13440,7 +13715,6 @@
|
|
|
13440
13715
|
*/
|
|
13441
13716
|
/**
|
|
13442
13717
|
* The native auth V2 flow that a result or error originates from.
|
|
13443
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
13444
13718
|
*/
|
|
13445
13719
|
const CustomAuthFlowScenarioV2 = {
|
|
13446
13720
|
SignIn: "signIn",
|
|
@@ -13608,17 +13882,25 @@
|
|
|
13608
13882
|
codeLength: startResult.codeLength,
|
|
13609
13883
|
});
|
|
13610
13884
|
}
|
|
13611
|
-
|
|
13612
|
-
|
|
13613
|
-
|
|
13614
|
-
|
|
13615
|
-
|
|
13616
|
-
|
|
13617
|
-
|
|
13885
|
+
return createFlowExistingAccountStartResultV2({
|
|
13886
|
+
correlationId,
|
|
13887
|
+
continuationState: {
|
|
13888
|
+
continuationToken: startResult.continuationToken,
|
|
13889
|
+
scenario: CustomAuthFlowScenarioV2.SignIn,
|
|
13890
|
+
scopes,
|
|
13891
|
+
links: {},
|
|
13892
|
+
signUp: {
|
|
13893
|
+
purpose: "existingAccount",
|
|
13894
|
+
},
|
|
13618
13895
|
},
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13896
|
+
authenticationFactor: startResult.authenticationFactor,
|
|
13897
|
+
methods: startResult.methods,
|
|
13898
|
+
});
|
|
13899
|
+
}
|
|
13900
|
+
async challengeExistingAccount(parameters) {
|
|
13901
|
+
const { continuationState, correlationId } = parameters;
|
|
13902
|
+
this.ensureAuthenticationFactor(parameters.authenticationFactor, AuthenticationFactorV2.SINGLE_FACTOR, "existing-account sign-up", correlationId);
|
|
13903
|
+
const supportedMethods = parameters.methods
|
|
13622
13904
|
.map((method) => ({
|
|
13623
13905
|
id: method.id,
|
|
13624
13906
|
type: method.type ?? "",
|
|
@@ -13784,11 +14066,11 @@
|
|
|
13784
14066
|
continuationState: {
|
|
13785
14067
|
...continuationState,
|
|
13786
14068
|
continuationToken: result.continuationToken,
|
|
13787
|
-
links: {},
|
|
14069
|
+
links: { continue: result.continueHref },
|
|
13788
14070
|
},
|
|
13789
14071
|
});
|
|
13790
14072
|
}
|
|
13791
|
-
return this.completeSignInAfterVerification(continuationState, result.continuationToken, correlationId);
|
|
14073
|
+
return this.completeSignInAfterVerification(continuationState, result.continuationToken, result.continueHref, correlationId);
|
|
13792
14074
|
}
|
|
13793
14075
|
/*
|
|
13794
14076
|
* Requests a replacement authentication-method activation challenge.
|
|
@@ -13826,7 +14108,7 @@
|
|
|
13826
14108
|
continuationState: {
|
|
13827
14109
|
...continuationState,
|
|
13828
14110
|
continuationToken: verifyResult.continuationToken,
|
|
13829
|
-
links: {},
|
|
14111
|
+
links: { continue: verifyResult.continueHref },
|
|
13830
14112
|
},
|
|
13831
14113
|
});
|
|
13832
14114
|
}
|
|
@@ -13848,10 +14130,6 @@
|
|
|
13848
14130
|
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignIn) {
|
|
13849
14131
|
return this.handleSignInVerification(continuationState, verifyResult, correlationId);
|
|
13850
14132
|
}
|
|
13851
|
-
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp &&
|
|
13852
|
-
continuationState.signUp?.purpose === "existingAccount") {
|
|
13853
|
-
return this.handleSignInVerification(continuationState, verifyResult, correlationId);
|
|
13854
|
-
}
|
|
13855
14133
|
if (continuationState.scenario === CustomAuthFlowScenarioV2.SignUp) {
|
|
13856
14134
|
return this.handleSignUpVerification(continuationState, verifyResult, correlationId);
|
|
13857
14135
|
}
|
|
@@ -13879,9 +14157,9 @@
|
|
|
13879
14157
|
codeLength: challengeResult.codeLength,
|
|
13880
14158
|
});
|
|
13881
14159
|
}
|
|
13882
|
-
async submitSignUpAttributes(parameters) {
|
|
14160
|
+
async submitSignUpAttributes(parameters, step = "submitAttributes") {
|
|
13883
14161
|
const { continuationState, correlationId, attributes: submittedAttributes, } = parameters;
|
|
13884
|
-
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario,
|
|
14162
|
+
const context = this.createRequestContext(this.resolveStepApiId(continuationState.scenario, step, correlationId), correlationId);
|
|
13885
14163
|
this.logger.verbose("Submitting additional V2 sign-up attributes.", correlationId);
|
|
13886
14164
|
const submittedAttributeIds = Object.keys(submittedAttributes);
|
|
13887
14165
|
const submitResult = await this.apiClient.submitSignUpAttributes(this.requireLink(correlationId, continuationState.links.submitAttributes), {
|
|
@@ -13978,7 +14256,7 @@
|
|
|
13978
14256
|
continuationToken: pollResult.continuationToken,
|
|
13979
14257
|
scenario: continuationState.scenario,
|
|
13980
14258
|
scopes: continuationState.scopes,
|
|
13981
|
-
links: {},
|
|
14259
|
+
links: { continue: pollResult.continueHref },
|
|
13982
14260
|
},
|
|
13983
14261
|
});
|
|
13984
14262
|
}
|
|
@@ -14004,6 +14282,7 @@
|
|
|
14004
14282
|
this.logger.verbose("Signing in with a V2 continuation.", correlationId);
|
|
14005
14283
|
const tokenResponse = await this.apiClient.completeWithTokens({
|
|
14006
14284
|
continuationToken: continuationState.continuationToken,
|
|
14285
|
+
continueHref: this.requireLink(correlationId, continuationState.links.continue),
|
|
14007
14286
|
}, context);
|
|
14008
14287
|
const authenticationResult = await this.handleTokenResponse(tokenResponse, continuationState.scopes, correlationId, apiId);
|
|
14009
14288
|
this.logger.verbose("V2 continuation sign-in completed.", correlationId);
|
|
@@ -14042,7 +14321,7 @@
|
|
|
14042
14321
|
});
|
|
14043
14322
|
}
|
|
14044
14323
|
if (verifyResult.nextAction === ResponseStateV2.CONTINUE) {
|
|
14045
|
-
return this.completeSignInAfterVerification(continuationState, verifyResult.continuationToken, correlationId);
|
|
14324
|
+
return this.completeSignInAfterVerification(continuationState, verifyResult.continuationToken, verifyResult.continueHref, correlationId);
|
|
14046
14325
|
}
|
|
14047
14326
|
const message = `Verification next action '${verifyResult.nextAction}' is not supported for authentication.`;
|
|
14048
14327
|
this.logger.error(message, correlationId);
|
|
@@ -14098,7 +14377,7 @@
|
|
|
14098
14377
|
continuationState: {
|
|
14099
14378
|
...continuationState,
|
|
14100
14379
|
continuationToken: verifyResult.continuationToken,
|
|
14101
|
-
links: {},
|
|
14380
|
+
links: { continue: verifyResult.continueHref },
|
|
14102
14381
|
},
|
|
14103
14382
|
});
|
|
14104
14383
|
}
|
|
@@ -14237,7 +14516,7 @@
|
|
|
14237
14516
|
continuationState: {
|
|
14238
14517
|
...continuationState,
|
|
14239
14518
|
continuationToken: result.continuationToken,
|
|
14240
|
-
links: {},
|
|
14519
|
+
links: { continue: result.continueHref },
|
|
14241
14520
|
},
|
|
14242
14521
|
});
|
|
14243
14522
|
}
|
|
@@ -14299,13 +14578,13 @@
|
|
|
14299
14578
|
password: parameters.password,
|
|
14300
14579
|
}, context);
|
|
14301
14580
|
}
|
|
14302
|
-
completeSignInAfterVerification(continuationState, continuationToken, correlationId) {
|
|
14581
|
+
completeSignInAfterVerification(continuationState, continuationToken, continueHref, correlationId) {
|
|
14303
14582
|
return this.signInWithContinuation({
|
|
14304
14583
|
correlationId,
|
|
14305
14584
|
continuationState: {
|
|
14306
14585
|
...continuationState,
|
|
14307
14586
|
continuationToken,
|
|
14308
|
-
links: {},
|
|
14587
|
+
links: { continue: continueHref },
|
|
14309
14588
|
},
|
|
14310
14589
|
});
|
|
14311
14590
|
}
|
|
@@ -14370,7 +14649,6 @@
|
|
|
14370
14649
|
*/
|
|
14371
14650
|
/**
|
|
14372
14651
|
* Terminal state indicating the operation failed.
|
|
14373
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14374
14652
|
*/
|
|
14375
14653
|
class FailedStateV2 extends AuthFlowStateBase {
|
|
14376
14654
|
constructor() {
|
|
@@ -14400,7 +14678,6 @@
|
|
|
14400
14678
|
*/
|
|
14401
14679
|
/**
|
|
14402
14680
|
* Error returned by a native authentication V2 operation.
|
|
14403
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14404
14681
|
*/
|
|
14405
14682
|
class AuthFlowErrorV2 {
|
|
14406
14683
|
constructor(errorData, scenario = CustomAuthFlowScenarioV2.Unknown, errorContext = "default") {
|
|
@@ -14553,7 +14830,6 @@
|
|
|
14553
14830
|
*/
|
|
14554
14831
|
/**
|
|
14555
14832
|
* Result of a native auth V2 operation.
|
|
14556
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14557
14833
|
*/
|
|
14558
14834
|
class CustomAuthResultV2 {
|
|
14559
14835
|
constructor(state, data, scenario = CustomAuthFlowScenarioV2.Unknown) {
|
|
@@ -14628,7 +14904,6 @@
|
|
|
14628
14904
|
*/
|
|
14629
14905
|
/**
|
|
14630
14906
|
* Terminal state indicating the operation completed successfully.
|
|
14631
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14632
14907
|
*/
|
|
14633
14908
|
class CompletedStateV2 extends AuthFlowStateBase {
|
|
14634
14909
|
constructor() {
|
|
@@ -14643,7 +14918,6 @@
|
|
|
14643
14918
|
*/
|
|
14644
14919
|
/**
|
|
14645
14920
|
* State returned when a completed V2 flow can sign the user in.
|
|
14646
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14647
14921
|
*/
|
|
14648
14922
|
class SignInContinuationStateV2 extends AuthFlowActionRequiredStateBase {
|
|
14649
14923
|
constructor() {
|
|
@@ -14712,7 +14986,6 @@
|
|
|
14712
14986
|
/**
|
|
14713
14987
|
* State returned when a newly registered authentication method must be
|
|
14714
14988
|
* activated with the challenge sent by the service.
|
|
14715
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14716
14989
|
*/
|
|
14717
14990
|
class AuthMethodVerificationRequiredStateV2 extends AuthFlowActionRequiredStateBase {
|
|
14718
14991
|
constructor(stateParameters) {
|
|
@@ -14799,7 +15072,6 @@
|
|
|
14799
15072
|
*/
|
|
14800
15073
|
/**
|
|
14801
15074
|
* State returned when an authentication method must be registered.
|
|
14802
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14803
15075
|
*/
|
|
14804
15076
|
class AuthMethodRegistrationRequiredStateV2 extends AuthFlowActionRequiredStateBase {
|
|
14805
15077
|
constructor(stateParameters) {
|
|
@@ -14857,7 +15129,6 @@
|
|
|
14857
15129
|
*/
|
|
14858
15130
|
/**
|
|
14859
15131
|
* State returned when first-factor authentication requires a one-time code.
|
|
14860
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14861
15132
|
*/
|
|
14862
15133
|
class CodeRequiredStateV2 extends ChallengeVerificationStateBaseV2 {
|
|
14863
15134
|
constructor() {
|
|
@@ -14978,7 +15249,6 @@
|
|
|
14978
15249
|
/**
|
|
14979
15250
|
* State returned when authentication requires verification of an email or SMS MFA
|
|
14980
15251
|
* challenge. It allows the app to submit the challenge or request a replacement.
|
|
14981
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
14982
15252
|
*/
|
|
14983
15253
|
class MFAVerificationRequiredStateV2 extends ChallengeVerificationStateBaseV2 {
|
|
14984
15254
|
constructor() {
|
|
@@ -15202,7 +15472,6 @@
|
|
|
15202
15472
|
*/
|
|
15203
15473
|
/**
|
|
15204
15474
|
* State returned when the user must select an authentication method.
|
|
15205
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
15206
15475
|
*/
|
|
15207
15476
|
class AuthMethodSelectionRequiredStateV2 extends AuthFlowActionRequiredStateBase {
|
|
15208
15477
|
constructor(stateParameters) {
|
|
@@ -15229,9 +15498,7 @@
|
|
|
15229
15498
|
cacheClient: this.stateParameters.cacheClient,
|
|
15230
15499
|
signInStateTransitionHandler,
|
|
15231
15500
|
};
|
|
15232
|
-
const isExistingAccountSignUp = continuationState.
|
|
15233
|
-
CustomAuthFlowScenarioV2.SignUp &&
|
|
15234
|
-
continuationState.signUp?.purpose === "existingAccount";
|
|
15501
|
+
const isExistingAccountSignUp = continuationState.signUp?.purpose === "existingAccount";
|
|
15235
15502
|
const channel = result.type === FLOW_CODE_REQUIRED_V2
|
|
15236
15503
|
? result.channel?.toLowerCase()
|
|
15237
15504
|
: undefined;
|
|
@@ -15338,7 +15605,6 @@
|
|
|
15338
15605
|
*/
|
|
15339
15606
|
/**
|
|
15340
15607
|
* State returned when sign-in or sign-up requires a password.
|
|
15341
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
15342
15608
|
*/
|
|
15343
15609
|
class PasswordRequiredStateV2 extends AuthFlowActionRequiredStateBase {
|
|
15344
15610
|
constructor(stateParameters) {
|
|
@@ -15383,7 +15649,7 @@
|
|
|
15383
15649
|
correlationId,
|
|
15384
15650
|
continuationState,
|
|
15385
15651
|
attributes: { password },
|
|
15386
|
-
});
|
|
15652
|
+
}, "submitPassword");
|
|
15387
15653
|
return signUpStateTransitionHandler.handleAttributeSubmission(result, { ...this.stateParameters, signUpStateTransitionHandler }, "password");
|
|
15388
15654
|
}
|
|
15389
15655
|
async submitSignInPassword(password) {
|
|
@@ -15459,7 +15725,6 @@
|
|
|
15459
15725
|
* State returned when the user must supply a new password. Submission can
|
|
15460
15726
|
* require method registration or MFA, and the flow is not complete until any
|
|
15461
15727
|
* subsequent required actions finish.
|
|
15462
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
15463
15728
|
*/
|
|
15464
15729
|
class NewPasswordRequiredStateV2 extends AuthFlowActionRequiredStateBase {
|
|
15465
15730
|
constructor() {
|
|
@@ -15552,7 +15817,6 @@
|
|
|
15552
15817
|
*/
|
|
15553
15818
|
/**
|
|
15554
15819
|
* State returned when sign-up requires profile or custom attributes.
|
|
15555
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
15556
15820
|
*/
|
|
15557
15821
|
class AttributesRequiredStateV2 extends AuthFlowActionRequiredStateBase {
|
|
15558
15822
|
constructor(stateParameters) {
|
|
@@ -15650,7 +15914,7 @@
|
|
|
15650
15914
|
* @param customAuthProxyDomain - The custom auth proxy domain.
|
|
15651
15915
|
*/
|
|
15652
15916
|
constructor(authority, config, networkInterface, cacheManager, logger, performanceClient, customAuthProxyDomain) {
|
|
15653
|
-
const ciamAuthorityUrl = CustomAuthAuthority.transformCIAMAuthority(authority, "");
|
|
15917
|
+
const ciamAuthorityUrl = CustomAuthAuthority.transformCIAMAuthority(formatAuthorityUri(authority), "");
|
|
15654
15918
|
const authorityOptions = {
|
|
15655
15919
|
protocolMode: config.system.protocolMode,
|
|
15656
15920
|
OIDCOptions: config.auth.OIDCOptions,
|
|
@@ -16955,6 +17219,7 @@
|
|
|
16955
17219
|
},
|
|
16956
17220
|
cryptoInterface: this.browserCrypto,
|
|
16957
17221
|
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
17222
|
+
dpopNonceProvider: this.browserStorage,
|
|
16958
17223
|
networkInterface: this.networkClient,
|
|
16959
17224
|
storageInterface: this.browserStorage,
|
|
16960
17225
|
serverTelemetryManager: serverTelemetryManager,
|
|
@@ -17052,7 +17317,6 @@
|
|
|
17052
17317
|
}
|
|
17053
17318
|
/**
|
|
17054
17319
|
* Checks if the result requires authentication method registration.
|
|
17055
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17056
17320
|
*/
|
|
17057
17321
|
isAuthMethodRegistrationRequired() {
|
|
17058
17322
|
return (this.state.stateType ===
|
|
@@ -17060,7 +17324,6 @@
|
|
|
17060
17324
|
}
|
|
17061
17325
|
/**
|
|
17062
17326
|
* Checks if the result requires MFA.
|
|
17063
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17064
17327
|
*/
|
|
17065
17328
|
isMfaRequired() {
|
|
17066
17329
|
return this.state.stateType === MFA_AWAITING_STATE_TYPE;
|
|
@@ -17142,7 +17405,6 @@
|
|
|
17142
17405
|
/**
|
|
17143
17406
|
* Checks if the result indicates that verification is required.
|
|
17144
17407
|
* @returns true if verification is required, false otherwise.
|
|
17145
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17146
17408
|
*/
|
|
17147
17409
|
isVerificationRequired() {
|
|
17148
17410
|
return (this.state.stateType ===
|
|
@@ -17151,7 +17413,6 @@
|
|
|
17151
17413
|
/**
|
|
17152
17414
|
* Checks if the result indicates that registration is completed (fast-pass scenario).
|
|
17153
17415
|
* @returns true if registration is completed, false otherwise.
|
|
17154
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17155
17416
|
*/
|
|
17156
17417
|
isCompleted() {
|
|
17157
17418
|
return (this.state.stateType ===
|
|
@@ -17160,7 +17421,6 @@
|
|
|
17160
17421
|
/**
|
|
17161
17422
|
* Checks if the result is in a failed state.
|
|
17162
17423
|
* @returns true if the result is failed, false otherwise.
|
|
17163
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17164
17424
|
*/
|
|
17165
17425
|
isFailed() {
|
|
17166
17426
|
return (this.state.stateType === AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE);
|
|
@@ -17188,7 +17448,6 @@
|
|
|
17188
17448
|
/**
|
|
17189
17449
|
* Checks if the result indicates that registration is completed.
|
|
17190
17450
|
* @returns true if registration is completed, false otherwise.
|
|
17191
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17192
17451
|
*/
|
|
17193
17452
|
isCompleted() {
|
|
17194
17453
|
return (this.state.stateType ===
|
|
@@ -17197,7 +17456,6 @@
|
|
|
17197
17456
|
/**
|
|
17198
17457
|
* Checks if the result is in a failed state.
|
|
17199
17458
|
* @returns true if the result is failed, false otherwise.
|
|
17200
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17201
17459
|
*/
|
|
17202
17460
|
isFailed() {
|
|
17203
17461
|
return (this.state.stateType === AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE);
|
|
@@ -17298,7 +17556,6 @@
|
|
|
17298
17556
|
/**
|
|
17299
17557
|
* Gets the available authentication methods for registration.
|
|
17300
17558
|
* @returns Array of available authentication methods.
|
|
17301
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17302
17559
|
*/
|
|
17303
17560
|
getAuthMethods() {
|
|
17304
17561
|
return this.stateParameters.authMethods;
|
|
@@ -17307,7 +17564,6 @@
|
|
|
17307
17564
|
* Challenges an authentication method for registration.
|
|
17308
17565
|
* @param authMethodDetails The authentication method details to challenge.
|
|
17309
17566
|
* @returns Promise that resolves to AuthMethodRegistrationChallengeMethodResult.
|
|
17310
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17311
17567
|
*/
|
|
17312
17568
|
async challengeAuthMethod(authMethodDetails) {
|
|
17313
17569
|
return this.challengeAuthMethodInternal(authMethodDetails);
|
|
@@ -17327,7 +17583,6 @@
|
|
|
17327
17583
|
/**
|
|
17328
17584
|
* Gets the length of the expected verification code.
|
|
17329
17585
|
* @returns The code length.
|
|
17330
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17331
17586
|
*/
|
|
17332
17587
|
getCodeLength() {
|
|
17333
17588
|
return this.stateParameters.codeLength;
|
|
@@ -17335,7 +17590,6 @@
|
|
|
17335
17590
|
/**
|
|
17336
17591
|
* Gets the channel through which the challenge was sent.
|
|
17337
17592
|
* @returns The challenge channel (e.g., "email").
|
|
17338
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17339
17593
|
*/
|
|
17340
17594
|
getChannel() {
|
|
17341
17595
|
return this.stateParameters.challengeChannel;
|
|
@@ -17343,7 +17597,6 @@
|
|
|
17343
17597
|
/**
|
|
17344
17598
|
* Gets the target label indicating where the challenge was sent.
|
|
17345
17599
|
* @returns The challenge target label (e.g., masked email address).
|
|
17346
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17347
17600
|
*/
|
|
17348
17601
|
getSentTo() {
|
|
17349
17602
|
return this.stateParameters.challengeTargetLabel;
|
|
@@ -17352,7 +17605,6 @@
|
|
|
17352
17605
|
* Submits the verification challenge to complete the authentication method registration.
|
|
17353
17606
|
* @param code The verification code entered by the user.
|
|
17354
17607
|
* @returns Promise that resolves to AuthMethodRegistrationSubmitChallengeResult.
|
|
17355
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17356
17608
|
*/
|
|
17357
17609
|
async submitChallenge(code) {
|
|
17358
17610
|
try {
|
|
@@ -17381,7 +17633,6 @@
|
|
|
17381
17633
|
* Challenges a different authentication method for registration.
|
|
17382
17634
|
* @param authMethodDetails The authentication method details to challenge.
|
|
17383
17635
|
* @returns Promise that resolves to AuthMethodRegistrationChallengeMethodResult.
|
|
17384
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17385
17636
|
*/
|
|
17386
17637
|
async challengeAuthMethod(authMethodDetails) {
|
|
17387
17638
|
return this.challengeAuthMethodInternal(authMethodDetails);
|
|
@@ -17462,7 +17713,6 @@
|
|
|
17462
17713
|
/**
|
|
17463
17714
|
* Checks if the MFA flow is completed successfully.
|
|
17464
17715
|
* @returns true if completed, false otherwise.
|
|
17465
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17466
17716
|
*/
|
|
17467
17717
|
isCompleted() {
|
|
17468
17718
|
return this.state.stateType === MFA_COMPLETED_STATE_TYPE;
|
|
@@ -17470,7 +17720,6 @@
|
|
|
17470
17720
|
/**
|
|
17471
17721
|
* Checks if the result is in a failed state.
|
|
17472
17722
|
* @returns true if the result is failed, false otherwise.
|
|
17473
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17474
17723
|
*/
|
|
17475
17724
|
isFailed() {
|
|
17476
17725
|
return this.state.stateType === MFA_FAILED_STATE_TYPE;
|
|
@@ -17499,7 +17748,6 @@
|
|
|
17499
17748
|
/**
|
|
17500
17749
|
* Checks if the result indicates that verification is required.
|
|
17501
17750
|
* @returns true if verification is required, false otherwise.
|
|
17502
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17503
17751
|
*/
|
|
17504
17752
|
isVerificationRequired() {
|
|
17505
17753
|
return this.state.stateType === MFA_VERIFICATION_REQUIRED_STATE_TYPE;
|
|
@@ -17507,7 +17755,6 @@
|
|
|
17507
17755
|
/**
|
|
17508
17756
|
* Checks if the result is in a failed state.
|
|
17509
17757
|
* @returns true if the result is failed, false otherwise.
|
|
17510
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17511
17758
|
*/
|
|
17512
17759
|
isFailed() {
|
|
17513
17760
|
return this.state.stateType === MFA_FAILED_STATE_TYPE;
|
|
@@ -17540,7 +17787,6 @@
|
|
|
17540
17787
|
* Requests an MFA challenge for a specific authentication method.
|
|
17541
17788
|
* @param authMethodId The authentication method ID to use for the challenge.
|
|
17542
17789
|
* @returns Promise that resolves to MfaRequestChallengeResult.
|
|
17543
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17544
17790
|
*/
|
|
17545
17791
|
async requestChallenge(authMethodId) {
|
|
17546
17792
|
try {
|
|
@@ -17589,7 +17835,6 @@
|
|
|
17589
17835
|
/**
|
|
17590
17836
|
* Gets the available authentication methods for MFA.
|
|
17591
17837
|
* @returns Array of available authentication methods.
|
|
17592
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17593
17838
|
*/
|
|
17594
17839
|
getAuthMethods() {
|
|
17595
17840
|
return this.stateParameters.authMethods;
|
|
@@ -17610,7 +17855,6 @@
|
|
|
17610
17855
|
/**
|
|
17611
17856
|
* Gets the length of the code that the user needs to provide.
|
|
17612
17857
|
* @returns The expected code length.
|
|
17613
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17614
17858
|
*/
|
|
17615
17859
|
getCodeLength() {
|
|
17616
17860
|
return this.stateParameters.codeLength;
|
|
@@ -17618,7 +17862,6 @@
|
|
|
17618
17862
|
/**
|
|
17619
17863
|
* Gets the channel through which the challenge was sent.
|
|
17620
17864
|
* @returns The challenge channel (e.g., "email").
|
|
17621
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17622
17865
|
*/
|
|
17623
17866
|
getChannel() {
|
|
17624
17867
|
return this.stateParameters.challengeChannel;
|
|
@@ -17626,7 +17869,6 @@
|
|
|
17626
17869
|
/**
|
|
17627
17870
|
* Gets the target label indicating where the challenge was sent.
|
|
17628
17871
|
* @returns The challenge target label (e.g., masked email address).
|
|
17629
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17630
17872
|
*/
|
|
17631
17873
|
getSentTo() {
|
|
17632
17874
|
return this.stateParameters.challengeTargetLabel;
|
|
@@ -17635,7 +17877,6 @@
|
|
|
17635
17877
|
* Submits the MFA challenge (e.g., OTP code) to complete the authentication.
|
|
17636
17878
|
* @param challenge The challenge code (e.g., OTP code) entered by the user.
|
|
17637
17879
|
* @returns Promise that resolves to MfaSubmitChallengeResult.
|
|
17638
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17639
17880
|
*/
|
|
17640
17881
|
async submitChallenge(challenge) {
|
|
17641
17882
|
try {
|
|
@@ -17882,7 +18123,6 @@
|
|
|
17882
18123
|
}
|
|
17883
18124
|
/**
|
|
17884
18125
|
* Checks if the result requires authentication method registration.
|
|
17885
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17886
18126
|
*/
|
|
17887
18127
|
isAuthMethodRegistrationRequired() {
|
|
17888
18128
|
return (this.state.stateType ===
|
|
@@ -17890,7 +18130,6 @@
|
|
|
17890
18130
|
}
|
|
17891
18131
|
/**
|
|
17892
18132
|
* Checks if the result requires MFA.
|
|
17893
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
17894
18133
|
*/
|
|
17895
18134
|
isMfaRequired() {
|
|
17896
18135
|
return this.state.stateType === MFA_AWAITING_STATE_TYPE;
|
|
@@ -19466,6 +19705,7 @@
|
|
|
19466
19705
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19467
19706
|
* Licensed under the MIT License.
|
|
19468
19707
|
*/
|
|
19708
|
+
const MAX_RESOURCE_SERVER_NONCES = 50;
|
|
19469
19709
|
/**
|
|
19470
19710
|
* Reason an old-schema cache entry was removed during migration.
|
|
19471
19711
|
*/
|
|
@@ -19481,6 +19721,7 @@
|
|
|
19481
19721
|
class BrowserCacheManager extends CacheManager {
|
|
19482
19722
|
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
|
|
19483
19723
|
super(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions, tokenBindingKeyManager);
|
|
19724
|
+
this.dpopNonces = new Map();
|
|
19484
19725
|
this.cacheConfig = cacheConfig;
|
|
19485
19726
|
this.logger = logger;
|
|
19486
19727
|
this.internalStorage = new MemoryStorage();
|
|
@@ -20501,6 +20742,40 @@
|
|
|
20501
20742
|
const version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) || "";
|
|
20502
20743
|
return [sku, version];
|
|
20503
20744
|
}
|
|
20745
|
+
/**
|
|
20746
|
+
* Stores a validated resource-server DPoP nonce in PCA-local memory.
|
|
20747
|
+
* @internal
|
|
20748
|
+
*/
|
|
20749
|
+
setDpopNonce(resourceRequestUri, dpopNonce, correlationId = "") {
|
|
20750
|
+
const resourceServer = canonicalizeDpopResourceServer(resourceRequestUri, correlationId);
|
|
20751
|
+
const validatedNonce = validateDpopNonce(dpopNonce, correlationId);
|
|
20752
|
+
// Reinsert replacements so eviction remains oldest-write ordered.
|
|
20753
|
+
this.dpopNonces.delete(resourceServer);
|
|
20754
|
+
this.dpopNonces.set(resourceServer, validatedNonce);
|
|
20755
|
+
if (this.dpopNonces.size > MAX_RESOURCE_SERVER_NONCES) {
|
|
20756
|
+
const oldestResourceServer = this.dpopNonces.keys().next().value;
|
|
20757
|
+
if (oldestResourceServer) {
|
|
20758
|
+
this.dpopNonces.delete(oldestResourceServer);
|
|
20759
|
+
}
|
|
20760
|
+
this.performanceClient.incrementFields({ "ext.dpopNonceCacheEvictionCount": 1 }, correlationId);
|
|
20761
|
+
}
|
|
20762
|
+
}
|
|
20763
|
+
/**
|
|
20764
|
+
* Reads the current resource-server DPoP nonce from PCA-local memory.
|
|
20765
|
+
* This optional structural capability is consumed by msal-common without
|
|
20766
|
+
* adding methods to the CacheManager abstraction.
|
|
20767
|
+
* @internal
|
|
20768
|
+
*/
|
|
20769
|
+
getDpopNonce(resourceRequestUri, correlationId = "") {
|
|
20770
|
+
return this.dpopNonces.get(canonicalizeDpopResourceServer(resourceRequestUri, correlationId));
|
|
20771
|
+
}
|
|
20772
|
+
/**
|
|
20773
|
+
* Clears all PCA-local DPoP nonce state.
|
|
20774
|
+
* @internal
|
|
20775
|
+
*/
|
|
20776
|
+
clearDpopNonces() {
|
|
20777
|
+
this.dpopNonces.clear();
|
|
20778
|
+
}
|
|
20504
20779
|
/**
|
|
20505
20780
|
*
|
|
20506
20781
|
* @param key
|
|
@@ -20645,6 +20920,7 @@
|
|
|
20645
20920
|
}
|
|
20646
20921
|
});
|
|
20647
20922
|
this.internalStorage.clear();
|
|
20923
|
+
this.dpopNonces.clear();
|
|
20648
20924
|
}
|
|
20649
20925
|
/**
|
|
20650
20926
|
* Prepend msal.<client-id> to each key
|
|
@@ -20751,8 +21027,7 @@
|
|
|
20751
21027
|
}
|
|
20752
21028
|
}
|
|
20753
21029
|
catch (e) {
|
|
20754
|
-
this.logger.
|
|
20755
|
-
this.logger.error(`Parsing cached token request threw with error: '${e}'`, correlationId);
|
|
21030
|
+
this.logger.error("Unable to parse cached token request", correlationId);
|
|
20756
21031
|
throw createBrowserAuthError(unableToParseTokenRequestCacheError, "");
|
|
20757
21032
|
}
|
|
20758
21033
|
return [parsedRequest, verifier];
|
|
@@ -21227,30 +21502,42 @@
|
|
|
21227
21502
|
* page (see `runPopupRelay`) back to the embedded frame that opened it. See
|
|
21228
21503
|
* {@link BrowserAuthOptions.popupRelayUri}.
|
|
21229
21504
|
*
|
|
21230
|
-
*
|
|
21231
|
-
*
|
|
21232
|
-
* pulling in the other's dependencies.
|
|
21505
|
+
* Shared by the relay-page entry and client helpers without importing either
|
|
21506
|
+
* implementation into the other bundle.
|
|
21233
21507
|
*
|
|
21234
21508
|
* @internal
|
|
21235
21509
|
*/
|
|
21236
|
-
const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
|
|
21510
|
+
const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
|
|
21511
|
+
/** @internal Response bound to an authenticated v2 relay document. */
|
|
21512
|
+
const POPUP_RELAY_V2_RESPONSE_TYPE = "msal:popup-relay-response:v2";
|
|
21513
|
+
/** @internal Ready signal for the authenticated popup-relay request handoff. */
|
|
21514
|
+
const POPUP_RELAY_READY_TYPE = "msal:popup-relay-ready:v2";
|
|
21515
|
+
/** @internal Request delivered only to the same-origin relay window. */
|
|
21516
|
+
const POPUP_RELAY_REQUEST_TYPE = "msal:popup-relay-request:v2";
|
|
21517
|
+
/** @internal Resolve the compatibility default without downgrading invalid versions. */
|
|
21518
|
+
function getPopupRelayProtocolVersion(version, correlationId = "") {
|
|
21519
|
+
if (version === undefined) {
|
|
21520
|
+
return 1;
|
|
21521
|
+
}
|
|
21522
|
+
if (version !== 1 && version !== 2) {
|
|
21523
|
+
throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_invalid_protocol");
|
|
21524
|
+
}
|
|
21525
|
+
return version;
|
|
21526
|
+
}
|
|
21237
21527
|
|
|
21238
21528
|
/*
|
|
21239
21529
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21240
21530
|
* Licensed under the MIT License.
|
|
21241
21531
|
*/
|
|
21242
21532
|
/**
|
|
21243
|
-
* Builds the
|
|
21244
|
-
*
|
|
21245
|
-
*
|
|
21246
|
-
* library-state `id` so the relay page can listen on the right BroadcastChannel
|
|
21247
|
-
* and echo the id back. The relay URI is resolved against the app origin, so it
|
|
21248
|
-
* must be same-origin as the embedded frame. See `runPopupRelay`.
|
|
21533
|
+
* Builds the same-origin relay URL. V1 preserves the fragment descriptor;
|
|
21534
|
+
* explicitly selected v2 carries only the id and retains the navigation for
|
|
21535
|
+
* the authenticated handoff.
|
|
21249
21536
|
*
|
|
21250
21537
|
* @internal
|
|
21251
21538
|
*/
|
|
21252
|
-
function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
|
|
21253
|
-
const
|
|
21539
|
+
function buildPopupRelayUrl(popupRelayUri, id, action, correlationId, protocolVersion) {
|
|
21540
|
+
const version = getPopupRelayProtocolVersion(protocolVersion, correlationId);
|
|
21254
21541
|
const target = new URL(popupRelayUri, window.location.origin);
|
|
21255
21542
|
/*
|
|
21256
21543
|
* The relay page must be same-origin as the embedded frame: the response is
|
|
@@ -21263,7 +21550,12 @@
|
|
|
21263
21550
|
throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_cross_origin");
|
|
21264
21551
|
}
|
|
21265
21552
|
const hashParams = new URLSearchParams();
|
|
21266
|
-
|
|
21553
|
+
if (version === 1) {
|
|
21554
|
+
hashParams.set("req", JSON.stringify({ id, ...action }));
|
|
21555
|
+
}
|
|
21556
|
+
else {
|
|
21557
|
+
hashParams.set("id", id);
|
|
21558
|
+
}
|
|
21267
21559
|
target.hash = hashParams.toString();
|
|
21268
21560
|
return target.toString();
|
|
21269
21561
|
}
|
|
@@ -21274,21 +21566,30 @@
|
|
|
21274
21566
|
* partitioning blocks the BroadcastChannel the redirect bridge uses from
|
|
21275
21567
|
* reaching the embedded frame.
|
|
21276
21568
|
*
|
|
21277
|
-
*
|
|
21278
|
-
*
|
|
21279
|
-
*
|
|
21569
|
+
* In v2, the retained navigation is sent once, after a ready signal from the popup
|
|
21570
|
+
* window we opened on our own origin with the matching library-state id.
|
|
21571
|
+
* Successful responses must also carry that handoff's relay-document nonce.
|
|
21572
|
+
* Setup failures can reject the request before the handoff completes.
|
|
21280
21573
|
*
|
|
21281
21574
|
* @internal
|
|
21282
21575
|
*/
|
|
21283
|
-
async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient) {
|
|
21576
|
+
async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient, action, protocolVersion) {
|
|
21577
|
+
const version = getPopupRelayProtocolVersion(protocolVersion, request.correlationId);
|
|
21578
|
+
if (version === 2 && !action) {
|
|
21579
|
+
throw createBrowserAuthError(popupRelayUnsupportedFlow, request.correlationId, "popup_relay_bad_request");
|
|
21580
|
+
}
|
|
21284
21581
|
return new Promise((resolve, reject) => {
|
|
21285
21582
|
const correlationId = request.correlationId;
|
|
21286
21583
|
logger.verbose("PopupRelay.waitForPopupRelayResponse - started", correlationId);
|
|
21287
|
-
performanceClient.addFields({
|
|
21584
|
+
performanceClient.addFields({
|
|
21585
|
+
redirectBridgeTimeoutMs: timeoutMs,
|
|
21586
|
+
popupRelayProtocolVersion: version,
|
|
21587
|
+
}, correlationId);
|
|
21288
21588
|
const { libraryState } = parseRequestState(base64Decode, request.state || "", correlationId);
|
|
21289
21589
|
const expectedId = libraryState.id;
|
|
21290
21590
|
const expectedOrigin = window.location.origin;
|
|
21291
21591
|
let settled = false;
|
|
21592
|
+
let handoffNonce = "";
|
|
21292
21593
|
const cleanup = () => {
|
|
21293
21594
|
window.removeEventListener("message", onMessage);
|
|
21294
21595
|
clearTimeout(timeoutId);
|
|
@@ -21300,20 +21601,52 @@
|
|
|
21300
21601
|
return;
|
|
21301
21602
|
}
|
|
21302
21603
|
const data = event.data;
|
|
21303
|
-
if (!data ||
|
|
21304
|
-
data.type !== POPUP_RELAY_RESPONSE_TYPE ||
|
|
21305
|
-
data.id !== expectedId) {
|
|
21604
|
+
if (!data || data.id !== expectedId) {
|
|
21306
21605
|
return;
|
|
21307
21606
|
}
|
|
21308
21607
|
if (settled) {
|
|
21309
21608
|
return;
|
|
21310
21609
|
}
|
|
21610
|
+
if (version === 2 && data.type === POPUP_RELAY_READY_TYPE) {
|
|
21611
|
+
if (handoffNonce ||
|
|
21612
|
+
typeof data.nonce !== "string" ||
|
|
21613
|
+
!data.nonce) {
|
|
21614
|
+
return;
|
|
21615
|
+
}
|
|
21616
|
+
handoffNonce = data.nonce;
|
|
21617
|
+
try {
|
|
21618
|
+
popupWindow.postMessage({
|
|
21619
|
+
type: POPUP_RELAY_REQUEST_TYPE,
|
|
21620
|
+
id: expectedId,
|
|
21621
|
+
nonce: handoffNonce,
|
|
21622
|
+
request: { id: expectedId, ...action },
|
|
21623
|
+
}, expectedOrigin);
|
|
21624
|
+
performanceClient.addFields({ "ext.popupRelayRequestSent": true }, correlationId);
|
|
21625
|
+
}
|
|
21626
|
+
catch {
|
|
21627
|
+
settled = true;
|
|
21628
|
+
cleanup();
|
|
21629
|
+
logger.error("PopupRelay.waitForPopupRelayResponse - request handoff failed", correlationId);
|
|
21630
|
+
reject(createBrowserAuthError(popupWindowError, correlationId, "popup_relay_handoff_failed"));
|
|
21631
|
+
}
|
|
21632
|
+
return;
|
|
21633
|
+
}
|
|
21634
|
+
const hasError = typeof data.error === "string" && data.error.length > 0;
|
|
21635
|
+
const responseType = version === 1
|
|
21636
|
+
? POPUP_RELAY_RESPONSE_TYPE
|
|
21637
|
+
: POPUP_RELAY_V2_RESPONSE_TYPE;
|
|
21638
|
+
if (data.type !== responseType ||
|
|
21639
|
+
(version === 2 &&
|
|
21640
|
+
((!handoffNonce && !hasError) ||
|
|
21641
|
+
(handoffNonce && data.nonce !== handoffNonce)))) {
|
|
21642
|
+
return;
|
|
21643
|
+
}
|
|
21311
21644
|
settled = true;
|
|
21312
21645
|
cleanup();
|
|
21313
|
-
if (
|
|
21314
|
-
reject(createBrowserAuthError(data.error, correlationId));
|
|
21646
|
+
if (hasError) {
|
|
21647
|
+
reject(createBrowserAuthError(data.error, correlationId, data.subError));
|
|
21315
21648
|
}
|
|
21316
|
-
else if (data.payload) {
|
|
21649
|
+
else if (typeof data.payload === "string" && data.payload) {
|
|
21317
21650
|
resolve(data.payload);
|
|
21318
21651
|
}
|
|
21319
21652
|
else {
|
|
@@ -21691,7 +22024,7 @@
|
|
|
21691
22024
|
this.accountId = accountId;
|
|
21692
22025
|
this.platformAuthProvider = provider;
|
|
21693
22026
|
this.nativeStorageManager = nativeStorageImpl;
|
|
21694
|
-
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, this.tokenBindingKeyManager);
|
|
22027
|
+
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, this.tokenBindingKeyManager, browserStorage);
|
|
21695
22028
|
const extensionName = this.platformAuthProvider.getExtensionName();
|
|
21696
22029
|
this.skus = ServerTelemetryManager.makeExtraSkuString({
|
|
21697
22030
|
libraryName: BrowserConstants.MSAL_SKU,
|
|
@@ -22076,6 +22409,11 @@
|
|
|
22076
22409
|
const shouldRemoveGeneratedDpopKey = isL3DpopResponse ||
|
|
22077
22410
|
(this.isDpopBrokerRequest(request) &&
|
|
22078
22411
|
storeInCache?.accessToken === false);
|
|
22412
|
+
if (dpopBrokerOutcome === "L1" &&
|
|
22413
|
+
!shouldRemoveGeneratedDpopKey &&
|
|
22414
|
+
request.keyId) {
|
|
22415
|
+
ResponseHandler.setDpopKeyId(result, request.keyId);
|
|
22416
|
+
}
|
|
22079
22417
|
if (shouldRemoveGeneratedDpopKey) {
|
|
22080
22418
|
await this.resetGeneratedDpopRequestKey(request);
|
|
22081
22419
|
}
|
|
@@ -22344,7 +22682,12 @@
|
|
|
22344
22682
|
const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
|
|
22345
22683
|
? undefined
|
|
22346
22684
|
: this.config.auth.clientCapabilities;
|
|
22347
|
-
const { scopes, claims
|
|
22685
|
+
const { scopes, claims } = request;
|
|
22686
|
+
const dpopNonce = request.authenticationScheme ===
|
|
22687
|
+
AuthenticationScheme.DPOP &&
|
|
22688
|
+
request.resourceRequestUri
|
|
22689
|
+
? this.browserStorage.getDpopNonce(request.resourceRequestUri, this.correlationId)
|
|
22690
|
+
: undefined;
|
|
22348
22691
|
const scopeSet = new ScopeSet([...(scopes || []), ...OIDC_DEFAULT_SCOPES], this.correlationId);
|
|
22349
22692
|
const mergedClaims = buildMergedClaims(claims, configClaims?.length ? configClaims : undefined);
|
|
22350
22693
|
const hasAttributeTokens = !!request.attributeTokens?.length;
|
|
@@ -22654,11 +22997,14 @@
|
|
|
22654
22997
|
return brokerProof;
|
|
22655
22998
|
}
|
|
22656
22999
|
const dpopProofGenerator = new DpopProofGenerator(this.browserCrypto, this.tokenBindingKeyManager);
|
|
23000
|
+
const currentNonce = request.resourceRequestUri
|
|
23001
|
+
? this.browserStorage.getDpopNonce(request.resourceRequestUri, this.correlationId)
|
|
23002
|
+
: undefined;
|
|
22657
23003
|
return dpopProofGenerator.generateResourceProof({
|
|
22658
23004
|
htu: request.resourceRequestUri,
|
|
22659
23005
|
htm: request.resourceRequestMethod,
|
|
22660
23006
|
accessToken: response.access_token,
|
|
22661
|
-
nonce: request.extraParametersNoCache?.pop_nonce,
|
|
23007
|
+
nonce: currentNonce ?? request.extraParametersNoCache?.pop_nonce,
|
|
22662
23008
|
}, request.keyId, this.correlationId);
|
|
22663
23009
|
}
|
|
22664
23010
|
/**
|
|
@@ -22981,6 +23327,36 @@
|
|
|
22981
23327
|
addCorrelationId(queryParams, request.correlationId);
|
|
22982
23328
|
return getAuthorizeUrl(authority, queryParams);
|
|
22983
23329
|
}
|
|
23330
|
+
/**
|
|
23331
|
+
* Prepares the selected EAR construction.
|
|
23332
|
+
* @internal
|
|
23333
|
+
*/
|
|
23334
|
+
async function initializeEarRequest(config, request, logger, performanceClient) {
|
|
23335
|
+
if (!config.experimental.enableAsymmetricEar) {
|
|
23336
|
+
const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, logger, performanceClient, request.correlationId)();
|
|
23337
|
+
return {
|
|
23338
|
+
...request,
|
|
23339
|
+
earJwk,
|
|
23340
|
+
asymmetricEar: undefined,
|
|
23341
|
+
};
|
|
23342
|
+
}
|
|
23343
|
+
try {
|
|
23344
|
+
const { privateJwk, publicJwk } = await invokeAsync(generateAsymmetricEarKey, GenerateAsymmetricEarKey, logger, performanceClient, request.correlationId)();
|
|
23345
|
+
const apv = generateAsymmetricEarApv(publicJwk);
|
|
23346
|
+
const earJwk = base64Encode(JSON.stringify(publicJwk));
|
|
23347
|
+
return {
|
|
23348
|
+
...request,
|
|
23349
|
+
earJwk,
|
|
23350
|
+
asymmetricEar: { privateJwk, apv },
|
|
23351
|
+
};
|
|
23352
|
+
}
|
|
23353
|
+
catch (error) {
|
|
23354
|
+
if (error instanceof AuthError) {
|
|
23355
|
+
throw error;
|
|
23356
|
+
}
|
|
23357
|
+
throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_initialization_failed" /* AsymmetricEarSubErrors.RequestInitializationFailed */);
|
|
23358
|
+
}
|
|
23359
|
+
}
|
|
22984
23360
|
/**
|
|
22985
23361
|
* Builds the action URL + POST-body fields for the EAR /authorize form.
|
|
22986
23362
|
*/
|
|
@@ -22990,7 +23366,18 @@
|
|
|
22990
23366
|
}
|
|
22991
23367
|
const parameters = await getStandardParameters(config, authority, request, logger, performanceClient);
|
|
22992
23368
|
addResponseType(parameters, OAuthResponseType.IDTOKEN_TOKEN_REFRESHTOKEN);
|
|
22993
|
-
|
|
23369
|
+
try {
|
|
23370
|
+
addEARParameters(parameters, request.earJwk, request.asymmetricEar
|
|
23371
|
+
? base64Encode(JSON.stringify({
|
|
23372
|
+
alg: "ECDH-ES",
|
|
23373
|
+
enc: "A256GCM",
|
|
23374
|
+
apv: request.asymmetricEar.apv,
|
|
23375
|
+
}))
|
|
23376
|
+
: undefined);
|
|
23377
|
+
}
|
|
23378
|
+
catch {
|
|
23379
|
+
throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_encoding_failed" /* AsymmetricEarSubErrors.RequestEncodingFailed */);
|
|
23380
|
+
}
|
|
22994
23381
|
// Also add codeChallenge as backup in case EAR is not supported
|
|
22995
23382
|
addCodeChallengeParams(parameters, request.codeChallenge, S256_CODE_CHALLENGE_METHOD);
|
|
22996
23383
|
addExtraParameters(parameters, {
|
|
@@ -23074,12 +23461,14 @@
|
|
|
23074
23461
|
const browserCrypto = new CryptoOps(logger, performanceClient);
|
|
23075
23462
|
const nativeInteractionClient = new PlatformAuthInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, config.system.navigationClient, apiId, performanceClient, platformAuthProvider, accountId, nativeStorage, request.correlationId, tokenBindingKeyManager);
|
|
23076
23463
|
const { userRequestState } = parseRequestState(browserCrypto.base64Decode, request.state, request.correlationId);
|
|
23464
|
+
const brokerRequest = {
|
|
23465
|
+
...request,
|
|
23466
|
+
state: userRequestState,
|
|
23467
|
+
prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
|
|
23468
|
+
};
|
|
23469
|
+
delete brokerRequest.asymmetricEar;
|
|
23077
23470
|
try {
|
|
23078
|
-
return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)(
|
|
23079
|
-
...request,
|
|
23080
|
-
state: userRequestState,
|
|
23081
|
-
prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
|
|
23082
|
-
});
|
|
23471
|
+
return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)(brokerRequest);
|
|
23083
23472
|
}
|
|
23084
23473
|
catch (e) {
|
|
23085
23474
|
await removeTokenBindingKeyOnFailure(request, tokenBindingKeyManager, logger, performanceClient);
|
|
@@ -23103,6 +23492,7 @@
|
|
|
23103
23492
|
// Instrument clientdata telemetry fields from the authorize response
|
|
23104
23493
|
instrumentClientData(response, request.correlationId, performanceClient);
|
|
23105
23494
|
if (response.accountId) {
|
|
23495
|
+
validateAuthorizationResponse(response, request.state, request.correlationId);
|
|
23106
23496
|
return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, response.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
|
|
23107
23497
|
}
|
|
23108
23498
|
const authCodeRequest = {
|
|
@@ -23144,7 +23534,20 @@
|
|
|
23144
23534
|
if (!request.earJwk) {
|
|
23145
23535
|
throw createBrowserAuthError(earJwkEmpty, request.correlationId);
|
|
23146
23536
|
}
|
|
23147
|
-
|
|
23537
|
+
let plaintext;
|
|
23538
|
+
if (request.asymmetricEar) {
|
|
23539
|
+
plaintext = await invokeAsync(decryptAsymmetricEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.asymmetricEar.privateJwk, request.asymmetricEar.apv, response.ear_jwe, request.asymmetricEar.apv, { logger, performanceClient, correlationId: request.correlationId });
|
|
23540
|
+
}
|
|
23541
|
+
else {
|
|
23542
|
+
plaintext = await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe);
|
|
23543
|
+
}
|
|
23544
|
+
let decryptedData;
|
|
23545
|
+
try {
|
|
23546
|
+
decryptedData = JSON.parse(plaintext);
|
|
23547
|
+
}
|
|
23548
|
+
catch {
|
|
23549
|
+
throw createBrowserAuthError(failedToDecryptEarResponse, request.correlationId, "invalid_decrypted_response_payload" /* AsymmetricEarSubErrors.InvalidDecryptedResponsePayload */);
|
|
23550
|
+
}
|
|
23148
23551
|
if (decryptedData.accountId) {
|
|
23149
23552
|
return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
|
|
23150
23553
|
}
|
|
@@ -23435,6 +23838,7 @@
|
|
|
23435
23838
|
: "",
|
|
23436
23839
|
postLogoutRedirectUri: "",
|
|
23437
23840
|
popupRelayUri: "",
|
|
23841
|
+
popupRelayProtocolVersion: 1,
|
|
23438
23842
|
clientCapabilities: [],
|
|
23439
23843
|
OIDCOptions: {
|
|
23440
23844
|
responseMode: ResponseMode.FRAGMENT,
|
|
@@ -23501,6 +23905,7 @@
|
|
|
23501
23905
|
client: new StubPerformanceClient(),
|
|
23502
23906
|
};
|
|
23503
23907
|
const DEFAULT_EXPERIMENTAL_OPTIONS = {
|
|
23908
|
+
enableAsymmetricEar: false,
|
|
23504
23909
|
iframeTimeoutTelemetry: false,
|
|
23505
23910
|
allowPlatformBrokerWithDOM: false,
|
|
23506
23911
|
};
|
|
@@ -23554,9 +23959,16 @@
|
|
|
23554
23959
|
experimental: {
|
|
23555
23960
|
...DEFAULT_EXPERIMENTAL_OPTIONS,
|
|
23556
23961
|
...userInputExperimental,
|
|
23962
|
+
enableAsymmetricEar: userInputExperimental?.enableAsymmetricEar ?? false,
|
|
23557
23963
|
},
|
|
23558
23964
|
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry },
|
|
23559
23965
|
};
|
|
23966
|
+
if (overlayedConfig.experimental.enableAsymmetricEar &&
|
|
23967
|
+
overlayedConfig.system.protocolMode !== ProtocolMode.EAR) {
|
|
23968
|
+
const logger = new Logger(providedSystemOptions.loggerOptions, name, version);
|
|
23969
|
+
logger.warning("experimental.enableAsymmetricEar is ignored because system.protocolMode is not ProtocolMode.EAR.", "");
|
|
23970
|
+
overlayedConfig.experimental.enableAsymmetricEar = false;
|
|
23971
|
+
}
|
|
23560
23972
|
return overlayedConfig;
|
|
23561
23973
|
}
|
|
23562
23974
|
|
|
@@ -23938,7 +24350,6 @@
|
|
|
23938
24350
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
23939
24351
|
* Licensed under the MIT License.
|
|
23940
24352
|
*/
|
|
23941
|
-
const PLATFORM_AUTH_DOM_DPOP_NOT_SUPPORTED = "platform_auth_dom_dpop_not_supported";
|
|
23942
24353
|
class PlatformAuthDOMHandler {
|
|
23943
24354
|
constructor(logger, performanceClient, correlationId) {
|
|
23944
24355
|
this.logger = logger;
|
|
@@ -24018,11 +24429,9 @@
|
|
|
24018
24429
|
});
|
|
24019
24430
|
this.logger.trace(`'${this.platformAuthType}' - Sending request to browser DOM API`, correlationId);
|
|
24020
24431
|
try {
|
|
24021
|
-
if (request.tokenType?.trim().toLowerCase() ===
|
|
24022
|
-
PlatformAuthTokenType.DPOP_WITH_PROOF) {
|
|
24023
|
-
throw createBrowserAuthError(PLATFORM_AUTH_DOM_DPOP_NOT_SUPPORTED, correlationId);
|
|
24024
|
-
}
|
|
24025
24432
|
const platformDOMRequest = invoke(this.initializePlatformDOMRequest.bind(this), PlatformAuthDOMInitializeRequest, this.logger, this.performanceClient, correlationId)(request);
|
|
24433
|
+
request.bindingPreferenceSent =
|
|
24434
|
+
platformDOMRequest.preferBinding !== undefined;
|
|
24026
24435
|
const response =
|
|
24027
24436
|
// @ts-ignore
|
|
24028
24437
|
await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
|
|
@@ -24067,8 +24476,12 @@
|
|
|
24067
24476
|
preferBinding: preferBinding,
|
|
24068
24477
|
enclave: enclave,
|
|
24069
24478
|
requestConfirmation: reqCnf,
|
|
24070
|
-
extraParametersNoCache
|
|
24479
|
+
extraParametersNoCache: extraParametersNoCache && {
|
|
24480
|
+
...extraParametersNoCache,
|
|
24481
|
+
},
|
|
24071
24482
|
};
|
|
24483
|
+
delete platformDOMRequest.extraParameters?.bindingPreferenceSent;
|
|
24484
|
+
delete platformDOMRequest.extraParametersNoCache?.bindingPreferenceSent;
|
|
24072
24485
|
return platformDOMRequest;
|
|
24073
24486
|
}
|
|
24074
24487
|
validatePlatformBrokerResponse(response, correlationId) {
|
|
@@ -24085,7 +24498,8 @@
|
|
|
24085
24498
|
requiredKeys.every((key) => Object.prototype.hasOwnProperty.call(response, key));
|
|
24086
24499
|
if (response &&
|
|
24087
24500
|
Object.prototype.hasOwnProperty.call(response, "isSuccess")) {
|
|
24088
|
-
if (isValid
|
|
24501
|
+
if (isValid &&
|
|
24502
|
+
response.isSuccess === true) {
|
|
24089
24503
|
this.logger.trace(`'${this.platformAuthType}' - platform broker returned successful and valid response`, correlationId);
|
|
24090
24504
|
try {
|
|
24091
24505
|
const validatedResponse = this.convertToPlatformBrokerResponse(response, correlationId);
|
|
@@ -24138,7 +24552,6 @@
|
|
|
24138
24552
|
convertToPlatformBrokerResponse(response, correlationId) {
|
|
24139
24553
|
this.logger.trace(`'${this.platformAuthType}' - convertToNativeResponse called`, correlationId);
|
|
24140
24554
|
const responseProperties = response.properties || {};
|
|
24141
|
-
const bindingAttested = this.parseDOMBoolean(responseProperties.binding_attested, "binding_attested", correlationId);
|
|
24142
24555
|
const nativeResponse = {
|
|
24143
24556
|
access_token: response.accessToken,
|
|
24144
24557
|
id_token: response.idToken,
|
|
@@ -24150,21 +24563,9 @@
|
|
|
24150
24563
|
properties: responseProperties,
|
|
24151
24564
|
extendedLifetimeToken: response.extendedLifetimeToken ?? false,
|
|
24152
24565
|
shr: response.proofOfPossessionPayload,
|
|
24153
|
-
token_type: responseProperties.token_type,
|
|
24154
|
-
DPoP: responseProperties.dpop_proof,
|
|
24155
|
-
binding_attested: bindingAttested,
|
|
24156
24566
|
};
|
|
24157
24567
|
return nativeResponse;
|
|
24158
24568
|
}
|
|
24159
|
-
parseDOMBoolean(value, propertyName, correlationId) {
|
|
24160
|
-
if (value === undefined) {
|
|
24161
|
-
return undefined;
|
|
24162
|
-
}
|
|
24163
|
-
if (value === "true" || value === "false") {
|
|
24164
|
-
return value === "true";
|
|
24165
|
-
}
|
|
24166
|
-
throw createAuthError(unexpectedError, correlationId, `Platform broker returned invalid ${propertyName} value.`);
|
|
24167
|
-
}
|
|
24168
24569
|
getDOMExtraParams(extraParameters, correlationId) {
|
|
24169
24570
|
try {
|
|
24170
24571
|
const stringifiedProperties = {};
|
|
@@ -24260,8 +24661,7 @@
|
|
|
24260
24661
|
const schemeSupported = !authenticationScheme ||
|
|
24261
24662
|
authenticationScheme === AuthenticationScheme.BEARER ||
|
|
24262
24663
|
authenticationScheme === AuthenticationScheme.POP ||
|
|
24263
|
-
|
|
24264
|
-
!(platformAuthProvider instanceof PlatformAuthDOMHandler));
|
|
24664
|
+
authenticationScheme === AuthenticationScheme.DPOP;
|
|
24265
24665
|
const fields = {
|
|
24266
24666
|
allowPlatformBroker: config.system.allowPlatformBroker,
|
|
24267
24667
|
...(config.system.allowPlatformBroker && {
|
|
@@ -24444,19 +24844,21 @@
|
|
|
24444
24844
|
/*
|
|
24445
24845
|
* When a popup-relay page is configured, open it top-level
|
|
24446
24846
|
* (same first-party origin) instead of navigating the popup
|
|
24447
|
-
* straight to the IdP
|
|
24847
|
+
* straight to the IdP. V1 carries the action in the hash; v2
|
|
24848
|
+
* retains it for the authenticated handoff.
|
|
24448
24849
|
* The relay page opens the IdP child popup and relays the
|
|
24449
24850
|
* response back via postMessage (see waitForPopupResponse).
|
|
24450
24851
|
*/
|
|
24451
24852
|
const popupRelayUri = this.config.auth.popupRelayUri;
|
|
24853
|
+
popupParams.relayAction = { method: "GET", url: navigateUrl };
|
|
24452
24854
|
const popupNavigateUrl = popupRelayUri
|
|
24453
|
-
? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId),
|
|
24855
|
+
? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), popupParams.relayAction, correlationId, this.config.auth.popupRelayProtocolVersion)
|
|
24454
24856
|
: navigateUrl;
|
|
24455
24857
|
// Show the UI once the url has been created. Get the window handle for the popup.
|
|
24456
24858
|
const popupWindow = this.initiateAuthRequest(popupNavigateUrl, popupParams);
|
|
24457
24859
|
this.eventHandler.emitEvent(EventType.POPUP_OPENED, correlationId, InteractionType.Popup, { popupWindow }, null);
|
|
24458
24860
|
// Wait for the redirect bridge response
|
|
24459
|
-
const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent);
|
|
24861
|
+
const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
|
|
24460
24862
|
const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
|
|
24461
24863
|
return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
|
|
24462
24864
|
}
|
|
@@ -24480,21 +24882,20 @@
|
|
|
24480
24882
|
const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
|
|
24481
24883
|
// Get the frame handle for the silent request
|
|
24482
24884
|
const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
|
|
24483
|
-
const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
|
|
24484
24885
|
const pkce = pkceCodes ||
|
|
24485
24886
|
(await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId));
|
|
24486
24887
|
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
24487
|
-
|
|
24888
|
+
let popupRequest = {
|
|
24488
24889
|
...request,
|
|
24489
|
-
earJwk: earJwk,
|
|
24490
24890
|
codeChallenge: pkce.challenge,
|
|
24491
24891
|
...tokenBindingParams,
|
|
24492
24892
|
popupOriginCheckDone: this.getPopupOriginCheckDone(popupParams.popupWindowParent),
|
|
24493
24893
|
};
|
|
24494
24894
|
try {
|
|
24895
|
+
popupRequest = await initializeEarRequest(this.config, popupRequest, this.logger, this.performanceClient);
|
|
24495
24896
|
const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
|
|
24496
24897
|
// Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
24497
|
-
const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent);
|
|
24898
|
+
const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
|
|
24498
24899
|
const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
|
|
24499
24900
|
if (!serverParams.ear_jwe && serverParams.code) {
|
|
24500
24901
|
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, correlationId)({
|
|
@@ -24522,7 +24923,7 @@
|
|
|
24522
24923
|
const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger);
|
|
24523
24924
|
const popupWindow = await this.openPostFormPopup(request, discoveredAuthority, popupParams, correlationId, false);
|
|
24524
24925
|
// Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
24525
|
-
const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(request, popupWindow, popupParams.popupWindowParent);
|
|
24926
|
+
const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(request, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
|
|
24526
24927
|
const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
|
|
24527
24928
|
return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(request, serverParams, pkceVerifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
|
|
24528
24929
|
}
|
|
@@ -24578,21 +24979,22 @@
|
|
|
24578
24979
|
this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, validRequest.correlationId, InteractionType.Popup, validRequest);
|
|
24579
24980
|
/*
|
|
24580
24981
|
* When a popup-relay page is configured, open it top-level (same
|
|
24581
|
-
* first-party origin)
|
|
24582
|
-
*
|
|
24982
|
+
* first-party origin), using the configured wire protocol for the
|
|
24983
|
+
* end-session URL. The relay page opens the IdP child
|
|
24583
24984
|
* popup and the post-logout redirect page (running the redirect
|
|
24584
24985
|
* bridge) relays completion back via postMessage — so logout works
|
|
24585
24986
|
* from an embedded, cross-origin iframe where a direct popup to the
|
|
24586
24987
|
* IdP cannot. See runPopupRelay / waitForPopupResponse.
|
|
24587
24988
|
*/
|
|
24588
24989
|
const popupRelayUri = this.config.auth.popupRelayUri;
|
|
24990
|
+
popupParams.relayAction = { method: "GET", url: logoutUri };
|
|
24589
24991
|
const popupNavigateUrl = popupRelayUri
|
|
24590
|
-
? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(validRequest.state || "", this.correlationId),
|
|
24992
|
+
? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(validRequest.state || "", this.correlationId), popupParams.relayAction, this.correlationId, this.config.auth.popupRelayProtocolVersion)
|
|
24591
24993
|
: logoutUri;
|
|
24592
24994
|
// Open the popup window to requestUrl.
|
|
24593
24995
|
const popupWindow = this.openPopup(popupNavigateUrl, popupParams);
|
|
24594
24996
|
this.eventHandler.emitEvent(EventType.POPUP_OPENED, validRequest.correlationId, InteractionType.Popup, { popupWindow }, null);
|
|
24595
|
-
await this.waitForPopupResponse(validRequest, popupWindow, popupParams.popupWindowParent).catch(() => {
|
|
24997
|
+
await this.waitForPopupResponse(validRequest, popupWindow, popupParams.popupWindowParent, popupParams.relayAction).catch(() => {
|
|
24596
24998
|
// Swallow any errors related to monitoring the window. Server logout is best effort
|
|
24597
24999
|
});
|
|
24598
25000
|
if (mainWindowRedirectUri) {
|
|
@@ -24804,11 +25206,12 @@
|
|
|
24804
25206
|
? getEARFormData
|
|
24805
25207
|
: getCodeFormData;
|
|
24806
25208
|
const formData = await getFormData(this.config, discoveredAuthority, request, this.logger, this.performanceClient);
|
|
24807
|
-
|
|
25209
|
+
popupParams.relayAction = {
|
|
24808
25210
|
method: "POST",
|
|
24809
25211
|
action: formData.action,
|
|
24810
25212
|
fields: formData.fields,
|
|
24811
|
-
}
|
|
25213
|
+
};
|
|
25214
|
+
const relayUrl = buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), popupParams.relayAction, correlationId, this.config.auth.popupRelayProtocolVersion);
|
|
24812
25215
|
return this.initiateAuthRequest(relayUrl, popupParams);
|
|
24813
25216
|
}
|
|
24814
25217
|
const popupWindow = popupParams.popup || this.openPopup("about:blank", popupParams);
|
|
@@ -24817,7 +25220,7 @@
|
|
|
24817
25220
|
form.submit();
|
|
24818
25221
|
return popupWindow;
|
|
24819
25222
|
}
|
|
24820
|
-
async waitForPopupResponse(request, popupWindow, popupWindowParent) {
|
|
25223
|
+
async waitForPopupResponse(request, popupWindow, popupWindowParent, relayAction) {
|
|
24821
25224
|
/*
|
|
24822
25225
|
* When a popup-relay page is configured the response is relayed back to
|
|
24823
25226
|
* this frame by the relay page via postMessage, and the relay popup's
|
|
@@ -24827,7 +25230,11 @@
|
|
|
24827
25230
|
* frame and which does not track the relay popup.
|
|
24828
25231
|
*/
|
|
24829
25232
|
if (this.config.auth.popupRelayUri) {
|
|
24830
|
-
|
|
25233
|
+
if (this.config.auth.popupRelayProtocolVersion === 2 &&
|
|
25234
|
+
!relayAction) {
|
|
25235
|
+
throw createBrowserAuthError(popupRelayUnsupportedFlow, this.correlationId, "popup_relay_bad_request");
|
|
25236
|
+
}
|
|
25237
|
+
return waitForPopupRelayResponse(this.config.system.popupBridgeTimeout, this.logger, request, popupWindow, this.performanceClient, relayAction, this.config.auth.popupRelayProtocolVersion);
|
|
24831
25238
|
}
|
|
24832
25239
|
if (this.waitForPopupResponseHook) {
|
|
24833
25240
|
return this.waitForPopupResponseHook(request, popupWindow, popupWindowParent);
|
|
@@ -24952,16 +25359,15 @@
|
|
|
24952
25359
|
const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
|
|
24953
25360
|
// Get the frame handle for the silent request
|
|
24954
25361
|
const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
|
|
24955
|
-
const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
|
|
24956
25362
|
const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
|
|
24957
25363
|
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
24958
|
-
|
|
25364
|
+
let redirectRequest = {
|
|
24959
25365
|
...request,
|
|
24960
|
-
earJwk: earJwk,
|
|
24961
25366
|
codeChallenge: pkceCodes.challenge,
|
|
24962
25367
|
...tokenBindingParams,
|
|
24963
25368
|
};
|
|
24964
25369
|
try {
|
|
25370
|
+
redirectRequest = await initializeEarRequest(this.config, redirectRequest, this.logger, this.performanceClient);
|
|
24965
25371
|
if (!(await isTokenBindingKeyPersistedForRedirect(redirectRequest, this.tokenBindingKeyManager))) {
|
|
24966
25372
|
throw createBrowserAuthError(cryptoKeyNotFound, this.correlationId);
|
|
24967
25373
|
}
|
|
@@ -24974,9 +25380,10 @@
|
|
|
24974
25380
|
}, this.config.system.redirectNavigationTimeout);
|
|
24975
25381
|
});
|
|
24976
25382
|
}
|
|
24977
|
-
catch (
|
|
25383
|
+
catch (error) {
|
|
25384
|
+
this.browserStorage.resetRequestCache(correlationId);
|
|
24978
25385
|
await removeTokenBindingKeyOnFailure(redirectRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
24979
|
-
throw
|
|
25386
|
+
throw error;
|
|
24980
25387
|
}
|
|
24981
25388
|
}
|
|
24982
25389
|
/**
|
|
@@ -25165,7 +25572,6 @@
|
|
|
25165
25572
|
/**
|
|
25166
25573
|
* Redirects window to given URL.
|
|
25167
25574
|
* @param urlNavigate
|
|
25168
|
-
* @param onRedirectNavigateRequest - onRedirectNavigate callback provided on the request
|
|
25169
25575
|
*/
|
|
25170
25576
|
async initiateAuthRequest(requestUrl) {
|
|
25171
25577
|
this.logger.verbose("RedirectHandler.initiateAuthRequest called", this.correlationId);
|
|
@@ -25453,13 +25859,11 @@
|
|
|
25453
25859
|
async executeEarFlow(request) {
|
|
25454
25860
|
const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
|
|
25455
25861
|
const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
|
|
25456
|
-
const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
|
|
25457
25862
|
const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
|
|
25458
|
-
const silentRequest = {
|
|
25863
|
+
const silentRequest = await initializeEarRequest(this.config, {
|
|
25459
25864
|
...request,
|
|
25460
|
-
earJwk: earJwk,
|
|
25461
25865
|
codeChallenge: pkceCodes.challenge,
|
|
25462
|
-
};
|
|
25866
|
+
}, this.logger, this.performanceClient);
|
|
25463
25867
|
// Create the iframe, register the response listener, then navigate, so the listener is active before the iframe can respond.
|
|
25464
25868
|
const iframe = createHiddenIframe();
|
|
25465
25869
|
const responseType = this.config.auth.OIDCOptions.responseMode;
|
|
@@ -25809,6 +26213,7 @@
|
|
|
25809
26213
|
return {
|
|
25810
26214
|
key: JSON.stringify({
|
|
25811
26215
|
...thumbprint,
|
|
26216
|
+
accountTenantId: account.tenantId,
|
|
25812
26217
|
forceRefresh: !!request.forceRefresh,
|
|
25813
26218
|
cacheLookupPolicy: request.cacheLookupPolicy ?? CacheLookupPolicy.Default,
|
|
25814
26219
|
extraParameters: canonicalizeStringDict(request.extraParameters),
|
|
@@ -25827,7 +26232,10 @@
|
|
|
25827
26232
|
account,
|
|
25828
26233
|
});
|
|
25829
26234
|
return {
|
|
25830
|
-
key:
|
|
26235
|
+
key: platformRequest.authenticationScheme ===
|
|
26236
|
+
AuthenticationScheme.DPOP
|
|
26237
|
+
? undefined
|
|
26238
|
+
: `platform:${getPlatformSilentRequestKey(platformRequest, config)}`,
|
|
25831
26239
|
request: platformRequest,
|
|
25832
26240
|
account: platformRequest.account,
|
|
25833
26241
|
};
|
|
@@ -25859,7 +26267,6 @@
|
|
|
25859
26267
|
loginHint: request.loginHint,
|
|
25860
26268
|
popKid: request.popKid,
|
|
25861
26269
|
shrNonce: request.shrNonce,
|
|
25862
|
-
dpopNonce: request.dpopNonce,
|
|
25863
26270
|
skipBrokerClaims: request.embeddedClientId
|
|
25864
26271
|
? !!request.skipBrokerClaims
|
|
25865
26272
|
: undefined,
|
|
@@ -27108,6 +27515,16 @@
|
|
|
27108
27515
|
getLogger() {
|
|
27109
27516
|
return this.logger;
|
|
27110
27517
|
}
|
|
27518
|
+
/**
|
|
27519
|
+
* Stores a resource-server DPoP nonce for the matching HTTPS origin.
|
|
27520
|
+
*/
|
|
27521
|
+
async loadDpopNonce(resourceRequestUri, dpopNonce) {
|
|
27522
|
+
blockNonBrowserEnvironment();
|
|
27523
|
+
const correlationId = createNewGuid();
|
|
27524
|
+
return invokeAsync(async () => {
|
|
27525
|
+
this.browserStorage.setDpopNonce(resourceRequestUri, dpopNonce, correlationId);
|
|
27526
|
+
}, StandardControllerLoadDpopNonce, this.logger, this.performanceClient, correlationId)();
|
|
27527
|
+
}
|
|
27111
27528
|
/**
|
|
27112
27529
|
* Replaces the default logger set in configurations with new Logger with new configurations
|
|
27113
27530
|
* @param logger Logger instance
|
|
@@ -27262,32 +27679,55 @@
|
|
|
27262
27679
|
correlationId,
|
|
27263
27680
|
config: this.config,
|
|
27264
27681
|
}, this.platformAuthProvider, this.logger, this.performanceClient);
|
|
27265
|
-
const
|
|
27266
|
-
|
|
27682
|
+
const requestKey = preparedRequest.key;
|
|
27683
|
+
const shouldDeduplicate = requestKey !== undefined;
|
|
27267
27684
|
const inProgressRequest = shouldDeduplicate
|
|
27268
|
-
? this.activeSilentTokenRequests.get(
|
|
27685
|
+
? this.activeSilentTokenRequests.get(requestKey)
|
|
27269
27686
|
: undefined;
|
|
27270
27687
|
if (typeof inProgressRequest === "undefined") {
|
|
27271
27688
|
this.logger.verbose(shouldDeduplicate
|
|
27272
27689
|
? "acquireTokenSilent called for the first time, storing active request"
|
|
27273
|
-
: "acquireTokenSilent called for DPoP request, starting an independent operation", correlationId);
|
|
27690
|
+
: "acquireTokenSilent called for platform DPoP request, starting an independent operation", correlationId);
|
|
27274
27691
|
this.performanceClient.addFields({ deduped: false }, correlationId);
|
|
27275
27692
|
const activeRequest = invokeAsync(this.acquireTokenSilentAsync.bind(this), AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)({
|
|
27276
27693
|
...preparedRequest.request,
|
|
27277
27694
|
correlationId,
|
|
27278
27695
|
}, preparedRequest.account);
|
|
27279
|
-
if (
|
|
27696
|
+
if (requestKey === undefined) {
|
|
27280
27697
|
return activeRequest;
|
|
27281
27698
|
}
|
|
27282
|
-
this.activeSilentTokenRequests.set(
|
|
27699
|
+
this.activeSilentTokenRequests.set(requestKey, activeRequest);
|
|
27283
27700
|
return activeRequest.finally(() => {
|
|
27284
|
-
this.activeSilentTokenRequests.delete(
|
|
27701
|
+
this.activeSilentTokenRequests.delete(requestKey);
|
|
27285
27702
|
});
|
|
27286
27703
|
}
|
|
27287
27704
|
else {
|
|
27288
27705
|
this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call", correlationId);
|
|
27289
27706
|
this.performanceClient.addFields({ deduped: true }, correlationId);
|
|
27290
|
-
|
|
27707
|
+
const joiningRequest = {
|
|
27708
|
+
...preparedRequest.request,
|
|
27709
|
+
correlationId,
|
|
27710
|
+
};
|
|
27711
|
+
const result = await inProgressRequest;
|
|
27712
|
+
if (joiningRequest.authenticationScheme !==
|
|
27713
|
+
AuthenticationScheme.DPOP) {
|
|
27714
|
+
return result;
|
|
27715
|
+
}
|
|
27716
|
+
if (result.fromPlatformBroker &&
|
|
27717
|
+
!ResponseHandler.hasDpopKeyId(result)) {
|
|
27718
|
+
return invokeAsync(this.acquireTokenSilentAsync.bind(this), AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)(joiningRequest, result.account || preparedRequest.account);
|
|
27719
|
+
}
|
|
27720
|
+
const dpopProof = await ResponseHandler.generateDpopResourceProof(this.browserCrypto, result, {
|
|
27721
|
+
...joiningRequest,
|
|
27722
|
+
authority: joiningRequest.authority || this.config.auth.authority,
|
|
27723
|
+
}, this.performanceClient, {
|
|
27724
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
27725
|
+
dpopNonceProvider: this.browserStorage,
|
|
27726
|
+
});
|
|
27727
|
+
return {
|
|
27728
|
+
...result,
|
|
27729
|
+
dpopProof,
|
|
27730
|
+
};
|
|
27291
27731
|
}
|
|
27292
27732
|
}
|
|
27293
27733
|
/**
|
|
@@ -27910,6 +28350,7 @@
|
|
|
27910
28350
|
}
|
|
27911
28351
|
async signUpV2(inputs) {
|
|
27912
28352
|
const correlationId = this.getCorrelationId(inputs);
|
|
28353
|
+
let scenario = CustomAuthFlowScenarioV2.SignUp;
|
|
27913
28354
|
try {
|
|
27914
28355
|
ensureArgumentIsNotNullOrUndefined("inputs", inputs, correlationId);
|
|
27915
28356
|
this.ensureUsernameIsValidV2(inputs.username, correlationId);
|
|
@@ -27921,13 +28362,19 @@
|
|
|
27921
28362
|
}
|
|
27922
28363
|
this.ensureUserNotSignedIn(correlationId);
|
|
27923
28364
|
this.logger.verbose("Starting native auth V2 sign-up.", correlationId);
|
|
27924
|
-
const
|
|
28365
|
+
const startResult = await this.flowClientV2.signUp({
|
|
27925
28366
|
correlationId,
|
|
27926
28367
|
username: inputs.username,
|
|
27927
28368
|
scopes: inputs.scopes,
|
|
27928
28369
|
claims: inputs.claims,
|
|
27929
28370
|
attributes: inputs.attributes,
|
|
27930
28371
|
});
|
|
28372
|
+
if (startResult.type === FLOW_EXISTING_ACCOUNT_START_V2) {
|
|
28373
|
+
scenario = startResult.continuationState.scenario;
|
|
28374
|
+
}
|
|
28375
|
+
const result = startResult.type === FLOW_EXISTING_ACCOUNT_START_V2
|
|
28376
|
+
? await this.flowClientV2.challengeExistingAccount(startResult)
|
|
28377
|
+
: startResult;
|
|
27931
28378
|
if (result.type === FLOW_CODE_REQUIRED_V2) {
|
|
27932
28379
|
return new CustomAuthResultV2(new CodeRequiredStateV2({
|
|
27933
28380
|
correlationId: result.correlationId,
|
|
@@ -27986,7 +28433,7 @@
|
|
|
27986
28433
|
catch (error) {
|
|
27987
28434
|
this.logger.errorPii(`An error occurred during native auth V2 sign-up: '${error}'`, correlationId);
|
|
27988
28435
|
return CustomAuthResultV2.createWithError(error, {
|
|
27989
|
-
scenario
|
|
28436
|
+
scenario,
|
|
27990
28437
|
correlationId,
|
|
27991
28438
|
});
|
|
27992
28439
|
}
|
|
@@ -28825,6 +29272,12 @@
|
|
|
28825
29272
|
getActiveAccount() {
|
|
28826
29273
|
return this.controller.getActiveAccount();
|
|
28827
29274
|
}
|
|
29275
|
+
/**
|
|
29276
|
+
* Stores an opaque resource-server DPoP nonce for the matching HTTPS origin.
|
|
29277
|
+
*/
|
|
29278
|
+
loadDpopNonce(resourceRequestUri, dpopNonce) {
|
|
29279
|
+
return this.controller.loadDpopNonce(resourceRequestUri, dpopNonce);
|
|
29280
|
+
}
|
|
28828
29281
|
/**
|
|
28829
29282
|
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
|
28830
29283
|
* @param sku
|
|
@@ -28968,7 +29421,6 @@
|
|
|
28968
29421
|
}
|
|
28969
29422
|
/**
|
|
28970
29423
|
* Starts native auth V2 sign-in.
|
|
28971
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
28972
29424
|
* @param inputs - Inputs for the sign-in V2 flow.
|
|
28973
29425
|
* @returns A promise that resolves to the sign-in start result.
|
|
28974
29426
|
*/
|
|
@@ -28977,7 +29429,6 @@
|
|
|
28977
29429
|
}
|
|
28978
29430
|
/**
|
|
28979
29431
|
* Starts native auth V2 sign-up.
|
|
28980
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
28981
29432
|
* @param inputs - Inputs for the sign-up V2 flow.
|
|
28982
29433
|
* @returns A promise that resolves to the sign-up start result.
|
|
28983
29434
|
*/
|
|
@@ -28986,7 +29437,6 @@
|
|
|
28986
29437
|
}
|
|
28987
29438
|
/**
|
|
28988
29439
|
* Starts native auth V2 self-service password reset.
|
|
28989
|
-
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
|
|
28990
29440
|
* @param {ResetPasswordInputsV2} inputs - Inputs for the reset-password V2 flow
|
|
28991
29441
|
* @returns {Promise<ResetPasswordStartResultV2>} - A promise that resolves to ResetPasswordStartResultV2
|
|
28992
29442
|
*/
|