@azure/msal-browser 5.18.0 → 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 +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 +21 -15
- 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 +6 -6
- 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 +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 +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 +4390 -4069
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +4390 -4069
- 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 +827 -392
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +827 -392
- 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/controllers/StandardController.ts +38 -13
- 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 +9 -3
- 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/mapping/NestedAppAuthAdapter.ts +57 -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/PendingRequestRegistry.ts +2 -5
- package/types/cache/AsyncMemoryStorage.d.ts +1 -2
- package/types/cache/AsyncMemoryStorage.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/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/PendingRequestRegistry.d.ts +2 -2
- package/types/webBrokerBridge/PendingRequestRegistry.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
package/lib/msal-browser.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.19.0 2026-08-18 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v16.
|
|
5
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6
6
|
/*
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
@@ -55,7 +55,7 @@ const RESOURCE = "resource";
|
|
|
55
55
|
const CLI_DATA = "clidata";
|
|
56
56
|
const ATTRIBUTE_TOKENS = "attribute_tokens";
|
|
57
57
|
|
|
58
|
-
/*! @azure/msal-common v16.
|
|
58
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
59
59
|
/*
|
|
60
60
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
61
61
|
* Licensed under the MIT License.
|
|
@@ -287,11 +287,12 @@ const JsonWebTokenTypes$1 = {
|
|
|
287
287
|
Jwt: "JWT",
|
|
288
288
|
Jwk: "JWK",
|
|
289
289
|
Pop: "pop",
|
|
290
|
+
Dpop: "dpop+jwt",
|
|
290
291
|
};
|
|
291
292
|
// Token renewal offset default in seconds
|
|
292
293
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
293
294
|
|
|
294
|
-
/*! @azure/msal-common v16.
|
|
295
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
295
296
|
/*
|
|
296
297
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
297
298
|
* Licensed under the MIT License.
|
|
@@ -320,7 +321,7 @@ function createAuthError(code, correlationId, additionalMessage) {
|
|
|
320
321
|
return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
|
|
321
322
|
}
|
|
322
323
|
|
|
323
|
-
/*! @azure/msal-common v16.
|
|
324
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
324
325
|
|
|
325
326
|
/*
|
|
326
327
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -343,7 +344,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
|
|
|
343
344
|
return new ClientAuthError(errorCode, correlationId, additionalMessage);
|
|
344
345
|
}
|
|
345
346
|
|
|
346
|
-
/*! @azure/msal-common v16.
|
|
347
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
347
348
|
/*
|
|
348
349
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
349
350
|
* Licensed under the MIT License.
|
|
@@ -427,7 +428,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
427
428
|
userCanceled: userCanceled
|
|
428
429
|
});
|
|
429
430
|
|
|
430
|
-
/*! @azure/msal-common v16.
|
|
431
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
431
432
|
|
|
432
433
|
/*
|
|
433
434
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -465,7 +466,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
465
466
|
};
|
|
466
467
|
}
|
|
467
468
|
|
|
468
|
-
/*! @azure/msal-common v16.
|
|
469
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
469
470
|
|
|
470
471
|
/*
|
|
471
472
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -531,7 +532,7 @@ function getJWSPayload(authToken, correlationId) {
|
|
|
531
532
|
return matches[2];
|
|
532
533
|
}
|
|
533
534
|
|
|
534
|
-
/*! @azure/msal-common v16.
|
|
535
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
535
536
|
|
|
536
537
|
/*
|
|
537
538
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -619,7 +620,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
619
620
|
return updatedAccountInfo;
|
|
620
621
|
}
|
|
621
622
|
|
|
622
|
-
/*! @azure/msal-common v16.
|
|
623
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
623
624
|
/*
|
|
624
625
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
625
626
|
* Licensed under the MIT License.
|
|
@@ -634,7 +635,7 @@ const AuthorityType = {
|
|
|
634
635
|
Ciam: 3,
|
|
635
636
|
};
|
|
636
637
|
|
|
637
|
-
/*! @azure/msal-common v16.
|
|
638
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
638
639
|
/*
|
|
639
640
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
640
641
|
* Licensed under the MIT License.
|
|
@@ -656,7 +657,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
656
657
|
return null;
|
|
657
658
|
}
|
|
658
659
|
|
|
659
|
-
/*! @azure/msal-common v16.
|
|
660
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
660
661
|
/*
|
|
661
662
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
662
663
|
* Licensed under the MIT License.
|
|
@@ -680,7 +681,7 @@ const ProtocolMode = {
|
|
|
680
681
|
EAR: "EAR",
|
|
681
682
|
};
|
|
682
683
|
|
|
683
|
-
/*! @azure/msal-common v16.
|
|
684
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
684
685
|
/**
|
|
685
686
|
* Returns the AccountInfo interface for this account.
|
|
686
687
|
* @internal
|
|
@@ -869,7 +870,7 @@ function isAccountEntity(entity) {
|
|
|
869
870
|
entity.hasOwnProperty("authorityType"));
|
|
870
871
|
}
|
|
871
872
|
|
|
872
|
-
/*! @azure/msal-common v16.
|
|
873
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
873
874
|
/*
|
|
874
875
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
875
876
|
* Licensed under the MIT License.
|
|
@@ -886,7 +887,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
886
887
|
unexpectedError: unexpectedError
|
|
887
888
|
});
|
|
888
889
|
|
|
889
|
-
/*! @azure/msal-common v16.
|
|
890
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
890
891
|
|
|
891
892
|
/*
|
|
892
893
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -906,7 +907,7 @@ function createClientConfigurationError(errorCode, correlationId) {
|
|
|
906
907
|
return new ClientConfigurationError(errorCode, correlationId);
|
|
907
908
|
}
|
|
908
909
|
|
|
909
|
-
/*! @azure/msal-common v16.
|
|
910
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
910
911
|
/*
|
|
911
912
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
912
913
|
* Licensed under the MIT License.
|
|
@@ -927,6 +928,7 @@ const invalidAuthorityMetadata = "invalid_authority_metadata";
|
|
|
927
928
|
const untrustedAuthority = "untrusted_authority";
|
|
928
929
|
const missingSshJwk = "missing_ssh_jwk";
|
|
929
930
|
const missingSshKid = "missing_ssh_kid";
|
|
931
|
+
const unsupportedAuthenticationScheme = "unsupported_authentication_scheme";
|
|
930
932
|
const missingNonceAuthenticationHeader = "missing_nonce_authentication_header";
|
|
931
933
|
const invalidAuthenticationHeader = "invalid_authentication_header";
|
|
932
934
|
const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
|
|
@@ -965,12 +967,13 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
965
967
|
pkceParamsMissing: pkceParamsMissing,
|
|
966
968
|
redirectUriEmpty: redirectUriEmpty,
|
|
967
969
|
tokenRequestEmpty: tokenRequestEmpty,
|
|
970
|
+
unsupportedAuthenticationScheme: unsupportedAuthenticationScheme,
|
|
968
971
|
untrustedAuthority: untrustedAuthority,
|
|
969
972
|
urlEmptyError: urlEmptyError,
|
|
970
973
|
urlParseError: urlParseError
|
|
971
974
|
});
|
|
972
975
|
|
|
973
|
-
/*! @azure/msal-common v16.
|
|
976
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
974
977
|
|
|
975
978
|
/*
|
|
976
979
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1028,7 +1031,7 @@ class AuthenticationHeaderParser {
|
|
|
1028
1031
|
}
|
|
1029
1032
|
}
|
|
1030
1033
|
|
|
1031
|
-
/*! @azure/msal-common v16.
|
|
1034
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1032
1035
|
/*
|
|
1033
1036
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1034
1037
|
* Licensed under the MIT License.
|
|
@@ -1040,7 +1043,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
1040
1043
|
response.hasOwnProperty("jwks_uri"));
|
|
1041
1044
|
}
|
|
1042
1045
|
|
|
1043
|
-
/*! @azure/msal-common v16.
|
|
1046
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1044
1047
|
/*
|
|
1045
1048
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1046
1049
|
* Licensed under the MIT License.
|
|
@@ -1120,7 +1123,7 @@ class StringUtils {
|
|
|
1120
1123
|
}
|
|
1121
1124
|
}
|
|
1122
1125
|
|
|
1123
|
-
/*! @azure/msal-common v16.
|
|
1126
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1124
1127
|
|
|
1125
1128
|
/*
|
|
1126
1129
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1278,7 +1281,7 @@ class UrlString {
|
|
|
1278
1281
|
}
|
|
1279
1282
|
}
|
|
1280
1283
|
|
|
1281
|
-
/*! @azure/msal-common v16.
|
|
1284
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1282
1285
|
|
|
1283
1286
|
/*
|
|
1284
1287
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1287,10 +1290,7 @@ class UrlString {
|
|
|
1287
1290
|
// Build endpoint metadata dynamically to avoid string duplication
|
|
1288
1291
|
const endpointHosts = [
|
|
1289
1292
|
{ host: "login.microsoftonline.com" },
|
|
1290
|
-
{
|
|
1291
|
-
host: "login.chinacloudapi.cn",
|
|
1292
|
-
issuerHost: "login.partner.microsoftonline.cn", // Issuer differs
|
|
1293
|
-
},
|
|
1293
|
+
{ host: "login.partner.microsoftonline.cn" },
|
|
1294
1294
|
{ host: "login.microsoftonline.us" },
|
|
1295
1295
|
{ host: "login.sovcloud-identity.fr" },
|
|
1296
1296
|
{ host: "login.sovcloud-identity.de" },
|
|
@@ -1444,7 +1444,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
1444
1444
|
return null;
|
|
1445
1445
|
}
|
|
1446
1446
|
|
|
1447
|
-
/*! @azure/msal-common v16.
|
|
1447
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1448
1448
|
/*
|
|
1449
1449
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1450
1450
|
* Licensed under the MIT License.
|
|
@@ -1464,7 +1464,7 @@ const AzureCloudInstance = {
|
|
|
1464
1464
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1465
1465
|
};
|
|
1466
1466
|
|
|
1467
|
-
/*! @azure/msal-common v16.
|
|
1467
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1468
1468
|
/*
|
|
1469
1469
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1470
1470
|
* Licensed under the MIT License.
|
|
@@ -1474,7 +1474,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
1474
1474
|
response.hasOwnProperty("metadata"));
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
-
/*! @azure/msal-common v16.
|
|
1477
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1478
1478
|
/*
|
|
1479
1479
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1480
1480
|
* Licensed under the MIT License.
|
|
@@ -1484,7 +1484,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
1484
1484
|
response.hasOwnProperty("error_description"));
|
|
1485
1485
|
}
|
|
1486
1486
|
|
|
1487
|
-
/*! @azure/msal-common v16.
|
|
1487
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1488
1488
|
/*
|
|
1489
1489
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1490
1490
|
* Licensed under the MIT License.
|
|
@@ -1555,7 +1555,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
|
|
|
1555
1555
|
const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
|
|
1556
1556
|
const SetUserData = "setUserData";
|
|
1557
1557
|
|
|
1558
|
-
/*! @azure/msal-common v16.
|
|
1558
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1559
1559
|
/*
|
|
1560
1560
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1561
1561
|
* Licensed under the MIT License.
|
|
@@ -1648,7 +1648,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
1648
1648
|
};
|
|
1649
1649
|
};
|
|
1650
1650
|
|
|
1651
|
-
/*! @azure/msal-common v16.
|
|
1651
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1652
1652
|
|
|
1653
1653
|
/*
|
|
1654
1654
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1759,7 +1759,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
1759
1759
|
},
|
|
1760
1760
|
};
|
|
1761
1761
|
|
|
1762
|
-
/*! @azure/msal-common v16.
|
|
1762
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1763
1763
|
/*
|
|
1764
1764
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1765
1765
|
* Licensed under the MIT License.
|
|
@@ -1824,7 +1824,7 @@ function wasClockTurnedBack(cachedAt) {
|
|
|
1824
1824
|
return cachedAtSec > nowSeconds();
|
|
1825
1825
|
}
|
|
1826
1826
|
|
|
1827
|
-
/*! @azure/msal-common v16.
|
|
1827
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
1828
1828
|
|
|
1829
1829
|
/*
|
|
1830
1830
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1881,6 +1881,7 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1881
1881
|
if (refreshOn) {
|
|
1882
1882
|
atEntity.refreshOn = refreshOn.toString();
|
|
1883
1883
|
}
|
|
1884
|
+
const normalizedTokenType = atEntity.tokenType?.toLowerCase();
|
|
1884
1885
|
/*
|
|
1885
1886
|
* Create Access Token With Auth Scheme instead of regular access token
|
|
1886
1887
|
* Cast to lower to handle "bearer" from ADFS
|
|
@@ -1889,7 +1890,7 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1889
1890
|
AuthenticationScheme$1.BEARER.toLowerCase()) {
|
|
1890
1891
|
atEntity.credentialType =
|
|
1891
1892
|
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
1892
|
-
switch (
|
|
1893
|
+
switch (normalizedTokenType) {
|
|
1893
1894
|
case AuthenticationScheme$1.POP:
|
|
1894
1895
|
// Make sure keyId is present and add it to credential
|
|
1895
1896
|
const tokenClaims = extractTokenClaims(accessToken, base64Decode, correlationId);
|
|
@@ -1898,6 +1899,12 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1898
1899
|
}
|
|
1899
1900
|
atEntity.keyId = tokenClaims.cnf.kid;
|
|
1900
1901
|
break;
|
|
1902
|
+
case "dpop":
|
|
1903
|
+
if (!keyId) {
|
|
1904
|
+
throw createClientAuthError(keyIdMissing, correlationId);
|
|
1905
|
+
}
|
|
1906
|
+
atEntity.keyId = keyId;
|
|
1907
|
+
break;
|
|
1901
1908
|
case AuthenticationScheme$1.SSH:
|
|
1902
1909
|
atEntity.keyId = keyId;
|
|
1903
1910
|
}
|
|
@@ -2104,7 +2111,7 @@ function serializeAttributeTokens(attributeTokens) {
|
|
|
2104
2111
|
return [...attributeTokens].sort().join(" ");
|
|
2105
2112
|
}
|
|
2106
2113
|
|
|
2107
|
-
/*! @azure/msal-common v16.
|
|
2114
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
2108
2115
|
|
|
2109
2116
|
/*
|
|
2110
2117
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3074,7 +3081,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
3074
3081
|
};
|
|
3075
3082
|
}
|
|
3076
3083
|
|
|
3077
|
-
/*! @azure/msal-common v16.
|
|
3084
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3078
3085
|
|
|
3079
3086
|
/*
|
|
3080
3087
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3108,7 +3115,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
3108
3115
|
}
|
|
3109
3116
|
}
|
|
3110
3117
|
|
|
3111
|
-
/*! @azure/msal-common v16.
|
|
3118
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3112
3119
|
|
|
3113
3120
|
/*
|
|
3114
3121
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3304,7 +3311,7 @@ class ScopeSet {
|
|
|
3304
3311
|
}
|
|
3305
3312
|
}
|
|
3306
3313
|
|
|
3307
|
-
/*! @azure/msal-common v16.
|
|
3314
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3308
3315
|
|
|
3309
3316
|
/*
|
|
3310
3317
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3621,7 +3628,7 @@ function parseClaims(claims, correlationId = "") {
|
|
|
3621
3628
|
// Malformed JSON
|
|
3622
3629
|
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
3623
3630
|
}
|
|
3624
|
-
if (!isPlainObject(parsed)) {
|
|
3631
|
+
if (!isPlainObject$1(parsed)) {
|
|
3625
3632
|
// Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
|
|
3626
3633
|
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
3627
3634
|
}
|
|
@@ -3632,7 +3639,7 @@ function parseClaims(claims, correlationId = "") {
|
|
|
3632
3639
|
* @param value - The value to test
|
|
3633
3640
|
* @returns True when value is a plain object that can be deep-merged
|
|
3634
3641
|
*/
|
|
3635
|
-
function isPlainObject(value) {
|
|
3642
|
+
function isPlainObject$1(value) {
|
|
3636
3643
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3637
3644
|
}
|
|
3638
3645
|
/**
|
|
@@ -3649,7 +3656,7 @@ function deepMergeClaims(baseClaims, claimsToMerge) {
|
|
|
3649
3656
|
const merged = { ...baseClaims };
|
|
3650
3657
|
for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
|
|
3651
3658
|
const baseValue = merged[key];
|
|
3652
|
-
if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
|
|
3659
|
+
if (isPlainObject$1(baseValue) && isPlainObject$1(mergeInValue)) {
|
|
3653
3660
|
merged[key] = deepMergeClaims(baseValue, mergeInValue);
|
|
3654
3661
|
}
|
|
3655
3662
|
else {
|
|
@@ -3786,7 +3793,7 @@ function addAttributeTokens(parameters, attributeTokens) {
|
|
|
3786
3793
|
}
|
|
3787
3794
|
}
|
|
3788
3795
|
|
|
3789
|
-
/*! @azure/msal-common v16.
|
|
3796
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3790
3797
|
|
|
3791
3798
|
/*
|
|
3792
3799
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3908,12 +3915,20 @@ function validateUrl(url, logger, correlationId) {
|
|
|
3908
3915
|
}
|
|
3909
3916
|
}
|
|
3910
3917
|
|
|
3911
|
-
/*! @azure/msal-common v16.
|
|
3918
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3912
3919
|
|
|
3913
3920
|
/*
|
|
3914
3921
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3915
3922
|
* Licensed under the MIT License.
|
|
3916
3923
|
*/
|
|
3924
|
+
/**
|
|
3925
|
+
* Shared JOSE algorithm literals used by MSAL package internals.
|
|
3926
|
+
* @internal
|
|
3927
|
+
*/
|
|
3928
|
+
const JsonWebTokenAlgorithms = {
|
|
3929
|
+
ES256: "ES256",
|
|
3930
|
+
RS256: "RS256",
|
|
3931
|
+
};
|
|
3917
3932
|
/**
|
|
3918
3933
|
* Default crypto implementation used when a platform-specific implementation has
|
|
3919
3934
|
* not been provided.
|
|
@@ -3934,24 +3949,44 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
3934
3949
|
encodeKid: () => {
|
|
3935
3950
|
throw createClientAuthError(methodNotImplemented, "");
|
|
3936
3951
|
},
|
|
3937
|
-
async
|
|
3938
|
-
throw createClientAuthError(methodNotImplemented,
|
|
3939
|
-
},
|
|
3940
|
-
async removeTokenBindingKey() {
|
|
3941
|
-
throw createClientAuthError(methodNotImplemented, "");
|
|
3952
|
+
async removeTokenBindingKey(kid, correlationId) {
|
|
3953
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
3942
3954
|
},
|
|
3943
|
-
async clearKeystore() {
|
|
3944
|
-
throw createClientAuthError(methodNotImplemented,
|
|
3955
|
+
async clearKeystore(correlationId) {
|
|
3956
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
3945
3957
|
},
|
|
3946
|
-
async
|
|
3947
|
-
throw createClientAuthError(methodNotImplemented,
|
|
3958
|
+
async signTokenBindingJwt(header, payload, kid, correlationId) {
|
|
3959
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
3948
3960
|
},
|
|
3949
3961
|
async hashString() {
|
|
3950
3962
|
throw createClientAuthError(methodNotImplemented, "");
|
|
3951
3963
|
},
|
|
3952
3964
|
};
|
|
3953
3965
|
|
|
3954
|
-
/*! @azure/msal-common v16.
|
|
3966
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3967
|
+
|
|
3968
|
+
/*
|
|
3969
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3970
|
+
* Licensed under the MIT License.
|
|
3971
|
+
*/
|
|
3972
|
+
/**
|
|
3973
|
+
* Default token-binding key manager used when a platform-specific implementation
|
|
3974
|
+
* has not been provided.
|
|
3975
|
+
* @internal
|
|
3976
|
+
*/
|
|
3977
|
+
const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
|
|
3978
|
+
async provisionTokenBindingKey(request) {
|
|
3979
|
+
throw createClientAuthError(methodNotImplemented, request.correlationId);
|
|
3980
|
+
},
|
|
3981
|
+
async removeTokenBindingKey(_kid, correlationId) {
|
|
3982
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
3983
|
+
},
|
|
3984
|
+
async getTokenBindingPublicKeyJwk(_kid, correlationId) {
|
|
3985
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
3986
|
+
},
|
|
3987
|
+
};
|
|
3988
|
+
|
|
3989
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
3955
3990
|
/*
|
|
3956
3991
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3957
3992
|
* Licensed under the MIT License.
|
|
@@ -4240,12 +4275,12 @@ class Logger {
|
|
|
4240
4275
|
}
|
|
4241
4276
|
}
|
|
4242
4277
|
|
|
4243
|
-
/*! @azure/msal-common v16.
|
|
4278
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
4244
4279
|
/* eslint-disable header/header */
|
|
4245
4280
|
const name$1 = "@azure/msal-common";
|
|
4246
|
-
const version$1 = "16.
|
|
4281
|
+
const version$1 = "16.13.0";
|
|
4247
4282
|
|
|
4248
|
-
/*! @azure/msal-common v16.
|
|
4283
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
4249
4284
|
/*
|
|
4250
4285
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4251
4286
|
* Licensed under the MIT License.
|
|
@@ -4253,7 +4288,7 @@ const version$1 = "16.12.0";
|
|
|
4253
4288
|
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
4254
4289
|
const cacheErrorUnknown = "cache_error_unknown";
|
|
4255
4290
|
|
|
4256
|
-
/*! @azure/msal-common v16.
|
|
4291
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
4257
4292
|
|
|
4258
4293
|
/*
|
|
4259
4294
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4291,7 +4326,7 @@ function createCacheError(e) {
|
|
|
4291
4326
|
}
|
|
4292
4327
|
}
|
|
4293
4328
|
|
|
4294
|
-
/*! @azure/msal-common v16.
|
|
4329
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
4295
4330
|
|
|
4296
4331
|
/*
|
|
4297
4332
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4652,16 +4687,9 @@ class CacheManager {
|
|
|
4652
4687
|
// Access Token with Auth Scheme specific matching
|
|
4653
4688
|
if (entity.credentialType ===
|
|
4654
4689
|
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {
|
|
4655
|
-
if (
|
|
4656
|
-
!this.matchTokenType(entity, filter.tokenType)) {
|
|
4690
|
+
if (!this.matchAccessTokenWithAuthScheme(entity, filter)) {
|
|
4657
4691
|
return false;
|
|
4658
4692
|
}
|
|
4659
|
-
// KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
|
|
4660
|
-
if (filter.tokenType === AuthenticationScheme$1.SSH) {
|
|
4661
|
-
if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {
|
|
4662
|
-
return false;
|
|
4663
|
-
}
|
|
4664
|
-
}
|
|
4665
4693
|
}
|
|
4666
4694
|
// Additional cache key components matching (bidirectional isolation)
|
|
4667
4695
|
const entityComponents = entity.additionalCacheKeyComponents;
|
|
@@ -4978,7 +5006,9 @@ class CacheManager {
|
|
|
4978
5006
|
realm: targetRealm || account.tenantId,
|
|
4979
5007
|
target: scopes,
|
|
4980
5008
|
tokenType: authScheme,
|
|
4981
|
-
keyId:
|
|
5009
|
+
keyId: authScheme === AuthenticationScheme$1.SSH
|
|
5010
|
+
? request.sshKid
|
|
5011
|
+
: undefined,
|
|
4982
5012
|
additionalCacheKeyComponents: additionalCacheKeyComponents,
|
|
4983
5013
|
};
|
|
4984
5014
|
const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
|
|
@@ -5340,7 +5370,29 @@ class CacheManager {
|
|
|
5340
5370
|
* @param tokenType
|
|
5341
5371
|
*/
|
|
5342
5372
|
matchTokenType(entity, tokenType) {
|
|
5343
|
-
return !!(entity.tokenType &&
|
|
5373
|
+
return !!(entity.tokenType &&
|
|
5374
|
+
entity.tokenType.toLowerCase() === tokenType.toLowerCase());
|
|
5375
|
+
}
|
|
5376
|
+
matchAccessTokenWithAuthScheme(entity, filter) {
|
|
5377
|
+
const normalizedFilterTokenType = filter.tokenType?.toLowerCase();
|
|
5378
|
+
if (!!filter.tokenType &&
|
|
5379
|
+
!this.matchTokenType(entity, filter.tokenType)) {
|
|
5380
|
+
return false;
|
|
5381
|
+
}
|
|
5382
|
+
switch (normalizedFilterTokenType) {
|
|
5383
|
+
case "dpop":
|
|
5384
|
+
return this.matchKeyBoundAccessToken(entity, filter, true);
|
|
5385
|
+
case AuthenticationScheme$1.SSH:
|
|
5386
|
+
return this.matchKeyBoundAccessToken(entity, filter, false);
|
|
5387
|
+
default:
|
|
5388
|
+
return true;
|
|
5389
|
+
}
|
|
5390
|
+
}
|
|
5391
|
+
matchKeyBoundAccessToken(entity, filter, requireKeyId) {
|
|
5392
|
+
if (!filter.keyId) {
|
|
5393
|
+
return !requireKeyId;
|
|
5394
|
+
}
|
|
5395
|
+
return this.matchKeyId(entity, filter.keyId);
|
|
5344
5396
|
}
|
|
5345
5397
|
/**
|
|
5346
5398
|
* Returns true if the credential's keyId matches the one in the request, false otherwise
|
|
@@ -5457,7 +5509,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
5457
5509
|
}
|
|
5458
5510
|
}
|
|
5459
5511
|
|
|
5460
|
-
/*! @azure/msal-common v16.
|
|
5512
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5461
5513
|
/*
|
|
5462
5514
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5463
5515
|
* Licensed under the MIT License.
|
|
@@ -5522,7 +5574,7 @@ const IntFields = new Set([
|
|
|
5522
5574
|
"fetchRetryCount",
|
|
5523
5575
|
]);
|
|
5524
5576
|
|
|
5525
|
-
/*! @azure/msal-common v16.
|
|
5577
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5526
5578
|
|
|
5527
5579
|
/*
|
|
5528
5580
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5580,7 +5632,7 @@ class StubPerformanceClient {
|
|
|
5580
5632
|
}
|
|
5581
5633
|
}
|
|
5582
5634
|
|
|
5583
|
-
/*! @azure/msal-common v16.
|
|
5635
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5584
5636
|
|
|
5585
5637
|
/*
|
|
5586
5638
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5634,7 +5686,7 @@ const DEFAULT_TELEMETRY_OPTIONS = {
|
|
|
5634
5686
|
* @returns Configuration
|
|
5635
5687
|
* @internal
|
|
5636
5688
|
*/
|
|
5637
|
-
function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
|
|
5689
|
+
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, }) {
|
|
5638
5690
|
const loggerOptions = {
|
|
5639
5691
|
...DEFAULT_LOGGER_IMPLEMENTATION,
|
|
5640
5692
|
...userLoggerOption,
|
|
@@ -5647,6 +5699,7 @@ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions:
|
|
|
5647
5699
|
new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name$1, version$1), new StubPerformanceClient()),
|
|
5648
5700
|
networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
|
|
5649
5701
|
cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
|
|
5702
|
+
tokenBindingKeyManager: tokenBindingKeyManager || DEFAULT_TOKEN_BINDING_KEY_MANAGER,
|
|
5650
5703
|
clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
|
|
5651
5704
|
libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
|
|
5652
5705
|
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
|
|
@@ -5676,7 +5729,7 @@ function isOidcProtocolMode(config) {
|
|
|
5676
5729
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
5677
5730
|
}
|
|
5678
5731
|
|
|
5679
|
-
/*! @azure/msal-common v16.
|
|
5732
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5680
5733
|
/*
|
|
5681
5734
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5682
5735
|
* Licensed under the MIT License.
|
|
@@ -5703,7 +5756,129 @@ function isOidcProtocolMode(config) {
|
|
|
5703
5756
|
}
|
|
5704
5757
|
}
|
|
5705
5758
|
|
|
5706
|
-
/*! @azure/msal-common v16.
|
|
5759
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5760
|
+
|
|
5761
|
+
/*
|
|
5762
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5763
|
+
* Licensed under the MIT License.
|
|
5764
|
+
*/
|
|
5765
|
+
/**
|
|
5766
|
+
* Error thrown when there is an error in the client code running on the browser.
|
|
5767
|
+
*/
|
|
5768
|
+
class JoseHeaderError extends AuthError {
|
|
5769
|
+
constructor(errorCode, correlationId, errorMessage) {
|
|
5770
|
+
super(errorCode, correlationId, errorMessage);
|
|
5771
|
+
this.name = "JoseHeaderError";
|
|
5772
|
+
Object.setPrototypeOf(this, JoseHeaderError.prototype);
|
|
5773
|
+
}
|
|
5774
|
+
}
|
|
5775
|
+
/** Returns JoseHeaderError object */
|
|
5776
|
+
function createJoseHeaderError(code, correlationId) {
|
|
5777
|
+
return new JoseHeaderError(code, correlationId);
|
|
5778
|
+
}
|
|
5779
|
+
|
|
5780
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5781
|
+
/*
|
|
5782
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5783
|
+
* Licensed under the MIT License.
|
|
5784
|
+
*/
|
|
5785
|
+
/**
|
|
5786
|
+
* Checks whether a value is a plain JSON-like object.
|
|
5787
|
+
* Allows objects with null prototypes, but rejects arrays and object subclasses.
|
|
5788
|
+
*/
|
|
5789
|
+
function isPlainObject(value) {
|
|
5790
|
+
if (typeof value !== "object" ||
|
|
5791
|
+
value === null ||
|
|
5792
|
+
Object.prototype.toString.call(value) !== "[object Object]") {
|
|
5793
|
+
return false;
|
|
5794
|
+
}
|
|
5795
|
+
if (Object.getPrototypeOf(value) === null) {
|
|
5796
|
+
return true;
|
|
5797
|
+
}
|
|
5798
|
+
let proto = value;
|
|
5799
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
5800
|
+
proto = Object.getPrototypeOf(proto);
|
|
5801
|
+
}
|
|
5802
|
+
return Object.getPrototypeOf(value) === proto;
|
|
5803
|
+
}
|
|
5804
|
+
|
|
5805
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5806
|
+
/*
|
|
5807
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5808
|
+
* Licensed under the MIT License.
|
|
5809
|
+
*/
|
|
5810
|
+
const missingKidError = "missing_kid_error";
|
|
5811
|
+
const missingAlgError = "missing_alg_error";
|
|
5812
|
+
const missingJwkError = "missing_jwk_error";
|
|
5813
|
+
const invalidJwkError = "invalid_jwk_error";
|
|
5814
|
+
|
|
5815
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5816
|
+
|
|
5817
|
+
/*
|
|
5818
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5819
|
+
* Licensed under the MIT License.
|
|
5820
|
+
*/
|
|
5821
|
+
/** @internal */
|
|
5822
|
+
class JoseHeader {
|
|
5823
|
+
constructor(options, correlationId) {
|
|
5824
|
+
if (typeof options.alg !== "string" || !options.alg) {
|
|
5825
|
+
throw createJoseHeaderError(missingAlgError, correlationId);
|
|
5826
|
+
}
|
|
5827
|
+
this.typ = options.typ;
|
|
5828
|
+
this.alg = options.alg;
|
|
5829
|
+
this.kid = options.kid;
|
|
5830
|
+
this.jwk = options.jwk;
|
|
5831
|
+
}
|
|
5832
|
+
/**
|
|
5833
|
+
* Builds SignedHttpRequest formatted JOSE Header from the
|
|
5834
|
+
* JOSE Header options provided or previously set on the object.
|
|
5835
|
+
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
|
|
5836
|
+
* @param shrHeaderOptions
|
|
5837
|
+
* @param correlationId
|
|
5838
|
+
* @returns
|
|
5839
|
+
*/
|
|
5840
|
+
static getShrHeader(shrHeaderOptions, correlationId) {
|
|
5841
|
+
// KeyID is required on the SHR header
|
|
5842
|
+
if (!shrHeaderOptions.kid) {
|
|
5843
|
+
throw createJoseHeaderError(missingKidError, correlationId);
|
|
5844
|
+
}
|
|
5845
|
+
// Alg is required on the SHR header
|
|
5846
|
+
if (!shrHeaderOptions.alg) {
|
|
5847
|
+
throw createJoseHeaderError(missingAlgError, correlationId);
|
|
5848
|
+
}
|
|
5849
|
+
return new JoseHeader({
|
|
5850
|
+
// Access Token PoP headers must have type pop, but the type header can be overriden for special cases
|
|
5851
|
+
typ: shrHeaderOptions.typ || JsonWebTokenTypes$1.Pop,
|
|
5852
|
+
kid: shrHeaderOptions.kid,
|
|
5853
|
+
alg: shrHeaderOptions.alg,
|
|
5854
|
+
}, correlationId);
|
|
5855
|
+
}
|
|
5856
|
+
/**
|
|
5857
|
+
* Builds a DPoP formatted JOSE Header from the JOSE Header options provided.
|
|
5858
|
+
* Throws if public JWK or algorithm aren't provided since they are required for DPoP.
|
|
5859
|
+
* @param dpopHeaderOptions
|
|
5860
|
+
* @param correlationId
|
|
5861
|
+
* @returns
|
|
5862
|
+
*/
|
|
5863
|
+
static getDpopHeader(dpopHeaderOptions, correlationId) {
|
|
5864
|
+
if (!isPlainObject(dpopHeaderOptions.jwk)) {
|
|
5865
|
+
throw createJoseHeaderError(missingJwkError, correlationId);
|
|
5866
|
+
}
|
|
5867
|
+
if (!dpopHeaderOptions.alg) {
|
|
5868
|
+
throw createJoseHeaderError(missingAlgError, correlationId);
|
|
5869
|
+
}
|
|
5870
|
+
if (Object.keys(dpopHeaderOptions.jwk).length === 0) {
|
|
5871
|
+
throw createJoseHeaderError(invalidJwkError, correlationId);
|
|
5872
|
+
}
|
|
5873
|
+
return new JoseHeader({
|
|
5874
|
+
typ: JsonWebTokenTypes$1.Dpop,
|
|
5875
|
+
alg: dpopHeaderOptions.alg,
|
|
5876
|
+
jwk: dpopHeaderOptions.jwk,
|
|
5877
|
+
}, correlationId);
|
|
5878
|
+
}
|
|
5879
|
+
}
|
|
5880
|
+
|
|
5881
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5707
5882
|
|
|
5708
5883
|
/*
|
|
5709
5884
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5711,10 +5886,13 @@ function isOidcProtocolMode(config) {
|
|
|
5711
5886
|
*/
|
|
5712
5887
|
const KeyLocation = {
|
|
5713
5888
|
SW: "sw"};
|
|
5889
|
+
const SHR_TOKEN_BINDING_KEY_TYPE = "shr";
|
|
5890
|
+
const SHR_TOKEN_BINDING_KEY_ALGORITHM = JsonWebTokenAlgorithms.RS256;
|
|
5714
5891
|
/** @internal */
|
|
5715
5892
|
class PopTokenGenerator {
|
|
5716
|
-
constructor(cryptoUtils, performanceClient) {
|
|
5893
|
+
constructor(cryptoUtils, tokenBindingKeyManager, performanceClient) {
|
|
5717
5894
|
this.cryptoUtils = cryptoUtils;
|
|
5895
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
5718
5896
|
this.performanceClient = performanceClient;
|
|
5719
5897
|
}
|
|
5720
5898
|
/**
|
|
@@ -5737,7 +5915,11 @@ class PopTokenGenerator {
|
|
|
5737
5915
|
* @returns
|
|
5738
5916
|
*/
|
|
5739
5917
|
async generateKid(request) {
|
|
5740
|
-
const kidThumbprint = await this.
|
|
5918
|
+
const kidThumbprint = await this.tokenBindingKeyManager.provisionTokenBindingKey({
|
|
5919
|
+
correlationId: request.correlationId,
|
|
5920
|
+
tokenBindingKeyType: SHR_TOKEN_BINDING_KEY_TYPE,
|
|
5921
|
+
tokenBindingKeyAlgorithm: SHR_TOKEN_BINDING_KEY_ALGORITHM,
|
|
5922
|
+
});
|
|
5741
5923
|
return {
|
|
5742
5924
|
kid: kidThumbprint,
|
|
5743
5925
|
xms_ksl: KeyLocation.SW,
|
|
@@ -5767,7 +5949,17 @@ class PopTokenGenerator {
|
|
|
5767
5949
|
? new UrlString(resourceRequestUri, request.correlationId)
|
|
5768
5950
|
: undefined;
|
|
5769
5951
|
const resourceUrlComponents = resourceUrlString?.getUrlComponents();
|
|
5770
|
-
|
|
5952
|
+
const publicKeyJwk = await this.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(keyId, request.correlationId);
|
|
5953
|
+
const encodedKeyIdThumbprint = this.cryptoUtils.base64UrlEncode(JSON.stringify({ kid: keyId }));
|
|
5954
|
+
const shrAlgorithm = shrOptions?.header?.alg ||
|
|
5955
|
+
publicKeyJwk.alg ||
|
|
5956
|
+
SHR_TOKEN_BINDING_KEY_ALGORITHM;
|
|
5957
|
+
const shrHeader = JoseHeader.getShrHeader({
|
|
5958
|
+
...shrOptions?.header,
|
|
5959
|
+
alg: shrAlgorithm,
|
|
5960
|
+
kid: encodedKeyIdThumbprint,
|
|
5961
|
+
}, request.correlationId);
|
|
5962
|
+
const shrPayload = {
|
|
5771
5963
|
at: payload,
|
|
5772
5964
|
ts: nowSeconds(),
|
|
5773
5965
|
m: resourceRequestMethod?.toUpperCase(),
|
|
@@ -5779,11 +5971,15 @@ class PopTokenGenerator {
|
|
|
5779
5971
|
: undefined,
|
|
5780
5972
|
client_claims: shrClaims || undefined,
|
|
5781
5973
|
...claims,
|
|
5782
|
-
|
|
5974
|
+
cnf: {
|
|
5975
|
+
jwk: publicKeyJwk,
|
|
5976
|
+
},
|
|
5977
|
+
};
|
|
5978
|
+
return this.cryptoUtils.signTokenBindingJwt(shrHeader, shrPayload, keyId, request.correlationId);
|
|
5783
5979
|
}
|
|
5784
5980
|
}
|
|
5785
5981
|
|
|
5786
|
-
/*! @azure/msal-common v16.
|
|
5982
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5787
5983
|
/*
|
|
5788
5984
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5789
5985
|
* Licensed under the MIT License.
|
|
@@ -5847,7 +6043,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
5847
6043
|
uiNotAllowed: uiNotAllowed
|
|
5848
6044
|
});
|
|
5849
6045
|
|
|
5850
|
-
/*! @azure/msal-common v16.
|
|
6046
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5851
6047
|
|
|
5852
6048
|
/*
|
|
5853
6049
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5914,7 +6110,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
|
|
|
5914
6110
|
return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
|
|
5915
6111
|
}
|
|
5916
6112
|
|
|
5917
|
-
/*! @azure/msal-common v16.
|
|
6113
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5918
6114
|
|
|
5919
6115
|
/*
|
|
5920
6116
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5933,7 +6129,7 @@ class ServerError extends AuthError {
|
|
|
5933
6129
|
}
|
|
5934
6130
|
}
|
|
5935
6131
|
|
|
5936
|
-
/*! @azure/msal-common v16.
|
|
6132
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
5937
6133
|
|
|
5938
6134
|
/*
|
|
5939
6135
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6004,7 +6200,7 @@ function parseRequestState(base64Decode, state, correlationId) {
|
|
|
6004
6200
|
}
|
|
6005
6201
|
}
|
|
6006
6202
|
|
|
6007
|
-
/*! @azure/msal-common v16.
|
|
6203
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6008
6204
|
|
|
6009
6205
|
/*
|
|
6010
6206
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6015,10 +6211,11 @@ function parseRequestState(base64Decode, state, correlationId) {
|
|
|
6015
6211
|
* @internal
|
|
6016
6212
|
*/
|
|
6017
6213
|
class ResponseHandler {
|
|
6018
|
-
constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin) {
|
|
6214
|
+
constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
|
|
6019
6215
|
this.clientId = clientId;
|
|
6020
6216
|
this.cacheStorage = cacheStorage;
|
|
6021
6217
|
this.cryptoObj = cryptoObj;
|
|
6218
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
6022
6219
|
this.logger = logger;
|
|
6023
6220
|
this.performanceClient = performanceClient;
|
|
6024
6221
|
this.serializableCache = serializableCache;
|
|
@@ -6127,7 +6324,12 @@ class ResponseHandler {
|
|
|
6127
6324
|
this.performanceClient?.addFields({
|
|
6128
6325
|
acntLoggedOut: true,
|
|
6129
6326
|
}, request.correlationId);
|
|
6130
|
-
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient,
|
|
6327
|
+
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, {
|
|
6328
|
+
idTokenClaims,
|
|
6329
|
+
requestState: requestStateObj,
|
|
6330
|
+
requestId: serverRequestId,
|
|
6331
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
6332
|
+
});
|
|
6131
6333
|
}
|
|
6132
6334
|
}
|
|
6133
6335
|
await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, isKmsi(idTokenClaims || {}), apiId, request.storeInCache);
|
|
@@ -6140,7 +6342,13 @@ class ResponseHandler {
|
|
|
6140
6342
|
await this.persistencePlugin.afterCacheAccess(cacheContext);
|
|
6141
6343
|
}
|
|
6142
6344
|
}
|
|
6143
|
-
return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient,
|
|
6345
|
+
return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, {
|
|
6346
|
+
idTokenClaims,
|
|
6347
|
+
requestState: requestStateObj,
|
|
6348
|
+
serverTokenResponse,
|
|
6349
|
+
requestId: serverRequestId,
|
|
6350
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
6351
|
+
});
|
|
6144
6352
|
}
|
|
6145
6353
|
/**
|
|
6146
6354
|
* Generates CacheRecord
|
|
@@ -6236,7 +6444,8 @@ class ResponseHandler {
|
|
|
6236
6444
|
* @param fromTokenCache
|
|
6237
6445
|
* @param stateString
|
|
6238
6446
|
*/
|
|
6239
|
-
static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient,
|
|
6447
|
+
static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient, options = {}) {
|
|
6448
|
+
const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, } = options;
|
|
6240
6449
|
let accessToken = "";
|
|
6241
6450
|
let responseScopes = [];
|
|
6242
6451
|
let expiresOn = null;
|
|
@@ -6251,7 +6460,7 @@ class ResponseHandler {
|
|
|
6251
6460
|
if (cacheRecord.accessToken.tokenType ===
|
|
6252
6461
|
AuthenticationScheme$1.POP &&
|
|
6253
6462
|
!request.popKid) {
|
|
6254
|
-
const popTokenGenerator = new PopTokenGenerator(cryptoObj, performanceClient);
|
|
6463
|
+
const popTokenGenerator = new PopTokenGenerator(cryptoObj, tokenBindingKeyManager, performanceClient);
|
|
6255
6464
|
const { secret, keyId } = cacheRecord.accessToken;
|
|
6256
6465
|
if (!keyId) {
|
|
6257
6466
|
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
@@ -6363,7 +6572,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6363
6572
|
return baseAccount;
|
|
6364
6573
|
}
|
|
6365
6574
|
|
|
6366
|
-
/*! @azure/msal-common v16.
|
|
6575
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6367
6576
|
/*
|
|
6368
6577
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6369
6578
|
* Licensed under the MIT License.
|
|
@@ -6373,7 +6582,7 @@ const CcsCredentialType = {
|
|
|
6373
6582
|
UPN: "UPN",
|
|
6374
6583
|
};
|
|
6375
6584
|
|
|
6376
|
-
/*! @azure/msal-common v16.
|
|
6585
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6377
6586
|
/*
|
|
6378
6587
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6379
6588
|
* Licensed under the MIT License.
|
|
@@ -6392,7 +6601,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
|
|
|
6392
6601
|
}
|
|
6393
6602
|
}
|
|
6394
6603
|
|
|
6395
|
-
/*! @azure/msal-common v16.
|
|
6604
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6396
6605
|
|
|
6397
6606
|
/*
|
|
6398
6607
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6416,7 +6625,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
6416
6625
|
};
|
|
6417
6626
|
}
|
|
6418
6627
|
|
|
6419
|
-
/*! @azure/msal-common v16.
|
|
6628
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6420
6629
|
|
|
6421
6630
|
/*
|
|
6422
6631
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6502,7 +6711,7 @@ class ThrottlingUtils {
|
|
|
6502
6711
|
}
|
|
6503
6712
|
}
|
|
6504
6713
|
|
|
6505
|
-
/*! @azure/msal-common v16.
|
|
6714
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6506
6715
|
|
|
6507
6716
|
/*
|
|
6508
6717
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6533,7 +6742,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
|
|
|
6533
6742
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6534
6743
|
}
|
|
6535
6744
|
|
|
6536
|
-
/*! @azure/msal-common v16.
|
|
6745
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6537
6746
|
|
|
6538
6747
|
/*
|
|
6539
6748
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6649,7 +6858,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
6649
6858
|
return response;
|
|
6650
6859
|
}
|
|
6651
6860
|
|
|
6652
|
-
/*! @azure/msal-common v16.
|
|
6861
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6653
6862
|
|
|
6654
6863
|
/*
|
|
6655
6864
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6699,7 +6908,7 @@ class AuthorizationCodeClient {
|
|
|
6699
6908
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request, this.serverTelemetryManager);
|
|
6700
6909
|
// Retrieve requestId from response headers
|
|
6701
6910
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
6702
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin);
|
|
6911
|
+
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);
|
|
6703
6912
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
6704
6913
|
responseHandler.validateTokenResponse(response.body, request.correlationId);
|
|
6705
6914
|
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);
|
|
@@ -6800,7 +7009,7 @@ class AuthorizationCodeClient {
|
|
|
6800
7009
|
addGrantType(parameters, GrantType.AUTHORIZATION_CODE_GRANT);
|
|
6801
7010
|
addClientInfo(parameters);
|
|
6802
7011
|
if (request.authenticationScheme === AuthenticationScheme$1.POP) {
|
|
6803
|
-
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
7012
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager, this.performanceClient);
|
|
6804
7013
|
let reqCnfData;
|
|
6805
7014
|
if (!request.popKid) {
|
|
6806
7015
|
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
|
|
@@ -6912,7 +7121,7 @@ class AuthorizationCodeClient {
|
|
|
6912
7121
|
}
|
|
6913
7122
|
}
|
|
6914
7123
|
|
|
6915
|
-
/*! @azure/msal-common v16.
|
|
7124
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
6916
7125
|
|
|
6917
7126
|
/*
|
|
6918
7127
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7139,76 +7348,7 @@ function extractLoginHint(account) {
|
|
|
7139
7348
|
return account.loginHint || account.idTokenClaims?.login_hint || null;
|
|
7140
7349
|
}
|
|
7141
7350
|
|
|
7142
|
-
/*! @azure/msal-common v16.
|
|
7143
|
-
|
|
7144
|
-
/*
|
|
7145
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7146
|
-
* Licensed under the MIT License.
|
|
7147
|
-
*/
|
|
7148
|
-
/**
|
|
7149
|
-
* Error thrown when there is an error in the client code running on the browser.
|
|
7150
|
-
*/
|
|
7151
|
-
class JoseHeaderError extends AuthError {
|
|
7152
|
-
constructor(errorCode, correlationId, errorMessage) {
|
|
7153
|
-
super(errorCode, correlationId, errorMessage);
|
|
7154
|
-
this.name = "JoseHeaderError";
|
|
7155
|
-
Object.setPrototypeOf(this, JoseHeaderError.prototype);
|
|
7156
|
-
}
|
|
7157
|
-
}
|
|
7158
|
-
/** Returns JoseHeaderError object */
|
|
7159
|
-
function createJoseHeaderError(code, correlationId) {
|
|
7160
|
-
return new JoseHeaderError(code, correlationId);
|
|
7161
|
-
}
|
|
7162
|
-
|
|
7163
|
-
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7164
|
-
/*
|
|
7165
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7166
|
-
* Licensed under the MIT License.
|
|
7167
|
-
*/
|
|
7168
|
-
const missingKidError = "missing_kid_error";
|
|
7169
|
-
const missingAlgError = "missing_alg_error";
|
|
7170
|
-
|
|
7171
|
-
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7172
|
-
|
|
7173
|
-
/*
|
|
7174
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7175
|
-
* Licensed under the MIT License.
|
|
7176
|
-
*/
|
|
7177
|
-
/** @internal */
|
|
7178
|
-
class JoseHeader {
|
|
7179
|
-
constructor(options) {
|
|
7180
|
-
this.typ = options.typ;
|
|
7181
|
-
this.alg = options.alg;
|
|
7182
|
-
this.kid = options.kid;
|
|
7183
|
-
}
|
|
7184
|
-
/**
|
|
7185
|
-
* Builds SignedHttpRequest formatted JOSE Header from the
|
|
7186
|
-
* JOSE Header options provided or previously set on the object and returns
|
|
7187
|
-
* the stringified header object.
|
|
7188
|
-
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
|
|
7189
|
-
* @param shrHeaderOptions
|
|
7190
|
-
* @returns
|
|
7191
|
-
*/
|
|
7192
|
-
static getShrHeaderString(shrHeaderOptions) {
|
|
7193
|
-
// KeyID is required on the SHR header
|
|
7194
|
-
if (!shrHeaderOptions.kid) {
|
|
7195
|
-
throw createJoseHeaderError(missingKidError, "");
|
|
7196
|
-
}
|
|
7197
|
-
// Alg is required on the SHR header
|
|
7198
|
-
if (!shrHeaderOptions.alg) {
|
|
7199
|
-
throw createJoseHeaderError(missingAlgError, "");
|
|
7200
|
-
}
|
|
7201
|
-
const shrHeader = new JoseHeader({
|
|
7202
|
-
// Access Token PoP headers must have type pop, but the type header can be overriden for special cases
|
|
7203
|
-
typ: shrHeaderOptions.typ || JsonWebTokenTypes$1.Pop,
|
|
7204
|
-
kid: shrHeaderOptions.kid,
|
|
7205
|
-
alg: shrHeaderOptions.alg,
|
|
7206
|
-
});
|
|
7207
|
-
return JSON.stringify(shrHeader);
|
|
7208
|
-
}
|
|
7209
|
-
}
|
|
7210
|
-
|
|
7211
|
-
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7351
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
7212
7352
|
|
|
7213
7353
|
/*
|
|
7214
7354
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7757,7 +7897,7 @@ class PerformanceClient {
|
|
|
7757
7897
|
}
|
|
7758
7898
|
}
|
|
7759
7899
|
|
|
7760
|
-
/*! @azure/msal-common v16.
|
|
7900
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
7761
7901
|
|
|
7762
7902
|
/*
|
|
7763
7903
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7792,7 +7932,7 @@ class RefreshTokenClient {
|
|
|
7792
7932
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
|
|
7793
7933
|
// Retrieve requestId from response headers
|
|
7794
7934
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
7795
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin);
|
|
7935
|
+
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);
|
|
7796
7936
|
responseHandler.validateTokenResponse(response.body, request.correlationId);
|
|
7797
7937
|
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);
|
|
7798
7938
|
}
|
|
@@ -7933,7 +8073,7 @@ class RefreshTokenClient {
|
|
|
7933
8073
|
addClientAssertionType(parameters, clientAssertion.assertionType);
|
|
7934
8074
|
}
|
|
7935
8075
|
if (request.authenticationScheme === AuthenticationScheme$1.POP) {
|
|
7936
|
-
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
8076
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager, this.performanceClient);
|
|
7937
8077
|
let reqCnfData;
|
|
7938
8078
|
if (!request.popKid) {
|
|
7939
8079
|
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
|
|
@@ -7984,7 +8124,7 @@ class RefreshTokenClient {
|
|
|
7984
8124
|
}
|
|
7985
8125
|
}
|
|
7986
8126
|
|
|
7987
|
-
/*! @azure/msal-common v16.
|
|
8127
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
7988
8128
|
|
|
7989
8129
|
/*
|
|
7990
8130
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8277,7 +8417,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
|
|
|
8277
8417
|
clearNativeBrokerErrorCode() { }
|
|
8278
8418
|
}
|
|
8279
8419
|
|
|
8280
|
-
/*! @azure/msal-common v16.
|
|
8420
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
8281
8421
|
|
|
8282
8422
|
/*
|
|
8283
8423
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8381,11 +8521,14 @@ class SilentFlowClient {
|
|
|
8381
8521
|
if (cacheRecord.idToken) {
|
|
8382
8522
|
idTokenClaims = extractTokenClaims(cacheRecord.idToken.secret, this.config.cryptoInterface.base64Decode, request.correlationId);
|
|
8383
8523
|
}
|
|
8384
|
-
return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient,
|
|
8524
|
+
return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient, {
|
|
8525
|
+
idTokenClaims,
|
|
8526
|
+
tokenBindingKeyManager: this.config.tokenBindingKeyManager,
|
|
8527
|
+
});
|
|
8385
8528
|
}
|
|
8386
8529
|
}
|
|
8387
8530
|
|
|
8388
|
-
/*! @azure/msal-common v16.
|
|
8531
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
8389
8532
|
|
|
8390
8533
|
/*
|
|
8391
8534
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8401,7 +8544,7 @@ const StubbedNetworkModule = {
|
|
|
8401
8544
|
},
|
|
8402
8545
|
};
|
|
8403
8546
|
|
|
8404
|
-
/*! @azure/msal-common v16.
|
|
8547
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
8405
8548
|
|
|
8406
8549
|
/*
|
|
8407
8550
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8454,13 +8597,13 @@ const AcquireTokenByRefreshToken = "acquireTokenByRefreshToken";
|
|
|
8454
8597
|
*/
|
|
8455
8598
|
const AcquireTokenSilentAsync = "acquireTokenSilentAsync";
|
|
8456
8599
|
/**
|
|
8457
|
-
*
|
|
8458
|
-
* Used to
|
|
8600
|
+
* provisionTokenBindingKey API in TokenBindingKeyManager class (msal-browser).
|
|
8601
|
+
* Used to provision token-binding key material and return a key identifier.
|
|
8459
8602
|
*/
|
|
8460
8603
|
const CryptoOptsGetPublicKeyThumbprint = "cryptoOptsGetPublicKeyThumbprint";
|
|
8461
8604
|
/**
|
|
8462
|
-
*
|
|
8463
|
-
* Used to
|
|
8605
|
+
* signTokenBindingJwt API in CryptoOpts class (msal-browser).
|
|
8606
|
+
* Used to sign token-binding JWTs.
|
|
8464
8607
|
*/
|
|
8465
8608
|
const CryptoOptsSignJwt = "cryptoOptsSignJwt";
|
|
8466
8609
|
/**
|
|
@@ -8617,6 +8760,9 @@ const uninitializedPublicClientApplication = "uninitialized_public_client_applic
|
|
|
8617
8760
|
const nativePromptNotSupported = "native_prompt_not_supported";
|
|
8618
8761
|
const invalidBase64String = "invalid_base64_string";
|
|
8619
8762
|
const invalidPopTokenRequest = "invalid_pop_token_request";
|
|
8763
|
+
const unsupportedTokenBindingAlgorithm = "unsupported_token_binding_algorithm";
|
|
8764
|
+
const tokenBindingKeyAlgorithmMismatch = "token_binding_key_algorithm_mismatch";
|
|
8765
|
+
const tokenBindingKeyJwkThumbprintMismatch = "token_binding_key_jwk_thumbprint_mismatch";
|
|
8620
8766
|
const failedToBuildHeaders = "failed_to_build_headers";
|
|
8621
8767
|
const failedToParseHeaders = "failed_to_parse_headers";
|
|
8622
8768
|
const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
|
|
@@ -8673,11 +8819,14 @@ var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
8673
8819
|
spaCodeAndNativeAccountIdPresent: spaCodeAndNativeAccountIdPresent,
|
|
8674
8820
|
stateInteractionTypeMismatch: stateInteractionTypeMismatch,
|
|
8675
8821
|
timedOut: timedOut,
|
|
8822
|
+
tokenBindingKeyAlgorithmMismatch: tokenBindingKeyAlgorithmMismatch,
|
|
8823
|
+
tokenBindingKeyJwkThumbprintMismatch: tokenBindingKeyJwkThumbprintMismatch,
|
|
8676
8824
|
unableToAcquireTokenFromNativePlatform: unableToAcquireTokenFromNativePlatform,
|
|
8677
8825
|
unableToLoadToken: unableToLoadToken,
|
|
8678
8826
|
unableToParseState: unableToParseState,
|
|
8679
8827
|
unableToParseTokenRequestCacheError: unableToParseTokenRequestCacheError,
|
|
8680
8828
|
uninitializedPublicClientApplication: uninitializedPublicClientApplication,
|
|
8829
|
+
unsupportedTokenBindingAlgorithm: unsupportedTokenBindingAlgorithm,
|
|
8681
8830
|
userCancelled: userCancelled
|
|
8682
8831
|
});
|
|
8683
8832
|
|
|
@@ -9015,6 +9164,8 @@ const AES_GCM = "AES-GCM";
|
|
|
9015
9164
|
const HKDF = "HKDF";
|
|
9016
9165
|
// SHA-256 hashing algorithm
|
|
9017
9166
|
const S256_HASH_ALG = "SHA-256";
|
|
9167
|
+
// JWK values used by browser-internal WebCrypto helpers.
|
|
9168
|
+
const JSON_WEB_KEY_CURVE_P256 = "P-256";
|
|
9018
9169
|
const JSON_WEB_KEY_TYPE_EC = "EC";
|
|
9019
9170
|
const JSON_WEB_KEY_TYPE_RSA = "RSA";
|
|
9020
9171
|
const MISSING_JWK_KTY_SUBERROR = "missing_jwk_kty";
|
|
@@ -9046,6 +9197,14 @@ const RSA_KEYGEN_ALGORITHM_OPTIONS = {
|
|
|
9046
9197
|
const RSA_SIGN_ALGORITHM_OPTIONS = {
|
|
9047
9198
|
name: PKCS1_V15_KEYGEN_ALG,
|
|
9048
9199
|
};
|
|
9200
|
+
const ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS = {
|
|
9201
|
+
name: "ECDSA",
|
|
9202
|
+
namedCurve: JSON_WEB_KEY_CURVE_P256,
|
|
9203
|
+
};
|
|
9204
|
+
const ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS = {
|
|
9205
|
+
name: "ECDSA",
|
|
9206
|
+
hash: { name: S256_HASH_ALG },
|
|
9207
|
+
};
|
|
9049
9208
|
/**
|
|
9050
9209
|
* Check whether browser crypto is available.
|
|
9051
9210
|
*/
|
|
@@ -9144,16 +9303,6 @@ async function generateKeyPair(extractable, usages, algorithm) {
|
|
|
9144
9303
|
async function exportJwk(key) {
|
|
9145
9304
|
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
|
9146
9305
|
}
|
|
9147
|
-
/**
|
|
9148
|
-
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
|
9149
|
-
* @param key
|
|
9150
|
-
* @param extractable
|
|
9151
|
-
* @param usages
|
|
9152
|
-
* @param algorithm
|
|
9153
|
-
*/
|
|
9154
|
-
async function importJwk(key, extractable, usages, algorithm) {
|
|
9155
|
-
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, algorithm, extractable, usages);
|
|
9156
|
-
}
|
|
9157
9306
|
/**
|
|
9158
9307
|
* Signs given data with given key.
|
|
9159
9308
|
* @param key
|
|
@@ -9309,22 +9458,22 @@ const JWK_THUMBPRINT_REQUIRED_MEMBERS = {
|
|
|
9309
9458
|
[JSON_WEB_KEY_TYPE_EC]: ["crv", "kty", "x", "y"],
|
|
9310
9459
|
[JSON_WEB_KEY_TYPE_RSA]: ["e", "kty", "n"],
|
|
9311
9460
|
};
|
|
9312
|
-
function getJwkThumbprintMembers(publicJwk) {
|
|
9461
|
+
function getJwkThumbprintMembers(publicJwk, correlationId) {
|
|
9313
9462
|
const kty = publicJwk.kty;
|
|
9314
9463
|
if (typeof kty !== "string" || kty.length === 0) {
|
|
9315
|
-
throw createBrowserAuthError(invalidPublicJwk,
|
|
9464
|
+
throw createBrowserAuthError(invalidPublicJwk, correlationId, MISSING_JWK_KTY_SUBERROR);
|
|
9316
9465
|
}
|
|
9317
9466
|
const requiredMembers = JWK_THUMBPRINT_REQUIRED_MEMBERS[kty];
|
|
9318
9467
|
if (!requiredMembers) {
|
|
9319
|
-
throw createBrowserAuthError(invalidPublicJwk,
|
|
9468
|
+
throw createBrowserAuthError(invalidPublicJwk, correlationId, UNSUPPORTED_JWK_KTY_SUBERROR);
|
|
9320
9469
|
}
|
|
9321
9470
|
return requiredMembers.reduce((thumbprintMembers, memberName) => {
|
|
9322
9471
|
const memberValue = publicJwk[memberName];
|
|
9323
9472
|
if (typeof memberValue !== "string") {
|
|
9324
|
-
throw createBrowserAuthError(invalidPublicJwk,
|
|
9473
|
+
throw createBrowserAuthError(invalidPublicJwk, correlationId, MISSING_JWK_MEMBER_SUBERROR);
|
|
9325
9474
|
}
|
|
9326
9475
|
if (memberValue.length === 0) {
|
|
9327
|
-
throw createBrowserAuthError(invalidPublicJwk,
|
|
9476
|
+
throw createBrowserAuthError(invalidPublicJwk, correlationId, EMPTY_JWK_MEMBER_SUBERROR);
|
|
9328
9477
|
}
|
|
9329
9478
|
thumbprintMembers[memberName] = memberValue;
|
|
9330
9479
|
return thumbprintMembers;
|
|
@@ -9336,8 +9485,8 @@ function getJwkThumbprintMembers(publicJwk) {
|
|
|
9336
9485
|
* and the SHA-256 digest is returned as a base64url string.
|
|
9337
9486
|
* @internal
|
|
9338
9487
|
*/
|
|
9339
|
-
async function computeJwkThumbprint(publicJwk) {
|
|
9340
|
-
const thumbprintMembers = getJwkThumbprintMembers(publicJwk);
|
|
9488
|
+
async function computeJwkThumbprint(publicJwk, correlationId) {
|
|
9489
|
+
const thumbprintMembers = getJwkThumbprintMembers(publicJwk, correlationId);
|
|
9341
9490
|
// RFC 7638 §3.3: use only required members, sorted lexicographically
|
|
9342
9491
|
const thumbprintJson = JSON.stringify(thumbprintMembers, Object.keys(thumbprintMembers).sort());
|
|
9343
9492
|
return hashString(thumbprintJson);
|
|
@@ -10071,22 +10220,19 @@ class AsyncMemoryStorage {
|
|
|
10071
10220
|
}
|
|
10072
10221
|
}
|
|
10073
10222
|
/**
|
|
10074
|
-
* Get all
|
|
10075
|
-
* asynchronous storage object.
|
|
10223
|
+
* Get all keys from both in-memory and persistent storage.
|
|
10076
10224
|
* @param correlationId
|
|
10077
10225
|
*/
|
|
10078
10226
|
async getKeys(correlationId) {
|
|
10079
10227
|
const cacheKeys = this.inMemoryCache.getKeys();
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
}
|
|
10228
|
+
try {
|
|
10229
|
+
const persistentCacheKeys = await this.indexedDBCache.getKeys();
|
|
10230
|
+
return Array.from(new Set([...cacheKeys, ...persistentCacheKeys]));
|
|
10231
|
+
}
|
|
10232
|
+
catch (e) {
|
|
10233
|
+
this.handleDatabaseAccessError(e, correlationId);
|
|
10234
|
+
return cacheKeys;
|
|
10088
10235
|
}
|
|
10089
|
-
return cacheKeys;
|
|
10090
10236
|
}
|
|
10091
10237
|
/**
|
|
10092
10238
|
* Returns true or false if the given key is present in the cache.
|
|
@@ -10137,6 +10283,152 @@ class AsyncMemoryStorage {
|
|
|
10137
10283
|
}
|
|
10138
10284
|
}
|
|
10139
10285
|
|
|
10286
|
+
/*
|
|
10287
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10288
|
+
* Licensed under the MIT License.
|
|
10289
|
+
*/
|
|
10290
|
+
/**
|
|
10291
|
+
* Owns browser token-binding key lifecycle and storage lookup.
|
|
10292
|
+
* @internal
|
|
10293
|
+
*/
|
|
10294
|
+
class TokenBindingKeyManager {
|
|
10295
|
+
constructor(logger, performanceClient) {
|
|
10296
|
+
this.logger = logger;
|
|
10297
|
+
this.cache = TokenBindingKeyManager.getTokenBindingKeyStorage(this.logger);
|
|
10298
|
+
this.performanceClient = performanceClient;
|
|
10299
|
+
}
|
|
10300
|
+
static getTokenBindingKeyStorage(logger) {
|
|
10301
|
+
if (!TokenBindingKeyManager.tokenBindingKeyStorage) {
|
|
10302
|
+
TokenBindingKeyManager.tokenBindingKeyStorage =
|
|
10303
|
+
new AsyncMemoryStorage(logger);
|
|
10304
|
+
}
|
|
10305
|
+
return TokenBindingKeyManager.tokenBindingKeyStorage;
|
|
10306
|
+
}
|
|
10307
|
+
/**
|
|
10308
|
+
* Provisions a browser token-binding key and returns its key identifier.
|
|
10309
|
+
* @param request - Key provisioning policy.
|
|
10310
|
+
*/
|
|
10311
|
+
async provisionTokenBindingKey(request) {
|
|
10312
|
+
const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(CryptoOptsGetPublicKeyThumbprint, request.correlationId);
|
|
10313
|
+
try {
|
|
10314
|
+
const activeKeyPair = await this.createTokenBindingKey(request);
|
|
10315
|
+
publicKeyThumbMeasurement?.end({
|
|
10316
|
+
success: true,
|
|
10317
|
+
...this.getTokenBindingKeyTelemetry(activeKeyPair),
|
|
10318
|
+
});
|
|
10319
|
+
return activeKeyPair.keyId;
|
|
10320
|
+
}
|
|
10321
|
+
catch (e) {
|
|
10322
|
+
publicKeyThumbMeasurement?.end({
|
|
10323
|
+
success: false,
|
|
10324
|
+
tokenBindingKeyType: request.tokenBindingKeyType,
|
|
10325
|
+
tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
|
|
10326
|
+
});
|
|
10327
|
+
throw e;
|
|
10328
|
+
}
|
|
10329
|
+
}
|
|
10330
|
+
/**
|
|
10331
|
+
* Removes a browser token-binding key by identifier.
|
|
10332
|
+
* @param kid - Token-binding key identifier.
|
|
10333
|
+
* @param correlationId - Request correlation identifier.
|
|
10334
|
+
*/
|
|
10335
|
+
async removeTokenBindingKey(kid, correlationId) {
|
|
10336
|
+
await this.cache.removeItem(kid, correlationId);
|
|
10337
|
+
const keyFound = await this.cache.containsKey(kid, correlationId);
|
|
10338
|
+
if (keyFound) {
|
|
10339
|
+
throw createClientAuthError(bindingKeyNotRemoved, correlationId);
|
|
10340
|
+
}
|
|
10341
|
+
}
|
|
10342
|
+
/**
|
|
10343
|
+
* Clears browser token-binding keys from memory and persistent storage.
|
|
10344
|
+
* @param correlationId - Request correlation identifier.
|
|
10345
|
+
*/
|
|
10346
|
+
async clearKeystore(correlationId) {
|
|
10347
|
+
this.cache.clearInMemory(correlationId);
|
|
10348
|
+
try {
|
|
10349
|
+
await this.cache.clearPersistent(correlationId);
|
|
10350
|
+
return true;
|
|
10351
|
+
}
|
|
10352
|
+
catch (e) {
|
|
10353
|
+
if (e instanceof Error) {
|
|
10354
|
+
this.logger.error(`1owpn8 ${e.message}`, correlationId);
|
|
10355
|
+
}
|
|
10356
|
+
else {
|
|
10357
|
+
this.logger.error("0yrmwo", correlationId);
|
|
10358
|
+
}
|
|
10359
|
+
return false;
|
|
10360
|
+
}
|
|
10361
|
+
}
|
|
10362
|
+
/**
|
|
10363
|
+
* Gets a token-binding public key as a JWK by identifier.
|
|
10364
|
+
* @param keyId - Token-binding key identifier.
|
|
10365
|
+
* @param correlationId - Request correlation identifier.
|
|
10366
|
+
*/
|
|
10367
|
+
async getTokenBindingPublicKeyJwk(keyId, correlationId) {
|
|
10368
|
+
const cachedKeyPair = await this.getTokenBindingKeyPair(keyId, correlationId);
|
|
10369
|
+
return exportJwk(cachedKeyPair.publicKey);
|
|
10370
|
+
}
|
|
10371
|
+
async createTokenBindingKey(request) {
|
|
10372
|
+
const keyGenAlgorithm = this.getTokenBindingKeyGenAlgorithmOptions(request.tokenBindingKeyAlgorithm, request.correlationId);
|
|
10373
|
+
const generatedKeyPair = await this.generateKeyPairAndThumbprint(TokenBindingKeyManager.TOKEN_BINDING_KEY_USAGES, keyGenAlgorithm, request.correlationId);
|
|
10374
|
+
await this.cache.setItem(generatedKeyPair.keyId, {
|
|
10375
|
+
...generatedKeyPair,
|
|
10376
|
+
tokenBindingKeyType: request.tokenBindingKeyType,
|
|
10377
|
+
tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
|
|
10378
|
+
}, request.correlationId);
|
|
10379
|
+
return {
|
|
10380
|
+
...generatedKeyPair,
|
|
10381
|
+
tokenBindingKeyType: request.tokenBindingKeyType,
|
|
10382
|
+
tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
|
|
10383
|
+
};
|
|
10384
|
+
}
|
|
10385
|
+
async generateKeyPairAndThumbprint(usages, keyGenAlgorithm, correlationId) {
|
|
10386
|
+
const keyPair = await generateKeyPair(false, usages, keyGenAlgorithm);
|
|
10387
|
+
const publicJwk = await exportJwk(keyPair.publicKey);
|
|
10388
|
+
const keyId = await computeJwkThumbprint(publicJwk, correlationId);
|
|
10389
|
+
return {
|
|
10390
|
+
publicKey: keyPair.publicKey,
|
|
10391
|
+
privateKey: keyPair.privateKey,
|
|
10392
|
+
keyId,
|
|
10393
|
+
};
|
|
10394
|
+
}
|
|
10395
|
+
/** @internal */
|
|
10396
|
+
async getTokenBindingKeyPair(keyId, correlationId) {
|
|
10397
|
+
const cachedKeyPair = await this.cache.getItem(keyId, correlationId);
|
|
10398
|
+
if (!cachedKeyPair) {
|
|
10399
|
+
throw createBrowserAuthError(cryptoKeyNotFound, correlationId);
|
|
10400
|
+
}
|
|
10401
|
+
return cachedKeyPair;
|
|
10402
|
+
}
|
|
10403
|
+
/** @internal */
|
|
10404
|
+
getTokenBindingKeyTelemetry(cachedKeyPair, fallbackAlgorithm) {
|
|
10405
|
+
return {
|
|
10406
|
+
...(cachedKeyPair.tokenBindingKeyType && {
|
|
10407
|
+
tokenBindingKeyType: cachedKeyPair.tokenBindingKeyType,
|
|
10408
|
+
}),
|
|
10409
|
+
...(cachedKeyPair.tokenBindingKeyAlgorithm || fallbackAlgorithm
|
|
10410
|
+
? {
|
|
10411
|
+
tokenBindingKeyAlgorithm: cachedKeyPair.tokenBindingKeyAlgorithm ||
|
|
10412
|
+
fallbackAlgorithm,
|
|
10413
|
+
}
|
|
10414
|
+
: {}),
|
|
10415
|
+
};
|
|
10416
|
+
}
|
|
10417
|
+
getTokenBindingKeyGenAlgorithmOptions(tokenBindingKeyAlgorithm, correlationId) {
|
|
10418
|
+
if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.RS256) {
|
|
10419
|
+
return RSA_KEYGEN_ALGORITHM_OPTIONS;
|
|
10420
|
+
}
|
|
10421
|
+
if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.ES256) {
|
|
10422
|
+
return ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS;
|
|
10423
|
+
}
|
|
10424
|
+
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId);
|
|
10425
|
+
}
|
|
10426
|
+
}
|
|
10427
|
+
TokenBindingKeyManager.TOKEN_BINDING_KEY_USAGES = [
|
|
10428
|
+
"sign",
|
|
10429
|
+
"verify",
|
|
10430
|
+
];
|
|
10431
|
+
|
|
10140
10432
|
/*
|
|
10141
10433
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10142
10434
|
* Licensed under the MIT License.
|
|
@@ -10150,8 +10442,8 @@ class CryptoOps {
|
|
|
10150
10442
|
this.logger = logger;
|
|
10151
10443
|
// Browser crypto needs to be validated first before any other classes can be set.
|
|
10152
10444
|
validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
|
|
10153
|
-
this.cache = new AsyncMemoryStorage(this.logger);
|
|
10154
10445
|
this.performanceClient = performanceClient;
|
|
10446
|
+
this.tokenBindingKeyManager = new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
10155
10447
|
}
|
|
10156
10448
|
/**
|
|
10157
10449
|
* Creates a new random GUID - used to populate state and nonce.
|
|
@@ -10189,114 +10481,45 @@ class CryptoOps {
|
|
|
10189
10481
|
encodeKid(inputKid) {
|
|
10190
10482
|
return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));
|
|
10191
10483
|
}
|
|
10192
|
-
/**
|
|
10193
|
-
* Generates a keypair, stores it and returns a thumbprint
|
|
10194
|
-
* @param request
|
|
10195
|
-
*/
|
|
10196
|
-
async getPublicKeyThumbprint(request) {
|
|
10197
|
-
const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(CryptoOptsGetPublicKeyThumbprint, request.correlationId);
|
|
10198
|
-
// Generate Keypair
|
|
10199
|
-
const keyPair = await generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES, RSA_KEYGEN_ALGORITHM_OPTIONS);
|
|
10200
|
-
// Generate Thumbprint for Public Key
|
|
10201
|
-
const publicKeyJwk = await exportJwk(keyPair.publicKey);
|
|
10202
|
-
const publicJwkHash = await computeJwkThumbprint(publicKeyJwk);
|
|
10203
|
-
// Generate Thumbprint for Private Key
|
|
10204
|
-
const privateKeyJwk = await exportJwk(keyPair.privateKey);
|
|
10205
|
-
// Re-import private key to make it unextractable
|
|
10206
|
-
const unextractablePrivateKey = await importJwk(privateKeyJwk, false, ["sign"], RSA_KEYGEN_ALGORITHM_OPTIONS);
|
|
10207
|
-
// Store Keypair data in keystore
|
|
10208
|
-
await this.cache.setItem(publicJwkHash, {
|
|
10209
|
-
privateKey: unextractablePrivateKey,
|
|
10210
|
-
publicKey: keyPair.publicKey,
|
|
10211
|
-
requestMethod: request.resourceRequestMethod,
|
|
10212
|
-
requestUri: request.resourceRequestUri,
|
|
10213
|
-
}, request.correlationId);
|
|
10214
|
-
if (publicKeyThumbMeasurement) {
|
|
10215
|
-
publicKeyThumbMeasurement.end({
|
|
10216
|
-
success: true,
|
|
10217
|
-
});
|
|
10218
|
-
}
|
|
10219
|
-
return publicJwkHash;
|
|
10220
|
-
}
|
|
10221
10484
|
/**
|
|
10222
10485
|
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
10223
10486
|
* @param kid
|
|
10224
10487
|
* @param correlationId
|
|
10225
10488
|
*/
|
|
10226
10489
|
async removeTokenBindingKey(kid, correlationId) {
|
|
10227
|
-
await this.
|
|
10228
|
-
const keyFound = await this.cache.containsKey(kid, correlationId);
|
|
10229
|
-
if (keyFound) {
|
|
10230
|
-
throw createClientAuthError(bindingKeyNotRemoved, correlationId);
|
|
10231
|
-
}
|
|
10490
|
+
await this.tokenBindingKeyManager.removeTokenBindingKey(kid, correlationId);
|
|
10232
10491
|
}
|
|
10233
10492
|
/**
|
|
10234
10493
|
* Removes all cryptographic keys from IndexedDB storage
|
|
10235
10494
|
* @param correlationId
|
|
10236
10495
|
*/
|
|
10237
10496
|
async clearKeystore(correlationId) {
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10497
|
+
return this.tokenBindingKeyManager.clearKeystore(correlationId);
|
|
10498
|
+
}
|
|
10499
|
+
/** @internal */
|
|
10500
|
+
async signTokenBindingJwt(header, payload, kid, correlationId) {
|
|
10501
|
+
let telemetry = {};
|
|
10502
|
+
const signTokenBindingJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
|
|
10244
10503
|
try {
|
|
10245
|
-
await this.
|
|
10246
|
-
|
|
10504
|
+
const cachedKeyPair = await this.tokenBindingKeyManager.getTokenBindingKeyPair(kid, correlationId);
|
|
10505
|
+
await this.validateTokenBindingJwtHeaderKey(header, kid, correlationId);
|
|
10506
|
+
telemetry = this.tokenBindingKeyManager.getTokenBindingKeyTelemetry(cachedKeyPair, header.alg);
|
|
10507
|
+
const signingAlgorithm = this.getTokenBindingKeySigningAlgorithm(cachedKeyPair, header.alg, correlationId);
|
|
10508
|
+
const tokenString = `${urlEncode(JSON.stringify(header))}.${urlEncode(JSON.stringify(payload))}`;
|
|
10509
|
+
const encodedSignature = await this.signInput(cachedKeyPair, tokenString, signingAlgorithm);
|
|
10510
|
+
signTokenBindingJwtMeasurement?.end({
|
|
10511
|
+
success: true,
|
|
10512
|
+
...telemetry,
|
|
10513
|
+
});
|
|
10514
|
+
return `${tokenString}.${encodedSignature}`;
|
|
10247
10515
|
}
|
|
10248
10516
|
catch (e) {
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
else {
|
|
10253
|
-
this.logger.error("0yrmwo", correlationId);
|
|
10254
|
-
}
|
|
10255
|
-
return false;
|
|
10256
|
-
}
|
|
10257
|
-
}
|
|
10258
|
-
/**
|
|
10259
|
-
* Signs the given object as a jwt payload with private key retrieved by given kid.
|
|
10260
|
-
* @param payload
|
|
10261
|
-
* @param kid
|
|
10262
|
-
*/
|
|
10263
|
-
async signJwt(payload, kid, shrOptions, correlationId) {
|
|
10264
|
-
const signJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
|
|
10265
|
-
const cachedKeyPair = await this.cache.getItem(kid, correlationId || "");
|
|
10266
|
-
if (!cachedKeyPair) {
|
|
10267
|
-
throw createBrowserAuthError(cryptoKeyNotFound, correlationId || "");
|
|
10268
|
-
}
|
|
10269
|
-
// Get public key as JWK
|
|
10270
|
-
const publicKeyJwk = await exportJwk(cachedKeyPair.publicKey);
|
|
10271
|
-
const publicKeyJwkString = getSortedObjectString(publicKeyJwk);
|
|
10272
|
-
// Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: "FULL_PUBLIC_KEY_HASH" })
|
|
10273
|
-
const encodedKeyIdThumbprint = urlEncode(JSON.stringify({ kid: kid }));
|
|
10274
|
-
// Generate header
|
|
10275
|
-
const shrHeader = JoseHeader.getShrHeaderString({
|
|
10276
|
-
...shrOptions?.header,
|
|
10277
|
-
alg: publicKeyJwk.alg,
|
|
10278
|
-
kid: encodedKeyIdThumbprint,
|
|
10279
|
-
});
|
|
10280
|
-
const encodedShrHeader = urlEncode(shrHeader);
|
|
10281
|
-
// Generate payload
|
|
10282
|
-
payload.cnf = {
|
|
10283
|
-
jwk: JSON.parse(publicKeyJwkString),
|
|
10284
|
-
};
|
|
10285
|
-
const encodedPayload = urlEncode(JSON.stringify(payload));
|
|
10286
|
-
// Form token string
|
|
10287
|
-
const tokenString = `${encodedShrHeader}.${encodedPayload}`;
|
|
10288
|
-
// Sign token
|
|
10289
|
-
const encoder = new TextEncoder();
|
|
10290
|
-
const tokenBuffer = encoder.encode(tokenString);
|
|
10291
|
-
const signatureBuffer = await sign(cachedKeyPair.privateKey, tokenBuffer, RSA_SIGN_ALGORITHM_OPTIONS);
|
|
10292
|
-
const encodedSignature = urlEncodeArr(new Uint8Array(signatureBuffer));
|
|
10293
|
-
const signedJwt = `${tokenString}.${encodedSignature}`;
|
|
10294
|
-
if (signJwtMeasurement) {
|
|
10295
|
-
signJwtMeasurement.end({
|
|
10296
|
-
success: true,
|
|
10517
|
+
signTokenBindingJwtMeasurement?.end({
|
|
10518
|
+
success: false,
|
|
10519
|
+
...telemetry,
|
|
10297
10520
|
});
|
|
10521
|
+
throw e;
|
|
10298
10522
|
}
|
|
10299
|
-
return signedJwt;
|
|
10300
10523
|
}
|
|
10301
10524
|
/**
|
|
10302
10525
|
* Returns the SHA-256 hash of an input string
|
|
@@ -10305,11 +10528,39 @@ class CryptoOps {
|
|
|
10305
10528
|
async hashString(plainText) {
|
|
10306
10529
|
return hashString(plainText);
|
|
10307
10530
|
}
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10531
|
+
async signInput(cachedKeyPair, signingInput, algorithm) {
|
|
10532
|
+
const encoder = new TextEncoder();
|
|
10533
|
+
const signatureBuffer = await sign(cachedKeyPair.privateKey, encoder.encode(signingInput), algorithm);
|
|
10534
|
+
return urlEncodeArr(new Uint8Array(signatureBuffer));
|
|
10535
|
+
}
|
|
10536
|
+
getTokenBindingKeySigningAlgorithm(cachedKeyPair, requestedAlgorithm, correlationId) {
|
|
10537
|
+
const keyAlgorithm = cachedKeyPair.privateKey.algorithm;
|
|
10538
|
+
if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 &&
|
|
10539
|
+
keyAlgorithm.name === RSA_SIGN_ALGORITHM_OPTIONS.name) {
|
|
10540
|
+
return RSA_SIGN_ALGORITHM_OPTIONS;
|
|
10541
|
+
}
|
|
10542
|
+
if (requestedAlgorithm === JsonWebTokenAlgorithms.ES256 &&
|
|
10543
|
+
keyAlgorithm.name ===
|
|
10544
|
+
ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS.name &&
|
|
10545
|
+
keyAlgorithm.namedCurve ===
|
|
10546
|
+
ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS.namedCurve) {
|
|
10547
|
+
return ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS;
|
|
10548
|
+
}
|
|
10549
|
+
if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 ||
|
|
10550
|
+
requestedAlgorithm === JsonWebTokenAlgorithms.ES256) {
|
|
10551
|
+
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId, tokenBindingKeyAlgorithmMismatch);
|
|
10552
|
+
}
|
|
10553
|
+
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId);
|
|
10554
|
+
}
|
|
10555
|
+
async validateTokenBindingJwtHeaderKey(header, kid, correlationId) {
|
|
10556
|
+
if (!header.jwk) {
|
|
10557
|
+
return;
|
|
10558
|
+
}
|
|
10559
|
+
const headerKeyId = await computeJwkThumbprint(header.jwk, correlationId);
|
|
10560
|
+
if (headerKeyId !== kid) {
|
|
10561
|
+
throw createBrowserAuthError(invalidPublicJwk, correlationId, tokenBindingKeyJwkThumbprintMismatch);
|
|
10562
|
+
}
|
|
10563
|
+
}
|
|
10313
10564
|
}
|
|
10314
10565
|
|
|
10315
10566
|
/*
|
|
@@ -10904,7 +11155,7 @@ const EventType = {
|
|
|
10904
11155
|
|
|
10905
11156
|
/* eslint-disable header/header */
|
|
10906
11157
|
const name = "@azure/msal-browser";
|
|
10907
|
-
const version = "5.
|
|
11158
|
+
const version = "5.19.0";
|
|
10908
11159
|
|
|
10909
11160
|
/*
|
|
10910
11161
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -12519,7 +12770,7 @@ class EventHandler {
|
|
|
12519
12770
|
* Licensed under the MIT License.
|
|
12520
12771
|
*/
|
|
12521
12772
|
class BaseInteractionClient {
|
|
12522
|
-
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider) {
|
|
12773
|
+
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager) {
|
|
12523
12774
|
this.config = config;
|
|
12524
12775
|
this.browserStorage = storageImpl;
|
|
12525
12776
|
this.browserCrypto = browserCrypto;
|
|
@@ -12530,6 +12781,9 @@ class BaseInteractionClient {
|
|
|
12530
12781
|
this.correlationId = correlationId;
|
|
12531
12782
|
this.logger = logger.clone(name, version);
|
|
12532
12783
|
this.performanceClient = performanceClient;
|
|
12784
|
+
this.tokenBindingKeyManager =
|
|
12785
|
+
tokenBindingKeyManager ||
|
|
12786
|
+
new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
12533
12787
|
}
|
|
12534
12788
|
}
|
|
12535
12789
|
/**
|
|
@@ -12656,6 +12910,11 @@ async function clearCacheOnLogout(browserStorage, browserCrypto, logger, correla
|
|
|
12656
12910
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12657
12911
|
* Licensed under the MIT License.
|
|
12658
12912
|
*/
|
|
12913
|
+
const SUPPORTED_AUTHENTICATION_SCHEMES = new Set([
|
|
12914
|
+
AuthenticationScheme$1.BEARER,
|
|
12915
|
+
AuthenticationScheme$1.POP,
|
|
12916
|
+
AuthenticationScheme$1.SSH,
|
|
12917
|
+
]);
|
|
12659
12918
|
/**
|
|
12660
12919
|
* Initializer function for all request APIs
|
|
12661
12920
|
* @param request
|
|
@@ -12680,13 +12939,16 @@ async function initializeBaseRequest(request, config, performanceClient, logger,
|
|
|
12680
12939
|
logger.verbose("1l4fwv", correlationId);
|
|
12681
12940
|
}
|
|
12682
12941
|
else {
|
|
12942
|
+
if (!SUPPORTED_AUTHENTICATION_SCHEMES.has(validatedRequest.authenticationScheme)) {
|
|
12943
|
+
throw createClientConfigurationError(unsupportedAuthenticationScheme, correlationId);
|
|
12944
|
+
}
|
|
12683
12945
|
if (validatedRequest.authenticationScheme ===
|
|
12684
12946
|
AuthenticationScheme$1.SSH) {
|
|
12685
12947
|
if (!request.sshJwk) {
|
|
12686
|
-
throw createClientConfigurationError(missingSshJwk,
|
|
12948
|
+
throw createClientConfigurationError(missingSshJwk, correlationId);
|
|
12687
12949
|
}
|
|
12688
12950
|
if (!request.sshKid) {
|
|
12689
|
-
throw createClientConfigurationError(missingSshKid,
|
|
12951
|
+
throw createClientConfigurationError(missingSshKid, correlationId);
|
|
12690
12952
|
}
|
|
12691
12953
|
}
|
|
12692
12954
|
logger.verbose(`1ecmns ${validatedRequest.authenticationScheme}`, correlationId);
|
|
@@ -12871,6 +13133,7 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
12871
13133
|
correlationId: this.correlationId,
|
|
12872
13134
|
},
|
|
12873
13135
|
cryptoInterface: this.browserCrypto,
|
|
13136
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
12874
13137
|
networkInterface: this.networkClient,
|
|
12875
13138
|
storageInterface: this.browserStorage,
|
|
12876
13139
|
serverTelemetryManager: serverTelemetryManager,
|
|
@@ -13342,13 +13605,13 @@ class SilentCacheClient extends StandardInteractionClient {
|
|
|
13342
13605
|
* Licensed under the MIT License.
|
|
13343
13606
|
*/
|
|
13344
13607
|
class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
13345
|
-
constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
|
|
13346
|
-
super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider);
|
|
13608
|
+
constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId, tokenBindingKeyManager) {
|
|
13609
|
+
super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, tokenBindingKeyManager);
|
|
13347
13610
|
this.apiId = apiId;
|
|
13348
13611
|
this.accountId = accountId;
|
|
13349
13612
|
this.platformAuthProvider = provider;
|
|
13350
13613
|
this.nativeStorageManager = nativeStorageImpl;
|
|
13351
|
-
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider);
|
|
13614
|
+
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, this.tokenBindingKeyManager);
|
|
13352
13615
|
const extensionName = this.platformAuthProvider.getExtensionName();
|
|
13353
13616
|
this.skus = ServerTelemetryManager.makeExtraSkuString({
|
|
13354
13617
|
libraryName: BrowserConstants.MSAL_SKU,
|
|
@@ -13695,7 +13958,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
13695
13958
|
return response.shr;
|
|
13696
13959
|
}
|
|
13697
13960
|
// Generate SHR in msal js if WAM does not compute it when POP is enabled
|
|
13698
|
-
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.performanceClient);
|
|
13961
|
+
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.tokenBindingKeyManager, this.performanceClient);
|
|
13699
13962
|
const shrParameters = {
|
|
13700
13963
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
13701
13964
|
resourceRequestUri: request.resourceRequestUri,
|
|
@@ -13955,7 +14218,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
13955
14218
|
shrNonce: request.shrNonce,
|
|
13956
14219
|
correlationId: this.correlationId,
|
|
13957
14220
|
};
|
|
13958
|
-
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.performanceClient);
|
|
14221
|
+
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.tokenBindingKeyManager, this.performanceClient);
|
|
13959
14222
|
// generate reqCnf if not provided in the request
|
|
13960
14223
|
let reqCnfData;
|
|
13961
14224
|
if (!validatedRequest.keyId) {
|
|
@@ -14145,7 +14408,8 @@ async function getStandardParameters(config, authority, request, logger, perform
|
|
|
14145
14408
|
// pass the req_cnf for POP
|
|
14146
14409
|
if (request.authenticationScheme === AuthenticationScheme$1.POP) {
|
|
14147
14410
|
const cryptoOps = new CryptoOps(logger, performanceClient);
|
|
14148
|
-
const
|
|
14411
|
+
const tokenBindingKeyManager = new TokenBindingKeyManager(logger, performanceClient);
|
|
14412
|
+
const popTokenGenerator = new PopTokenGenerator(cryptoOps, tokenBindingKeyManager, performanceClient);
|
|
14149
14413
|
// req_cnf is always sent as a string for SPAs
|
|
14150
14414
|
let reqCnfData;
|
|
14151
14415
|
if (!request.popKid) {
|
|
@@ -14354,7 +14618,7 @@ async function handleResponseEAR(request, response, apiId, config, authority, br
|
|
|
14354
14618
|
if (decryptedData.accountId) {
|
|
14355
14619
|
return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider);
|
|
14356
14620
|
}
|
|
14357
|
-
const responseHandler = new ResponseHandler(config.auth.clientId, browserStorage, new CryptoOps(logger, performanceClient), logger, performanceClient, null, null);
|
|
14621
|
+
const responseHandler = new ResponseHandler(config.auth.clientId, browserStorage, new CryptoOps(logger, performanceClient), logger, performanceClient, null, null, new TokenBindingKeyManager(logger, performanceClient));
|
|
14358
14622
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
14359
14623
|
responseHandler.validateTokenResponse(decryptedData, request.correlationId);
|
|
14360
14624
|
// Temporary until response handler is refactored to be more flow agnostic.
|
|
@@ -15234,8 +15498,8 @@ function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvid
|
|
|
15234
15498
|
* Licensed under the MIT License.
|
|
15235
15499
|
*/
|
|
15236
15500
|
class PopupClient extends StandardInteractionClient {
|
|
15237
|
-
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler, waitForPopupResponseHook) {
|
|
15238
|
-
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler);
|
|
15501
|
+
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler, waitForPopupResponseHook, tokenBindingKeyManager) {
|
|
15502
|
+
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler, tokenBindingKeyManager);
|
|
15239
15503
|
this.nativeStorage = nativeStorageImpl;
|
|
15240
15504
|
this.eventHandler = eventHandler;
|
|
15241
15505
|
this.waitForPopupResponseHook = waitForPopupResponseHook;
|
|
@@ -15749,8 +16013,8 @@ function getNavigationType() {
|
|
|
15749
16013
|
return navigation?.type;
|
|
15750
16014
|
}
|
|
15751
16015
|
class RedirectClient extends StandardInteractionClient {
|
|
15752
|
-
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler) {
|
|
15753
|
-
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler);
|
|
16016
|
+
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler, tokenBindingKeyManager) {
|
|
16017
|
+
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler, tokenBindingKeyManager);
|
|
15754
16018
|
this.nativeStorage = nativeStorageImpl;
|
|
15755
16019
|
}
|
|
15756
16020
|
/**
|
|
@@ -16242,8 +16506,8 @@ function removeHiddenIframe(iframe) {
|
|
|
16242
16506
|
* Licensed under the MIT License.
|
|
16243
16507
|
*/
|
|
16244
16508
|
class SilentIframeClient extends StandardInteractionClient {
|
|
16245
|
-
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, correlationId, platformAuthProvider, waitForIframeResponseHook) {
|
|
16246
|
-
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider);
|
|
16509
|
+
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, correlationId, platformAuthProvider, waitForIframeResponseHook, tokenBindingKeyManager) {
|
|
16510
|
+
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager);
|
|
16247
16511
|
this.apiId = apiId;
|
|
16248
16512
|
this.nativeStorage = nativeStorageImpl;
|
|
16249
16513
|
this.waitForIframeResponseHook = waitForIframeResponseHook;
|
|
@@ -16550,8 +16814,8 @@ class HybridSpaAuthorizationCodeClient extends AuthorizationCodeClient {
|
|
|
16550
16814
|
* Licensed under the MIT License.
|
|
16551
16815
|
*/
|
|
16552
16816
|
class SilentAuthCodeClient extends StandardInteractionClient {
|
|
16553
|
-
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, correlationId, platformAuthProvider) {
|
|
16554
|
-
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider);
|
|
16817
|
+
constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager) {
|
|
16818
|
+
super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager);
|
|
16555
16819
|
this.apiId = apiId;
|
|
16556
16820
|
}
|
|
16557
16821
|
/**
|
|
@@ -16704,10 +16968,15 @@ class StandardController {
|
|
|
16704
16968
|
this.hybridAuthCodeResponses = new Map();
|
|
16705
16969
|
// Initialize performance client
|
|
16706
16970
|
this.performanceClient = this.config.telemetry.client;
|
|
16707
|
-
// Initialize
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
|
|
16971
|
+
// Initialize environment-specific crypto and token-binding services.
|
|
16972
|
+
if (this.isBrowserEnvironment) {
|
|
16973
|
+
this.browserCrypto = new CryptoOps(this.logger, this.performanceClient);
|
|
16974
|
+
this.tokenBindingKeyManager = new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
16975
|
+
}
|
|
16976
|
+
else {
|
|
16977
|
+
this.browserCrypto = DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
16978
|
+
this.tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER;
|
|
16979
|
+
}
|
|
16711
16980
|
this.eventHandler = new EventHandler(this.logger);
|
|
16712
16981
|
// Initialize the browser storage class.
|
|
16713
16982
|
this.browserStorage = this.isBrowserEnvironment
|
|
@@ -16860,7 +17129,7 @@ class StandardController {
|
|
|
16860
17129
|
rootMeasurement.add({
|
|
16861
17130
|
isPlatformBrokerRequest: true,
|
|
16862
17131
|
});
|
|
16863
|
-
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.platformAuthProvider, platformBrokerRequest.accountId, this.nativeInternalStorage, platformBrokerRequest.correlationId);
|
|
17132
|
+
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.platformAuthProvider, platformBrokerRequest.accountId, this.nativeInternalStorage, platformBrokerRequest.correlationId, this.tokenBindingKeyManager);
|
|
16864
17133
|
redirectResponse = invokeAsync(nativeClient.handleRedirectPromise.bind(nativeClient), HandleNativeRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)();
|
|
16865
17134
|
}
|
|
16866
17135
|
else {
|
|
@@ -16961,7 +17230,7 @@ class StandardController {
|
|
|
16961
17230
|
let result;
|
|
16962
17231
|
if (this.platformAuthProvider &&
|
|
16963
17232
|
this.canUsePlatformBroker(request)) {
|
|
16964
|
-
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
|
|
17233
|
+
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
|
|
16965
17234
|
result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
|
|
16966
17235
|
if (e instanceof NativeAuthError &&
|
|
16967
17236
|
isFatalNativeAuthError(e)) {
|
|
@@ -17636,7 +17905,7 @@ class StandardController {
|
|
|
17636
17905
|
if (!this.platformAuthProvider) {
|
|
17637
17906
|
throw createBrowserAuthError(nativeConnectionNotEstablished, correlationId);
|
|
17638
17907
|
}
|
|
17639
|
-
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.platformAuthProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
|
|
17908
|
+
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.platformAuthProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
|
|
17640
17909
|
return invokeAsync(nativeClient.acquireToken.bind(nativeClient), NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)(request, cacheLookupPolicy);
|
|
17641
17910
|
}
|
|
17642
17911
|
/**
|
|
@@ -17693,39 +17962,39 @@ class StandardController {
|
|
|
17693
17962
|
* @param correlationId
|
|
17694
17963
|
*/
|
|
17695
17964
|
createPopupClient(correlationId) {
|
|
17696
|
-
return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForPopupResponse);
|
|
17965
|
+
return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForPopupResponse, this.tokenBindingKeyManager);
|
|
17697
17966
|
}
|
|
17698
17967
|
/**
|
|
17699
17968
|
* Returns new instance of the Redirect Interaction Client
|
|
17700
17969
|
* @param correlationId
|
|
17701
17970
|
*/
|
|
17702
17971
|
createRedirectClient(correlationId) {
|
|
17703
|
-
return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider);
|
|
17972
|
+
return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
|
|
17704
17973
|
}
|
|
17705
17974
|
/**
|
|
17706
17975
|
* Returns new instance of the Silent Iframe Interaction Client
|
|
17707
17976
|
* @param correlationId
|
|
17708
17977
|
*/
|
|
17709
17978
|
createSilentIframeClient(correlationId) {
|
|
17710
|
-
return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForIframeResponse);
|
|
17979
|
+
return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForIframeResponse, this.tokenBindingKeyManager);
|
|
17711
17980
|
}
|
|
17712
17981
|
/**
|
|
17713
17982
|
* Returns new instance of the Silent Cache Interaction Client
|
|
17714
17983
|
*/
|
|
17715
17984
|
createSilentCacheClient(correlationId) {
|
|
17716
|
-
return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider);
|
|
17985
|
+
return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
|
|
17717
17986
|
}
|
|
17718
17987
|
/**
|
|
17719
17988
|
* Returns new instance of the Silent Refresh Interaction Client
|
|
17720
17989
|
*/
|
|
17721
17990
|
createSilentRefreshClient(correlationId) {
|
|
17722
|
-
return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider);
|
|
17991
|
+
return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
|
|
17723
17992
|
}
|
|
17724
17993
|
/**
|
|
17725
17994
|
* Returns new instance of the Silent AuthCode Interaction Client
|
|
17726
17995
|
*/
|
|
17727
17996
|
createSilentAuthCodeClient(correlationId) {
|
|
17728
|
-
return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, correlationId, this.platformAuthProvider);
|
|
17997
|
+
return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
|
|
17729
17998
|
}
|
|
17730
17999
|
/**
|
|
17731
18000
|
* Adds event callbacks to array
|
|
@@ -18313,6 +18582,92 @@ const BridgeStatusCode = {
|
|
|
18313
18582
|
NestedAppAuthUnavailable: "NESTED_APP_AUTH_UNAVAILABLE", // NAA is unavailable in the current context, can retry with standard browser based auth
|
|
18314
18583
|
};
|
|
18315
18584
|
|
|
18585
|
+
/*
|
|
18586
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18587
|
+
* Licensed under the MIT License.
|
|
18588
|
+
*/
|
|
18589
|
+
/**
|
|
18590
|
+
* Unified error taxonomy shared by NAA and PWB.
|
|
18591
|
+
*
|
|
18592
|
+
* Each code maps to exactly one of the four base MSAL error classes
|
|
18593
|
+
* (`AuthError`, `ClientAuthError`, `ServerError`,
|
|
18594
|
+
* `InteractionRequiredAuthError`) via `toAuthError` in
|
|
18595
|
+
* `./WebBrokerBridgeErrorMap`.
|
|
18596
|
+
*/
|
|
18597
|
+
const WebBrokerBridgeErrorCode = {
|
|
18598
|
+
/* Interaction / auth outcomes */
|
|
18599
|
+
UserInteractionRequired: "user_interaction_required",
|
|
18600
|
+
UserCanceled: "user_canceled",
|
|
18601
|
+
/* Environment / connectivity */
|
|
18602
|
+
NoNetwork: "no_network",
|
|
18603
|
+
AccountUnavailable: "account_unavailable",
|
|
18604
|
+
BridgeDisabled: "bridge_disabled",
|
|
18605
|
+
BridgeUnavailable: "bridge_unavailable",
|
|
18606
|
+
/* Server-side outcomes */
|
|
18607
|
+
TransientError: "transient_error",
|
|
18608
|
+
PersistentError: "persistent_error",
|
|
18609
|
+
/* Broker-channel failures */
|
|
18610
|
+
BridgeTimeout: "bridge_timeout",
|
|
18611
|
+
BridgeHandshakeFailed: "bridge_handshake_failed",
|
|
18612
|
+
BridgeConnectionReset: "bridge_connection_reset",
|
|
18613
|
+
BridgeResponseInvalid: "bridge_response_invalid",
|
|
18614
|
+
PopupWillRedirect: "popup_will_redirect",
|
|
18615
|
+
ShrGenerationError: "shr_generation_error",
|
|
18616
|
+
/* Fallback */
|
|
18617
|
+
Unknown: "unknown",
|
|
18618
|
+
};
|
|
18619
|
+
|
|
18620
|
+
/*
|
|
18621
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18622
|
+
* Licensed under the MIT License.
|
|
18623
|
+
*/
|
|
18624
|
+
/**
|
|
18625
|
+
* Lift a normalized `WebBrokerBridgeError` to one of the four base
|
|
18626
|
+
* MSAL error classes. Callers are responsible for lowering
|
|
18627
|
+
* transport-specific errors into `WebBrokerBridgeError` before calling
|
|
18628
|
+
* this function.
|
|
18629
|
+
*/
|
|
18630
|
+
function toAuthError(err) {
|
|
18631
|
+
const correlationId = err.correlationId ?? "";
|
|
18632
|
+
switch (err.code) {
|
|
18633
|
+
case WebBrokerBridgeErrorCode.UserInteractionRequired:
|
|
18634
|
+
return new InteractionRequiredAuthError(err.innerErrorCode || "", correlationId, err.description, err.subError);
|
|
18635
|
+
case WebBrokerBridgeErrorCode.TransientError:
|
|
18636
|
+
case WebBrokerBridgeErrorCode.PersistentError:
|
|
18637
|
+
return new ServerError(err.innerErrorCode || "", correlationId, err.description, err.subError);
|
|
18638
|
+
case WebBrokerBridgeErrorCode.UserCanceled:
|
|
18639
|
+
return new ClientAuthError(userCanceled, correlationId);
|
|
18640
|
+
case WebBrokerBridgeErrorCode.NoNetwork:
|
|
18641
|
+
return new ClientAuthError(noNetworkConnectivity$1, correlationId);
|
|
18642
|
+
case WebBrokerBridgeErrorCode.AccountUnavailable:
|
|
18643
|
+
return new ClientAuthError(noAccountFound, correlationId);
|
|
18644
|
+
case WebBrokerBridgeErrorCode.BridgeDisabled:
|
|
18645
|
+
return new ClientAuthError(nestedAppAuthBridgeDisabled, correlationId);
|
|
18646
|
+
case WebBrokerBridgeErrorCode.BridgeUnavailable:
|
|
18647
|
+
/*
|
|
18648
|
+
* NAA parity: pass through inner code when the broker supplied
|
|
18649
|
+
* one, otherwise fall back to the disabled code.
|
|
18650
|
+
*/
|
|
18651
|
+
return new ClientAuthError(err.innerErrorCode ||
|
|
18652
|
+
nestedAppAuthBridgeDisabled, correlationId, err.description);
|
|
18653
|
+
/*
|
|
18654
|
+
* PWB broker-channel failures. The common code doubles as the
|
|
18655
|
+
* concrete errorCode on AuthError so the original error identity
|
|
18656
|
+
* can be recovered by round-tripping the string.
|
|
18657
|
+
*/
|
|
18658
|
+
case WebBrokerBridgeErrorCode.BridgeTimeout:
|
|
18659
|
+
case WebBrokerBridgeErrorCode.BridgeHandshakeFailed:
|
|
18660
|
+
case WebBrokerBridgeErrorCode.BridgeConnectionReset:
|
|
18661
|
+
case WebBrokerBridgeErrorCode.BridgeResponseInvalid:
|
|
18662
|
+
case WebBrokerBridgeErrorCode.PopupWillRedirect:
|
|
18663
|
+
case WebBrokerBridgeErrorCode.ShrGenerationError:
|
|
18664
|
+
return new AuthError(err.code, correlationId, err.description, err.subError);
|
|
18665
|
+
case WebBrokerBridgeErrorCode.Unknown:
|
|
18666
|
+
default:
|
|
18667
|
+
return new AuthError(err.innerErrorCode || "unknown_error", correlationId, err.description || "An unknown error occurred", err.subError);
|
|
18668
|
+
}
|
|
18669
|
+
}
|
|
18670
|
+
|
|
18316
18671
|
/*
|
|
18317
18672
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18318
18673
|
* Licensed under the MIT License.
|
|
@@ -18457,30 +18812,9 @@ class NestedAppAuthAdapter {
|
|
|
18457
18812
|
*/
|
|
18458
18813
|
fromBridgeError(error) {
|
|
18459
18814
|
if (isBridgeError(error)) {
|
|
18460
|
-
|
|
18461
|
-
case BridgeStatusCode.UserCancel:
|
|
18462
|
-
return new ClientAuthError(userCanceled, "");
|
|
18463
|
-
case BridgeStatusCode.NoNetwork:
|
|
18464
|
-
return new ClientAuthError(noNetworkConnectivity$1, "");
|
|
18465
|
-
case BridgeStatusCode.AccountUnavailable:
|
|
18466
|
-
return new ClientAuthError(noAccountFound, "");
|
|
18467
|
-
case BridgeStatusCode.Disabled:
|
|
18468
|
-
return new ClientAuthError(nestedAppAuthBridgeDisabled, "");
|
|
18469
|
-
case BridgeStatusCode.NestedAppAuthUnavailable:
|
|
18470
|
-
return new ClientAuthError(error.code ||
|
|
18471
|
-
nestedAppAuthBridgeDisabled, "", error.description);
|
|
18472
|
-
case BridgeStatusCode.TransientError:
|
|
18473
|
-
case BridgeStatusCode.PersistentError:
|
|
18474
|
-
return new ServerError(error.code || "", "", error.description);
|
|
18475
|
-
case BridgeStatusCode.UserInteractionRequired:
|
|
18476
|
-
return new InteractionRequiredAuthError(error.code || "", "", error.description);
|
|
18477
|
-
default:
|
|
18478
|
-
return new AuthError(error.code || "", "", error.description);
|
|
18479
|
-
}
|
|
18480
|
-
}
|
|
18481
|
-
else {
|
|
18482
|
-
return new AuthError("unknown_error", "", "An unknown error occurred");
|
|
18815
|
+
return toAuthError(bridgeErrorToWebBrokerBridgeError(error));
|
|
18483
18816
|
}
|
|
18817
|
+
return new AuthError("unknown_error", "", "An unknown error occurred");
|
|
18484
18818
|
}
|
|
18485
18819
|
/**
|
|
18486
18820
|
* Returns an AuthenticationResult from the given cache items
|
|
@@ -18516,6 +18850,52 @@ class NestedAppAuthAdapter {
|
|
|
18516
18850
|
};
|
|
18517
18851
|
return authenticationResult;
|
|
18518
18852
|
}
|
|
18853
|
+
}
|
|
18854
|
+
/**
|
|
18855
|
+
* Converts NAA `BridgeError` into the shared `WebBrokerBridgeError`
|
|
18856
|
+
* taxonomy.
|
|
18857
|
+
*/
|
|
18858
|
+
function bridgeErrorToWebBrokerBridgeError(error) {
|
|
18859
|
+
switch (error.status) {
|
|
18860
|
+
case BridgeStatusCode.UserCancel:
|
|
18861
|
+
return { code: WebBrokerBridgeErrorCode.UserCanceled };
|
|
18862
|
+
case BridgeStatusCode.NoNetwork:
|
|
18863
|
+
return { code: WebBrokerBridgeErrorCode.NoNetwork };
|
|
18864
|
+
case BridgeStatusCode.AccountUnavailable:
|
|
18865
|
+
return { code: WebBrokerBridgeErrorCode.AccountUnavailable };
|
|
18866
|
+
case BridgeStatusCode.Disabled:
|
|
18867
|
+
return { code: WebBrokerBridgeErrorCode.BridgeDisabled };
|
|
18868
|
+
case BridgeStatusCode.NestedAppAuthUnavailable:
|
|
18869
|
+
return {
|
|
18870
|
+
code: WebBrokerBridgeErrorCode.BridgeUnavailable,
|
|
18871
|
+
innerErrorCode: error.code,
|
|
18872
|
+
description: error.description,
|
|
18873
|
+
};
|
|
18874
|
+
case BridgeStatusCode.TransientError:
|
|
18875
|
+
return {
|
|
18876
|
+
code: WebBrokerBridgeErrorCode.TransientError,
|
|
18877
|
+
innerErrorCode: error.code,
|
|
18878
|
+
description: error.description,
|
|
18879
|
+
};
|
|
18880
|
+
case BridgeStatusCode.PersistentError:
|
|
18881
|
+
return {
|
|
18882
|
+
code: WebBrokerBridgeErrorCode.PersistentError,
|
|
18883
|
+
innerErrorCode: error.code,
|
|
18884
|
+
description: error.description,
|
|
18885
|
+
};
|
|
18886
|
+
case BridgeStatusCode.UserInteractionRequired:
|
|
18887
|
+
return {
|
|
18888
|
+
code: WebBrokerBridgeErrorCode.UserInteractionRequired,
|
|
18889
|
+
innerErrorCode: error.code,
|
|
18890
|
+
description: error.description,
|
|
18891
|
+
};
|
|
18892
|
+
default:
|
|
18893
|
+
return {
|
|
18894
|
+
code: WebBrokerBridgeErrorCode.Unknown,
|
|
18895
|
+
innerErrorCode: error.code,
|
|
18896
|
+
description: error.description,
|
|
18897
|
+
};
|
|
18898
|
+
}
|
|
18519
18899
|
}
|
|
18520
18900
|
|
|
18521
18901
|
/*
|
|
@@ -19001,6 +19381,66 @@ class NestedAppAuthController {
|
|
|
19001
19381
|
}
|
|
19002
19382
|
}
|
|
19003
19383
|
|
|
19384
|
+
/*
|
|
19385
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19386
|
+
* Licensed under the MIT License.
|
|
19387
|
+
*/
|
|
19388
|
+
/**
|
|
19389
|
+
* Correlates outbound requests with inbound responses by `requestId`.
|
|
19390
|
+
*/
|
|
19391
|
+
class PendingRequestRegistry {
|
|
19392
|
+
constructor() {
|
|
19393
|
+
this.pending = new Map();
|
|
19394
|
+
}
|
|
19395
|
+
/**
|
|
19396
|
+
* Register a pending request. Returns a promise that resolves when a
|
|
19397
|
+
* response with the matching `requestId` arrives, or rejects if the
|
|
19398
|
+
* caller invokes `reject` for that id.
|
|
19399
|
+
*/
|
|
19400
|
+
register(requestId) {
|
|
19401
|
+
return new Promise((resolve, reject) => {
|
|
19402
|
+
this.pending.set(requestId, { resolve, reject });
|
|
19403
|
+
});
|
|
19404
|
+
}
|
|
19405
|
+
/** Resolve a pending request. No-op if `requestId` isn't registered. */
|
|
19406
|
+
resolve(requestId, response) {
|
|
19407
|
+
const entry = this.pending.get(requestId);
|
|
19408
|
+
if (entry === undefined) {
|
|
19409
|
+
return;
|
|
19410
|
+
}
|
|
19411
|
+
this.pending.delete(requestId);
|
|
19412
|
+
entry.resolve(response);
|
|
19413
|
+
}
|
|
19414
|
+
/** Reject a pending request. No-op if `requestId` isn't registered. */
|
|
19415
|
+
reject(requestId, reason) {
|
|
19416
|
+
const entry = this.pending.get(requestId);
|
|
19417
|
+
if (entry === undefined) {
|
|
19418
|
+
return;
|
|
19419
|
+
}
|
|
19420
|
+
this.pending.delete(requestId);
|
|
19421
|
+
entry.reject(reason);
|
|
19422
|
+
}
|
|
19423
|
+
/** True if `requestId` has an in-flight registration. */
|
|
19424
|
+
has(requestId) {
|
|
19425
|
+
return this.pending.has(requestId);
|
|
19426
|
+
}
|
|
19427
|
+
/**
|
|
19428
|
+
* Register, then invoke `send` synchronously. If `send` throws, the
|
|
19429
|
+
* pending entry is cleared and the promise rejects with the thrown
|
|
19430
|
+
* error.
|
|
19431
|
+
*/
|
|
19432
|
+
async sendAndAwait(message, send) {
|
|
19433
|
+
const promise = this.register(message.requestId);
|
|
19434
|
+
try {
|
|
19435
|
+
send(message);
|
|
19436
|
+
}
|
|
19437
|
+
catch (err) {
|
|
19438
|
+
this.reject(message.requestId, err);
|
|
19439
|
+
}
|
|
19440
|
+
return promise;
|
|
19441
|
+
}
|
|
19442
|
+
}
|
|
19443
|
+
|
|
19004
19444
|
/*
|
|
19005
19445
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19006
19446
|
* Licensed under the MIT License.
|
|
@@ -19028,28 +19468,14 @@ class BridgeProxy {
|
|
|
19028
19468
|
window.nestedAppAuthBridge.addEventListener("message", (response) => {
|
|
19029
19469
|
const responsePayload = typeof response === "string" ? response : response.data;
|
|
19030
19470
|
const responseEnvelope = JSON.parse(responsePayload);
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19035
|
-
|
|
19036
|
-
}
|
|
19037
|
-
else {
|
|
19038
|
-
request.reject(responseEnvelope.error);
|
|
19039
|
-
}
|
|
19471
|
+
if (responseEnvelope.success) {
|
|
19472
|
+
BridgeProxy.pendingRegistry.resolve(responseEnvelope.requestId, responseEnvelope);
|
|
19473
|
+
}
|
|
19474
|
+
else {
|
|
19475
|
+
BridgeProxy.pendingRegistry.reject(responseEnvelope.requestId, responseEnvelope.error);
|
|
19040
19476
|
}
|
|
19041
19477
|
});
|
|
19042
|
-
const bridgeResponse = await
|
|
19043
|
-
const message = BridgeProxy.buildRequest("GetInitContext");
|
|
19044
|
-
const request = {
|
|
19045
|
-
requestId: message.requestId,
|
|
19046
|
-
method: message.method,
|
|
19047
|
-
resolve: resolve,
|
|
19048
|
-
reject: reject,
|
|
19049
|
-
};
|
|
19050
|
-
BridgeProxy.bridgeRequests.push(request);
|
|
19051
|
-
window.nestedAppAuthBridge.postMessage(JSON.stringify(message));
|
|
19052
|
-
});
|
|
19478
|
+
const bridgeResponse = await BridgeProxy.sendRequestViaRegistry(BridgeProxy.buildRequest("GetInitContext"));
|
|
19053
19479
|
return BridgeProxy.validateBridgeResultOrThrow(bridgeResponse.initContext);
|
|
19054
19480
|
}
|
|
19055
19481
|
catch (error) {
|
|
@@ -19105,18 +19531,22 @@ class BridgeProxy {
|
|
|
19105
19531
|
* @returns a promise that resolves to a response of provided type or rejects with a BridgeError
|
|
19106
19532
|
*/
|
|
19107
19533
|
sendRequest(method, requestParams) {
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19534
|
+
return BridgeProxy.sendRequestViaRegistry(BridgeProxy.buildRequest(method, requestParams));
|
|
19535
|
+
}
|
|
19536
|
+
/**
|
|
19537
|
+
* Registers `message.requestId` with the shared pending-request
|
|
19538
|
+
* registry, then posts the envelope over the host bridge. Resolves
|
|
19539
|
+
* with the matching response envelope; rejects with the raw
|
|
19540
|
+
* `BridgeError` payload.
|
|
19541
|
+
*/
|
|
19542
|
+
static sendRequestViaRegistry(message) {
|
|
19543
|
+
const correlationKey = {
|
|
19544
|
+
requestId: message.requestId,
|
|
19545
|
+
type: message.method,
|
|
19546
|
+
};
|
|
19547
|
+
return BridgeProxy.pendingRegistry.sendAndAwait(correlationKey, () => {
|
|
19117
19548
|
window.nestedAppAuthBridge.postMessage(JSON.stringify(message));
|
|
19118
19549
|
});
|
|
19119
|
-
return promise;
|
|
19120
19550
|
}
|
|
19121
19551
|
static validateBridgeResultOrThrow(input) {
|
|
19122
19552
|
if (input === undefined) {
|
|
@@ -19148,7 +19578,11 @@ class BridgeProxy {
|
|
|
19148
19578
|
return new BridgeProxy(response.sdkName, response.sdkVersion, response.accountContext, response.capabilities);
|
|
19149
19579
|
}
|
|
19150
19580
|
}
|
|
19151
|
-
|
|
19581
|
+
/**
|
|
19582
|
+
* Correlates outbound bridge requests with inbound responses by
|
|
19583
|
+
* `requestId`
|
|
19584
|
+
*/
|
|
19585
|
+
BridgeProxy.pendingRegistry = new PendingRequestRegistry();
|
|
19152
19586
|
|
|
19153
19587
|
/*
|
|
19154
19588
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -19917,7 +20351,8 @@ class SignedHttpRequest {
|
|
|
19917
20351
|
const loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};
|
|
19918
20352
|
this.logger = new Logger(loggerOptions, name, version);
|
|
19919
20353
|
this.cryptoOps = new CryptoOps(this.logger);
|
|
19920
|
-
|
|
20354
|
+
const tokenBindingKeyManager = new TokenBindingKeyManager(this.logger);
|
|
20355
|
+
this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps, tokenBindingKeyManager, new StubPerformanceClient());
|
|
19921
20356
|
this.shrParameters = shrParameters;
|
|
19922
20357
|
}
|
|
19923
20358
|
/**
|