@azure/msal-browser 5.17.3 → 5.19.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 +15 -7
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +34 -17
- 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/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 +30 -9
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +3 -3
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +3 -3
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +3 -3
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +3 -3
- 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 +1196 -1200
- 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 +54 -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 +5 -3
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +11 -3
- 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 +4542 -4060
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +4542 -4060
- 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 +1030 -432
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +1030 -432
- 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/broker/nativeBroker/PlatformAuthRequest.ts +2 -1
- package/src/cache/AsyncMemoryStorage.ts +7 -13
- package/src/cache/BrowserCacheManager.ts +24 -6
- package/src/controllers/StandardController.ts +58 -15
- 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/interaction_client/BaseInteractionClient.ts +8 -1
- package/src/interaction_client/PlatformAuthInteractionClient.ts +44 -6
- package/src/interaction_client/PopupClient.ts +5 -2
- package/src/interaction_client/RedirectClient.ts +5 -2
- package/src/interaction_client/SilentAuthCodeClient.ts +5 -2
- package/src/interaction_client/SilentIframeClient.ts +5 -2
- package/src/interaction_client/StandardInteractionClient.ts +1 -0
- package/src/naa/BridgeProxy.ts +38 -44
- package/src/naa/TokenRequest.ts +1 -0
- package/src/naa/mapping/NestedAppAuthAdapter.ts +62 -55
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +8 -1
- package/src/request/RequestHelpers.ts +19 -2
- package/src/telemetry/BrowserPerformanceEvents.ts +4 -4
- package/src/webBrokerBridge/IWebBrokerBridgeMessage.ts +42 -0
- package/src/webBrokerBridge/PendingRequestRegistry.ts +76 -0
- package/src/webBrokerBridge/WebBrokerBridgeError.ts +69 -0
- package/src/webBrokerBridge/WebBrokerBridgeErrorMap.ts +108 -0
- package/src/webBrokerBridge/index.ts +25 -0
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +1 -0
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
- package/types/cache/AsyncMemoryStorage.d.ts +1 -2
- package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +7 -5
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +2 -1
- package/types/controllers/StandardController.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 +1 -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/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/TokenRequest.d.ts +1 -0
- package/types/naa/TokenRequest.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.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +4 -4
- package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts +35 -0
- package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts.map +1 -0
- package/types/webBrokerBridge/PendingRequestRegistry.d.ts +27 -0
- package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -0
- package/types/webBrokerBridge/WebBrokerBridgeError.d.ts +50 -0
- package/types/webBrokerBridge/WebBrokerBridgeError.d.ts.map +1 -0
- package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts +10 -0
- package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts.map +1 -0
- package/types/webBrokerBridge/index.d.ts +16 -0
- package/types/webBrokerBridge/index.d.ts.map +1 -0
- package/src/naa/BridgeRequest.ts +0 -16
- package/types/naa/BridgeRequest.d.ts +0 -8
- package/types/naa/BridgeRequest.d.ts.map +0 -1
|
@@ -237,7 +237,7 @@ export async function importJwk(
|
|
|
237
237
|
*/
|
|
238
238
|
export async function sign(
|
|
239
239
|
key: CryptoKey,
|
|
240
|
-
data:
|
|
240
|
+
data: BufferSource,
|
|
241
241
|
algorithm: AlgorithmIdentifier
|
|
242
242
|
): Promise<ArrayBuffer> {
|
|
243
243
|
return window.crypto.subtle.sign(
|
|
@@ -463,13 +463,14 @@ const JWK_THUMBPRINT_REQUIRED_MEMBERS: Record<string, Array<string>> = {
|
|
|
463
463
|
};
|
|
464
464
|
|
|
465
465
|
function getJwkThumbprintMembers(
|
|
466
|
-
publicJwk: JsonWebKey
|
|
466
|
+
publicJwk: JsonWebKey,
|
|
467
|
+
correlationId: string
|
|
467
468
|
): Record<string, string> {
|
|
468
469
|
const kty = publicJwk.kty;
|
|
469
470
|
if (typeof kty !== "string" || kty.length === 0) {
|
|
470
471
|
throw createBrowserAuthError(
|
|
471
472
|
BrowserAuthErrorCodes.invalidPublicJwk,
|
|
472
|
-
|
|
473
|
+
correlationId,
|
|
473
474
|
MISSING_JWK_KTY_SUBERROR
|
|
474
475
|
);
|
|
475
476
|
}
|
|
@@ -478,7 +479,7 @@ function getJwkThumbprintMembers(
|
|
|
478
479
|
if (!requiredMembers) {
|
|
479
480
|
throw createBrowserAuthError(
|
|
480
481
|
BrowserAuthErrorCodes.invalidPublicJwk,
|
|
481
|
-
|
|
482
|
+
correlationId,
|
|
482
483
|
UNSUPPORTED_JWK_KTY_SUBERROR
|
|
483
484
|
);
|
|
484
485
|
}
|
|
@@ -488,7 +489,7 @@ function getJwkThumbprintMembers(
|
|
|
488
489
|
if (typeof memberValue !== "string") {
|
|
489
490
|
throw createBrowserAuthError(
|
|
490
491
|
BrowserAuthErrorCodes.invalidPublicJwk,
|
|
491
|
-
|
|
492
|
+
correlationId,
|
|
492
493
|
MISSING_JWK_MEMBER_SUBERROR
|
|
493
494
|
);
|
|
494
495
|
}
|
|
@@ -496,7 +497,7 @@ function getJwkThumbprintMembers(
|
|
|
496
497
|
if (memberValue.length === 0) {
|
|
497
498
|
throw createBrowserAuthError(
|
|
498
499
|
BrowserAuthErrorCodes.invalidPublicJwk,
|
|
499
|
-
|
|
500
|
+
correlationId,
|
|
500
501
|
EMPTY_JWK_MEMBER_SUBERROR
|
|
501
502
|
);
|
|
502
503
|
}
|
|
@@ -513,9 +514,10 @@ function getJwkThumbprintMembers(
|
|
|
513
514
|
* @internal
|
|
514
515
|
*/
|
|
515
516
|
export async function computeJwkThumbprint(
|
|
516
|
-
publicJwk: JsonWebKey
|
|
517
|
+
publicJwk: JsonWebKey,
|
|
518
|
+
correlationId: string
|
|
517
519
|
): Promise<string> {
|
|
518
|
-
const thumbprintMembers = getJwkThumbprintMembers(publicJwk);
|
|
520
|
+
const thumbprintMembers = getJwkThumbprintMembers(publicJwk, correlationId);
|
|
519
521
|
// RFC 7638 §3.3: use only required members, sorted lexicographically
|
|
520
522
|
const thumbprintJson = JSON.stringify(
|
|
521
523
|
thumbprintMembers,
|
package/src/crypto/CryptoOps.ts
CHANGED
|
@@ -4,15 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
ClientAuthErrorCodes,
|
|
8
|
-
createClientAuthError,
|
|
9
7
|
ICrypto,
|
|
10
8
|
IPerformanceClient,
|
|
9
|
+
JsonWebTokenAlgorithms,
|
|
11
10
|
JoseHeader,
|
|
12
11
|
Logger,
|
|
13
|
-
ShrOptions,
|
|
14
|
-
SignedHttpRequest,
|
|
15
|
-
SignedHttpRequestParameters,
|
|
16
12
|
} from "@azure/msal-common/browser";
|
|
17
13
|
import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
|
|
18
14
|
import {
|
|
@@ -23,17 +19,14 @@ import {
|
|
|
23
19
|
import { base64Decode } from "../encode/Base64Decode.js";
|
|
24
20
|
import * as BrowserCrypto from "./BrowserCrypto.js";
|
|
25
21
|
import {
|
|
26
|
-
|
|
22
|
+
CachedKeyPair,
|
|
23
|
+
TokenBindingKeyTelemetry,
|
|
24
|
+
TokenBindingKeyManager,
|
|
25
|
+
} from "./TokenBindingKeyManager.js";
|
|
26
|
+
import {
|
|
27
27
|
BrowserAuthErrorCodes,
|
|
28
|
+
createBrowserAuthError,
|
|
28
29
|
} from "../error/BrowserAuthError.js";
|
|
29
|
-
import { AsyncMemoryStorage } from "../cache/AsyncMemoryStorage.js";
|
|
30
|
-
|
|
31
|
-
export type CachedKeyPair = {
|
|
32
|
-
publicKey: CryptoKey;
|
|
33
|
-
privateKey: CryptoKey;
|
|
34
|
-
requestMethod?: string;
|
|
35
|
-
requestUri?: string;
|
|
36
|
-
};
|
|
37
30
|
|
|
38
31
|
/**
|
|
39
32
|
* This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
@@ -47,10 +40,7 @@ export class CryptoOps implements ICrypto {
|
|
|
47
40
|
* meaning there won't be a performance manager available.
|
|
48
41
|
*/
|
|
49
42
|
private performanceClient: IPerformanceClient | undefined;
|
|
50
|
-
|
|
51
|
-
private static POP_KEY_USAGES: Array<KeyUsage> = ["sign", "verify"];
|
|
52
|
-
private static EXTRACTABLE: boolean = true;
|
|
53
|
-
private cache: AsyncMemoryStorage<CachedKeyPair>;
|
|
43
|
+
private tokenBindingKeyManager: TokenBindingKeyManager;
|
|
54
44
|
|
|
55
45
|
constructor(
|
|
56
46
|
logger: Logger,
|
|
@@ -62,8 +52,11 @@ export class CryptoOps implements ICrypto {
|
|
|
62
52
|
BrowserCrypto.validateCryptoAvailable(
|
|
63
53
|
skipValidateSubtleCrypto ?? false
|
|
64
54
|
);
|
|
65
|
-
this.cache = new AsyncMemoryStorage<CachedKeyPair>(this.logger);
|
|
66
55
|
this.performanceClient = performanceClient;
|
|
56
|
+
this.tokenBindingKeyManager = new TokenBindingKeyManager(
|
|
57
|
+
this.logger,
|
|
58
|
+
this.performanceClient
|
|
59
|
+
);
|
|
67
60
|
}
|
|
68
61
|
|
|
69
62
|
/**
|
|
@@ -107,69 +100,6 @@ export class CryptoOps implements ICrypto {
|
|
|
107
100
|
return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));
|
|
108
101
|
}
|
|
109
102
|
|
|
110
|
-
/**
|
|
111
|
-
* Generates a keypair, stores it and returns a thumbprint
|
|
112
|
-
* @param request
|
|
113
|
-
*/
|
|
114
|
-
async getPublicKeyThumbprint(
|
|
115
|
-
request: SignedHttpRequestParameters
|
|
116
|
-
): Promise<string> {
|
|
117
|
-
const publicKeyThumbMeasurement =
|
|
118
|
-
this.performanceClient?.startMeasurement(
|
|
119
|
-
BrowserPerformanceEvents.CryptoOptsGetPublicKeyThumbprint,
|
|
120
|
-
request.correlationId
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
// Generate Keypair
|
|
124
|
-
const keyPair: CryptoKeyPair = await BrowserCrypto.generateKeyPair(
|
|
125
|
-
CryptoOps.EXTRACTABLE,
|
|
126
|
-
CryptoOps.POP_KEY_USAGES,
|
|
127
|
-
BrowserCrypto.RSA_KEYGEN_ALGORITHM_OPTIONS
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
// Generate Thumbprint for Public Key
|
|
131
|
-
const publicKeyJwk: JsonWebKey = await BrowserCrypto.exportJwk(
|
|
132
|
-
keyPair.publicKey
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
const publicJwkHash = await BrowserCrypto.computeJwkThumbprint(
|
|
136
|
-
publicKeyJwk
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
// Generate Thumbprint for Private Key
|
|
140
|
-
const privateKeyJwk: JsonWebKey = await BrowserCrypto.exportJwk(
|
|
141
|
-
keyPair.privateKey
|
|
142
|
-
);
|
|
143
|
-
// Re-import private key to make it unextractable
|
|
144
|
-
const unextractablePrivateKey: CryptoKey =
|
|
145
|
-
await BrowserCrypto.importJwk(
|
|
146
|
-
privateKeyJwk,
|
|
147
|
-
false,
|
|
148
|
-
["sign"],
|
|
149
|
-
BrowserCrypto.RSA_KEYGEN_ALGORITHM_OPTIONS
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
// Store Keypair data in keystore
|
|
153
|
-
await this.cache.setItem(
|
|
154
|
-
publicJwkHash,
|
|
155
|
-
{
|
|
156
|
-
privateKey: unextractablePrivateKey,
|
|
157
|
-
publicKey: keyPair.publicKey,
|
|
158
|
-
requestMethod: request.resourceRequestMethod,
|
|
159
|
-
requestUri: request.resourceRequestUri,
|
|
160
|
-
},
|
|
161
|
-
request.correlationId
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
if (publicKeyThumbMeasurement) {
|
|
165
|
-
publicKeyThumbMeasurement.end({
|
|
166
|
-
success: true,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return publicJwkHash;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
103
|
/**
|
|
174
104
|
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
175
105
|
* @param kid
|
|
@@ -179,14 +109,10 @@ export class CryptoOps implements ICrypto {
|
|
|
179
109
|
kid: string,
|
|
180
110
|
correlationId: string
|
|
181
111
|
): Promise<void> {
|
|
182
|
-
await this.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
ClientAuthErrorCodes.bindingKeyNotRemoved,
|
|
187
|
-
correlationId
|
|
188
|
-
);
|
|
189
|
-
}
|
|
112
|
+
await this.tokenBindingKeyManager.removeTokenBindingKey(
|
|
113
|
+
kid,
|
|
114
|
+
correlationId
|
|
115
|
+
);
|
|
190
116
|
}
|
|
191
117
|
|
|
192
118
|
/**
|
|
@@ -194,115 +120,149 @@ export class CryptoOps implements ICrypto {
|
|
|
194
120
|
* @param correlationId
|
|
195
121
|
*/
|
|
196
122
|
async clearKeystore(correlationId: string): Promise<boolean> {
|
|
197
|
-
|
|
198
|
-
|
|
123
|
+
return this.tokenBindingKeyManager.clearKeystore(correlationId);
|
|
124
|
+
}
|
|
199
125
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
126
|
+
/** @internal */
|
|
127
|
+
async signTokenBindingJwt(
|
|
128
|
+
header: JoseHeader,
|
|
129
|
+
payload: object,
|
|
130
|
+
kid: string,
|
|
131
|
+
correlationId: string
|
|
132
|
+
): Promise<string> {
|
|
133
|
+
let telemetry: TokenBindingKeyTelemetry = {};
|
|
134
|
+
const signTokenBindingJwtMeasurement =
|
|
135
|
+
this.performanceClient?.startMeasurement(
|
|
136
|
+
BrowserPerformanceEvents.CryptoOptsSignJwt,
|
|
137
|
+
correlationId
|
|
138
|
+
);
|
|
204
139
|
try {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (e instanceof Error) {
|
|
209
|
-
this.logger.error(
|
|
210
|
-
`Clearing keystore failed with error: '${e.message}'`,
|
|
211
|
-
correlationId
|
|
212
|
-
);
|
|
213
|
-
} else {
|
|
214
|
-
this.logger.error(
|
|
215
|
-
"Clearing keystore failed with unknown error",
|
|
140
|
+
const cachedKeyPair =
|
|
141
|
+
await this.tokenBindingKeyManager.getTokenBindingKeyPair(
|
|
142
|
+
kid,
|
|
216
143
|
correlationId
|
|
217
144
|
);
|
|
218
|
-
|
|
145
|
+
await this.validateTokenBindingJwtHeaderKey(
|
|
146
|
+
header,
|
|
147
|
+
kid,
|
|
148
|
+
correlationId
|
|
149
|
+
);
|
|
150
|
+
telemetry = this.tokenBindingKeyManager.getTokenBindingKeyTelemetry(
|
|
151
|
+
cachedKeyPair,
|
|
152
|
+
header.alg
|
|
153
|
+
);
|
|
219
154
|
|
|
220
|
-
|
|
155
|
+
const signingAlgorithm = this.getTokenBindingKeySigningAlgorithm(
|
|
156
|
+
cachedKeyPair,
|
|
157
|
+
header.alg,
|
|
158
|
+
correlationId
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const tokenString = `${urlEncode(
|
|
162
|
+
JSON.stringify(header)
|
|
163
|
+
)}.${urlEncode(JSON.stringify(payload))}`;
|
|
164
|
+
const encodedSignature = await this.signInput(
|
|
165
|
+
cachedKeyPair,
|
|
166
|
+
tokenString,
|
|
167
|
+
signingAlgorithm
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
signTokenBindingJwtMeasurement?.end({
|
|
171
|
+
success: true,
|
|
172
|
+
...telemetry,
|
|
173
|
+
});
|
|
174
|
+
return `${tokenString}.${encodedSignature}`;
|
|
175
|
+
} catch (e) {
|
|
176
|
+
signTokenBindingJwtMeasurement?.end({
|
|
177
|
+
success: false,
|
|
178
|
+
...telemetry,
|
|
179
|
+
});
|
|
180
|
+
throw e;
|
|
221
181
|
}
|
|
222
182
|
}
|
|
223
183
|
|
|
224
184
|
/**
|
|
225
|
-
*
|
|
226
|
-
* @param
|
|
227
|
-
* @param kid
|
|
185
|
+
* Returns the SHA-256 hash of an input string
|
|
186
|
+
* @param plainText
|
|
228
187
|
*/
|
|
229
|
-
async
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
188
|
+
async hashString(plainText: string): Promise<string> {
|
|
189
|
+
return BrowserCrypto.hashString(plainText);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private async signInput(
|
|
193
|
+
cachedKeyPair: CachedKeyPair,
|
|
194
|
+
signingInput: string,
|
|
195
|
+
algorithm: AlgorithmIdentifier
|
|
234
196
|
): Promise<string> {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
kid,
|
|
241
|
-
correlationId || ""
|
|
197
|
+
const encoder = new TextEncoder();
|
|
198
|
+
const signatureBuffer = await BrowserCrypto.sign(
|
|
199
|
+
cachedKeyPair.privateKey,
|
|
200
|
+
encoder.encode(signingInput),
|
|
201
|
+
algorithm
|
|
242
202
|
);
|
|
243
203
|
|
|
244
|
-
|
|
204
|
+
return urlEncodeArr(new Uint8Array(signatureBuffer));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
private getTokenBindingKeySigningAlgorithm(
|
|
208
|
+
cachedKeyPair: CachedKeyPair,
|
|
209
|
+
requestedAlgorithm: string,
|
|
210
|
+
correlationId: string
|
|
211
|
+
): AlgorithmIdentifier {
|
|
212
|
+
const keyAlgorithm = cachedKeyPair.privateKey.algorithm;
|
|
213
|
+
if (
|
|
214
|
+
requestedAlgorithm === JsonWebTokenAlgorithms.RS256 &&
|
|
215
|
+
keyAlgorithm.name === BrowserCrypto.RSA_SIGN_ALGORITHM_OPTIONS.name
|
|
216
|
+
) {
|
|
217
|
+
return BrowserCrypto.RSA_SIGN_ALGORITHM_OPTIONS;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (
|
|
221
|
+
requestedAlgorithm === JsonWebTokenAlgorithms.ES256 &&
|
|
222
|
+
keyAlgorithm.name ===
|
|
223
|
+
BrowserCrypto.ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS.name &&
|
|
224
|
+
(keyAlgorithm as EcKeyAlgorithm).namedCurve ===
|
|
225
|
+
BrowserCrypto.ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS.namedCurve
|
|
226
|
+
) {
|
|
227
|
+
return BrowserCrypto.ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (
|
|
231
|
+
requestedAlgorithm === JsonWebTokenAlgorithms.RS256 ||
|
|
232
|
+
requestedAlgorithm === JsonWebTokenAlgorithms.ES256
|
|
233
|
+
) {
|
|
245
234
|
throw createBrowserAuthError(
|
|
246
|
-
BrowserAuthErrorCodes.
|
|
247
|
-
correlationId
|
|
235
|
+
BrowserAuthErrorCodes.unsupportedTokenBindingAlgorithm,
|
|
236
|
+
correlationId,
|
|
237
|
+
BrowserAuthErrorCodes.tokenBindingKeyAlgorithmMismatch
|
|
248
238
|
);
|
|
249
239
|
}
|
|
250
240
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
241
|
+
throw createBrowserAuthError(
|
|
242
|
+
BrowserAuthErrorCodes.unsupportedTokenBindingAlgorithm,
|
|
243
|
+
correlationId
|
|
254
244
|
);
|
|
255
|
-
|
|
256
|
-
// Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: "FULL_PUBLIC_KEY_HASH" })
|
|
257
|
-
const encodedKeyIdThumbprint = urlEncode(JSON.stringify({ kid: kid }));
|
|
258
|
-
// Generate header
|
|
259
|
-
const shrHeader = JoseHeader.getShrHeaderString({
|
|
260
|
-
...shrOptions?.header,
|
|
261
|
-
alg: publicKeyJwk.alg,
|
|
262
|
-
kid: encodedKeyIdThumbprint,
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
const encodedShrHeader = urlEncode(shrHeader);
|
|
266
|
-
|
|
267
|
-
// Generate payload
|
|
268
|
-
payload.cnf = {
|
|
269
|
-
jwk: JSON.parse(publicKeyJwkString),
|
|
270
|
-
};
|
|
271
|
-
const encodedPayload = urlEncode(JSON.stringify(payload));
|
|
245
|
+
}
|
|
272
246
|
|
|
273
|
-
|
|
274
|
-
|
|
247
|
+
private async validateTokenBindingJwtHeaderKey(
|
|
248
|
+
header: JoseHeader,
|
|
249
|
+
kid: string,
|
|
250
|
+
correlationId: string
|
|
251
|
+
): Promise<void> {
|
|
252
|
+
if (!header.jwk) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
275
255
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const signatureBuffer = await BrowserCrypto.sign(
|
|
280
|
-
cachedKeyPair.privateKey,
|
|
281
|
-
tokenBuffer,
|
|
282
|
-
BrowserCrypto.RSA_SIGN_ALGORITHM_OPTIONS
|
|
256
|
+
const headerKeyId = await BrowserCrypto.computeJwkThumbprint(
|
|
257
|
+
header.jwk,
|
|
258
|
+
correlationId
|
|
283
259
|
);
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
success: true,
|
|
291
|
-
});
|
|
260
|
+
if (headerKeyId !== kid) {
|
|
261
|
+
throw createBrowserAuthError(
|
|
262
|
+
BrowserAuthErrorCodes.invalidPublicJwk,
|
|
263
|
+
correlationId,
|
|
264
|
+
BrowserAuthErrorCodes.tokenBindingKeyJwkThumbprintMismatch
|
|
265
|
+
);
|
|
292
266
|
}
|
|
293
|
-
|
|
294
|
-
return signedJwt;
|
|
295
267
|
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Returns the SHA-256 hash of an input string
|
|
299
|
-
* @param plainText
|
|
300
|
-
*/
|
|
301
|
-
async hashString(plainText: string): Promise<string> {
|
|
302
|
-
return BrowserCrypto.hashString(plainText);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
function getSortedObjectString(obj: object): string {
|
|
307
|
-
return JSON.stringify(obj, Object.keys(obj).sort());
|
|
308
268
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { CryptoOps } from "./CryptoOps.js";
|
|
7
|
+
import { TokenBindingKeyManager } from "./TokenBindingKeyManager.js";
|
|
7
8
|
import {
|
|
8
9
|
Logger,
|
|
9
10
|
LoggerOptions,
|
|
@@ -30,8 +31,10 @@ export class SignedHttpRequest {
|
|
|
30
31
|
const loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};
|
|
31
32
|
this.logger = new Logger(loggerOptions, name, version);
|
|
32
33
|
this.cryptoOps = new CryptoOps(this.logger);
|
|
34
|
+
const tokenBindingKeyManager = new TokenBindingKeyManager(this.logger);
|
|
33
35
|
this.popTokenGenerator = new PopTokenGenerator(
|
|
34
36
|
this.cryptoOps,
|
|
37
|
+
tokenBindingKeyManager,
|
|
35
38
|
new StubPerformanceClient()
|
|
36
39
|
);
|
|
37
40
|
this.shrParameters = shrParameters;
|