@azure/msal-browser 5.19.0 → 5.21.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 +1 -1
- package/dist/cache/BrowserCacheManager.mjs +6 -6
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +15 -5
- package/dist/cache/LocalStorage.mjs.map +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +3 -2
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +8 -4
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +4 -4
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +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 +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
- package/dist/custom_auth/core/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 +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 +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
- package/dist/interaction_client/PopupClient.mjs +7 -3
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +6 -1
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +4 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +6 -3
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +4 -2
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +2 -2
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +151 -14
- package/dist/popup_relay/index.mjs.map +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +10 -16
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +63 -10
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/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 +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +2 -2
- package/lib/custom-auth-path/msal-custom-auth.cjs +580 -277
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +580 -277
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +2 -2
- package/lib/msal-browser.cjs +455 -150
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +455 -150
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +152 -15
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +152 -15
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +2 -2
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/package.json +2 -2
- package/src/cache/BrowserCacheManager.ts +12 -4
- package/src/cache/LocalStorage.ts +14 -4
- package/src/cache/TokenCache.ts +3 -1
- package/src/controllers/NestedAppAuthController.ts +10 -2
- package/src/controllers/StandardController.ts +8 -3
- package/src/controllers/UnknownOperatingContextController.ts +11 -2
- package/src/index.ts +1 -0
- package/src/interaction_client/PopupClient.ts +19 -2
- package/src/interaction_client/RedirectClient.ts +15 -0
- package/src/interaction_client/SilentAuthCodeClient.ts +8 -0
- package/src/interaction_client/SilentIframeClient.ts +11 -5
- package/src/interaction_client/SilentRefreshClient.ts +11 -1
- package/src/packageMetadata.ts +1 -1
- package/src/popup_relay/index.ts +202 -20
- package/src/protocol/Authorize.ts +12 -28
- package/src/request/RequestHelpers.ts +109 -15
- package/src/webBrokerBridge/adapter/CrossVersionRequestAdapter.ts +186 -0
- package/src/webBrokerBridge/index.ts +11 -0
- package/types/cache/BrowserCacheManager.d.ts +3 -3
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/cache/LocalStorage.d.ts.map +1 -1
- package/types/cache/TokenCache.d.ts.map +1 -1
- package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/popup_relay/index.d.ts +27 -3
- package/types/popup_relay/index.d.ts.map +1 -1
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts +11 -1
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/webBrokerBridge/adapter/CrossVersionRequestAdapter.d.ts +66 -0
- package/types/webBrokerBridge/adapter/CrossVersionRequestAdapter.d.ts.map +1 -0
- package/types/webBrokerBridge/index.d.ts +2 -0
- package/types/webBrokerBridge/index.d.ts.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.21.0 2026-09-02 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msalCustomAuth = {}));
|
|
7
7
|
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
|
-
/*! @azure/msal-common v16.
|
|
9
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
10
10
|
/*
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
12
|
* Licensed under the MIT License.
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
const CLIENT_ASSERTION_TYPE = "client_assertion_type";
|
|
44
44
|
const TOKEN_TYPE = "token_type";
|
|
45
45
|
const REQ_CNF = "req_cnf";
|
|
46
|
+
const DPOP_JKT = "dpop_jkt";
|
|
46
47
|
const RETURN_SPA_CODE = "return_spa_code";
|
|
47
48
|
const NATIVE_BROKER = "nativebroker";
|
|
48
49
|
const LOGOUT_HINT = "logout_hint";
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
const CLI_DATA = "clidata";
|
|
60
61
|
const ATTRIBUTE_TOKENS = "attribute_tokens";
|
|
61
62
|
|
|
62
|
-
/*! @azure/msal-common v16.
|
|
63
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
63
64
|
/*
|
|
64
65
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
65
66
|
* Licensed under the MIT License.
|
|
@@ -71,7 +72,6 @@
|
|
|
71
72
|
const DEFAULT_COMMON_TENANT = "common";
|
|
72
73
|
// ADFS String
|
|
73
74
|
const ADFS = "adfs";
|
|
74
|
-
const DSTS = "dstsv2";
|
|
75
75
|
// Default AAD Instance Discovery Endpoint
|
|
76
76
|
const AAD_INSTANCE_DISCOVERY_ENDPT = `${DEFAULT_AUTHORITY}discovery/instance?api-version=1.1&authorization_endpoint=`;
|
|
77
77
|
// CIAM URL
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
const HeaderNames = {
|
|
125
125
|
CONTENT_TYPE: "Content-Type",
|
|
126
126
|
CONTENT_LENGTH: "Content-Length",
|
|
127
|
+
DPOP: "DPoP",
|
|
127
128
|
RETRY_AFTER: "Retry-After",
|
|
128
129
|
CCS_HEADER: "X-AnchorMailbox",
|
|
129
130
|
WWWAuthenticate: "WWW-Authenticate",
|
|
@@ -154,6 +155,7 @@
|
|
|
154
155
|
ID_TOKEN: "id_token",
|
|
155
156
|
SIGNIN_STATE: "signin_state",
|
|
156
157
|
LOGIN_HINT: "login_hint",
|
|
158
|
+
TENANT_REGION_SUB_SCOPE: "tenant_region_sub_scope",
|
|
157
159
|
};
|
|
158
160
|
/**
|
|
159
161
|
* we considered making this "enum" in the request instead of string, however it looks like the allowed list of
|
|
@@ -235,6 +237,7 @@
|
|
|
235
237
|
const AuthenticationScheme = {
|
|
236
238
|
BEARER: "Bearer",
|
|
237
239
|
POP: "pop",
|
|
240
|
+
DPOP: "DPoP",
|
|
238
241
|
SSH: "ssh-cert",
|
|
239
242
|
};
|
|
240
243
|
/**
|
|
@@ -291,7 +294,7 @@
|
|
|
291
294
|
// Token renewal offset default in seconds
|
|
292
295
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
293
296
|
|
|
294
|
-
/*! @azure/msal-common v16.
|
|
297
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
295
298
|
/*
|
|
296
299
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
297
300
|
* Licensed under the MIT License.
|
|
@@ -320,7 +323,7 @@
|
|
|
320
323
|
return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
|
|
321
324
|
}
|
|
322
325
|
|
|
323
|
-
/*! @azure/msal-common v16.
|
|
326
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
324
327
|
|
|
325
328
|
/*
|
|
326
329
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -343,7 +346,7 @@
|
|
|
343
346
|
return new ClientAuthError(errorCode, correlationId, additionalMessage);
|
|
344
347
|
}
|
|
345
348
|
|
|
346
|
-
/*! @azure/msal-common v16.
|
|
349
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
347
350
|
/*
|
|
348
351
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
349
352
|
* Licensed under the MIT License.
|
|
@@ -370,6 +373,7 @@
|
|
|
370
373
|
const invalidCacheEnvironment = "invalid_cache_environment";
|
|
371
374
|
const noAccountFound = "no_account_found";
|
|
372
375
|
const noCryptoObject = "no_crypto_object";
|
|
376
|
+
const dpopTokenTypeMismatch = "dpop_token_type_mismatch";
|
|
373
377
|
const tokenRefreshRequired = "token_refresh_required";
|
|
374
378
|
const tokenClaimsCnfRequiredForSignedJwt = "token_claims_cnf_required_for_signedjwt";
|
|
375
379
|
const authorizationCodeMissingFromServerResponse = "authorization_code_missing_from_server_response";
|
|
@@ -380,7 +384,7 @@
|
|
|
380
384
|
const resourceParameterRequired = "resource_parameter_required";
|
|
381
385
|
const misplacedResourceParam = "misplaced_resource_parameter";
|
|
382
386
|
|
|
383
|
-
/*! @azure/msal-common v16.
|
|
387
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
384
388
|
|
|
385
389
|
/*
|
|
386
390
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -418,7 +422,7 @@
|
|
|
418
422
|
};
|
|
419
423
|
}
|
|
420
424
|
|
|
421
|
-
/*! @azure/msal-common v16.
|
|
425
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
422
426
|
|
|
423
427
|
/*
|
|
424
428
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -484,7 +488,7 @@
|
|
|
484
488
|
return matches[2];
|
|
485
489
|
}
|
|
486
490
|
|
|
487
|
-
/*! @azure/msal-common v16.
|
|
491
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
488
492
|
|
|
489
493
|
/*
|
|
490
494
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -572,7 +576,7 @@
|
|
|
572
576
|
return updatedAccountInfo;
|
|
573
577
|
}
|
|
574
578
|
|
|
575
|
-
/*! @azure/msal-common v16.
|
|
579
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
576
580
|
/*
|
|
577
581
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
578
582
|
* Licensed under the MIT License.
|
|
@@ -583,11 +587,10 @@
|
|
|
583
587
|
const AuthorityType = {
|
|
584
588
|
Default: 0,
|
|
585
589
|
Adfs: 1,
|
|
586
|
-
Dsts: 2,
|
|
587
590
|
Ciam: 3,
|
|
588
591
|
};
|
|
589
592
|
|
|
590
|
-
/*! @azure/msal-common v16.
|
|
593
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
591
594
|
/*
|
|
592
595
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
593
596
|
* Licensed under the MIT License.
|
|
@@ -609,7 +612,7 @@
|
|
|
609
612
|
return null;
|
|
610
613
|
}
|
|
611
614
|
|
|
612
|
-
/*! @azure/msal-common v16.
|
|
615
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
613
616
|
/*
|
|
614
617
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
615
618
|
* Licensed under the MIT License.
|
|
@@ -633,7 +636,7 @@
|
|
|
633
636
|
EAR: "EAR",
|
|
634
637
|
};
|
|
635
638
|
|
|
636
|
-
/*! @azure/msal-common v16.
|
|
639
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
637
640
|
/**
|
|
638
641
|
* Returns the AccountInfo interface for this account.
|
|
639
642
|
* @internal
|
|
@@ -788,8 +791,8 @@
|
|
|
788
791
|
* @param authType
|
|
789
792
|
*/
|
|
790
793
|
function generateHomeAccountId(serverClientInfo, authType, logger, cryptoObj, correlationId, idTokenClaims) {
|
|
791
|
-
//
|
|
792
|
-
if (
|
|
794
|
+
// ADFS does not have tid and does not set client_info
|
|
795
|
+
if (authType !== AuthorityType.Adfs) {
|
|
793
796
|
// for cases where there is clientInfo
|
|
794
797
|
if (serverClientInfo) {
|
|
795
798
|
try {
|
|
@@ -822,7 +825,7 @@
|
|
|
822
825
|
entity.hasOwnProperty("authorityType"));
|
|
823
826
|
}
|
|
824
827
|
|
|
825
|
-
/*! @azure/msal-common v16.
|
|
828
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
826
829
|
/*
|
|
827
830
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
828
831
|
* Licensed under the MIT License.
|
|
@@ -832,7 +835,7 @@
|
|
|
832
835
|
*/
|
|
833
836
|
const unexpectedError = "unexpected_error";
|
|
834
837
|
|
|
835
|
-
/*! @azure/msal-common v16.
|
|
838
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
836
839
|
|
|
837
840
|
/*
|
|
838
841
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -852,7 +855,7 @@
|
|
|
852
855
|
return new ClientConfigurationError(errorCode, correlationId);
|
|
853
856
|
}
|
|
854
857
|
|
|
855
|
-
/*! @azure/msal-common v16.
|
|
858
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
856
859
|
/*
|
|
857
860
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
858
861
|
* Licensed under the MIT License.
|
|
@@ -877,9 +880,13 @@
|
|
|
877
880
|
const authorityMismatch = "authority_mismatch";
|
|
878
881
|
const invalidRequestMethodForEAR = "invalid_request_method_for_EAR";
|
|
879
882
|
const invalidPlatformBrokerConfiguration = "invalid_platform_broker_configuration";
|
|
880
|
-
const issuerValidationFailed = "issuer_validation_failed";
|
|
883
|
+
const issuerValidationFailed = "issuer_validation_failed";
|
|
884
|
+
const invalidDpopHtm = "invalid_dpop_htm";
|
|
885
|
+
const invalidDpopHtu = "invalid_dpop_htu";
|
|
886
|
+
const invalidDpopNonce = "invalid_dpop_nonce";
|
|
887
|
+
const dpopMissingResourceContext = "dpop_missing_resource_context";
|
|
881
888
|
|
|
882
|
-
/*! @azure/msal-common v16.
|
|
889
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
883
890
|
/*
|
|
884
891
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
885
892
|
* Licensed under the MIT License.
|
|
@@ -891,7 +898,7 @@
|
|
|
891
898
|
response.hasOwnProperty("jwks_uri"));
|
|
892
899
|
}
|
|
893
900
|
|
|
894
|
-
/*! @azure/msal-common v16.
|
|
901
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
895
902
|
/*
|
|
896
903
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
897
904
|
* Licensed under the MIT License.
|
|
@@ -971,7 +978,7 @@
|
|
|
971
978
|
}
|
|
972
979
|
}
|
|
973
980
|
|
|
974
|
-
/*! @azure/msal-common v16.
|
|
981
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
975
982
|
|
|
976
983
|
/*
|
|
977
984
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1129,7 +1136,7 @@
|
|
|
1129
1136
|
}
|
|
1130
1137
|
}
|
|
1131
1138
|
|
|
1132
|
-
/*! @azure/msal-common v16.
|
|
1139
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1133
1140
|
|
|
1134
1141
|
/*
|
|
1135
1142
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1212,15 +1219,6 @@
|
|
|
1212
1219
|
preferred_cache: "login.sovcloud-identity.sg",
|
|
1213
1220
|
aliases: ["login.sovcloud-identity.sg"],
|
|
1214
1221
|
},
|
|
1215
|
-
{
|
|
1216
|
-
preferred_network: "login.windows-ppe.net",
|
|
1217
|
-
preferred_cache: "login.windows-ppe.net",
|
|
1218
|
-
aliases: [
|
|
1219
|
-
"login.windows-ppe.net",
|
|
1220
|
-
"sts.windows-ppe.net",
|
|
1221
|
-
"login.microsoft-ppe.com",
|
|
1222
|
-
],
|
|
1223
|
-
},
|
|
1224
1222
|
],
|
|
1225
1223
|
},
|
|
1226
1224
|
};
|
|
@@ -1292,7 +1290,7 @@
|
|
|
1292
1290
|
return null;
|
|
1293
1291
|
}
|
|
1294
1292
|
|
|
1295
|
-
/*! @azure/msal-common v16.
|
|
1293
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1296
1294
|
/*
|
|
1297
1295
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1298
1296
|
* Licensed under the MIT License.
|
|
@@ -1301,7 +1299,7 @@
|
|
|
1301
1299
|
// AzureCloudInstance is not specified.
|
|
1302
1300
|
None: "none"};
|
|
1303
1301
|
|
|
1304
|
-
/*! @azure/msal-common v16.
|
|
1302
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1305
1303
|
/*
|
|
1306
1304
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1307
1305
|
* Licensed under the MIT License.
|
|
@@ -1311,7 +1309,7 @@
|
|
|
1311
1309
|
response.hasOwnProperty("metadata"));
|
|
1312
1310
|
}
|
|
1313
1311
|
|
|
1314
|
-
/*! @azure/msal-common v16.
|
|
1312
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1315
1313
|
/*
|
|
1316
1314
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1317
1315
|
* Licensed under the MIT License.
|
|
@@ -1321,7 +1319,7 @@
|
|
|
1321
1319
|
response.hasOwnProperty("error_description"));
|
|
1322
1320
|
}
|
|
1323
1321
|
|
|
1324
|
-
/*! @azure/msal-common v16.
|
|
1322
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1325
1323
|
/*
|
|
1326
1324
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1327
1325
|
* Licensed under the MIT License.
|
|
@@ -1392,7 +1390,7 @@
|
|
|
1392
1390
|
const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
|
|
1393
1391
|
const SetUserData = "setUserData";
|
|
1394
1392
|
|
|
1395
|
-
/*! @azure/msal-common v16.
|
|
1393
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1396
1394
|
/*
|
|
1397
1395
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1398
1396
|
* Licensed under the MIT License.
|
|
@@ -1485,7 +1483,7 @@
|
|
|
1485
1483
|
};
|
|
1486
1484
|
};
|
|
1487
1485
|
|
|
1488
|
-
/*! @azure/msal-common v16.
|
|
1486
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1489
1487
|
|
|
1490
1488
|
/*
|
|
1491
1489
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1596,7 +1594,7 @@
|
|
|
1596
1594
|
},
|
|
1597
1595
|
};
|
|
1598
1596
|
|
|
1599
|
-
/*! @azure/msal-common v16.
|
|
1597
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1600
1598
|
/*
|
|
1601
1599
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1602
1600
|
* Licensed under the MIT License.
|
|
@@ -1661,7 +1659,7 @@
|
|
|
1661
1659
|
return cachedAtSec > nowSeconds();
|
|
1662
1660
|
}
|
|
1663
1661
|
|
|
1664
|
-
/*! @azure/msal-common v16.
|
|
1662
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1665
1663
|
|
|
1666
1664
|
/*
|
|
1667
1665
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1948,7 +1946,7 @@
|
|
|
1948
1946
|
return [...attributeTokens].sort().join(" ");
|
|
1949
1947
|
}
|
|
1950
1948
|
|
|
1951
|
-
/*! @azure/msal-common v16.
|
|
1949
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
1952
1950
|
|
|
1953
1951
|
/*
|
|
1954
1952
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1992,8 +1990,6 @@
|
|
|
1992
1990
|
switch (pathSegments[0].toLowerCase()) {
|
|
1993
1991
|
case ADFS:
|
|
1994
1992
|
return AuthorityType.Adfs;
|
|
1995
|
-
case DSTS:
|
|
1996
|
-
return AuthorityType.Dsts;
|
|
1997
1993
|
}
|
|
1998
1994
|
}
|
|
1999
1995
|
return AuthorityType.Default;
|
|
@@ -2918,7 +2914,7 @@
|
|
|
2918
2914
|
};
|
|
2919
2915
|
}
|
|
2920
2916
|
|
|
2921
|
-
/*! @azure/msal-common v16.
|
|
2917
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
2922
2918
|
|
|
2923
2919
|
/*
|
|
2924
2920
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2952,7 +2948,7 @@
|
|
|
2952
2948
|
}
|
|
2953
2949
|
}
|
|
2954
2950
|
|
|
2955
|
-
/*! @azure/msal-common v16.
|
|
2951
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
2956
2952
|
|
|
2957
2953
|
/*
|
|
2958
2954
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3148,7 +3144,7 @@
|
|
|
3148
3144
|
}
|
|
3149
3145
|
}
|
|
3150
3146
|
|
|
3151
|
-
/*! @azure/msal-common v16.
|
|
3147
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
3152
3148
|
|
|
3153
3149
|
/*
|
|
3154
3150
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3442,11 +3438,15 @@
|
|
|
3442
3438
|
}
|
|
3443
3439
|
/**
|
|
3444
3440
|
* Default optional idToken claims requested on all auth requests.
|
|
3445
|
-
* signin_state enables KMSI detection; login_hint enables login hint propagation
|
|
3441
|
+
* signin_state enables KMSI detection; login_hint enables login hint propagation;
|
|
3442
|
+
* tenant_region_sub_scope identifies the sovereign enclave a tenant belongs to.
|
|
3446
3443
|
*/
|
|
3447
3444
|
const DEFAULT_ID_TOKEN_CLAIMS = {
|
|
3448
3445
|
[ClaimsRequestKeys.SIGNIN_STATE]: { essential: false },
|
|
3449
3446
|
[ClaimsRequestKeys.LOGIN_HINT]: { essential: false },
|
|
3447
|
+
[ClaimsRequestKeys.TENANT_REGION_SUB_SCOPE]: {
|
|
3448
|
+
essential: false,
|
|
3449
|
+
},
|
|
3450
3450
|
};
|
|
3451
3451
|
/**
|
|
3452
3452
|
* Parses a claims JSON string into an object, throwing a ClientConfigurationError
|
|
@@ -3505,8 +3505,8 @@
|
|
|
3505
3505
|
/**
|
|
3506
3506
|
* Parses claims JSON, optionally deep-merges a second client-originated claims string
|
|
3507
3507
|
* (`claimsToMerge`, e.g. `claimsFromClient`) with precedence on conflicting keys, merges
|
|
3508
|
-
* default optional idToken claims (signin_state, login_hint), and appends client
|
|
3509
|
-
* capabilities (xms_cc) to the access_token section
|
|
3508
|
+
* default optional idToken claims (signin_state, login_hint, tenant_region_sub_scope), and appends client
|
|
3509
|
+
* capabilities (xms_cc) to the access_token section
|
|
3510
3510
|
* Does not overwrite idToken claims already specified by the caller.
|
|
3511
3511
|
* @param claims - Existing claims JSON string from the request (may be undefined)
|
|
3512
3512
|
* @param clientCapabilities - Client capabilities array from configuration
|
|
@@ -3630,7 +3630,7 @@
|
|
|
3630
3630
|
}
|
|
3631
3631
|
}
|
|
3632
3632
|
|
|
3633
|
-
/*! @azure/msal-common v16.
|
|
3633
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
3634
3634
|
|
|
3635
3635
|
/*
|
|
3636
3636
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3752,7 +3752,7 @@
|
|
|
3752
3752
|
}
|
|
3753
3753
|
}
|
|
3754
3754
|
|
|
3755
|
-
/*! @azure/msal-common v16.
|
|
3755
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
3756
3756
|
|
|
3757
3757
|
/*
|
|
3758
3758
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3800,7 +3800,7 @@
|
|
|
3800
3800
|
},
|
|
3801
3801
|
};
|
|
3802
3802
|
|
|
3803
|
-
/*! @azure/msal-common v16.
|
|
3803
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
3804
3804
|
|
|
3805
3805
|
/*
|
|
3806
3806
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3823,7 +3823,7 @@
|
|
|
3823
3823
|
},
|
|
3824
3824
|
};
|
|
3825
3825
|
|
|
3826
|
-
/*! @azure/msal-common v16.
|
|
3826
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
3827
3827
|
/*
|
|
3828
3828
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3829
3829
|
* Licensed under the MIT License.
|
|
@@ -4098,12 +4098,12 @@
|
|
|
4098
4098
|
}
|
|
4099
4099
|
}
|
|
4100
4100
|
|
|
4101
|
-
/*! @azure/msal-common v16.
|
|
4101
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
4102
4102
|
/* eslint-disable header/header */
|
|
4103
4103
|
const name$1 = "@azure/msal-common";
|
|
4104
|
-
const version$1 = "16.
|
|
4104
|
+
const version$1 = "16.14.0";
|
|
4105
4105
|
|
|
4106
|
-
/*! @azure/msal-common v16.
|
|
4106
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
4107
4107
|
/*
|
|
4108
4108
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4109
4109
|
* Licensed under the MIT License.
|
|
@@ -4111,7 +4111,7 @@
|
|
|
4111
4111
|
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
4112
4112
|
const cacheErrorUnknown = "cache_error_unknown";
|
|
4113
4113
|
|
|
4114
|
-
/*! @azure/msal-common v16.
|
|
4114
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
4115
4115
|
|
|
4116
4116
|
/*
|
|
4117
4117
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4149,7 +4149,7 @@
|
|
|
4149
4149
|
}
|
|
4150
4150
|
}
|
|
4151
4151
|
|
|
4152
|
-
/*! @azure/msal-common v16.
|
|
4152
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
4153
4153
|
|
|
4154
4154
|
/*
|
|
4155
4155
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4160,9 +4160,10 @@
|
|
|
4160
4160
|
* @internal
|
|
4161
4161
|
*/
|
|
4162
4162
|
class CacheManager {
|
|
4163
|
-
constructor(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions) {
|
|
4163
|
+
constructor(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions, tokenBindingKeyManager) {
|
|
4164
4164
|
this.clientId = clientId;
|
|
4165
4165
|
this.cryptoImpl = cryptoImpl;
|
|
4166
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
4166
4167
|
this.commonLogger = logger.clone(name$1, version$1);
|
|
4167
4168
|
this.staticAuthorityOptions = staticAuthorityOptions;
|
|
4168
4169
|
this.performanceClient = performanceClient;
|
|
@@ -4651,19 +4652,24 @@
|
|
|
4651
4652
|
}
|
|
4652
4653
|
this.removeItem(key, correlationId);
|
|
4653
4654
|
this.performanceClient.incrementFields({ accessTokensRemoved: 1 }, correlationId);
|
|
4654
|
-
// Remove Token Binding Key from key store for
|
|
4655
|
+
// Remove Token Binding Key from key store for token-bound access token credentials
|
|
4655
4656
|
if (credential.credentialType.toLowerCase() ===
|
|
4656
4657
|
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
this.
|
|
4665
|
-
|
|
4666
|
-
|
|
4658
|
+
const tokenType = credential.tokenType?.toLowerCase();
|
|
4659
|
+
switch (tokenType) {
|
|
4660
|
+
case AuthenticationScheme.POP:
|
|
4661
|
+
case AuthenticationScheme.DPOP.toLowerCase(): {
|
|
4662
|
+
const accessTokenWithAuthSchemeEntity = credential;
|
|
4663
|
+
const kid = accessTokenWithAuthSchemeEntity.keyId;
|
|
4664
|
+
if (kid) {
|
|
4665
|
+
void this.tokenBindingKeyManager
|
|
4666
|
+
.removeTokenBindingKey(kid, correlationId)
|
|
4667
|
+
.catch(() => {
|
|
4668
|
+
this.commonLogger.error("0id34f", correlationId);
|
|
4669
|
+
this.performanceClient?.incrementFields({ removeTokenBindingKeyFailure: 1 }, correlationId);
|
|
4670
|
+
});
|
|
4671
|
+
}
|
|
4672
|
+
break;
|
|
4667
4673
|
}
|
|
4668
4674
|
}
|
|
4669
4675
|
}
|
|
@@ -5203,16 +5209,15 @@
|
|
|
5203
5209
|
}
|
|
5204
5210
|
switch (normalizedFilterTokenType) {
|
|
5205
5211
|
case "dpop":
|
|
5206
|
-
return this.matchKeyBoundAccessToken(entity, filter, true);
|
|
5207
5212
|
case AuthenticationScheme.SSH:
|
|
5208
|
-
return this.matchKeyBoundAccessToken(entity, filter
|
|
5213
|
+
return this.matchKeyBoundAccessToken(entity, filter);
|
|
5209
5214
|
default:
|
|
5210
5215
|
return true;
|
|
5211
5216
|
}
|
|
5212
5217
|
}
|
|
5213
|
-
matchKeyBoundAccessToken(entity, filter
|
|
5218
|
+
matchKeyBoundAccessToken(entity, filter) {
|
|
5214
5219
|
if (!filter.keyId) {
|
|
5215
|
-
return
|
|
5220
|
+
return true;
|
|
5216
5221
|
}
|
|
5217
5222
|
return this.matchKeyId(entity, filter.keyId);
|
|
5218
5223
|
}
|
|
@@ -5331,7 +5336,7 @@
|
|
|
5331
5336
|
}
|
|
5332
5337
|
}
|
|
5333
5338
|
|
|
5334
|
-
/*! @azure/msal-common v16.
|
|
5339
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5335
5340
|
/*
|
|
5336
5341
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5337
5342
|
* Licensed under the MIT License.
|
|
@@ -5345,7 +5350,7 @@
|
|
|
5345
5350
|
const PerformanceEventStatus = {
|
|
5346
5351
|
InProgress: 1};
|
|
5347
5352
|
|
|
5348
|
-
/*! @azure/msal-common v16.
|
|
5353
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5349
5354
|
|
|
5350
5355
|
/*
|
|
5351
5356
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5403,7 +5408,7 @@
|
|
|
5403
5408
|
}
|
|
5404
5409
|
}
|
|
5405
5410
|
|
|
5406
|
-
/*! @azure/msal-common v16.
|
|
5411
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5407
5412
|
|
|
5408
5413
|
/*
|
|
5409
5414
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5462,15 +5467,16 @@
|
|
|
5462
5467
|
...DEFAULT_LOGGER_IMPLEMENTATION,
|
|
5463
5468
|
...userLoggerOption,
|
|
5464
5469
|
};
|
|
5470
|
+
const resolvedTokenBindingKeyManager = tokenBindingKeyManager || DEFAULT_TOKEN_BINDING_KEY_MANAGER;
|
|
5465
5471
|
return {
|
|
5466
5472
|
authOptions: buildAuthOptions(userAuthOptions),
|
|
5467
5473
|
systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },
|
|
5468
5474
|
loggerOptions: loggerOptions,
|
|
5469
5475
|
storageInterface: storageImplementation ||
|
|
5470
|
-
new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name$1, version$1), new StubPerformanceClient()),
|
|
5476
|
+
new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name$1, version$1), new StubPerformanceClient(), undefined, resolvedTokenBindingKeyManager),
|
|
5471
5477
|
networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
|
|
5472
5478
|
cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
|
|
5473
|
-
tokenBindingKeyManager:
|
|
5479
|
+
tokenBindingKeyManager: resolvedTokenBindingKeyManager,
|
|
5474
5480
|
clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
|
|
5475
5481
|
libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
|
|
5476
5482
|
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
|
|
@@ -5500,7 +5506,7 @@
|
|
|
5500
5506
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
5501
5507
|
}
|
|
5502
5508
|
|
|
5503
|
-
/*! @azure/msal-common v16.
|
|
5509
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5504
5510
|
/*
|
|
5505
5511
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5506
5512
|
* Licensed under the MIT License.
|
|
@@ -5527,7 +5533,7 @@
|
|
|
5527
5533
|
}
|
|
5528
5534
|
}
|
|
5529
5535
|
|
|
5530
|
-
/*! @azure/msal-common v16.
|
|
5536
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5531
5537
|
|
|
5532
5538
|
/*
|
|
5533
5539
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5548,7 +5554,7 @@
|
|
|
5548
5554
|
return new JoseHeaderError(code, correlationId);
|
|
5549
5555
|
}
|
|
5550
5556
|
|
|
5551
|
-
/*! @azure/msal-common v16.
|
|
5557
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5552
5558
|
/*
|
|
5553
5559
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5554
5560
|
* Licensed under the MIT License.
|
|
@@ -5573,7 +5579,7 @@
|
|
|
5573
5579
|
return Object.getPrototypeOf(value) === proto;
|
|
5574
5580
|
}
|
|
5575
5581
|
|
|
5576
|
-
/*! @azure/msal-common v16.
|
|
5582
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5577
5583
|
/*
|
|
5578
5584
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5579
5585
|
* Licensed under the MIT License.
|
|
@@ -5583,7 +5589,7 @@
|
|
|
5583
5589
|
const missingJwkError = "missing_jwk_error";
|
|
5584
5590
|
const invalidJwkError = "invalid_jwk_error";
|
|
5585
5591
|
|
|
5586
|
-
/*! @azure/msal-common v16.
|
|
5592
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5587
5593
|
|
|
5588
5594
|
/*
|
|
5589
5595
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5649,7 +5655,7 @@
|
|
|
5649
5655
|
}
|
|
5650
5656
|
}
|
|
5651
5657
|
|
|
5652
|
-
/*! @azure/msal-common v16.
|
|
5658
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5653
5659
|
|
|
5654
5660
|
/*
|
|
5655
5661
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5750,7 +5756,152 @@
|
|
|
5750
5756
|
}
|
|
5751
5757
|
}
|
|
5752
5758
|
|
|
5753
|
-
/*! @azure/msal-common v16.
|
|
5759
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5760
|
+
|
|
5761
|
+
/*
|
|
5762
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5763
|
+
* Licensed under the MIT License.
|
|
5764
|
+
*/
|
|
5765
|
+
const DPOP_HTM_REGEX = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
5766
|
+
const DPOP_TOKEN_BINDING_KEY_TYPE = "dpop";
|
|
5767
|
+
const DPOP_JWT_HEADER_ALGORITHM = JsonWebTokenAlgorithms.ES256;
|
|
5768
|
+
function buildProofHeader(publicJwk, correlationId) {
|
|
5769
|
+
return JoseHeader.getDpopHeader({
|
|
5770
|
+
alg: DPOP_JWT_HEADER_ALGORITHM,
|
|
5771
|
+
jwk: publicJwk,
|
|
5772
|
+
}, correlationId);
|
|
5773
|
+
}
|
|
5774
|
+
function normalizeHtm(htm, correlationId) {
|
|
5775
|
+
if (typeof htm !== "string" || !DPOP_HTM_REGEX.test(htm)) {
|
|
5776
|
+
throw createClientConfigurationError(invalidDpopHtm, correlationId);
|
|
5777
|
+
}
|
|
5778
|
+
return htm.toUpperCase();
|
|
5779
|
+
}
|
|
5780
|
+
/**
|
|
5781
|
+
* Normalizes a URL for use as the DPoP htu claim.
|
|
5782
|
+
* Per RFC 9449 §4.2, htu is the target URI without query and fragment components.
|
|
5783
|
+
* WHATWG URL serialization handles RFC 3986 syntax- and scheme-based normalization
|
|
5784
|
+
* such as lowercasing scheme/host and eliding default ports.
|
|
5785
|
+
*/
|
|
5786
|
+
function normalizeHtu(url, correlationId) {
|
|
5787
|
+
let parsedUrl;
|
|
5788
|
+
try {
|
|
5789
|
+
parsedUrl = new URL(url);
|
|
5790
|
+
}
|
|
5791
|
+
catch {
|
|
5792
|
+
throw createClientConfigurationError(urlParseError, correlationId);
|
|
5793
|
+
}
|
|
5794
|
+
if (!/^https:\/\//i.test(url) ||
|
|
5795
|
+
parsedUrl.protocol !== "https:" ||
|
|
5796
|
+
parsedUrl.username ||
|
|
5797
|
+
parsedUrl.password) {
|
|
5798
|
+
throw createClientConfigurationError(invalidDpopHtu, correlationId);
|
|
5799
|
+
}
|
|
5800
|
+
parsedUrl.search = "";
|
|
5801
|
+
parsedUrl.hash = "";
|
|
5802
|
+
return parsedUrl.href;
|
|
5803
|
+
}
|
|
5804
|
+
function validateDpopNonce(nonce, correlationId) {
|
|
5805
|
+
if (nonce !== undefined && nonce.trim().length === 0) {
|
|
5806
|
+
throw createClientConfigurationError(invalidDpopNonce, correlationId);
|
|
5807
|
+
}
|
|
5808
|
+
}
|
|
5809
|
+
/**
|
|
5810
|
+
* Builds RFC 9449 DPoP proof JWT payloads for token-endpoint and
|
|
5811
|
+
* resource-endpoint proof bindings.
|
|
5812
|
+
*
|
|
5813
|
+
* Not exported from any public package entry point.
|
|
5814
|
+
* This helper is internal-only until DPoP is wired into acquisition flows
|
|
5815
|
+
* in a subsequent work item.
|
|
5816
|
+
*
|
|
5817
|
+
* DPoP proofs do not contain SHR fields (at, ts, m, u, p, q).
|
|
5818
|
+
* @internal
|
|
5819
|
+
*/
|
|
5820
|
+
class DpopProofGenerator {
|
|
5821
|
+
constructor(cryptoUtils, tokenBindingKeyManager) {
|
|
5822
|
+
this.cryptoUtils = cryptoUtils;
|
|
5823
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
5824
|
+
}
|
|
5825
|
+
/**
|
|
5826
|
+
* Provisions a fresh DPoP key and returns the RFC 7638 JWK thumbprint used
|
|
5827
|
+
* as `dpop_jkt`.
|
|
5828
|
+
*/
|
|
5829
|
+
async generateJkt(correlationId = "") {
|
|
5830
|
+
return this.tokenBindingKeyManager.provisionTokenBindingKey({
|
|
5831
|
+
tokenBindingKeyType: DPOP_TOKEN_BINDING_KEY_TYPE,
|
|
5832
|
+
tokenBindingKeyAlgorithm: DPOP_JWT_HEADER_ALGORITHM,
|
|
5833
|
+
correlationId,
|
|
5834
|
+
});
|
|
5835
|
+
}
|
|
5836
|
+
/**
|
|
5837
|
+
* Builds RFC 9449 claims for a token-endpoint DPoP proof.
|
|
5838
|
+
* - htm is always "POST" because token endpoint requests use HTTP POST (RFC 9449 §5).
|
|
5839
|
+
* - htu is the normalized token endpoint URI (query and fragment stripped).
|
|
5840
|
+
* - jti is a fresh CSPRNG-backed unique identifier for every proof.
|
|
5841
|
+
*/
|
|
5842
|
+
buildTokenProofClaims(params, correlationId = "") {
|
|
5843
|
+
validateDpopNonce(params.nonce, correlationId);
|
|
5844
|
+
const claims = {
|
|
5845
|
+
jti: this.cryptoUtils.createNewGuid(),
|
|
5846
|
+
htm: "POST",
|
|
5847
|
+
htu: normalizeHtu(params.tokenEndpoint, correlationId),
|
|
5848
|
+
iat: nowSeconds(),
|
|
5849
|
+
};
|
|
5850
|
+
if (params.nonce !== undefined) {
|
|
5851
|
+
claims.nonce = params.nonce;
|
|
5852
|
+
}
|
|
5853
|
+
return claims;
|
|
5854
|
+
}
|
|
5855
|
+
/**
|
|
5856
|
+
* Builds and signs a compact DPoP proof JWT for a token-endpoint request.
|
|
5857
|
+
*/
|
|
5858
|
+
async generateTokenProof(params, keyId, correlationId = "") {
|
|
5859
|
+
return this.generateProof(this.buildTokenProofClaims(params, correlationId), keyId, correlationId);
|
|
5860
|
+
}
|
|
5861
|
+
/**
|
|
5862
|
+
* Builds RFC 9449 claims for a resource-endpoint DPoP proof.
|
|
5863
|
+
* - htm is uppercased per RFC 9449 §4.2.
|
|
5864
|
+
* - htu is the normalized resource URI (query and fragment stripped).
|
|
5865
|
+
* - ath is the base64url-encoded SHA-256 hash of the ASCII access token.
|
|
5866
|
+
* - jti is a fresh CSPRNG-backed unique identifier for every proof.
|
|
5867
|
+
*/
|
|
5868
|
+
buildResourceProofClaims(params, correlationId = "") {
|
|
5869
|
+
validateDpopNonce(params.nonce, correlationId);
|
|
5870
|
+
const claims = {
|
|
5871
|
+
jti: this.cryptoUtils.createNewGuid(),
|
|
5872
|
+
htm: normalizeHtm(params.htm, correlationId),
|
|
5873
|
+
htu: normalizeHtu(params.htu, correlationId),
|
|
5874
|
+
ath: params.ath,
|
|
5875
|
+
iat: nowSeconds(),
|
|
5876
|
+
};
|
|
5877
|
+
if (params.nonce !== undefined) {
|
|
5878
|
+
claims.nonce = params.nonce;
|
|
5879
|
+
}
|
|
5880
|
+
return claims;
|
|
5881
|
+
}
|
|
5882
|
+
/**
|
|
5883
|
+
* Builds and signs a compact DPoP proof JWT for a resource request.
|
|
5884
|
+
*/
|
|
5885
|
+
async generateResourceProof(params, keyId, correlationId = "") {
|
|
5886
|
+
const { htu, htm, nonce } = params;
|
|
5887
|
+
if (!htu || !htm) {
|
|
5888
|
+
throw createClientConfigurationError(dpopMissingResourceContext, correlationId);
|
|
5889
|
+
}
|
|
5890
|
+
const ath = await this.cryptoUtils.hashString(params.accessToken);
|
|
5891
|
+
return this.generateProof(this.buildResourceProofClaims({
|
|
5892
|
+
htu,
|
|
5893
|
+
htm,
|
|
5894
|
+
ath,
|
|
5895
|
+
nonce,
|
|
5896
|
+
}, correlationId), keyId, correlationId);
|
|
5897
|
+
}
|
|
5898
|
+
async generateProof(claims, keyId, correlationId) {
|
|
5899
|
+
const publicJwk = await this.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(keyId, correlationId);
|
|
5900
|
+
return this.cryptoUtils.signTokenBindingJwt(buildProofHeader(publicJwk, correlationId), claims, keyId, correlationId);
|
|
5901
|
+
}
|
|
5902
|
+
}
|
|
5903
|
+
|
|
5904
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5754
5905
|
/*
|
|
5755
5906
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5756
5907
|
* Licensed under the MIT License.
|
|
@@ -5801,7 +5952,7 @@
|
|
|
5801
5952
|
*/
|
|
5802
5953
|
const interruptedUser = "interrupted_user";
|
|
5803
5954
|
|
|
5804
|
-
/*! @azure/msal-common v16.
|
|
5955
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5805
5956
|
|
|
5806
5957
|
/*
|
|
5807
5958
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5868,7 +6019,7 @@
|
|
|
5868
6019
|
return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
|
|
5869
6020
|
}
|
|
5870
6021
|
|
|
5871
|
-
/*! @azure/msal-common v16.
|
|
6022
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5872
6023
|
|
|
5873
6024
|
/*
|
|
5874
6025
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5887,7 +6038,7 @@
|
|
|
5887
6038
|
}
|
|
5888
6039
|
}
|
|
5889
6040
|
|
|
5890
|
-
/*! @azure/msal-common v16.
|
|
6041
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5891
6042
|
|
|
5892
6043
|
/*
|
|
5893
6044
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5958,7 +6109,7 @@
|
|
|
5958
6109
|
}
|
|
5959
6110
|
}
|
|
5960
6111
|
|
|
5961
|
-
/*! @azure/msal-common v16.
|
|
6112
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
5962
6113
|
|
|
5963
6114
|
/*
|
|
5964
6115
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6047,7 +6198,21 @@
|
|
|
6047
6198
|
}
|
|
6048
6199
|
// Add keyId from request to serverTokenResponse if defined
|
|
6049
6200
|
serverTokenResponse.key_id =
|
|
6050
|
-
serverTokenResponse.key_id ||
|
|
6201
|
+
serverTokenResponse.key_id ||
|
|
6202
|
+
request.dpopJkt ||
|
|
6203
|
+
request.sshKid ||
|
|
6204
|
+
undefined;
|
|
6205
|
+
if (request.authenticationScheme === AuthenticationScheme.DPOP) {
|
|
6206
|
+
if (serverTokenResponse.token_type?.toLowerCase() !==
|
|
6207
|
+
AuthenticationScheme.DPOP.toLowerCase()) {
|
|
6208
|
+
this.performanceClient?.addFields({
|
|
6209
|
+
dpopTokenTypeMismatch: serverTokenResponse.token_type,
|
|
6210
|
+
}, request.correlationId);
|
|
6211
|
+
throw createClientAuthError(dpopTokenTypeMismatch, request.correlationId);
|
|
6212
|
+
}
|
|
6213
|
+
serverTokenResponse.token_type =
|
|
6214
|
+
AuthenticationScheme.DPOP;
|
|
6215
|
+
}
|
|
6051
6216
|
// Compute components once for entity storage (fallback if hash not provided by client)
|
|
6052
6217
|
const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
|
|
6053
6218
|
const cacheKeyComponents = additionalCacheKeyComponents ??
|
|
@@ -6210,7 +6375,9 @@
|
|
|
6210
6375
|
let extExpiresOn;
|
|
6211
6376
|
let refreshOn;
|
|
6212
6377
|
let familyId = "";
|
|
6378
|
+
let dpopProof;
|
|
6213
6379
|
if (cacheRecord.accessToken) {
|
|
6380
|
+
const accessTokenType = cacheRecord.accessToken.tokenType?.toLowerCase();
|
|
6214
6381
|
/*
|
|
6215
6382
|
* if the request object has `popKid` property, `signPopToken` will be set to false and
|
|
6216
6383
|
* the token will be returned unsigned
|
|
@@ -6228,6 +6395,18 @@
|
|
|
6228
6395
|
else {
|
|
6229
6396
|
accessToken = cacheRecord.accessToken.secret;
|
|
6230
6397
|
}
|
|
6398
|
+
if (accessTokenType ===
|
|
6399
|
+
AuthenticationScheme.DPOP.toLowerCase()) {
|
|
6400
|
+
if (!cacheRecord.accessToken.keyId) {
|
|
6401
|
+
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
6402
|
+
}
|
|
6403
|
+
const dpopProofGenerator = new DpopProofGenerator(cryptoObj, tokenBindingKeyManager);
|
|
6404
|
+
dpopProof = await dpopProofGenerator.generateResourceProof({
|
|
6405
|
+
htu: request.resourceRequestUri,
|
|
6406
|
+
htm: request.resourceRequestMethod,
|
|
6407
|
+
accessToken: cacheRecord.accessToken.secret,
|
|
6408
|
+
}, cacheRecord.accessToken.keyId, request.correlationId);
|
|
6409
|
+
}
|
|
6231
6410
|
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target, request.correlationId).asArray();
|
|
6232
6411
|
// Access token expiresOn cached in seconds, converting to Date for AuthenticationResult
|
|
6233
6412
|
expiresOn = toDateFromSeconds(cacheRecord.accessToken.expiresOn);
|
|
@@ -6244,6 +6423,15 @@
|
|
|
6244
6423
|
}
|
|
6245
6424
|
const uid = idTokenClaims?.oid || idTokenClaims?.sub || "";
|
|
6246
6425
|
const tid = idTokenClaims?.tid || "";
|
|
6426
|
+
/*
|
|
6427
|
+
* Surface the sovereign enclave for telemetry. This runs for both freshly acquired
|
|
6428
|
+
* and cache-served tokens because SilentFlowClient shares this method, so the field
|
|
6429
|
+
* is present on silent requests that never hit the network.
|
|
6430
|
+
*/
|
|
6431
|
+
const regionSubScope = idTokenClaims?.tenant_region_sub_scope;
|
|
6432
|
+
if (typeof regionSubScope === "string") {
|
|
6433
|
+
performanceClient?.addFields({ regionSubScope }, request.correlationId);
|
|
6434
|
+
}
|
|
6247
6435
|
// for hybrid + native bridge enablement, send back the native account Id
|
|
6248
6436
|
if (serverTokenResponse?.spa_accountid && !!cacheRecord.account) {
|
|
6249
6437
|
// Set on deprecated top-level for downgrade compat
|
|
@@ -6272,6 +6460,7 @@
|
|
|
6272
6460
|
idToken: cacheRecord?.idToken?.secret || "",
|
|
6273
6461
|
idTokenClaims: idTokenClaims || {},
|
|
6274
6462
|
accessToken: accessToken,
|
|
6463
|
+
dpopProof,
|
|
6275
6464
|
fromCache: fromTokenCache,
|
|
6276
6465
|
expiresOn: expiresOn,
|
|
6277
6466
|
extExpiresOn: extExpiresOn,
|
|
@@ -6279,7 +6468,10 @@
|
|
|
6279
6468
|
correlationId: request.correlationId,
|
|
6280
6469
|
requestId: requestId || "",
|
|
6281
6470
|
familyId: familyId,
|
|
6282
|
-
tokenType: cacheRecord.accessToken?.tokenType
|
|
6471
|
+
tokenType: cacheRecord.accessToken?.tokenType?.toLowerCase() ===
|
|
6472
|
+
AuthenticationScheme.DPOP.toLowerCase()
|
|
6473
|
+
? AuthenticationScheme.DPOP
|
|
6474
|
+
: cacheRecord.accessToken?.tokenType || "",
|
|
6283
6475
|
state: requestState ? requestState.userRequestState : "",
|
|
6284
6476
|
cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || "",
|
|
6285
6477
|
msGraphHost: cacheRecord.account?.msGraphHost || "",
|
|
@@ -6330,7 +6522,7 @@
|
|
|
6330
6522
|
return baseAccount;
|
|
6331
6523
|
}
|
|
6332
6524
|
|
|
6333
|
-
/*! @azure/msal-common v16.
|
|
6525
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6334
6526
|
/*
|
|
6335
6527
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6336
6528
|
* Licensed under the MIT License.
|
|
@@ -6340,7 +6532,7 @@
|
|
|
6340
6532
|
UPN: "UPN",
|
|
6341
6533
|
};
|
|
6342
6534
|
|
|
6343
|
-
/*! @azure/msal-common v16.
|
|
6535
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6344
6536
|
/*
|
|
6345
6537
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6346
6538
|
* Licensed under the MIT License.
|
|
@@ -6359,7 +6551,7 @@
|
|
|
6359
6551
|
}
|
|
6360
6552
|
}
|
|
6361
6553
|
|
|
6362
|
-
/*! @azure/msal-common v16.
|
|
6554
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6363
6555
|
|
|
6364
6556
|
/*
|
|
6365
6557
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6383,7 +6575,7 @@
|
|
|
6383
6575
|
};
|
|
6384
6576
|
}
|
|
6385
6577
|
|
|
6386
|
-
/*! @azure/msal-common v16.
|
|
6578
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6387
6579
|
|
|
6388
6580
|
/*
|
|
6389
6581
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6469,7 +6661,7 @@
|
|
|
6469
6661
|
}
|
|
6470
6662
|
}
|
|
6471
6663
|
|
|
6472
|
-
/*! @azure/msal-common v16.
|
|
6664
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6473
6665
|
|
|
6474
6666
|
/*
|
|
6475
6667
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6500,7 +6692,7 @@
|
|
|
6500
6692
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6501
6693
|
}
|
|
6502
6694
|
|
|
6503
|
-
/*! @azure/msal-common v16.
|
|
6695
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6504
6696
|
|
|
6505
6697
|
/*
|
|
6506
6698
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6530,6 +6722,23 @@
|
|
|
6530
6722
|
}
|
|
6531
6723
|
return headers;
|
|
6532
6724
|
}
|
|
6725
|
+
/**
|
|
6726
|
+
* Adds the DPoP proof header for token endpoint requests when DPoP is requested.
|
|
6727
|
+
* @internal
|
|
6728
|
+
*/
|
|
6729
|
+
async function addDpopTokenProofHeader(headers, request, tokenEndpoint, cryptoUtils, tokenBindingKeyManager) {
|
|
6730
|
+
if (request.authenticationScheme !== AuthenticationScheme.DPOP) {
|
|
6731
|
+
return;
|
|
6732
|
+
}
|
|
6733
|
+
const dpopProofGenerator = new DpopProofGenerator(cryptoUtils, tokenBindingKeyManager);
|
|
6734
|
+
const keyId = request.dpopJkt;
|
|
6735
|
+
if (!keyId?.trim()) {
|
|
6736
|
+
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
6737
|
+
}
|
|
6738
|
+
headers[HeaderNames.DPOP] = await dpopProofGenerator.generateTokenProof({
|
|
6739
|
+
tokenEndpoint,
|
|
6740
|
+
}, keyId, request.correlationId);
|
|
6741
|
+
}
|
|
6533
6742
|
/**
|
|
6534
6743
|
* Creates query string for the /token request
|
|
6535
6744
|
* @param request
|
|
@@ -6616,7 +6825,7 @@
|
|
|
6616
6825
|
return response;
|
|
6617
6826
|
}
|
|
6618
6827
|
|
|
6619
|
-
/*! @azure/msal-common v16.
|
|
6828
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6620
6829
|
|
|
6621
6830
|
/*
|
|
6622
6831
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6708,6 +6917,7 @@
|
|
|
6708
6917
|
}
|
|
6709
6918
|
}
|
|
6710
6919
|
const headers = createTokenRequestHeaders(this.logger, this.config.systemOptions.preventCorsPreflight, ccsCredential || request.ccsCredential);
|
|
6920
|
+
await addDpopTokenProofHeader(headers, request, endpoint, this.cryptoUtils, this.config.tokenBindingKeyManager);
|
|
6711
6921
|
const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);
|
|
6712
6922
|
return invokeAsync(executePostToTokenEndpoint, AuthorizationCodeClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, this.cacheManager, this.networkClient, this.logger, this.performanceClient, serverTelemetryManager);
|
|
6713
6923
|
}
|
|
@@ -6879,7 +7089,7 @@
|
|
|
6879
7089
|
}
|
|
6880
7090
|
}
|
|
6881
7091
|
|
|
6882
|
-
/*! @azure/msal-common v16.
|
|
7092
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
6883
7093
|
|
|
6884
7094
|
/*
|
|
6885
7095
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7106,7 +7316,7 @@
|
|
|
7106
7316
|
return account.loginHint || account.idTokenClaims?.login_hint || null;
|
|
7107
7317
|
}
|
|
7108
7318
|
|
|
7109
|
-
/*! @azure/msal-common v16.
|
|
7319
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
7110
7320
|
|
|
7111
7321
|
/*
|
|
7112
7322
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7217,6 +7427,12 @@
|
|
|
7217
7427
|
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
|
7218
7428
|
},
|
|
7219
7429
|
};
|
|
7430
|
+
if (refreshTokenRequest.authenticationScheme ===
|
|
7431
|
+
AuthenticationScheme.DPOP &&
|
|
7432
|
+
!refreshTokenRequest.dpopJkt) {
|
|
7433
|
+
const dpopProofGenerator = new DpopProofGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager);
|
|
7434
|
+
refreshTokenRequest.dpopJkt = await dpopProofGenerator.generateJkt(request.correlationId);
|
|
7435
|
+
}
|
|
7220
7436
|
try {
|
|
7221
7437
|
return await invokeAsync(this.acquireToken.bind(this), RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest, apiId);
|
|
7222
7438
|
}
|
|
@@ -7242,6 +7458,7 @@
|
|
|
7242
7458
|
const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
7243
7459
|
const requestBody = await invokeAsync(this.createTokenRequestBody.bind(this), RefreshTokenClientCreateTokenRequestBody, this.logger, this.performanceClient, request.correlationId)(request);
|
|
7244
7460
|
const headers = createTokenRequestHeaders(this.logger, this.config.systemOptions.preventCorsPreflight, request.ccsCredential);
|
|
7461
|
+
await addDpopTokenProofHeader(headers, request, endpoint, this.cryptoUtils, this.config.tokenBindingKeyManager);
|
|
7245
7462
|
const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);
|
|
7246
7463
|
return invokeAsync(executePostToTokenEndpoint, RefreshTokenClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, this.cacheManager, this.networkClient, this.logger, this.performanceClient, this.serverTelemetryManager);
|
|
7247
7464
|
}
|
|
@@ -7333,7 +7550,7 @@
|
|
|
7333
7550
|
}
|
|
7334
7551
|
}
|
|
7335
7552
|
|
|
7336
|
-
/*! @azure/msal-common v16.
|
|
7553
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
7337
7554
|
|
|
7338
7555
|
/*
|
|
7339
7556
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7626,7 +7843,7 @@
|
|
|
7626
7843
|
clearNativeBrokerErrorCode() { }
|
|
7627
7844
|
}
|
|
7628
7845
|
|
|
7629
|
-
/*! @azure/msal-common v16.
|
|
7846
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
7630
7847
|
|
|
7631
7848
|
/*
|
|
7632
7849
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7695,6 +7912,22 @@
|
|
|
7695
7912
|
lastCacheOutcome = CacheOutcome.PROACTIVELY_REFRESHED;
|
|
7696
7913
|
// don't throw ClientAuthError.createRefreshRequiredError(), return cached token instead
|
|
7697
7914
|
}
|
|
7915
|
+
const cachedAccessTokenType = cachedAccessToken.tokenType?.toLowerCase();
|
|
7916
|
+
if (cachedAccessTokenType === AuthenticationScheme.DPOP.toLowerCase()) {
|
|
7917
|
+
if (!cachedAccessToken.keyId) {
|
|
7918
|
+
this.logger.info("1enswf", request.correlationId);
|
|
7919
|
+
this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
|
|
7920
|
+
throw createClientAuthError(tokenRefreshRequired, request.correlationId);
|
|
7921
|
+
}
|
|
7922
|
+
try {
|
|
7923
|
+
await this.config.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(cachedAccessToken.keyId, request.correlationId);
|
|
7924
|
+
}
|
|
7925
|
+
catch {
|
|
7926
|
+
this.logger.info("14djth", request.correlationId);
|
|
7927
|
+
this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
|
|
7928
|
+
throw createClientAuthError(tokenRefreshRequired, request.correlationId);
|
|
7929
|
+
}
|
|
7930
|
+
}
|
|
7698
7931
|
const environment = request.authority || this.authority.getPreferredCache();
|
|
7699
7932
|
const cacheRecord = {
|
|
7700
7933
|
account: this.cacheManager.getAccount(this.cacheManager.generateAccountKey(request.account), request.correlationId),
|
|
@@ -7737,7 +7970,7 @@
|
|
|
7737
7970
|
}
|
|
7738
7971
|
}
|
|
7739
7972
|
|
|
7740
|
-
/*! @azure/msal-common v16.
|
|
7973
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
7741
7974
|
|
|
7742
7975
|
/*
|
|
7743
7976
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7753,7 +7986,7 @@
|
|
|
7753
7986
|
},
|
|
7754
7987
|
};
|
|
7755
7988
|
|
|
7756
|
-
/*! @azure/msal-common v16.
|
|
7989
|
+
/*! @azure/msal-common v16.14.0 2026-09-02 */
|
|
7757
7990
|
|
|
7758
7991
|
/*
|
|
7759
7992
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8181,7 +8414,7 @@
|
|
|
8181
8414
|
|
|
8182
8415
|
/* eslint-disable header/header */
|
|
8183
8416
|
const name = "@azure/msal-browser";
|
|
8184
|
-
const version = "5.
|
|
8417
|
+
const version = "5.21.0";
|
|
8185
8418
|
|
|
8186
8419
|
/*
|
|
8187
8420
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10538,6 +10771,140 @@
|
|
|
10538
10771
|
}
|
|
10539
10772
|
}
|
|
10540
10773
|
|
|
10774
|
+
/*
|
|
10775
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10776
|
+
* Licensed under the MIT License.
|
|
10777
|
+
*/
|
|
10778
|
+
/**
|
|
10779
|
+
* This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
10780
|
+
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
10781
|
+
*/
|
|
10782
|
+
class CryptoOps {
|
|
10783
|
+
constructor(logger, performanceClient, skipValidateSubtleCrypto) {
|
|
10784
|
+
this.logger = logger;
|
|
10785
|
+
// Browser crypto needs to be validated first before any other classes can be set.
|
|
10786
|
+
validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
|
|
10787
|
+
this.performanceClient = performanceClient;
|
|
10788
|
+
this.tokenBindingKeyManager = new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
10789
|
+
}
|
|
10790
|
+
/**
|
|
10791
|
+
* Creates a new random GUID - used to populate state and nonce.
|
|
10792
|
+
* @returns string (GUID)
|
|
10793
|
+
*/
|
|
10794
|
+
createNewGuid() {
|
|
10795
|
+
return createNewGuid();
|
|
10796
|
+
}
|
|
10797
|
+
/**
|
|
10798
|
+
* Encodes input string to base64.
|
|
10799
|
+
* @param input
|
|
10800
|
+
*/
|
|
10801
|
+
base64Encode(input) {
|
|
10802
|
+
return base64Encode(input);
|
|
10803
|
+
}
|
|
10804
|
+
/**
|
|
10805
|
+
* Decodes input string from base64.
|
|
10806
|
+
* @param input
|
|
10807
|
+
*/
|
|
10808
|
+
base64Decode(input) {
|
|
10809
|
+
return base64Decode(input);
|
|
10810
|
+
}
|
|
10811
|
+
/**
|
|
10812
|
+
* Encodes input string to base64 URL safe string.
|
|
10813
|
+
* @param input
|
|
10814
|
+
*/
|
|
10815
|
+
base64UrlEncode(input) {
|
|
10816
|
+
return urlEncode(input);
|
|
10817
|
+
}
|
|
10818
|
+
/**
|
|
10819
|
+
* Stringifies and base64Url encodes input public key
|
|
10820
|
+
* @param inputKid
|
|
10821
|
+
* @returns Base64Url encoded public key
|
|
10822
|
+
*/
|
|
10823
|
+
encodeKid(inputKid) {
|
|
10824
|
+
return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));
|
|
10825
|
+
}
|
|
10826
|
+
/**
|
|
10827
|
+
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
10828
|
+
* @param kid
|
|
10829
|
+
* @param correlationId
|
|
10830
|
+
*/
|
|
10831
|
+
async removeTokenBindingKey(kid, correlationId) {
|
|
10832
|
+
await this.tokenBindingKeyManager.removeTokenBindingKey(kid, correlationId);
|
|
10833
|
+
}
|
|
10834
|
+
/**
|
|
10835
|
+
* Removes all cryptographic keys from IndexedDB storage
|
|
10836
|
+
* @param correlationId
|
|
10837
|
+
*/
|
|
10838
|
+
async clearKeystore(correlationId) {
|
|
10839
|
+
return this.tokenBindingKeyManager.clearKeystore(correlationId);
|
|
10840
|
+
}
|
|
10841
|
+
/** @internal */
|
|
10842
|
+
async signTokenBindingJwt(header, payload, kid, correlationId) {
|
|
10843
|
+
let telemetry = {};
|
|
10844
|
+
const signTokenBindingJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
|
|
10845
|
+
try {
|
|
10846
|
+
const cachedKeyPair = await this.tokenBindingKeyManager.getTokenBindingKeyPair(kid, correlationId);
|
|
10847
|
+
await this.validateTokenBindingJwtHeaderKey(header, kid, correlationId);
|
|
10848
|
+
telemetry = this.tokenBindingKeyManager.getTokenBindingKeyTelemetry(cachedKeyPair, header.alg);
|
|
10849
|
+
const signingAlgorithm = this.getTokenBindingKeySigningAlgorithm(cachedKeyPair, header.alg, correlationId);
|
|
10850
|
+
const tokenString = `${urlEncode(JSON.stringify(header))}.${urlEncode(JSON.stringify(payload))}`;
|
|
10851
|
+
const encodedSignature = await this.signInput(cachedKeyPair, tokenString, signingAlgorithm);
|
|
10852
|
+
signTokenBindingJwtMeasurement?.end({
|
|
10853
|
+
success: true,
|
|
10854
|
+
...telemetry,
|
|
10855
|
+
});
|
|
10856
|
+
return `${tokenString}.${encodedSignature}`;
|
|
10857
|
+
}
|
|
10858
|
+
catch (e) {
|
|
10859
|
+
signTokenBindingJwtMeasurement?.end({
|
|
10860
|
+
success: false,
|
|
10861
|
+
...telemetry,
|
|
10862
|
+
});
|
|
10863
|
+
throw e;
|
|
10864
|
+
}
|
|
10865
|
+
}
|
|
10866
|
+
/**
|
|
10867
|
+
* Returns the SHA-256 hash of an input string
|
|
10868
|
+
* @param plainText
|
|
10869
|
+
*/
|
|
10870
|
+
async hashString(plainText) {
|
|
10871
|
+
return hashString(plainText);
|
|
10872
|
+
}
|
|
10873
|
+
async signInput(cachedKeyPair, signingInput, algorithm) {
|
|
10874
|
+
const encoder = new TextEncoder();
|
|
10875
|
+
const signatureBuffer = await sign(cachedKeyPair.privateKey, encoder.encode(signingInput), algorithm);
|
|
10876
|
+
return urlEncodeArr(new Uint8Array(signatureBuffer));
|
|
10877
|
+
}
|
|
10878
|
+
getTokenBindingKeySigningAlgorithm(cachedKeyPair, requestedAlgorithm, correlationId) {
|
|
10879
|
+
const keyAlgorithm = cachedKeyPair.privateKey.algorithm;
|
|
10880
|
+
if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 &&
|
|
10881
|
+
keyAlgorithm.name === RSA_SIGN_ALGORITHM_OPTIONS.name) {
|
|
10882
|
+
return RSA_SIGN_ALGORITHM_OPTIONS;
|
|
10883
|
+
}
|
|
10884
|
+
if (requestedAlgorithm === JsonWebTokenAlgorithms.ES256 &&
|
|
10885
|
+
keyAlgorithm.name ===
|
|
10886
|
+
ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS.name &&
|
|
10887
|
+
keyAlgorithm.namedCurve ===
|
|
10888
|
+
ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS.namedCurve) {
|
|
10889
|
+
return ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS;
|
|
10890
|
+
}
|
|
10891
|
+
if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 ||
|
|
10892
|
+
requestedAlgorithm === JsonWebTokenAlgorithms.ES256) {
|
|
10893
|
+
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId, tokenBindingKeyAlgorithmMismatch);
|
|
10894
|
+
}
|
|
10895
|
+
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId);
|
|
10896
|
+
}
|
|
10897
|
+
async validateTokenBindingJwtHeaderKey(header, kid, correlationId) {
|
|
10898
|
+
if (!header.jwk) {
|
|
10899
|
+
return;
|
|
10900
|
+
}
|
|
10901
|
+
const headerKeyId = await computeJwkThumbprint(header.jwk, correlationId);
|
|
10902
|
+
if (headerKeyId !== kid) {
|
|
10903
|
+
throw createBrowserAuthError(invalidPublicJwk, correlationId, tokenBindingKeyJwkThumbprintMismatch);
|
|
10904
|
+
}
|
|
10905
|
+
}
|
|
10906
|
+
}
|
|
10907
|
+
|
|
10541
10908
|
/*
|
|
10542
10909
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10543
10910
|
* Licensed under the MIT License.
|
|
@@ -10545,8 +10912,60 @@
|
|
|
10545
10912
|
const SUPPORTED_AUTHENTICATION_SCHEMES = new Set([
|
|
10546
10913
|
AuthenticationScheme.BEARER,
|
|
10547
10914
|
AuthenticationScheme.POP,
|
|
10915
|
+
AuthenticationScheme.DPOP,
|
|
10548
10916
|
AuthenticationScheme.SSH,
|
|
10549
10917
|
]);
|
|
10918
|
+
function validateSshRequest(request, correlationId) {
|
|
10919
|
+
if (!request.sshJwk) {
|
|
10920
|
+
throw createClientConfigurationError(missingSshJwk, correlationId);
|
|
10921
|
+
}
|
|
10922
|
+
if (!request.sshKid) {
|
|
10923
|
+
throw createClientConfigurationError(missingSshKid, correlationId);
|
|
10924
|
+
}
|
|
10925
|
+
}
|
|
10926
|
+
function validateDpopRequest(request, correlationId) {
|
|
10927
|
+
if (!request.resourceRequestMethod?.trim() ||
|
|
10928
|
+
!request.resourceRequestUri?.trim()) {
|
|
10929
|
+
throw createClientConfigurationError(dpopMissingResourceContext, correlationId);
|
|
10930
|
+
}
|
|
10931
|
+
}
|
|
10932
|
+
/**
|
|
10933
|
+
* Resolves the token-binding parameters needed before building authorize or token requests.
|
|
10934
|
+
* Public PCA DPoP requests use a dpopJkt thumbprint, while platform broker PoP requests use
|
|
10935
|
+
* a reqCnf confirmation claim. Requests that do not require request-time token binding return
|
|
10936
|
+
* no additional parameters.
|
|
10937
|
+
*/
|
|
10938
|
+
async function getTokenBindingRequestParams(request, tokenBindingKeyManager, logger, performanceClient) {
|
|
10939
|
+
switch (request.authenticationScheme) {
|
|
10940
|
+
case AuthenticationScheme.DPOP:
|
|
10941
|
+
if (request.platformBroker) {
|
|
10942
|
+
return {};
|
|
10943
|
+
}
|
|
10944
|
+
if (request.dpopJkt) {
|
|
10945
|
+
return { dpopJkt: request.dpopJkt };
|
|
10946
|
+
}
|
|
10947
|
+
return {
|
|
10948
|
+
dpopJkt: await tokenBindingKeyManager.provisionTokenBindingKey({
|
|
10949
|
+
tokenBindingKeyType: AuthenticationScheme.DPOP.toLowerCase(),
|
|
10950
|
+
tokenBindingKeyAlgorithm: JsonWebTokenAlgorithms.ES256,
|
|
10951
|
+
correlationId: request.correlationId,
|
|
10952
|
+
}),
|
|
10953
|
+
};
|
|
10954
|
+
case AuthenticationScheme.POP:
|
|
10955
|
+
if (!request.platformBroker) {
|
|
10956
|
+
return {};
|
|
10957
|
+
}
|
|
10958
|
+
const cryptoOps = new CryptoOps(logger, performanceClient);
|
|
10959
|
+
if (request.popKid) {
|
|
10960
|
+
return { reqCnf: cryptoOps.encodeKid(request.popKid) };
|
|
10961
|
+
}
|
|
10962
|
+
const popTokenGenerator = new PopTokenGenerator(cryptoOps, tokenBindingKeyManager, performanceClient);
|
|
10963
|
+
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, logger, performanceClient, request.correlationId)(request, logger);
|
|
10964
|
+
return { reqCnf: generatedReqCnfData.reqCnfString };
|
|
10965
|
+
default:
|
|
10966
|
+
return {};
|
|
10967
|
+
}
|
|
10968
|
+
}
|
|
10550
10969
|
/**
|
|
10551
10970
|
* Initializer function for all request APIs
|
|
10552
10971
|
* @param request
|
|
@@ -10574,13 +10993,13 @@
|
|
|
10574
10993
|
if (!SUPPORTED_AUTHENTICATION_SCHEMES.has(validatedRequest.authenticationScheme)) {
|
|
10575
10994
|
throw createClientConfigurationError(unsupportedAuthenticationScheme, correlationId);
|
|
10576
10995
|
}
|
|
10577
|
-
|
|
10578
|
-
AuthenticationScheme.SSH
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10996
|
+
switch (validatedRequest.authenticationScheme) {
|
|
10997
|
+
case AuthenticationScheme.SSH:
|
|
10998
|
+
validateSshRequest(request, correlationId);
|
|
10999
|
+
break;
|
|
11000
|
+
case AuthenticationScheme.DPOP: {
|
|
11001
|
+
validateDpopRequest(request, correlationId);
|
|
11002
|
+
break;
|
|
10584
11003
|
}
|
|
10585
11004
|
}
|
|
10586
11005
|
logger.verbose(`Authentication Scheme set to "'${validatedRequest.authenticationScheme}'" as configured in Auth request`, correlationId);
|
|
@@ -14862,140 +15281,6 @@
|
|
|
14862
15281
|
}
|
|
14863
15282
|
}
|
|
14864
15283
|
|
|
14865
|
-
/*
|
|
14866
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14867
|
-
* Licensed under the MIT License.
|
|
14868
|
-
*/
|
|
14869
|
-
/**
|
|
14870
|
-
* This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
14871
|
-
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
14872
|
-
*/
|
|
14873
|
-
class CryptoOps {
|
|
14874
|
-
constructor(logger, performanceClient, skipValidateSubtleCrypto) {
|
|
14875
|
-
this.logger = logger;
|
|
14876
|
-
// Browser crypto needs to be validated first before any other classes can be set.
|
|
14877
|
-
validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
|
|
14878
|
-
this.performanceClient = performanceClient;
|
|
14879
|
-
this.tokenBindingKeyManager = new TokenBindingKeyManager(this.logger, this.performanceClient);
|
|
14880
|
-
}
|
|
14881
|
-
/**
|
|
14882
|
-
* Creates a new random GUID - used to populate state and nonce.
|
|
14883
|
-
* @returns string (GUID)
|
|
14884
|
-
*/
|
|
14885
|
-
createNewGuid() {
|
|
14886
|
-
return createNewGuid();
|
|
14887
|
-
}
|
|
14888
|
-
/**
|
|
14889
|
-
* Encodes input string to base64.
|
|
14890
|
-
* @param input
|
|
14891
|
-
*/
|
|
14892
|
-
base64Encode(input) {
|
|
14893
|
-
return base64Encode(input);
|
|
14894
|
-
}
|
|
14895
|
-
/**
|
|
14896
|
-
* Decodes input string from base64.
|
|
14897
|
-
* @param input
|
|
14898
|
-
*/
|
|
14899
|
-
base64Decode(input) {
|
|
14900
|
-
return base64Decode(input);
|
|
14901
|
-
}
|
|
14902
|
-
/**
|
|
14903
|
-
* Encodes input string to base64 URL safe string.
|
|
14904
|
-
* @param input
|
|
14905
|
-
*/
|
|
14906
|
-
base64UrlEncode(input) {
|
|
14907
|
-
return urlEncode(input);
|
|
14908
|
-
}
|
|
14909
|
-
/**
|
|
14910
|
-
* Stringifies and base64Url encodes input public key
|
|
14911
|
-
* @param inputKid
|
|
14912
|
-
* @returns Base64Url encoded public key
|
|
14913
|
-
*/
|
|
14914
|
-
encodeKid(inputKid) {
|
|
14915
|
-
return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));
|
|
14916
|
-
}
|
|
14917
|
-
/**
|
|
14918
|
-
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
14919
|
-
* @param kid
|
|
14920
|
-
* @param correlationId
|
|
14921
|
-
*/
|
|
14922
|
-
async removeTokenBindingKey(kid, correlationId) {
|
|
14923
|
-
await this.tokenBindingKeyManager.removeTokenBindingKey(kid, correlationId);
|
|
14924
|
-
}
|
|
14925
|
-
/**
|
|
14926
|
-
* Removes all cryptographic keys from IndexedDB storage
|
|
14927
|
-
* @param correlationId
|
|
14928
|
-
*/
|
|
14929
|
-
async clearKeystore(correlationId) {
|
|
14930
|
-
return this.tokenBindingKeyManager.clearKeystore(correlationId);
|
|
14931
|
-
}
|
|
14932
|
-
/** @internal */
|
|
14933
|
-
async signTokenBindingJwt(header, payload, kid, correlationId) {
|
|
14934
|
-
let telemetry = {};
|
|
14935
|
-
const signTokenBindingJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
|
|
14936
|
-
try {
|
|
14937
|
-
const cachedKeyPair = await this.tokenBindingKeyManager.getTokenBindingKeyPair(kid, correlationId);
|
|
14938
|
-
await this.validateTokenBindingJwtHeaderKey(header, kid, correlationId);
|
|
14939
|
-
telemetry = this.tokenBindingKeyManager.getTokenBindingKeyTelemetry(cachedKeyPair, header.alg);
|
|
14940
|
-
const signingAlgorithm = this.getTokenBindingKeySigningAlgorithm(cachedKeyPair, header.alg, correlationId);
|
|
14941
|
-
const tokenString = `${urlEncode(JSON.stringify(header))}.${urlEncode(JSON.stringify(payload))}`;
|
|
14942
|
-
const encodedSignature = await this.signInput(cachedKeyPair, tokenString, signingAlgorithm);
|
|
14943
|
-
signTokenBindingJwtMeasurement?.end({
|
|
14944
|
-
success: true,
|
|
14945
|
-
...telemetry,
|
|
14946
|
-
});
|
|
14947
|
-
return `${tokenString}.${encodedSignature}`;
|
|
14948
|
-
}
|
|
14949
|
-
catch (e) {
|
|
14950
|
-
signTokenBindingJwtMeasurement?.end({
|
|
14951
|
-
success: false,
|
|
14952
|
-
...telemetry,
|
|
14953
|
-
});
|
|
14954
|
-
throw e;
|
|
14955
|
-
}
|
|
14956
|
-
}
|
|
14957
|
-
/**
|
|
14958
|
-
* Returns the SHA-256 hash of an input string
|
|
14959
|
-
* @param plainText
|
|
14960
|
-
*/
|
|
14961
|
-
async hashString(plainText) {
|
|
14962
|
-
return hashString(plainText);
|
|
14963
|
-
}
|
|
14964
|
-
async signInput(cachedKeyPair, signingInput, algorithm) {
|
|
14965
|
-
const encoder = new TextEncoder();
|
|
14966
|
-
const signatureBuffer = await sign(cachedKeyPair.privateKey, encoder.encode(signingInput), algorithm);
|
|
14967
|
-
return urlEncodeArr(new Uint8Array(signatureBuffer));
|
|
14968
|
-
}
|
|
14969
|
-
getTokenBindingKeySigningAlgorithm(cachedKeyPair, requestedAlgorithm, correlationId) {
|
|
14970
|
-
const keyAlgorithm = cachedKeyPair.privateKey.algorithm;
|
|
14971
|
-
if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 &&
|
|
14972
|
-
keyAlgorithm.name === RSA_SIGN_ALGORITHM_OPTIONS.name) {
|
|
14973
|
-
return RSA_SIGN_ALGORITHM_OPTIONS;
|
|
14974
|
-
}
|
|
14975
|
-
if (requestedAlgorithm === JsonWebTokenAlgorithms.ES256 &&
|
|
14976
|
-
keyAlgorithm.name ===
|
|
14977
|
-
ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS.name &&
|
|
14978
|
-
keyAlgorithm.namedCurve ===
|
|
14979
|
-
ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS.namedCurve) {
|
|
14980
|
-
return ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS;
|
|
14981
|
-
}
|
|
14982
|
-
if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 ||
|
|
14983
|
-
requestedAlgorithm === JsonWebTokenAlgorithms.ES256) {
|
|
14984
|
-
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId, tokenBindingKeyAlgorithmMismatch);
|
|
14985
|
-
}
|
|
14986
|
-
throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId);
|
|
14987
|
-
}
|
|
14988
|
-
async validateTokenBindingJwtHeaderKey(header, kid, correlationId) {
|
|
14989
|
-
if (!header.jwk) {
|
|
14990
|
-
return;
|
|
14991
|
-
}
|
|
14992
|
-
const headerKeyId = await computeJwkThumbprint(header.jwk, correlationId);
|
|
14993
|
-
if (headerKeyId !== kid) {
|
|
14994
|
-
throw createBrowserAuthError(invalidPublicJwk, correlationId, tokenBindingKeyJwkThumbprintMismatch);
|
|
14995
|
-
}
|
|
14996
|
-
}
|
|
14997
|
-
}
|
|
14998
|
-
|
|
14999
15284
|
/*
|
|
15000
15285
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
15001
15286
|
* Licensed under the MIT License.
|
|
@@ -15481,10 +15766,20 @@
|
|
|
15481
15766
|
}
|
|
15482
15767
|
if (context && context !== this.clientId) {
|
|
15483
15768
|
this.logger.trace(`Ignoring broadcast event from clientId: '${context}'`, correlationId);
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15769
|
+
/*
|
|
15770
|
+
* Discarded rather than ended: this is expected routing, not a failure.
|
|
15771
|
+
* BroadcastChannel has no server-side filtering, so every MSAL instance on
|
|
15772
|
+
* the origin receives every message and drops the ones scoped to another
|
|
15773
|
+
* clientId. With N instances sharing an origin each write produces N-1 of
|
|
15774
|
+
* these no-ops, so emitting them scales O(N^2) - and because they were
|
|
15775
|
+
* previously reported with success: false they bypassed both the 1% misc
|
|
15776
|
+
* sampler and the observability trimming in the 1P telemetry reporter,
|
|
15777
|
+
* shipping at full payload. On origins hosting many embedded first-party
|
|
15778
|
+
* apps that dwarfed all other MSAL telemetry combined. These events carry
|
|
15779
|
+
* no diagnostic value, so drop the measurement entirely. Genuine faults
|
|
15780
|
+
* such as the noKey case above are still reported.
|
|
15781
|
+
*/
|
|
15782
|
+
perfMeasurement.discard();
|
|
15488
15783
|
return;
|
|
15489
15784
|
}
|
|
15490
15785
|
if (!value) {
|
|
@@ -15599,8 +15894,8 @@
|
|
|
15599
15894
|
* This class implements the cache storage interface for MSAL through browser local or session storage.
|
|
15600
15895
|
*/
|
|
15601
15896
|
class BrowserCacheManager extends CacheManager {
|
|
15602
|
-
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions) {
|
|
15603
|
-
super(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions);
|
|
15897
|
+
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
|
|
15898
|
+
super(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions, tokenBindingKeyManager);
|
|
15604
15899
|
this.cacheConfig = cacheConfig;
|
|
15605
15900
|
this.logger = logger;
|
|
15606
15901
|
this.internalStorage = new MemoryStorage();
|
|
@@ -17018,12 +17313,12 @@
|
|
|
17018
17313
|
}
|
|
17019
17314
|
return new MemoryStorage();
|
|
17020
17315
|
}
|
|
17021
|
-
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient, eventHandler) => {
|
|
17316
|
+
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient, eventHandler, staticAuthorityOptions, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) => {
|
|
17022
17317
|
const cacheOptions = {
|
|
17023
17318
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
17024
17319
|
cacheRetentionDays: 5,
|
|
17025
17320
|
};
|
|
17026
|
-
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient, eventHandler);
|
|
17321
|
+
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient, eventHandler, staticAuthorityOptions, tokenBindingKeyManager);
|
|
17027
17322
|
};
|
|
17028
17323
|
|
|
17029
17324
|
/*
|
|
@@ -18384,22 +18679,16 @@
|
|
|
18384
18679
|
isPlatformAuthorizeRequest: true,
|
|
18385
18680
|
}, request.correlationId);
|
|
18386
18681
|
// pass the req_cnf for POP
|
|
18387
|
-
if (request.authenticationScheme ===
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
// req_cnf is always sent as a string for SPAs
|
|
18392
|
-
let reqCnfData;
|
|
18393
|
-
if (!request.popKid) {
|
|
18394
|
-
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, logger, performanceClient, request.correlationId)(request, logger);
|
|
18395
|
-
reqCnfData = generatedReqCnfData.reqCnfString;
|
|
18396
|
-
}
|
|
18397
|
-
else {
|
|
18398
|
-
reqCnfData = cryptoOps.encodeKid(request.popKid);
|
|
18399
|
-
}
|
|
18400
|
-
addPopToken(parameters, reqCnfData);
|
|
18682
|
+
if (request.authenticationScheme ===
|
|
18683
|
+
AuthenticationScheme.POP &&
|
|
18684
|
+
request.reqCnf) {
|
|
18685
|
+
addPopToken(parameters, request.reqCnf);
|
|
18401
18686
|
}
|
|
18402
18687
|
}
|
|
18688
|
+
if (request.authenticationScheme === AuthenticationScheme.DPOP &&
|
|
18689
|
+
request.dpopJkt) {
|
|
18690
|
+
parameters.set(DPOP_JKT, request.dpopJkt);
|
|
18691
|
+
}
|
|
18403
18692
|
instrumentBrokerParams(parameters, request.correlationId, performanceClient);
|
|
18404
18693
|
return parameters;
|
|
18405
18694
|
}
|
|
@@ -19574,9 +19863,11 @@
|
|
|
19574
19863
|
const serverTelemetryManager = initializeServerTelemetryManager(ApiId.acquireTokenPopup, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
19575
19864
|
const pkce = pkceCodes ||
|
|
19576
19865
|
(await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId));
|
|
19866
|
+
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
19577
19867
|
const popupRequest = {
|
|
19578
19868
|
...request,
|
|
19579
19869
|
codeChallenge: pkce.challenge,
|
|
19870
|
+
...tokenBindingParams,
|
|
19580
19871
|
};
|
|
19581
19872
|
try {
|
|
19582
19873
|
// Initialize the client
|
|
@@ -19610,7 +19901,7 @@
|
|
|
19610
19901
|
// Wait for the redirect bridge response
|
|
19611
19902
|
const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent);
|
|
19612
19903
|
const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
|
|
19613
|
-
return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(
|
|
19904
|
+
return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
|
|
19614
19905
|
}
|
|
19615
19906
|
}
|
|
19616
19907
|
catch (e) {
|
|
@@ -19634,10 +19925,12 @@
|
|
|
19634
19925
|
const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
|
|
19635
19926
|
const pkce = pkceCodes ||
|
|
19636
19927
|
(await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId));
|
|
19928
|
+
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
19637
19929
|
const popupRequest = {
|
|
19638
19930
|
...request,
|
|
19639
19931
|
earJwk: earJwk,
|
|
19640
19932
|
codeChallenge: pkce.challenge,
|
|
19933
|
+
...tokenBindingParams,
|
|
19641
19934
|
};
|
|
19642
19935
|
const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
|
|
19643
19936
|
// Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
@@ -20024,9 +20317,11 @@
|
|
|
20024
20317
|
const correlationId = request.correlationId;
|
|
20025
20318
|
const serverTelemetryManager = initializeServerTelemetryManager(ApiId.acquireTokenRedirect, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
20026
20319
|
const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
|
|
20320
|
+
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
20027
20321
|
const redirectRequest = {
|
|
20028
20322
|
...request,
|
|
20029
20323
|
codeChallenge: pkceCodes.challenge,
|
|
20324
|
+
...tokenBindingParams,
|
|
20030
20325
|
};
|
|
20031
20326
|
this.browserStorage.cacheAuthorizeRequest(redirectRequest, this.correlationId, pkceCodes.verifier);
|
|
20032
20327
|
try {
|
|
@@ -20066,10 +20361,12 @@
|
|
|
20066
20361
|
const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
|
|
20067
20362
|
const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
|
|
20068
20363
|
const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
|
|
20364
|
+
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
20069
20365
|
const redirectRequest = {
|
|
20070
20366
|
...request,
|
|
20071
20367
|
earJwk: earJwk,
|
|
20072
20368
|
codeChallenge: pkceCodes.challenge,
|
|
20369
|
+
...tokenBindingParams,
|
|
20073
20370
|
};
|
|
20074
20371
|
this.browserStorage.cacheAuthorizeRequest(redirectRequest, this.correlationId, pkceCodes.verifier);
|
|
20075
20372
|
const form = await getEARForm(document, this.config, discoveredAuthority, redirectRequest, this.logger, this.performanceClient);
|
|
@@ -20639,8 +20936,8 @@
|
|
|
20639
20936
|
* @param userRequestScopes
|
|
20640
20937
|
*/
|
|
20641
20938
|
async silentTokenHelper(authClient, request) {
|
|
20642
|
-
const { serverParams, pkceCodes } = await this.silentAuthorizeHelper(authClient, request);
|
|
20643
|
-
return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, request.correlationId)(
|
|
20939
|
+
const { serverParams, pkceCodes, silentRequest } = await this.silentAuthorizeHelper(authClient, request);
|
|
20940
|
+
return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, request.correlationId)(silentRequest, serverParams, pkceCodes.verifier, this.apiId, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider);
|
|
20644
20941
|
}
|
|
20645
20942
|
/**
|
|
20646
20943
|
* Shared helper that generates PKCE codes, builds the /authorize URL,
|
|
@@ -20651,9 +20948,11 @@
|
|
|
20651
20948
|
async silentAuthorizeHelper(authClient, request) {
|
|
20652
20949
|
const correlationId = request.correlationId;
|
|
20653
20950
|
const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
|
|
20951
|
+
const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
20654
20952
|
const silentRequest = {
|
|
20655
20953
|
...request,
|
|
20656
20954
|
codeChallenge: pkceCodes.challenge,
|
|
20955
|
+
...tokenBindingParams,
|
|
20657
20956
|
};
|
|
20658
20957
|
// Create the iframe, register the response listener, then navigate, so the listener is active before the iframe can respond.
|
|
20659
20958
|
const iframe = createHiddenIframe();
|
|
@@ -20707,9 +21006,11 @@
|
|
|
20707
21006
|
*/
|
|
20708
21007
|
async acquireToken(request) {
|
|
20709
21008
|
const baseRequest = await invokeAsync(initializeBaseRequest, InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request, this.config, this.performanceClient, this.logger, this.correlationId);
|
|
21009
|
+
const tokenBindingParams = await getTokenBindingRequestParams(baseRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
20710
21010
|
const silentRequest = {
|
|
20711
21011
|
...request,
|
|
20712
21012
|
...baseRequest,
|
|
21013
|
+
...tokenBindingParams,
|
|
20713
21014
|
};
|
|
20714
21015
|
if (request.redirectUri) {
|
|
20715
21016
|
// Make sure any passed redirectUri is converted to an absolute URL - redirectUri is not a required parameter for refresh token redemption so only include if explicitly provided
|
|
@@ -20797,10 +21098,12 @@
|
|
|
20797
21098
|
this.correlationId);
|
|
20798
21099
|
const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
20799
21100
|
try {
|
|
21101
|
+
const tokenBindingParams = await getTokenBindingRequestParams(silentRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
|
|
20800
21102
|
// Create auth code request (PKCE not needed)
|
|
20801
21103
|
const authCodeRequest = {
|
|
20802
21104
|
...silentRequest,
|
|
20803
21105
|
code: request.code,
|
|
21106
|
+
...tokenBindingParams,
|
|
20804
21107
|
};
|
|
20805
21108
|
// Initialize the client
|
|
20806
21109
|
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)({
|
|
@@ -20929,14 +21232,14 @@
|
|
|
20929
21232
|
this.eventHandler = new EventHandler(this.logger);
|
|
20930
21233
|
// Initialize the browser storage class.
|
|
20931
21234
|
this.browserStorage = this.isBrowserEnvironment
|
|
20932
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))
|
|
20933
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
|
21235
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth), this.tokenBindingKeyManager)
|
|
21236
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler, undefined, this.tokenBindingKeyManager);
|
|
20934
21237
|
// initialize in memory storage for native flows
|
|
20935
21238
|
const nativeCacheOptions = {
|
|
20936
21239
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
20937
21240
|
cacheRetentionDays: 5,
|
|
20938
21241
|
};
|
|
20939
|
-
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler);
|
|
21242
|
+
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, undefined, this.tokenBindingKeyManager);
|
|
20940
21243
|
this.activeSilentTokenRequests = new Map();
|
|
20941
21244
|
// Register listener functions
|
|
20942
21245
|
this.trackStateChange = this.trackStateChange.bind(this);
|