@azure/msal-browser 5.18.0 → 5.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +9 -12
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +6 -6
- 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 +15 -5
- package/dist/cache/LocalStorage.mjs.map +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +3 -2
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +8 -4
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +24 -18
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +19 -19
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +62 -103
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +4 -2
- package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +157 -0
- package/dist/crypto/TokenBindingKeyManager.mjs.map +1 -0
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +2 -2
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
- package/dist/custom_auth/core/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 +4 -4
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +4 -3
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs.map +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/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/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/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/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/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/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 +5 -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/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +6 -2
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +6 -6
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +9 -5
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +8 -3
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +6 -3
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +8 -5
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +4 -2
- package/dist/interaction_client/SilentRefreshClient.mjs.map +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 +243 -247
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +27 -32
- package/dist/naa/BridgeProxy.mjs.map +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +52 -25
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +12 -16
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +71 -10
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +5 -5
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.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/MsalFrameStatsUtils.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +64 -0
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs.map +1 -0
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +39 -0
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs.map +1 -0
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +58 -0
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs.map +1 -0
- package/lib/custom-auth-path/log-strings-mapping.json +39 -43
- package/lib/custom-auth-path/msal-custom-auth.cjs +2873 -2249
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +2873 -2249
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +11 -15
- package/lib/msal-browser.cjs +1243 -503
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +1243 -503
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +2 -2
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/package.json +2 -2
- package/src/cache/AsyncMemoryStorage.ts +7 -13
- package/src/cache/BrowserCacheManager.ts +12 -4
- package/src/cache/LocalStorage.ts +14 -4
- package/src/cache/TokenCache.ts +3 -1
- package/src/controllers/NestedAppAuthController.ts +10 -2
- package/src/controllers/StandardController.ts +46 -16
- package/src/controllers/UnknownOperatingContextController.ts +11 -2
- package/src/crypto/BrowserCrypto.ts +10 -8
- package/src/crypto/CryptoOps.ts +138 -178
- package/src/crypto/SignedHttpRequest.ts +3 -0
- package/src/crypto/TokenBindingKeyManager.ts +299 -0
- package/src/custom_auth/controller/CustomAuthStandardController.ts +2 -1
- package/src/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.ts +8 -3
- package/src/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.ts +7 -3
- package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
- package/src/error/BrowserAuthErrorCodes.ts +6 -0
- package/src/index.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +8 -1
- package/src/interaction_client/PlatformAuthInteractionClient.ts +9 -3
- package/src/interaction_client/PopupClient.ts +24 -4
- package/src/interaction_client/RedirectClient.ts +20 -2
- package/src/interaction_client/SilentAuthCodeClient.ts +13 -2
- package/src/interaction_client/SilentIframeClient.ts +16 -7
- package/src/interaction_client/SilentRefreshClient.ts +11 -1
- package/src/interaction_client/StandardInteractionClient.ts +1 -0
- package/src/naa/BridgeProxy.ts +38 -44
- package/src/naa/mapping/NestedAppAuthAdapter.ts +57 -55
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +15 -24
- package/src/request/RequestHelpers.ts +124 -13
- package/src/telemetry/BrowserPerformanceEvents.ts +4 -4
- package/src/webBrokerBridge/PendingRequestRegistry.ts +2 -5
- package/src/webBrokerBridge/adapter/CrossVersionRequestAdapter.ts +186 -0
- package/src/webBrokerBridge/index.ts +11 -0
- package/types/cache/AsyncMemoryStorage.d.ts +1 -2
- package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +3 -3
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/cache/LocalStorage.d.ts.map +1 -1
- package/types/cache/TokenCache.d.ts.map +1 -1
- package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +2 -1
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/types/crypto/BrowserCrypto.d.ts +2 -2
- package/types/crypto/BrowserCrypto.d.ts.map +1 -1
- package/types/crypto/CryptoOps.d.ts +7 -21
- package/types/crypto/CryptoOps.d.ts.map +1 -1
- package/types/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/types/crypto/TokenBindingKeyManager.d.ts +83 -0
- package/types/crypto/TokenBindingKeyManager.d.ts.map +1 -0
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +2 -2
- package/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
- package/types/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts +4 -3
- package/types/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts.map +1 -1
- package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/types/error/BrowserAuthErrorCodes.d.ts +3 -0
- package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/types/index.d.ts +3 -0
- package/types/index.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 +2 -2
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts +2 -2
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts +2 -2
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentAuthCodeClient.d.ts +2 -2
- package/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts +2 -2
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/types/naa/BridgeProxy.d.ts +14 -2
- package/types/naa/BridgeProxy.d.ts.map +1 -1
- package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts +11 -1
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +4 -4
- package/types/webBrokerBridge/PendingRequestRegistry.d.ts +2 -2
- package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -1
- package/types/webBrokerBridge/adapter/CrossVersionRequestAdapter.d.ts +66 -0
- package/types/webBrokerBridge/adapter/CrossVersionRequestAdapter.d.ts.map +1 -0
- package/types/webBrokerBridge/index.d.ts +2 -0
- package/types/webBrokerBridge/index.d.ts.map +1 -1
- package/src/naa/BridgeRequest.ts +0 -16
- package/types/naa/BridgeRequest.d.ts +0 -8
- package/types/naa/BridgeRequest.d.ts.map +0 -1
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ClientAuthErrorCodes,
|
|
8
|
+
createClientAuthError,
|
|
9
|
+
IPerformanceClient,
|
|
10
|
+
JsonWebTokenAlgorithms,
|
|
11
|
+
Logger,
|
|
12
|
+
} from "@azure/msal-common/browser";
|
|
13
|
+
import type {
|
|
14
|
+
ITokenBindingKeyManager,
|
|
15
|
+
TokenBindingKeyProvisioningParameters,
|
|
16
|
+
} from "@azure/msal-common/browser";
|
|
17
|
+
import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
|
|
18
|
+
import * as BrowserCrypto from "./BrowserCrypto.js";
|
|
19
|
+
import {
|
|
20
|
+
createBrowserAuthError,
|
|
21
|
+
BrowserAuthErrorCodes,
|
|
22
|
+
} from "../error/BrowserAuthError.js";
|
|
23
|
+
import { AsyncMemoryStorage } from "../cache/AsyncMemoryStorage.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Browser keystore record for asymmetric token-binding keys.
|
|
27
|
+
*/
|
|
28
|
+
export type CachedKeyPair = {
|
|
29
|
+
/**
|
|
30
|
+
* Public WebCrypto key.
|
|
31
|
+
*/
|
|
32
|
+
publicKey: CryptoKey;
|
|
33
|
+
/**
|
|
34
|
+
* Private WebCrypto key used for signing.
|
|
35
|
+
*/
|
|
36
|
+
privateKey: CryptoKey;
|
|
37
|
+
/**
|
|
38
|
+
* Protocol or token-binding family that owns the key.
|
|
39
|
+
*/
|
|
40
|
+
tokenBindingKeyType?: string;
|
|
41
|
+
/**
|
|
42
|
+
* JOSE algorithm policy associated with the key.
|
|
43
|
+
*/
|
|
44
|
+
tokenBindingKeyAlgorithm?: string;
|
|
45
|
+
/**
|
|
46
|
+
* JWK thumbprint used as the key identifier.
|
|
47
|
+
*/
|
|
48
|
+
keyId?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type GeneratedKeyPair = CachedKeyPair & { keyId: string };
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Token-binding key metadata emitted in performance measurements.
|
|
55
|
+
*/
|
|
56
|
+
export type TokenBindingKeyTelemetry = {
|
|
57
|
+
/**
|
|
58
|
+
* Protocol or token-binding family that owns the key.
|
|
59
|
+
*/
|
|
60
|
+
tokenBindingKeyType?: string;
|
|
61
|
+
/**
|
|
62
|
+
* JOSE algorithm policy associated with the key.
|
|
63
|
+
*/
|
|
64
|
+
tokenBindingKeyAlgorithm?: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Owns browser token-binding key lifecycle and storage lookup.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export class TokenBindingKeyManager implements ITokenBindingKeyManager {
|
|
72
|
+
private static TOKEN_BINDING_KEY_USAGES: Array<KeyUsage> = [
|
|
73
|
+
"sign",
|
|
74
|
+
"verify",
|
|
75
|
+
];
|
|
76
|
+
private static tokenBindingKeyStorage: AsyncMemoryStorage<CachedKeyPair>;
|
|
77
|
+
private cache: AsyncMemoryStorage<CachedKeyPair>;
|
|
78
|
+
private logger: Logger;
|
|
79
|
+
private performanceClient: IPerformanceClient | undefined;
|
|
80
|
+
|
|
81
|
+
constructor(logger: Logger, performanceClient?: IPerformanceClient) {
|
|
82
|
+
this.logger = logger;
|
|
83
|
+
this.cache = TokenBindingKeyManager.getTokenBindingKeyStorage(
|
|
84
|
+
this.logger
|
|
85
|
+
);
|
|
86
|
+
this.performanceClient = performanceClient;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private static getTokenBindingKeyStorage(
|
|
90
|
+
logger: Logger
|
|
91
|
+
): AsyncMemoryStorage<CachedKeyPair> {
|
|
92
|
+
if (!TokenBindingKeyManager.tokenBindingKeyStorage) {
|
|
93
|
+
TokenBindingKeyManager.tokenBindingKeyStorage =
|
|
94
|
+
new AsyncMemoryStorage<CachedKeyPair>(logger);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return TokenBindingKeyManager.tokenBindingKeyStorage;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Provisions a browser token-binding key and returns its key identifier.
|
|
102
|
+
* @param request - Key provisioning policy.
|
|
103
|
+
*/
|
|
104
|
+
async provisionTokenBindingKey(
|
|
105
|
+
request: TokenBindingKeyProvisioningParameters
|
|
106
|
+
): Promise<string> {
|
|
107
|
+
const publicKeyThumbMeasurement =
|
|
108
|
+
this.performanceClient?.startMeasurement(
|
|
109
|
+
BrowserPerformanceEvents.CryptoOptsGetPublicKeyThumbprint,
|
|
110
|
+
request.correlationId
|
|
111
|
+
);
|
|
112
|
+
try {
|
|
113
|
+
const activeKeyPair = await this.createTokenBindingKey(request);
|
|
114
|
+
|
|
115
|
+
publicKeyThumbMeasurement?.end({
|
|
116
|
+
success: true,
|
|
117
|
+
...this.getTokenBindingKeyTelemetry(activeKeyPair),
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
return activeKeyPair.keyId;
|
|
121
|
+
} catch (e) {
|
|
122
|
+
publicKeyThumbMeasurement?.end({
|
|
123
|
+
success: false,
|
|
124
|
+
tokenBindingKeyType: request.tokenBindingKeyType,
|
|
125
|
+
tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
|
|
126
|
+
});
|
|
127
|
+
throw e;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Removes a browser token-binding key by identifier.
|
|
133
|
+
* @param kid - Token-binding key identifier.
|
|
134
|
+
* @param correlationId - Request correlation identifier.
|
|
135
|
+
*/
|
|
136
|
+
async removeTokenBindingKey(
|
|
137
|
+
kid: string,
|
|
138
|
+
correlationId: string
|
|
139
|
+
): Promise<void> {
|
|
140
|
+
await this.cache.removeItem(kid, correlationId);
|
|
141
|
+
const keyFound = await this.cache.containsKey(kid, correlationId);
|
|
142
|
+
if (keyFound) {
|
|
143
|
+
throw createClientAuthError(
|
|
144
|
+
ClientAuthErrorCodes.bindingKeyNotRemoved,
|
|
145
|
+
correlationId
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Clears browser token-binding keys from memory and persistent storage.
|
|
152
|
+
* @param correlationId - Request correlation identifier.
|
|
153
|
+
*/
|
|
154
|
+
async clearKeystore(correlationId: string): Promise<boolean> {
|
|
155
|
+
this.cache.clearInMemory(correlationId);
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
await this.cache.clearPersistent(correlationId);
|
|
159
|
+
return true;
|
|
160
|
+
} catch (e) {
|
|
161
|
+
if (e instanceof Error) {
|
|
162
|
+
this.logger.error(
|
|
163
|
+
`Clearing keystore failed with error: '${e.message}'`,
|
|
164
|
+
correlationId
|
|
165
|
+
);
|
|
166
|
+
} else {
|
|
167
|
+
this.logger.error(
|
|
168
|
+
"Clearing keystore failed with unknown error",
|
|
169
|
+
correlationId
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Gets a token-binding public key as a JWK by identifier.
|
|
179
|
+
* @param keyId - Token-binding key identifier.
|
|
180
|
+
* @param correlationId - Request correlation identifier.
|
|
181
|
+
*/
|
|
182
|
+
async getTokenBindingPublicKeyJwk(
|
|
183
|
+
keyId: string,
|
|
184
|
+
correlationId: string
|
|
185
|
+
): Promise<JsonWebKey> {
|
|
186
|
+
const cachedKeyPair = await this.getTokenBindingKeyPair(
|
|
187
|
+
keyId,
|
|
188
|
+
correlationId
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
return BrowserCrypto.exportJwk(cachedKeyPair.publicKey);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private async createTokenBindingKey(
|
|
195
|
+
request: TokenBindingKeyProvisioningParameters
|
|
196
|
+
): Promise<GeneratedKeyPair> {
|
|
197
|
+
const keyGenAlgorithm = this.getTokenBindingKeyGenAlgorithmOptions(
|
|
198
|
+
request.tokenBindingKeyAlgorithm,
|
|
199
|
+
request.correlationId
|
|
200
|
+
);
|
|
201
|
+
const generatedKeyPair = await this.generateKeyPairAndThumbprint(
|
|
202
|
+
TokenBindingKeyManager.TOKEN_BINDING_KEY_USAGES,
|
|
203
|
+
keyGenAlgorithm,
|
|
204
|
+
request.correlationId
|
|
205
|
+
);
|
|
206
|
+
await this.cache.setItem(
|
|
207
|
+
generatedKeyPair.keyId,
|
|
208
|
+
{
|
|
209
|
+
...generatedKeyPair,
|
|
210
|
+
tokenBindingKeyType: request.tokenBindingKeyType,
|
|
211
|
+
tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
|
|
212
|
+
},
|
|
213
|
+
request.correlationId
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
...generatedKeyPair,
|
|
218
|
+
tokenBindingKeyType: request.tokenBindingKeyType,
|
|
219
|
+
tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
private async generateKeyPairAndThumbprint(
|
|
224
|
+
usages: Array<KeyUsage>,
|
|
225
|
+
keyGenAlgorithm: AlgorithmIdentifier,
|
|
226
|
+
correlationId: string
|
|
227
|
+
): Promise<GeneratedKeyPair> {
|
|
228
|
+
const keyPair: CryptoKeyPair = await BrowserCrypto.generateKeyPair(
|
|
229
|
+
false,
|
|
230
|
+
usages,
|
|
231
|
+
keyGenAlgorithm
|
|
232
|
+
);
|
|
233
|
+
const publicJwk: JsonWebKey = await BrowserCrypto.exportJwk(
|
|
234
|
+
keyPair.publicKey
|
|
235
|
+
);
|
|
236
|
+
const keyId = await BrowserCrypto.computeJwkThumbprint(
|
|
237
|
+
publicJwk,
|
|
238
|
+
correlationId
|
|
239
|
+
);
|
|
240
|
+
return {
|
|
241
|
+
publicKey: keyPair.publicKey,
|
|
242
|
+
privateKey: keyPair.privateKey,
|
|
243
|
+
keyId,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** @internal */
|
|
248
|
+
async getTokenBindingKeyPair(
|
|
249
|
+
keyId: string,
|
|
250
|
+
correlationId: string
|
|
251
|
+
): Promise<CachedKeyPair> {
|
|
252
|
+
const cachedKeyPair = await this.cache.getItem(keyId, correlationId);
|
|
253
|
+
if (!cachedKeyPair) {
|
|
254
|
+
throw createBrowserAuthError(
|
|
255
|
+
BrowserAuthErrorCodes.cryptoKeyNotFound,
|
|
256
|
+
correlationId
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return cachedKeyPair;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** @internal */
|
|
264
|
+
getTokenBindingKeyTelemetry(
|
|
265
|
+
cachedKeyPair: CachedKeyPair,
|
|
266
|
+
fallbackAlgorithm?: string
|
|
267
|
+
): TokenBindingKeyTelemetry {
|
|
268
|
+
return {
|
|
269
|
+
...(cachedKeyPair.tokenBindingKeyType && {
|
|
270
|
+
tokenBindingKeyType: cachedKeyPair.tokenBindingKeyType,
|
|
271
|
+
}),
|
|
272
|
+
...(cachedKeyPair.tokenBindingKeyAlgorithm || fallbackAlgorithm
|
|
273
|
+
? {
|
|
274
|
+
tokenBindingKeyAlgorithm:
|
|
275
|
+
cachedKeyPair.tokenBindingKeyAlgorithm ||
|
|
276
|
+
fallbackAlgorithm,
|
|
277
|
+
}
|
|
278
|
+
: {}),
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
private getTokenBindingKeyGenAlgorithmOptions(
|
|
283
|
+
tokenBindingKeyAlgorithm: string,
|
|
284
|
+
correlationId: string
|
|
285
|
+
): AlgorithmIdentifier {
|
|
286
|
+
if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.RS256) {
|
|
287
|
+
return BrowserCrypto.RSA_KEYGEN_ALGORITHM_OPTIONS;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.ES256) {
|
|
291
|
+
return BrowserCrypto.ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
throw createBrowserAuthError(
|
|
295
|
+
BrowserAuthErrorCodes.unsupportedTokenBindingAlgorithm,
|
|
296
|
+
correlationId
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
@@ -127,7 +127,8 @@ export class CustomAuthStandardController
|
|
|
127
127
|
this.customAuthConfig.customAuth?.requestInterceptor,
|
|
128
128
|
this.logger
|
|
129
129
|
),
|
|
130
|
-
this.authority
|
|
130
|
+
this.authority,
|
|
131
|
+
this.tokenBindingKeyManager
|
|
131
132
|
);
|
|
132
133
|
|
|
133
134
|
this.signInClient = interactionClientFactory.create(SignInClient);
|
|
@@ -13,6 +13,7 @@ import { BrowserCacheManager } from "../../../cache/BrowserCacheManager.js";
|
|
|
13
13
|
import {
|
|
14
14
|
Constants,
|
|
15
15
|
ICrypto,
|
|
16
|
+
ITokenBindingKeyManager,
|
|
16
17
|
IPerformanceClient,
|
|
17
18
|
Logger,
|
|
18
19
|
ResponseHandler,
|
|
@@ -39,7 +40,8 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
|
|
|
39
40
|
navigationClient: INavigationClient,
|
|
40
41
|
performanceClient: IPerformanceClient,
|
|
41
42
|
protected customAuthApiClient: ICustomAuthApiClient,
|
|
42
|
-
protected customAuthAuthority: CustomAuthAuthority
|
|
43
|
+
protected customAuthAuthority: CustomAuthAuthority,
|
|
44
|
+
tokenBindingKeyManager?: ITokenBindingKeyManager
|
|
43
45
|
) {
|
|
44
46
|
super(
|
|
45
47
|
config,
|
|
@@ -49,7 +51,9 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
|
|
|
49
51
|
eventHandler,
|
|
50
52
|
navigationClient,
|
|
51
53
|
performanceClient,
|
|
52
|
-
""
|
|
54
|
+
"",
|
|
55
|
+
undefined,
|
|
56
|
+
tokenBindingKeyManager
|
|
53
57
|
);
|
|
54
58
|
|
|
55
59
|
this.tokenResponseHandler = new ResponseHandler(
|
|
@@ -59,7 +63,8 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
|
|
|
59
63
|
this.logger,
|
|
60
64
|
this.performanceClient,
|
|
61
65
|
null,
|
|
62
|
-
null
|
|
66
|
+
null,
|
|
67
|
+
this.tokenBindingKeyManager
|
|
63
68
|
);
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -10,6 +10,7 @@ import { BrowserConfiguration } from "../../../config/Configuration.js";
|
|
|
10
10
|
import { BrowserCacheManager } from "../../../cache/BrowserCacheManager.js";
|
|
11
11
|
import {
|
|
12
12
|
ICrypto,
|
|
13
|
+
ITokenBindingKeyManager,
|
|
13
14
|
IPerformanceClient,
|
|
14
15
|
Logger,
|
|
15
16
|
} from "@azure/msal-common/browser";
|
|
@@ -26,7 +27,8 @@ export class CustomAuthInterationClientFactory {
|
|
|
26
27
|
private navigationClient: INavigationClient,
|
|
27
28
|
private performanceClient: IPerformanceClient,
|
|
28
29
|
private customAuthApiClient: ICustomAuthApiClient,
|
|
29
|
-
private customAuthAuthority: CustomAuthAuthority
|
|
30
|
+
private customAuthAuthority: CustomAuthAuthority,
|
|
31
|
+
private tokenBindingKeyManager: ITokenBindingKeyManager
|
|
30
32
|
) {}
|
|
31
33
|
|
|
32
34
|
create<TClient extends CustomAuthInteractionClientBase>(
|
|
@@ -39,7 +41,8 @@ export class CustomAuthInterationClientFactory {
|
|
|
39
41
|
navigationClient: INavigationClient,
|
|
40
42
|
performanceClient: IPerformanceClient,
|
|
41
43
|
customAuthApiClient: ICustomAuthApiClient,
|
|
42
|
-
customAuthAuthority: CustomAuthAuthority
|
|
44
|
+
customAuthAuthority: CustomAuthAuthority,
|
|
45
|
+
tokenBindingKeyManager?: ITokenBindingKeyManager
|
|
43
46
|
) => TClient
|
|
44
47
|
): TClient {
|
|
45
48
|
return new clientConstructor(
|
|
@@ -51,7 +54,8 @@ export class CustomAuthInterationClientFactory {
|
|
|
51
54
|
this.navigationClient,
|
|
52
55
|
this.performanceClient,
|
|
53
56
|
this.customAuthApiClient,
|
|
54
|
-
this.customAuthAuthority
|
|
57
|
+
this.customAuthAuthority,
|
|
58
|
+
this.tokenBindingKeyManager
|
|
55
59
|
);
|
|
56
60
|
}
|
|
57
61
|
}
|
|
@@ -212,6 +212,7 @@ export class CustomAuthSilentCacheClient extends CustomAuthInteractionClientBase
|
|
|
212
212
|
correlationId: correlationId,
|
|
213
213
|
},
|
|
214
214
|
cryptoInterface: this.browserCrypto,
|
|
215
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
215
216
|
networkInterface: this.networkClient,
|
|
216
217
|
storageInterface: this.browserStorage,
|
|
217
218
|
serverTelemetryManager: serverTelemetryManager,
|
|
@@ -60,6 +60,12 @@ export const uninitializedPublicClientApplication =
|
|
|
60
60
|
export const nativePromptNotSupported = "native_prompt_not_supported";
|
|
61
61
|
export const invalidBase64String = "invalid_base64_string";
|
|
62
62
|
export const invalidPopTokenRequest = "invalid_pop_token_request";
|
|
63
|
+
export const unsupportedTokenBindingAlgorithm =
|
|
64
|
+
"unsupported_token_binding_algorithm";
|
|
65
|
+
export const tokenBindingKeyAlgorithmMismatch =
|
|
66
|
+
"token_binding_key_algorithm_mismatch";
|
|
67
|
+
export const tokenBindingKeyJwkThumbprintMismatch =
|
|
68
|
+
"token_binding_key_jwk_thumbprint_mismatch";
|
|
63
69
|
export const failedToBuildHeaders = "failed_to_build_headers";
|
|
64
70
|
export const failedToParseHeaders = "failed_to_parse_headers";
|
|
65
71
|
export const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
|
package/src/index.ts
CHANGED
|
@@ -66,6 +66,7 @@ export { AuthenticationResult } from "./response/AuthenticationResult.js";
|
|
|
66
66
|
export { ClearCacheRequest } from "./request/ClearCacheRequest.js";
|
|
67
67
|
export { InitializeApplicationRequest } from "./request/InitializeApplicationRequest.js";
|
|
68
68
|
export { HandleRedirectPromiseOptions } from "./request/HandleRedirectPromiseOptions.js";
|
|
69
|
+
export type { IWebBrokerBridgeMessage } from "./webBrokerBridge/IWebBrokerBridgeMessage.js";
|
|
69
70
|
|
|
70
71
|
// Cache
|
|
71
72
|
export { LoadTokenOptions } from "./cache/TokenCache.js";
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
AzureCloudOptions,
|
|
22
22
|
invokeAsync,
|
|
23
23
|
StringDict,
|
|
24
|
+
ITokenBindingKeyManager,
|
|
24
25
|
} from "@azure/msal-common/browser";
|
|
25
26
|
import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
|
|
26
27
|
import { BrowserConfiguration } from "../config/Configuration.js";
|
|
@@ -36,6 +37,7 @@ import { INavigationClient } from "../navigation/INavigationClient.js";
|
|
|
36
37
|
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
|
37
38
|
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
|
38
39
|
import { IPlatformAuthHandler } from "../broker/nativeBroker/IPlatformAuthHandler.js";
|
|
40
|
+
import { TokenBindingKeyManager } from "../crypto/TokenBindingKeyManager.js";
|
|
39
41
|
|
|
40
42
|
export abstract class BaseInteractionClient {
|
|
41
43
|
protected config: BrowserConfiguration;
|
|
@@ -48,6 +50,7 @@ export abstract class BaseInteractionClient {
|
|
|
48
50
|
protected platformAuthProvider: IPlatformAuthHandler | undefined;
|
|
49
51
|
protected correlationId: string;
|
|
50
52
|
protected performanceClient: IPerformanceClient;
|
|
53
|
+
protected tokenBindingKeyManager: ITokenBindingKeyManager;
|
|
51
54
|
|
|
52
55
|
constructor(
|
|
53
56
|
config: BrowserConfiguration,
|
|
@@ -58,7 +61,8 @@ export abstract class BaseInteractionClient {
|
|
|
58
61
|
navigationClient: INavigationClient,
|
|
59
62
|
performanceClient: IPerformanceClient,
|
|
60
63
|
correlationId: string,
|
|
61
|
-
platformAuthProvider?: IPlatformAuthHandler
|
|
64
|
+
platformAuthProvider?: IPlatformAuthHandler,
|
|
65
|
+
tokenBindingKeyManager?: ITokenBindingKeyManager
|
|
62
66
|
) {
|
|
63
67
|
this.config = config;
|
|
64
68
|
this.browserStorage = storageImpl;
|
|
@@ -70,6 +74,9 @@ export abstract class BaseInteractionClient {
|
|
|
70
74
|
this.correlationId = correlationId;
|
|
71
75
|
this.logger = logger.clone(name, version);
|
|
72
76
|
this.performanceClient = performanceClient;
|
|
77
|
+
this.tokenBindingKeyManager =
|
|
78
|
+
tokenBindingKeyManager ||
|
|
79
|
+
new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
abstract acquireToken(
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
StoreInCache,
|
|
31
31
|
TimeUtils,
|
|
32
32
|
TokenClaims,
|
|
33
|
+
ITokenBindingKeyManager,
|
|
33
34
|
UrlString,
|
|
34
35
|
buildAccountToCache,
|
|
35
36
|
createClientAuthError,
|
|
@@ -102,7 +103,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
102
103
|
provider: IPlatformAuthHandler,
|
|
103
104
|
accountId: string,
|
|
104
105
|
nativeStorageImpl: BrowserCacheManager,
|
|
105
|
-
correlationId: string
|
|
106
|
+
correlationId: string,
|
|
107
|
+
tokenBindingKeyManager?: ITokenBindingKeyManager
|
|
106
108
|
) {
|
|
107
109
|
super(
|
|
108
110
|
config,
|
|
@@ -113,7 +115,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
113
115
|
navigationClient,
|
|
114
116
|
performanceClient,
|
|
115
117
|
correlationId,
|
|
116
|
-
provider
|
|
118
|
+
provider,
|
|
119
|
+
tokenBindingKeyManager
|
|
117
120
|
);
|
|
118
121
|
this.apiId = apiId;
|
|
119
122
|
this.accountId = accountId;
|
|
@@ -128,7 +131,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
128
131
|
navigationClient,
|
|
129
132
|
performanceClient,
|
|
130
133
|
correlationId,
|
|
131
|
-
provider
|
|
134
|
+
provider,
|
|
135
|
+
this.tokenBindingKeyManager
|
|
132
136
|
);
|
|
133
137
|
|
|
134
138
|
const extensionName = this.platformAuthProvider.getExtensionName();
|
|
@@ -756,6 +760,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
756
760
|
// Generate SHR in msal js if WAM does not compute it when POP is enabled
|
|
757
761
|
const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(
|
|
758
762
|
this.browserCrypto,
|
|
763
|
+
this.tokenBindingKeyManager,
|
|
759
764
|
this.performanceClient
|
|
760
765
|
);
|
|
761
766
|
const shrParameters: SignedHttpRequestParameters = {
|
|
@@ -1186,6 +1191,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
1186
1191
|
|
|
1187
1192
|
const popTokenGenerator = new PopTokenGenerator(
|
|
1188
1193
|
this.browserCrypto,
|
|
1194
|
+
this.tokenBindingKeyManager,
|
|
1189
1195
|
this.performanceClient
|
|
1190
1196
|
);
|
|
1191
1197
|
|
|
@@ -20,11 +20,16 @@ import {
|
|
|
20
20
|
CommonAuthorizationUrlRequest,
|
|
21
21
|
ProtocolUtils,
|
|
22
22
|
Authority,
|
|
23
|
+
ITokenBindingKeyManager,
|
|
23
24
|
} from "@azure/msal-common/browser";
|
|
24
25
|
import {
|
|
25
26
|
initializeAuthorizationRequest,
|
|
26
27
|
StandardInteractionClient,
|
|
27
28
|
} from "./StandardInteractionClient.js";
|
|
29
|
+
import {
|
|
30
|
+
getTokenBindingRequestParams,
|
|
31
|
+
validateRequestMethod,
|
|
32
|
+
} from "../request/RequestHelpers.js";
|
|
28
33
|
import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
|
|
29
34
|
import { EventType } from "../event/EventType.js";
|
|
30
35
|
import {
|
|
@@ -60,7 +65,6 @@ import {
|
|
|
60
65
|
getDiscoveredAuthority,
|
|
61
66
|
initializeServerTelemetryManager,
|
|
62
67
|
} from "./BaseInteractionClient.js";
|
|
63
|
-
import { validateRequestMethod } from "../request/RequestHelpers.js";
|
|
64
68
|
|
|
65
69
|
/**
|
|
66
70
|
* Signature of the popup-response handler supplied by
|
|
@@ -100,7 +104,8 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
100
104
|
nativeStorageImpl: BrowserCacheManager,
|
|
101
105
|
correlationId: string,
|
|
102
106
|
platformAuthHandler?: IPlatformAuthHandler,
|
|
103
|
-
waitForPopupResponseHook?: WaitForPopupResponseFn
|
|
107
|
+
waitForPopupResponseHook?: WaitForPopupResponseFn,
|
|
108
|
+
tokenBindingKeyManager?: ITokenBindingKeyManager
|
|
104
109
|
) {
|
|
105
110
|
super(
|
|
106
111
|
config,
|
|
@@ -111,7 +116,8 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
111
116
|
navigationClient,
|
|
112
117
|
performanceClient,
|
|
113
118
|
correlationId,
|
|
114
|
-
platformAuthHandler
|
|
119
|
+
platformAuthHandler,
|
|
120
|
+
tokenBindingKeyManager
|
|
115
121
|
);
|
|
116
122
|
this.nativeStorage = nativeStorageImpl;
|
|
117
123
|
this.eventHandler = eventHandler;
|
|
@@ -334,9 +340,16 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
334
340
|
correlationId
|
|
335
341
|
)(this.performanceClient, this.logger, correlationId));
|
|
336
342
|
|
|
343
|
+
const tokenBindingParams = await getTokenBindingRequestParams(
|
|
344
|
+
request,
|
|
345
|
+
this.tokenBindingKeyManager,
|
|
346
|
+
this.logger,
|
|
347
|
+
this.performanceClient
|
|
348
|
+
);
|
|
337
349
|
const popupRequest = {
|
|
338
350
|
...request,
|
|
339
351
|
codeChallenge: pkce.challenge,
|
|
352
|
+
...tokenBindingParams,
|
|
340
353
|
};
|
|
341
354
|
|
|
342
355
|
try {
|
|
@@ -435,7 +448,7 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
435
448
|
this.performanceClient,
|
|
436
449
|
correlationId
|
|
437
450
|
)(
|
|
438
|
-
|
|
451
|
+
popupRequest,
|
|
439
452
|
serverParams,
|
|
440
453
|
pkce.verifier,
|
|
441
454
|
ApiId.acquireTokenPopup,
|
|
@@ -512,10 +525,17 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
512
525
|
this.performanceClient,
|
|
513
526
|
correlationId
|
|
514
527
|
)(this.performanceClient, this.logger, correlationId));
|
|
528
|
+
const tokenBindingParams = await getTokenBindingRequestParams(
|
|
529
|
+
request,
|
|
530
|
+
this.tokenBindingKeyManager,
|
|
531
|
+
this.logger,
|
|
532
|
+
this.performanceClient
|
|
533
|
+
);
|
|
515
534
|
const popupRequest = {
|
|
516
535
|
...request,
|
|
517
536
|
earJwk: earJwk,
|
|
518
537
|
codeChallenge: pkce.challenge,
|
|
538
|
+
...tokenBindingParams,
|
|
519
539
|
};
|
|
520
540
|
const popupWindow = await this.openPostFormPopup(
|
|
521
541
|
popupRequest,
|
|
@@ -20,11 +20,13 @@ import {
|
|
|
20
20
|
InProgressPerformanceEvent,
|
|
21
21
|
CommonAuthorizationUrlRequest,
|
|
22
22
|
ProtocolUtils,
|
|
23
|
+
ITokenBindingKeyManager,
|
|
23
24
|
} from "@azure/msal-common/browser";
|
|
24
25
|
import {
|
|
25
26
|
initializeAuthorizationRequest,
|
|
26
27
|
StandardInteractionClient,
|
|
27
28
|
} from "./StandardInteractionClient.js";
|
|
29
|
+
import { getTokenBindingRequestParams } from "../request/RequestHelpers.js";
|
|
28
30
|
import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
|
|
29
31
|
import {
|
|
30
32
|
ApiId,
|
|
@@ -89,7 +91,8 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
89
91
|
performanceClient: IPerformanceClient,
|
|
90
92
|
nativeStorageImpl: BrowserCacheManager,
|
|
91
93
|
correlationId: string,
|
|
92
|
-
platformAuthHandler?: IPlatformAuthHandler
|
|
94
|
+
platformAuthHandler?: IPlatformAuthHandler,
|
|
95
|
+
tokenBindingKeyManager?: ITokenBindingKeyManager
|
|
93
96
|
) {
|
|
94
97
|
super(
|
|
95
98
|
config,
|
|
@@ -100,7 +103,8 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
100
103
|
navigationClient,
|
|
101
104
|
performanceClient,
|
|
102
105
|
correlationId,
|
|
103
|
-
platformAuthHandler
|
|
106
|
+
platformAuthHandler,
|
|
107
|
+
tokenBindingKeyManager
|
|
104
108
|
);
|
|
105
109
|
this.nativeStorage = nativeStorageImpl;
|
|
106
110
|
}
|
|
@@ -210,9 +214,16 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
210
214
|
correlationId
|
|
211
215
|
)(this.performanceClient, this.logger, correlationId);
|
|
212
216
|
|
|
217
|
+
const tokenBindingParams = await getTokenBindingRequestParams(
|
|
218
|
+
request,
|
|
219
|
+
this.tokenBindingKeyManager,
|
|
220
|
+
this.logger,
|
|
221
|
+
this.performanceClient
|
|
222
|
+
);
|
|
213
223
|
const redirectRequest = {
|
|
214
224
|
...request,
|
|
215
225
|
codeChallenge: pkceCodes.challenge,
|
|
226
|
+
...tokenBindingParams,
|
|
216
227
|
};
|
|
217
228
|
|
|
218
229
|
this.browserStorage.cacheAuthorizeRequest(
|
|
@@ -315,10 +326,17 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
315
326
|
correlationId
|
|
316
327
|
)(this.performanceClient, this.logger, correlationId);
|
|
317
328
|
|
|
329
|
+
const tokenBindingParams = await getTokenBindingRequestParams(
|
|
330
|
+
request,
|
|
331
|
+
this.tokenBindingKeyManager,
|
|
332
|
+
this.logger,
|
|
333
|
+
this.performanceClient
|
|
334
|
+
);
|
|
318
335
|
const redirectRequest = {
|
|
319
336
|
...request,
|
|
320
337
|
earJwk: earJwk,
|
|
321
338
|
codeChallenge: pkceCodes.challenge,
|
|
339
|
+
...tokenBindingParams,
|
|
322
340
|
};
|
|
323
341
|
|
|
324
342
|
this.browserStorage.cacheAuthorizeRequest(
|