@azure/msal-browser 5.17.1 → 5.18.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 +2 -4
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +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 +15 -7
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +36 -28
- 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/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/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +146 -61
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +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 +246 -246
- 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 +4 -2
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +39 -13
- package/dist/network/FetchClient.mjs.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +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/lib/custom-auth-path/log-strings-mapping.json +2 -2
- package/lib/custom-auth-path/msal-custom-auth.cjs +453 -207
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +453 -207
- 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 +458 -209
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +458 -209
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +2 -2
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/package.json +2 -2
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +0 -4
- package/src/broker/nativeBroker/PlatformAuthRequest.ts +6 -8
- package/src/cache/BrowserCacheManager.ts +24 -6
- package/src/controllers/StandardController.ts +44 -31
- package/src/interaction_client/PlatformAuthInteractionClient.ts +194 -74
- package/src/naa/TokenRequest.ts +1 -0
- package/src/naa/mapping/NestedAppAuthAdapter.ts +5 -0
- package/src/network/FetchClient.ts +62 -14
- package/src/packageMetadata.ts +1 -1
- package/src/webBrokerBridge/IWebBrokerBridgeMessage.ts +42 -0
- package/src/webBrokerBridge/PendingRequestRegistry.ts +79 -0
- package/src/webBrokerBridge/WebBrokerBridgeError.ts +69 -0
- package/src/webBrokerBridge/WebBrokerBridgeErrorMap.ts +108 -0
- package/src/webBrokerBridge/index.ts +25 -0
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +4 -6
- package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts +7 -5
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts +3 -0
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts +13 -3
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/naa/TokenRequest.d.ts +1 -0
- package/types/naa/TokenRequest.d.ts.map +1 -1
- package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
- package/types/network/FetchClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts +35 -0
- package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts.map +1 -0
- package/types/webBrokerBridge/PendingRequestRegistry.d.ts +27 -0
- package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -0
- package/types/webBrokerBridge/WebBrokerBridgeError.d.ts +50 -0
- package/types/webBrokerBridge/WebBrokerBridgeError.d.ts.map +1 -0
- package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts +10 -0
- package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts.map +1 -0
- package/types/webBrokerBridge/index.d.ts +16 -0
- package/types/webBrokerBridge/index.d.ts.map +1 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.18.0 2026-08-04 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v16.
|
|
5
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6
6
|
/*
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
@@ -52,9 +52,10 @@ const INSTANCE_AWARE = "instance_aware";
|
|
|
52
52
|
const EAR_JWK = "ear_jwk";
|
|
53
53
|
const EAR_JWE_CRYPTO = "ear_jwe_crypto";
|
|
54
54
|
const RESOURCE = "resource";
|
|
55
|
-
const CLI_DATA = "clidata";
|
|
55
|
+
const CLI_DATA = "clidata";
|
|
56
|
+
const ATTRIBUTE_TOKENS = "attribute_tokens";
|
|
56
57
|
|
|
57
|
-
/*! @azure/msal-common v16.
|
|
58
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
58
59
|
/*
|
|
59
60
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
60
61
|
* Licensed under the MIT License.
|
|
@@ -285,7 +286,7 @@ const JsonWebTokenTypes = {
|
|
|
285
286
|
// Token renewal offset default in seconds
|
|
286
287
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
287
288
|
|
|
288
|
-
/*! @azure/msal-common v16.
|
|
289
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
289
290
|
/*
|
|
290
291
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
291
292
|
* Licensed under the MIT License.
|
|
@@ -314,7 +315,7 @@ function createAuthError(code, correlationId, additionalMessage) {
|
|
|
314
315
|
return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
|
|
315
316
|
}
|
|
316
317
|
|
|
317
|
-
/*! @azure/msal-common v16.
|
|
318
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
318
319
|
|
|
319
320
|
/*
|
|
320
321
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -337,7 +338,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
|
|
|
337
338
|
return new ClientAuthError(errorCode, correlationId, additionalMessage);
|
|
338
339
|
}
|
|
339
340
|
|
|
340
|
-
/*! @azure/msal-common v16.
|
|
341
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
341
342
|
/*
|
|
342
343
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
343
344
|
* Licensed under the MIT License.
|
|
@@ -374,7 +375,7 @@ const methodNotImplemented = "method_not_implemented";
|
|
|
374
375
|
const resourceParameterRequired = "resource_parameter_required";
|
|
375
376
|
const misplacedResourceParam = "misplaced_resource_parameter";
|
|
376
377
|
|
|
377
|
-
/*! @azure/msal-common v16.
|
|
378
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
378
379
|
|
|
379
380
|
/*
|
|
380
381
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -412,7 +413,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
412
413
|
};
|
|
413
414
|
}
|
|
414
415
|
|
|
415
|
-
/*! @azure/msal-common v16.
|
|
416
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
416
417
|
|
|
417
418
|
/*
|
|
418
419
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -478,7 +479,7 @@ function getJWSPayload(authToken, correlationId) {
|
|
|
478
479
|
return matches[2];
|
|
479
480
|
}
|
|
480
481
|
|
|
481
|
-
/*! @azure/msal-common v16.
|
|
482
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
482
483
|
|
|
483
484
|
/*
|
|
484
485
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -566,7 +567,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
566
567
|
return updatedAccountInfo;
|
|
567
568
|
}
|
|
568
569
|
|
|
569
|
-
/*! @azure/msal-common v16.
|
|
570
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
570
571
|
/*
|
|
571
572
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
572
573
|
* Licensed under the MIT License.
|
|
@@ -581,7 +582,7 @@ const AuthorityType = {
|
|
|
581
582
|
Ciam: 3,
|
|
582
583
|
};
|
|
583
584
|
|
|
584
|
-
/*! @azure/msal-common v16.
|
|
585
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
585
586
|
/*
|
|
586
587
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
587
588
|
* Licensed under the MIT License.
|
|
@@ -603,7 +604,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
603
604
|
return null;
|
|
604
605
|
}
|
|
605
606
|
|
|
606
|
-
/*! @azure/msal-common v16.
|
|
607
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
607
608
|
/*
|
|
608
609
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
609
610
|
* Licensed under the MIT License.
|
|
@@ -627,7 +628,7 @@ const ProtocolMode = {
|
|
|
627
628
|
EAR: "EAR",
|
|
628
629
|
};
|
|
629
630
|
|
|
630
|
-
/*! @azure/msal-common v16.
|
|
631
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
631
632
|
/**
|
|
632
633
|
* Returns the AccountInfo interface for this account.
|
|
633
634
|
* @internal
|
|
@@ -816,7 +817,7 @@ function isAccountEntity(entity) {
|
|
|
816
817
|
entity.hasOwnProperty("authorityType"));
|
|
817
818
|
}
|
|
818
819
|
|
|
819
|
-
/*! @azure/msal-common v16.
|
|
820
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
820
821
|
/*
|
|
821
822
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
822
823
|
* Licensed under the MIT License.
|
|
@@ -826,7 +827,7 @@ function isAccountEntity(entity) {
|
|
|
826
827
|
*/
|
|
827
828
|
const unexpectedError = "unexpected_error";
|
|
828
829
|
|
|
829
|
-
/*! @azure/msal-common v16.
|
|
830
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
830
831
|
|
|
831
832
|
/*
|
|
832
833
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -846,7 +847,7 @@ function createClientConfigurationError(errorCode, correlationId) {
|
|
|
846
847
|
return new ClientConfigurationError(errorCode, correlationId);
|
|
847
848
|
}
|
|
848
849
|
|
|
849
|
-
/*! @azure/msal-common v16.
|
|
850
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
850
851
|
/*
|
|
851
852
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
852
853
|
* Licensed under the MIT License.
|
|
@@ -872,7 +873,7 @@ const invalidRequestMethodForEAR = "invalid_request_method_for_EAR";
|
|
|
872
873
|
const invalidPlatformBrokerConfiguration = "invalid_platform_broker_configuration";
|
|
873
874
|
const issuerValidationFailed = "issuer_validation_failed";
|
|
874
875
|
|
|
875
|
-
/*! @azure/msal-common v16.
|
|
876
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
876
877
|
/*
|
|
877
878
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
878
879
|
* Licensed under the MIT License.
|
|
@@ -884,7 +885,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
884
885
|
response.hasOwnProperty("jwks_uri"));
|
|
885
886
|
}
|
|
886
887
|
|
|
887
|
-
/*! @azure/msal-common v16.
|
|
888
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
888
889
|
/*
|
|
889
890
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
890
891
|
* Licensed under the MIT License.
|
|
@@ -964,7 +965,7 @@ class StringUtils {
|
|
|
964
965
|
}
|
|
965
966
|
}
|
|
966
967
|
|
|
967
|
-
/*! @azure/msal-common v16.
|
|
968
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
968
969
|
|
|
969
970
|
/*
|
|
970
971
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1122,7 +1123,7 @@ class UrlString {
|
|
|
1122
1123
|
}
|
|
1123
1124
|
}
|
|
1124
1125
|
|
|
1125
|
-
/*! @azure/msal-common v16.
|
|
1126
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1126
1127
|
|
|
1127
1128
|
/*
|
|
1128
1129
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1288,7 +1289,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
1288
1289
|
return null;
|
|
1289
1290
|
}
|
|
1290
1291
|
|
|
1291
|
-
/*! @azure/msal-common v16.
|
|
1292
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1292
1293
|
/*
|
|
1293
1294
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1294
1295
|
* Licensed under the MIT License.
|
|
@@ -1297,7 +1298,7 @@ const AzureCloudInstance = {
|
|
|
1297
1298
|
// AzureCloudInstance is not specified.
|
|
1298
1299
|
None: "none"};
|
|
1299
1300
|
|
|
1300
|
-
/*! @azure/msal-common v16.
|
|
1301
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1301
1302
|
/*
|
|
1302
1303
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1303
1304
|
* Licensed under the MIT License.
|
|
@@ -1307,7 +1308,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
1307
1308
|
response.hasOwnProperty("metadata"));
|
|
1308
1309
|
}
|
|
1309
1310
|
|
|
1310
|
-
/*! @azure/msal-common v16.
|
|
1311
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1311
1312
|
/*
|
|
1312
1313
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1313
1314
|
* Licensed under the MIT License.
|
|
@@ -1317,7 +1318,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
1317
1318
|
response.hasOwnProperty("error_description"));
|
|
1318
1319
|
}
|
|
1319
1320
|
|
|
1320
|
-
/*! @azure/msal-common v16.
|
|
1321
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1321
1322
|
/*
|
|
1322
1323
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1323
1324
|
* Licensed under the MIT License.
|
|
@@ -1388,7 +1389,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
|
|
|
1388
1389
|
const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
|
|
1389
1390
|
const SetUserData = "setUserData";
|
|
1390
1391
|
|
|
1391
|
-
/*! @azure/msal-common v16.
|
|
1392
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1392
1393
|
/*
|
|
1393
1394
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1394
1395
|
* Licensed under the MIT License.
|
|
@@ -1481,7 +1482,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
1481
1482
|
};
|
|
1482
1483
|
};
|
|
1483
1484
|
|
|
1484
|
-
/*! @azure/msal-common v16.
|
|
1485
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1485
1486
|
|
|
1486
1487
|
/*
|
|
1487
1488
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1592,7 +1593,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
1592
1593
|
},
|
|
1593
1594
|
};
|
|
1594
1595
|
|
|
1595
|
-
/*! @azure/msal-common v16.
|
|
1596
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1596
1597
|
/*
|
|
1597
1598
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1598
1599
|
* Licensed under the MIT License.
|
|
@@ -1657,7 +1658,7 @@ function wasClockTurnedBack(cachedAt) {
|
|
|
1657
1658
|
return cachedAtSec > nowSeconds();
|
|
1658
1659
|
}
|
|
1659
1660
|
|
|
1660
|
-
/*! @azure/msal-common v16.
|
|
1661
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1661
1662
|
|
|
1662
1663
|
/*
|
|
1663
1664
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1922,9 +1923,22 @@ function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetw
|
|
|
1922
1923
|
*/
|
|
1923
1924
|
function isAuthorityMetadataExpired(metadata) {
|
|
1924
1925
|
return metadata.expiresAt <= nowSeconds();
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Serialize attribute tokens synchronously (sort and join).
|
|
1929
|
+
* This is a sync-only operation for use at request construction time.
|
|
1930
|
+
* @param attributeTokens - array of tokens
|
|
1931
|
+
* @returns serialized partition string or undefined if no tokens
|
|
1932
|
+
*/
|
|
1933
|
+
function serializeAttributeTokens(attributeTokens) {
|
|
1934
|
+
if (!attributeTokens || attributeTokens.length === 0) {
|
|
1935
|
+
return undefined;
|
|
1936
|
+
}
|
|
1937
|
+
// Serialize: sort and join tokens
|
|
1938
|
+
return [...attributeTokens].sort().join(" ");
|
|
1925
1939
|
}
|
|
1926
1940
|
|
|
1927
|
-
/*! @azure/msal-common v16.
|
|
1941
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
1928
1942
|
|
|
1929
1943
|
/*
|
|
1930
1944
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2894,7 +2908,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
2894
2908
|
};
|
|
2895
2909
|
}
|
|
2896
2910
|
|
|
2897
|
-
/*! @azure/msal-common v16.
|
|
2911
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
2898
2912
|
|
|
2899
2913
|
/*
|
|
2900
2914
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2928,7 +2942,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
2928
2942
|
}
|
|
2929
2943
|
}
|
|
2930
2944
|
|
|
2931
|
-
/*! @azure/msal-common v16.
|
|
2945
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
2932
2946
|
|
|
2933
2947
|
/*
|
|
2934
2948
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3124,7 +3138,7 @@ class ScopeSet {
|
|
|
3124
3138
|
}
|
|
3125
3139
|
}
|
|
3126
3140
|
|
|
3127
|
-
/*! @azure/msal-common v16.
|
|
3141
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3128
3142
|
|
|
3129
3143
|
/*
|
|
3130
3144
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3252,13 +3266,14 @@ function addSid(parameters, sid) {
|
|
|
3252
3266
|
* @param claims - The claims string from the request
|
|
3253
3267
|
* @param clientCapabilities - The client capabilities from configuration
|
|
3254
3268
|
* @param skipBrokerClaims - When true and BROKER_CLIENT_ID is present, excludes clientCapabilities from claims
|
|
3269
|
+
* @param claimsToMerge - Optional client-originated claims JSON string (e.g. `claimsFromClient`) deep-merged into `claims` with precedence on conflicts
|
|
3255
3270
|
*/
|
|
3256
|
-
function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims) {
|
|
3271
|
+
function addClaims(parameters, correlationId, claims, clientCapabilities, skipBrokerClaims, claimsToMerge) {
|
|
3257
3272
|
// Skip clientCapabilities if skipBrokerClaims is set to true and this is a brokered authentication flow
|
|
3258
3273
|
const configClaims = skipBrokerClaims && parameters.has(BROKER_CLIENT_ID)
|
|
3259
3274
|
? undefined
|
|
3260
3275
|
: clientCapabilities;
|
|
3261
|
-
const mergedClaims = buildMergedClaims(claims, configClaims, correlationId);
|
|
3276
|
+
const mergedClaims = buildMergedClaims(claims, configClaims, correlationId, claimsToMerge);
|
|
3262
3277
|
parameters.set(CLAIMS, mergedClaims);
|
|
3263
3278
|
}
|
|
3264
3279
|
/**
|
|
@@ -3424,32 +3439,79 @@ const DEFAULT_ID_TOKEN_CLAIMS = {
|
|
|
3424
3439
|
[ClaimsRequestKeys.LOGIN_HINT]: { essential: false },
|
|
3425
3440
|
};
|
|
3426
3441
|
/**
|
|
3427
|
-
* Parses claims JSON
|
|
3428
|
-
*
|
|
3442
|
+
* Parses a claims JSON string into an object, throwing a ClientConfigurationError
|
|
3443
|
+
* (error code `invalid_claims`) if the value is not a valid JSON object. The raw
|
|
3444
|
+
* claims value is never included in the error - it may contain sensitive data.
|
|
3445
|
+
* @param claims - Claims JSON string. Must be valid JSON representing an object.
|
|
3446
|
+
* @param correlationId - The request correlation id
|
|
3447
|
+
* @returns The parsed claims object
|
|
3448
|
+
*/
|
|
3449
|
+
function parseClaims(claims, correlationId = "") {
|
|
3450
|
+
let parsed;
|
|
3451
|
+
try {
|
|
3452
|
+
parsed = JSON.parse(claims);
|
|
3453
|
+
}
|
|
3454
|
+
catch (e) {
|
|
3455
|
+
// Malformed JSON
|
|
3456
|
+
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
3457
|
+
}
|
|
3458
|
+
if (!isPlainObject(parsed)) {
|
|
3459
|
+
// Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
|
|
3460
|
+
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
3461
|
+
}
|
|
3462
|
+
return parsed;
|
|
3463
|
+
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Type guard for a non-null, non-array object (a JSON "object" value).
|
|
3466
|
+
* @param value - The value to test
|
|
3467
|
+
* @returns True when value is a plain object that can be deep-merged
|
|
3468
|
+
*/
|
|
3469
|
+
function isPlainObject(value) {
|
|
3470
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3471
|
+
}
|
|
3472
|
+
/**
|
|
3473
|
+
* Recursively deep-merges two parsed claims objects. Nested objects are merged key-by-key;
|
|
3474
|
+
* for any other value type (arrays, scalars, null) the value from `claimsToMerge` replaces
|
|
3475
|
+
* the base. This mirrors the deep merge used by msal-dotnet so that, for example, a server
|
|
3476
|
+
* `access_token` challenge and a client-originated `access_token` claim are combined rather
|
|
3477
|
+
* than one clobbering the other.
|
|
3478
|
+
* @param baseClaims - The parsed base claims object
|
|
3479
|
+
* @param claimsToMerge - The parsed claims object merged in with precedence
|
|
3480
|
+
* @returns The deep-merged claims object
|
|
3481
|
+
*/
|
|
3482
|
+
function deepMergeClaims(baseClaims, claimsToMerge) {
|
|
3483
|
+
const merged = { ...baseClaims };
|
|
3484
|
+
for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
|
|
3485
|
+
const baseValue = merged[key];
|
|
3486
|
+
if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
|
|
3487
|
+
merged[key] = deepMergeClaims(baseValue, mergeInValue);
|
|
3488
|
+
}
|
|
3489
|
+
else {
|
|
3490
|
+
merged[key] = mergeInValue;
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
return merged;
|
|
3494
|
+
}
|
|
3495
|
+
/**
|
|
3496
|
+
* Parses claims JSON, optionally deep-merges a second client-originated claims string
|
|
3497
|
+
* (`claimsToMerge`, e.g. `claimsFromClient`) with precedence on conflicting keys, merges
|
|
3498
|
+
* default optional idToken claims (signin_state, login_hint), and appends client
|
|
3499
|
+
* capabilities (xms_cc) to the access_token section.
|
|
3429
3500
|
* Does not overwrite idToken claims already specified by the caller.
|
|
3430
3501
|
* @param claims - Existing claims JSON string from the request (may be undefined)
|
|
3431
3502
|
* @param clientCapabilities - Client capabilities array from configuration
|
|
3503
|
+
* @param correlationId - The request correlation id
|
|
3504
|
+
* @param claimsToMerge - Optional second claims JSON string (e.g. client-originated `claimsFromClient`)
|
|
3505
|
+
* deep-merged into `claims` with precedence on conflicts; parsed and validated when present. Nested
|
|
3506
|
+
* objects are merged recursively; arrays and scalar values are replaced.
|
|
3432
3507
|
* @returns Merged claims JSON string
|
|
3433
3508
|
*/
|
|
3434
|
-
function buildMergedClaims(claims, clientCapabilities, correlationId = "") {
|
|
3435
|
-
let mergedClaims;
|
|
3509
|
+
function buildMergedClaims(claims, clientCapabilities, correlationId = "", claimsToMerge) {
|
|
3436
3510
|
// Parse provided claims into JSON object or initialize empty object
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
try {
|
|
3442
|
-
const parsed = JSON.parse(claims);
|
|
3443
|
-
if (typeof parsed !== "object" ||
|
|
3444
|
-
parsed === null ||
|
|
3445
|
-
Array.isArray(parsed)) {
|
|
3446
|
-
throw new Error("Claims must be a JSON object");
|
|
3447
|
-
}
|
|
3448
|
-
mergedClaims = parsed;
|
|
3449
|
-
}
|
|
3450
|
-
catch (e) {
|
|
3451
|
-
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
3452
|
-
}
|
|
3511
|
+
let mergedClaims = claims ? parseClaims(claims, correlationId) : {};
|
|
3512
|
+
// Deep-merge client-originated claims (e.g. `claimsFromClient`) with precedence on conflicts
|
|
3513
|
+
if (claimsToMerge?.trim()) {
|
|
3514
|
+
mergedClaims = deepMergeClaims(mergedClaims, parseClaims(claimsToMerge, correlationId));
|
|
3453
3515
|
}
|
|
3454
3516
|
// Add default optional idToken claims
|
|
3455
3517
|
if (!Object.prototype.hasOwnProperty.call(mergedClaims, ClaimsRequestKeys.ID_TOKEN)) {
|
|
@@ -3537,9 +3599,28 @@ function addResource(parameters, resource) {
|
|
|
3537
3599
|
if (resource) {
|
|
3538
3600
|
parameters.set(RESOURCE, resource);
|
|
3539
3601
|
}
|
|
3602
|
+
}
|
|
3603
|
+
/**
|
|
3604
|
+
* Add the `attribute_tokens` parameter to a /token request body.
|
|
3605
|
+
*
|
|
3606
|
+
* When `attributeTokens` is a non-empty array the values are sorted lexicographically and joined
|
|
3607
|
+
* with a single space, then written to the request body. When `attributeTokens` is an empty array
|
|
3608
|
+
* the parameter is deleted from the request body.
|
|
3609
|
+
*
|
|
3610
|
+
* @param parameters - request parameter map that will be serialized into the /token body
|
|
3611
|
+
* @param attributeTokens - caller-provided attribute token strings
|
|
3612
|
+
*/
|
|
3613
|
+
function addAttributeTokens(parameters, attributeTokens) {
|
|
3614
|
+
const serialized = serializeAttributeTokens(attributeTokens);
|
|
3615
|
+
if (serialized) {
|
|
3616
|
+
parameters.set(ATTRIBUTE_TOKENS, serialized);
|
|
3617
|
+
}
|
|
3618
|
+
else {
|
|
3619
|
+
parameters.delete(ATTRIBUTE_TOKENS);
|
|
3620
|
+
}
|
|
3540
3621
|
}
|
|
3541
3622
|
|
|
3542
|
-
/*! @azure/msal-common v16.
|
|
3623
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3543
3624
|
|
|
3544
3625
|
/*
|
|
3545
3626
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3661,7 +3742,7 @@ function validateUrl(url, logger, correlationId) {
|
|
|
3661
3742
|
}
|
|
3662
3743
|
}
|
|
3663
3744
|
|
|
3664
|
-
/*! @azure/msal-common v16.
|
|
3745
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3665
3746
|
|
|
3666
3747
|
/*
|
|
3667
3748
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3704,7 +3785,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
3704
3785
|
},
|
|
3705
3786
|
};
|
|
3706
3787
|
|
|
3707
|
-
/*! @azure/msal-common v16.
|
|
3788
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3708
3789
|
/*
|
|
3709
3790
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3710
3791
|
* Licensed under the MIT License.
|
|
@@ -3979,12 +4060,12 @@ class Logger {
|
|
|
3979
4060
|
}
|
|
3980
4061
|
}
|
|
3981
4062
|
|
|
3982
|
-
/*! @azure/msal-common v16.
|
|
4063
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3983
4064
|
/* eslint-disable header/header */
|
|
3984
4065
|
const name$1 = "@azure/msal-common";
|
|
3985
|
-
const version$1 = "16.
|
|
4066
|
+
const version$1 = "16.12.0";
|
|
3986
4067
|
|
|
3987
|
-
/*! @azure/msal-common v16.
|
|
4068
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3988
4069
|
/*
|
|
3989
4070
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3990
4071
|
* Licensed under the MIT License.
|
|
@@ -3992,7 +4073,7 @@ const version$1 = "16.11.2";
|
|
|
3992
4073
|
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
3993
4074
|
const cacheErrorUnknown = "cache_error_unknown";
|
|
3994
4075
|
|
|
3995
|
-
/*! @azure/msal-common v16.
|
|
4076
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
3996
4077
|
|
|
3997
4078
|
/*
|
|
3998
4079
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4030,7 +4111,7 @@ function createCacheError(e) {
|
|
|
4030
4111
|
}
|
|
4031
4112
|
}
|
|
4032
4113
|
|
|
4033
|
-
/*! @azure/msal-common v16.
|
|
4114
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
4034
4115
|
|
|
4035
4116
|
/*
|
|
4036
4117
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4257,9 +4338,17 @@ class CacheManager {
|
|
|
4257
4338
|
}
|
|
4258
4339
|
/**
|
|
4259
4340
|
* saves access token credential
|
|
4260
|
-
* @param credential
|
|
4341
|
+
* @param credential - the access token entity to save
|
|
4342
|
+
* @param correlationId - unique identifier for the request
|
|
4343
|
+
* @param kmsi - keep me signed in flag
|
|
4261
4344
|
*/
|
|
4262
4345
|
async saveAccessToken(credential, correlationId, kmsi) {
|
|
4346
|
+
// Compute hash from components on the entity itself — no need to thread externally.
|
|
4347
|
+
let additionalCacheKeyHash;
|
|
4348
|
+
if (credential.additionalCacheKeyComponents &&
|
|
4349
|
+
Object.keys(credential.additionalCacheKeyComponents).length > 0) {
|
|
4350
|
+
additionalCacheKeyHash = await this.cryptoImpl.hashString(JSON.stringify(credential.additionalCacheKeyComponents));
|
|
4351
|
+
}
|
|
4263
4352
|
const accessTokenFilter = {
|
|
4264
4353
|
clientId: credential.clientId,
|
|
4265
4354
|
credentialType: credential.credentialType,
|
|
@@ -4283,7 +4372,7 @@ class CacheManager {
|
|
|
4283
4372
|
}
|
|
4284
4373
|
}
|
|
4285
4374
|
});
|
|
4286
|
-
await this.setAccessTokenCredential(credential, correlationId, kmsi);
|
|
4375
|
+
await this.setAccessTokenCredential(credential, correlationId, kmsi, additionalCacheKeyHash);
|
|
4287
4376
|
}
|
|
4288
4377
|
/**
|
|
4289
4378
|
* Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
|
|
@@ -4694,6 +4783,12 @@ class CacheManager {
|
|
|
4694
4783
|
AuthenticationScheme.BEARER.toLowerCase()
|
|
4695
4784
|
? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
|
|
4696
4785
|
: CredentialType.ACCESS_TOKEN;
|
|
4786
|
+
const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
|
|
4787
|
+
const additionalCacheKeyComponents = attributeTokenPartition
|
|
4788
|
+
? {
|
|
4789
|
+
attribute_tokens: attributeTokenPartition,
|
|
4790
|
+
}
|
|
4791
|
+
: undefined;
|
|
4697
4792
|
const accessTokenFilter = {
|
|
4698
4793
|
homeAccountId: account.homeAccountId,
|
|
4699
4794
|
environment: account.environment,
|
|
@@ -4703,10 +4798,12 @@ class CacheManager {
|
|
|
4703
4798
|
target: scopes,
|
|
4704
4799
|
tokenType: authScheme,
|
|
4705
4800
|
keyId: request.sshKid,
|
|
4801
|
+
additionalCacheKeyComponents: additionalCacheKeyComponents,
|
|
4706
4802
|
};
|
|
4707
4803
|
const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
|
|
4708
4804
|
this.getTokenKeys().accessToken;
|
|
4709
4805
|
const accessTokens = [];
|
|
4806
|
+
const matchedKeys = [];
|
|
4710
4807
|
accessTokenKeys.forEach((key) => {
|
|
4711
4808
|
// Validate key
|
|
4712
4809
|
if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
|
|
@@ -4715,18 +4812,18 @@ class CacheManager {
|
|
|
4715
4812
|
if (accessToken &&
|
|
4716
4813
|
this.credentialMatchesFilter(accessToken, accessTokenFilter, correlationId)) {
|
|
4717
4814
|
accessTokens.push(accessToken);
|
|
4815
|
+
matchedKeys.push(key);
|
|
4718
4816
|
}
|
|
4719
4817
|
}
|
|
4720
4818
|
});
|
|
4721
|
-
|
|
4722
|
-
if (numAccessTokens < 1) {
|
|
4819
|
+
if (accessTokens.length < 1) {
|
|
4723
4820
|
this.commonLogger.info("1nckna", correlationId);
|
|
4724
4821
|
return null;
|
|
4725
4822
|
}
|
|
4726
|
-
else if (
|
|
4823
|
+
else if (accessTokens.length > 1) {
|
|
4727
4824
|
this.commonLogger.info("1wkfwp", correlationId);
|
|
4728
|
-
|
|
4729
|
-
this.removeAccessToken(
|
|
4825
|
+
matchedKeys.forEach((key) => {
|
|
4826
|
+
this.removeAccessToken(key, correlationId);
|
|
4730
4827
|
});
|
|
4731
4828
|
this.performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
|
|
4732
4829
|
return null;
|
|
@@ -5169,7 +5266,9 @@ class DefaultStorageClass extends CacheManager {
|
|
|
5169
5266
|
getTokenKeys() {
|
|
5170
5267
|
throw createClientAuthError(methodNotImplemented, "");
|
|
5171
5268
|
}
|
|
5172
|
-
|
|
5269
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5270
|
+
generateCredentialKey(_credential, _hash) {
|
|
5271
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
5173
5272
|
throw createClientAuthError(methodNotImplemented, "");
|
|
5174
5273
|
}
|
|
5175
5274
|
generateAccountKey() {
|
|
@@ -5177,7 +5276,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
5177
5276
|
}
|
|
5178
5277
|
}
|
|
5179
5278
|
|
|
5180
|
-
/*! @azure/msal-common v16.
|
|
5279
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5181
5280
|
/*
|
|
5182
5281
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5183
5282
|
* Licensed under the MIT License.
|
|
@@ -5191,7 +5290,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
5191
5290
|
const PerformanceEventStatus = {
|
|
5192
5291
|
InProgress: 1};
|
|
5193
5292
|
|
|
5194
|
-
/*! @azure/msal-common v16.
|
|
5293
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5195
5294
|
|
|
5196
5295
|
/*
|
|
5197
5296
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5249,7 +5348,7 @@ class StubPerformanceClient {
|
|
|
5249
5348
|
}
|
|
5250
5349
|
}
|
|
5251
5350
|
|
|
5252
|
-
/*! @azure/msal-common v16.
|
|
5351
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5253
5352
|
|
|
5254
5353
|
/*
|
|
5255
5354
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5345,7 +5444,7 @@ function isOidcProtocolMode(config) {
|
|
|
5345
5444
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
5346
5445
|
}
|
|
5347
5446
|
|
|
5348
|
-
/*! @azure/msal-common v16.
|
|
5447
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5349
5448
|
/*
|
|
5350
5449
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5351
5450
|
* Licensed under the MIT License.
|
|
@@ -5372,7 +5471,7 @@ function isOidcProtocolMode(config) {
|
|
|
5372
5471
|
}
|
|
5373
5472
|
}
|
|
5374
5473
|
|
|
5375
|
-
/*! @azure/msal-common v16.
|
|
5474
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5376
5475
|
|
|
5377
5476
|
/*
|
|
5378
5477
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5452,7 +5551,7 @@ class PopTokenGenerator {
|
|
|
5452
5551
|
}
|
|
5453
5552
|
}
|
|
5454
5553
|
|
|
5455
|
-
/*! @azure/msal-common v16.
|
|
5554
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5456
5555
|
/*
|
|
5457
5556
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5458
5557
|
* Licensed under the MIT License.
|
|
@@ -5503,7 +5602,7 @@ const badToken = "bad_token";
|
|
|
5503
5602
|
*/
|
|
5504
5603
|
const interruptedUser = "interrupted_user";
|
|
5505
5604
|
|
|
5506
|
-
/*! @azure/msal-common v16.
|
|
5605
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5507
5606
|
|
|
5508
5607
|
/*
|
|
5509
5608
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5570,7 +5669,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
|
|
|
5570
5669
|
return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
|
|
5571
5670
|
}
|
|
5572
5671
|
|
|
5573
|
-
/*! @azure/msal-common v16.
|
|
5672
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5574
5673
|
|
|
5575
5674
|
/*
|
|
5576
5675
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5589,7 +5688,7 @@ class ServerError extends AuthError {
|
|
|
5589
5688
|
}
|
|
5590
5689
|
}
|
|
5591
5690
|
|
|
5592
|
-
/*! @azure/msal-common v16.
|
|
5691
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5593
5692
|
|
|
5594
5693
|
/*
|
|
5595
5694
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5660,7 +5759,7 @@ function parseRequestState(base64Decode, state, correlationId) {
|
|
|
5660
5759
|
}
|
|
5661
5760
|
}
|
|
5662
5761
|
|
|
5663
|
-
/*! @azure/msal-common v16.
|
|
5762
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
5664
5763
|
|
|
5665
5764
|
/*
|
|
5666
5765
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5749,7 +5848,15 @@ class ResponseHandler {
|
|
|
5749
5848
|
// Add keyId from request to serverTokenResponse if defined
|
|
5750
5849
|
serverTokenResponse.key_id =
|
|
5751
5850
|
serverTokenResponse.key_id || request.sshKid || undefined;
|
|
5752
|
-
|
|
5851
|
+
// Compute components once for entity storage (fallback if hash not provided by client)
|
|
5852
|
+
const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
|
|
5853
|
+
const cacheKeyComponents = additionalCacheKeyComponents ??
|
|
5854
|
+
(attributeTokenPartition
|
|
5855
|
+
? {
|
|
5856
|
+
attribute_tokens: attributeTokenPartition,
|
|
5857
|
+
}
|
|
5858
|
+
: undefined);
|
|
5859
|
+
const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload, cacheKeyComponents);
|
|
5753
5860
|
let cacheContext;
|
|
5754
5861
|
try {
|
|
5755
5862
|
if (this.persistencePlugin && this.serializableCache) {
|
|
@@ -6011,7 +6118,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6011
6118
|
return baseAccount;
|
|
6012
6119
|
}
|
|
6013
6120
|
|
|
6014
|
-
/*! @azure/msal-common v16.
|
|
6121
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6015
6122
|
/*
|
|
6016
6123
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6017
6124
|
* Licensed under the MIT License.
|
|
@@ -6021,7 +6128,7 @@ const CcsCredentialType = {
|
|
|
6021
6128
|
UPN: "UPN",
|
|
6022
6129
|
};
|
|
6023
6130
|
|
|
6024
|
-
/*! @azure/msal-common v16.
|
|
6131
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6025
6132
|
/*
|
|
6026
6133
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6027
6134
|
* Licensed under the MIT License.
|
|
@@ -6040,7 +6147,8 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
|
|
|
6040
6147
|
}
|
|
6041
6148
|
}
|
|
6042
6149
|
|
|
6043
|
-
/*! @azure/msal-common v16.
|
|
6150
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6151
|
+
|
|
6044
6152
|
/*
|
|
6045
6153
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6046
6154
|
* Licensed under the MIT License.
|
|
@@ -6059,10 +6167,11 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
6059
6167
|
sshKid: request.sshKid,
|
|
6060
6168
|
embeddedClientId: request.embeddedClientId || request.extraParameters?.clientId,
|
|
6061
6169
|
resource: request.resource,
|
|
6170
|
+
attributeTokens: serializeAttributeTokens(request.attributeTokens),
|
|
6062
6171
|
};
|
|
6063
6172
|
}
|
|
6064
6173
|
|
|
6065
|
-
/*! @azure/msal-common v16.
|
|
6174
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6066
6175
|
|
|
6067
6176
|
/*
|
|
6068
6177
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6148,7 +6257,7 @@ class ThrottlingUtils {
|
|
|
6148
6257
|
}
|
|
6149
6258
|
}
|
|
6150
6259
|
|
|
6151
|
-
/*! @azure/msal-common v16.
|
|
6260
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6152
6261
|
|
|
6153
6262
|
/*
|
|
6154
6263
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6179,7 +6288,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
|
|
|
6179
6288
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6180
6289
|
}
|
|
6181
6290
|
|
|
6182
|
-
/*! @azure/msal-common v16.
|
|
6291
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6183
6292
|
|
|
6184
6293
|
/*
|
|
6185
6294
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6259,7 +6368,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
6259
6368
|
ThrottlingUtils.preProcess(cacheManager, thumbprint, correlationId);
|
|
6260
6369
|
let response;
|
|
6261
6370
|
try {
|
|
6262
|
-
response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, options);
|
|
6371
|
+
response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
|
|
6263
6372
|
const responseHeaders = response.headers || {};
|
|
6264
6373
|
performanceClient?.addFields({
|
|
6265
6374
|
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
@@ -6295,7 +6404,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
6295
6404
|
return response;
|
|
6296
6405
|
}
|
|
6297
6406
|
|
|
6298
|
-
/*! @azure/msal-common v16.
|
|
6407
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6299
6408
|
|
|
6300
6409
|
/*
|
|
6301
6410
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6416,6 +6525,12 @@ class AuthorizationCodeClient {
|
|
|
6416
6525
|
// Add scope array, parameter builder will add default scopes and dedupe
|
|
6417
6526
|
addScopes(parameters, request.scopes, request.correlationId, true, this.oidcDefaultScopes);
|
|
6418
6527
|
addResource(parameters, request.resource);
|
|
6528
|
+
if (request.attributeTokens) {
|
|
6529
|
+
addAttributeTokens(parameters, request.attributeTokens);
|
|
6530
|
+
}
|
|
6531
|
+
this.performanceClient?.addFields({
|
|
6532
|
+
hasAttributeTokens: !!request.attributeTokens?.length,
|
|
6533
|
+
}, request.correlationId);
|
|
6419
6534
|
// add code: user set, not validated
|
|
6420
6535
|
addAuthorizationCode(parameters, request.code);
|
|
6421
6536
|
// Add library metadata
|
|
@@ -6552,7 +6667,7 @@ class AuthorizationCodeClient {
|
|
|
6552
6667
|
}
|
|
6553
6668
|
}
|
|
6554
6669
|
|
|
6555
|
-
/*! @azure/msal-common v16.
|
|
6670
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6556
6671
|
|
|
6557
6672
|
/*
|
|
6558
6673
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6779,7 +6894,7 @@ function extractLoginHint(account) {
|
|
|
6779
6894
|
return account.loginHint || account.idTokenClaims?.login_hint || null;
|
|
6780
6895
|
}
|
|
6781
6896
|
|
|
6782
|
-
/*! @azure/msal-common v16.
|
|
6897
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6783
6898
|
|
|
6784
6899
|
/*
|
|
6785
6900
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6800,7 +6915,7 @@ function createJoseHeaderError(code, correlationId) {
|
|
|
6800
6915
|
return new JoseHeaderError(code, correlationId);
|
|
6801
6916
|
}
|
|
6802
6917
|
|
|
6803
|
-
/*! @azure/msal-common v16.
|
|
6918
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6804
6919
|
/*
|
|
6805
6920
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6806
6921
|
* Licensed under the MIT License.
|
|
@@ -6808,7 +6923,7 @@ function createJoseHeaderError(code, correlationId) {
|
|
|
6808
6923
|
const missingKidError = "missing_kid_error";
|
|
6809
6924
|
const missingAlgError = "missing_alg_error";
|
|
6810
6925
|
|
|
6811
|
-
/*! @azure/msal-common v16.
|
|
6926
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6812
6927
|
|
|
6813
6928
|
/*
|
|
6814
6929
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6848,7 +6963,7 @@ class JoseHeader {
|
|
|
6848
6963
|
}
|
|
6849
6964
|
}
|
|
6850
6965
|
|
|
6851
|
-
/*! @azure/msal-common v16.
|
|
6966
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
6852
6967
|
|
|
6853
6968
|
/*
|
|
6854
6969
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7009,6 +7124,12 @@ class RefreshTokenClient {
|
|
|
7009
7124
|
addServerTelemetry(parameters, this.serverTelemetryManager);
|
|
7010
7125
|
}
|
|
7011
7126
|
addRefreshToken(parameters, request.refreshToken);
|
|
7127
|
+
if (request.attributeTokens) {
|
|
7128
|
+
addAttributeTokens(parameters, request.attributeTokens);
|
|
7129
|
+
}
|
|
7130
|
+
this.performanceClient?.addFields({
|
|
7131
|
+
hasAttributeTokens: !!request.attributeTokens?.length,
|
|
7132
|
+
}, request.correlationId);
|
|
7012
7133
|
if (this.config.clientCredentials.clientSecret) {
|
|
7013
7134
|
addClientSecret(parameters, this.config.clientCredentials.clientSecret);
|
|
7014
7135
|
}
|
|
@@ -7069,7 +7190,7 @@ class RefreshTokenClient {
|
|
|
7069
7190
|
}
|
|
7070
7191
|
}
|
|
7071
7192
|
|
|
7072
|
-
/*! @azure/msal-common v16.
|
|
7193
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7073
7194
|
|
|
7074
7195
|
/*
|
|
7075
7196
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7362,7 +7483,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
|
|
|
7362
7483
|
clearNativeBrokerErrorCode() { }
|
|
7363
7484
|
}
|
|
7364
7485
|
|
|
7365
|
-
/*! @azure/msal-common v16.
|
|
7486
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7366
7487
|
|
|
7367
7488
|
/*
|
|
7368
7489
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7470,7 +7591,7 @@ class SilentFlowClient {
|
|
|
7470
7591
|
}
|
|
7471
7592
|
}
|
|
7472
7593
|
|
|
7473
|
-
/*! @azure/msal-common v16.
|
|
7594
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7474
7595
|
|
|
7475
7596
|
/*
|
|
7476
7597
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7486,7 +7607,7 @@ const StubbedNetworkModule = {
|
|
|
7486
7607
|
},
|
|
7487
7608
|
};
|
|
7488
7609
|
|
|
7489
|
-
/*! @azure/msal-common v16.
|
|
7610
|
+
/*! @azure/msal-common v16.12.0 2026-08-04 */
|
|
7490
7611
|
|
|
7491
7612
|
/*
|
|
7492
7613
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7914,7 +8035,7 @@ function ensureArgumentIsJSONString(argName, argValue, correlationId) {
|
|
|
7914
8035
|
|
|
7915
8036
|
/* eslint-disable header/header */
|
|
7916
8037
|
const name = "@azure/msal-browser";
|
|
7917
|
-
const version = "5.
|
|
8038
|
+
const version = "5.18.0";
|
|
7918
8039
|
|
|
7919
8040
|
/*
|
|
7920
8041
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -16071,12 +16192,12 @@ class BrowserCacheManager extends CacheManager {
|
|
|
16071
16192
|
return parsedAccessToken;
|
|
16072
16193
|
}
|
|
16073
16194
|
/**
|
|
16074
|
-
*
|
|
16075
|
-
* @param accessToken
|
|
16195
|
+
* Set accessToken credential to the platform cache
|
|
16196
|
+
* @param accessToken - the access token entity to cache
|
|
16076
16197
|
*/
|
|
16077
|
-
async setAccessTokenCredential(accessToken, correlationId, kmsi) {
|
|
16198
|
+
async setAccessTokenCredential(accessToken, correlationId, kmsi, additionalCacheKeyHash) {
|
|
16078
16199
|
this.logger.trace("1pondb", correlationId);
|
|
16079
|
-
const accessTokenKey = this.generateCredentialKey(accessToken);
|
|
16200
|
+
const accessTokenKey = this.generateCredentialKey(accessToken, additionalCacheKeyHash);
|
|
16080
16201
|
const timestamp = Date.now().toString();
|
|
16081
16202
|
accessToken.lastUpdatedAt = timestamp;
|
|
16082
16203
|
await this.setUserData(accessTokenKey, JSON.stringify(accessToken), correlationId, timestamp, kmsi);
|
|
@@ -16386,11 +16507,13 @@ class BrowserCacheManager extends CacheManager {
|
|
|
16386
16507
|
}
|
|
16387
16508
|
/**
|
|
16388
16509
|
* Generate Credential Key. All changes to the key REQUIRE a schema version update.
|
|
16389
|
-
* Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>
|
|
16510
|
+
* Cache Key: msal.<schema_version>|<home_account_id>|<environment>|<credential_type>|<client_id or familyId>|<realm>|<scopes>|<scheme>|<additional_cache_key_components_hash>
|
|
16511
|
+
*
|
|
16390
16512
|
* @param credentialEntity
|
|
16513
|
+
* @param hash - optional precomputed hash of additionalCacheKeyComponents
|
|
16391
16514
|
* @returns
|
|
16392
16515
|
*/
|
|
16393
|
-
generateCredentialKey(credential) {
|
|
16516
|
+
generateCredentialKey(credential, additionalCacheKeyHash) {
|
|
16394
16517
|
const familyId = (credential.credentialType ===
|
|
16395
16518
|
CredentialType.REFRESH_TOKEN &&
|
|
16396
16519
|
credential.familyId) ||
|
|
@@ -16410,6 +16533,12 @@ class BrowserCacheManager extends CacheManager {
|
|
|
16410
16533
|
credential.target || "",
|
|
16411
16534
|
scheme,
|
|
16412
16535
|
];
|
|
16536
|
+
// Append precomputed component-hash segment.
|
|
16537
|
+
if (credential.additionalCacheKeyComponents &&
|
|
16538
|
+
Object.keys(credential.additionalCacheKeyComponents).length > 0 &&
|
|
16539
|
+
additionalCacheKeyHash) {
|
|
16540
|
+
credentialKey.push(additionalCacheKeyHash);
|
|
16541
|
+
}
|
|
16413
16542
|
return credentialKey.join(CACHE_KEY_SEPARATOR).toLowerCase();
|
|
16414
16543
|
}
|
|
16415
16544
|
/**
|
|
@@ -17225,50 +17354,63 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17225
17354
|
const nativeATMeasurement = this.performanceClient.startMeasurement(NativeInteractionClientAcquireToken, this.correlationId);
|
|
17226
17355
|
const reqTimestamp = nowSeconds();
|
|
17227
17356
|
const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
17357
|
+
// initialize native request (statically builds the request; does not contact the broker)
|
|
17358
|
+
let nativeRequest;
|
|
17228
17359
|
try {
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17234
|
-
|
|
17235
|
-
|
|
17360
|
+
nativeRequest = await this.initializePlatformRequest(request);
|
|
17361
|
+
}
|
|
17362
|
+
catch (e) {
|
|
17363
|
+
/*
|
|
17364
|
+
* Request initialization (e.g. PoP token generation or authority
|
|
17365
|
+
* resolution) failed before the broker was contacted, so end the
|
|
17366
|
+
* measurement here to avoid an orphaned sub-measurement.
|
|
17367
|
+
* Broker was never engaged, so this was not a native broker outcome.
|
|
17368
|
+
*/
|
|
17369
|
+
nativeATMeasurement.add({
|
|
17370
|
+
isNativeBroker: false,
|
|
17371
|
+
});
|
|
17372
|
+
nativeATMeasurement.end({
|
|
17373
|
+
success: false,
|
|
17374
|
+
}, e);
|
|
17375
|
+
throw e;
|
|
17376
|
+
}
|
|
17377
|
+
// check if the tokens can be retrieved from internal cache
|
|
17378
|
+
try {
|
|
17379
|
+
const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
|
|
17380
|
+
// Served from the native internal cache; token did not come directly from the broker
|
|
17381
|
+
nativeATMeasurement.add({
|
|
17382
|
+
isNativeBroker: false,
|
|
17383
|
+
});
|
|
17384
|
+
nativeATMeasurement.end({
|
|
17385
|
+
success: true,
|
|
17386
|
+
fromCache: true,
|
|
17387
|
+
});
|
|
17388
|
+
return result;
|
|
17389
|
+
}
|
|
17390
|
+
catch (e) {
|
|
17391
|
+
if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
|
|
17392
|
+
this.logger.info("0eitbc", this.correlationId);
|
|
17393
|
+
nativeATMeasurement.add({
|
|
17236
17394
|
isNativeBroker: false,
|
|
17237
|
-
fromCache: true,
|
|
17238
|
-
});
|
|
17239
|
-
return result;
|
|
17240
|
-
}
|
|
17241
|
-
catch (e) {
|
|
17242
|
-
if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
|
|
17243
|
-
this.logger.info("0eitbc", this.correlationId);
|
|
17244
|
-
nativeATMeasurement.end({
|
|
17245
|
-
success: false,
|
|
17246
|
-
brokerErrorCode: "cache_request_failed",
|
|
17247
|
-
});
|
|
17248
|
-
throw e;
|
|
17249
|
-
}
|
|
17250
|
-
// continue with a native call for any and all errors
|
|
17251
|
-
this.logger.info("0957j1", this.correlationId);
|
|
17252
|
-
}
|
|
17253
|
-
const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
|
|
17254
|
-
return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
|
|
17255
|
-
.then((result) => {
|
|
17256
|
-
nativeATMeasurement.end({
|
|
17257
|
-
success: true,
|
|
17258
|
-
isNativeBroker: true,
|
|
17259
|
-
requestId: result.requestId,
|
|
17260
17395
|
});
|
|
17261
|
-
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
17262
|
-
return result;
|
|
17263
|
-
})
|
|
17264
|
-
.catch((error) => {
|
|
17265
17396
|
nativeATMeasurement.end({
|
|
17266
17397
|
success: false,
|
|
17267
|
-
errorCode: error.errorCode,
|
|
17268
|
-
subErrorCode: error.subError,
|
|
17269
17398
|
});
|
|
17270
|
-
throw
|
|
17399
|
+
throw e;
|
|
17400
|
+
}
|
|
17401
|
+
// continue with a native call for any and all errors
|
|
17402
|
+
this.logger.info("0957j1", this.correlationId);
|
|
17403
|
+
}
|
|
17404
|
+
// dispatch the request to the broker
|
|
17405
|
+
try {
|
|
17406
|
+
const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
|
|
17407
|
+
const result = await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
|
|
17408
|
+
nativeATMeasurement.end({
|
|
17409
|
+
success: true,
|
|
17410
|
+
requestId: result.requestId,
|
|
17271
17411
|
});
|
|
17412
|
+
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
17413
|
+
return result;
|
|
17272
17414
|
}
|
|
17273
17415
|
catch (e) {
|
|
17274
17416
|
if (e instanceof NativeAuthError) {
|
|
@@ -17276,10 +17418,29 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17276
17418
|
}
|
|
17277
17419
|
nativeATMeasurement.end({
|
|
17278
17420
|
success: false,
|
|
17279
|
-
});
|
|
17421
|
+
}, e);
|
|
17422
|
+
this.setBrokerErrorTelemetry(e);
|
|
17280
17423
|
throw e;
|
|
17281
17424
|
}
|
|
17282
17425
|
}
|
|
17426
|
+
/**
|
|
17427
|
+
* Records platform-broker error telemetry on the root event for the current
|
|
17428
|
+
* correlationId. `isNativeBroker` is set optimistically to true because the
|
|
17429
|
+
* broker was engaged; when the caller subsequently falls back to a web flow
|
|
17430
|
+
* that succeeds, the root success measurement overrides it to false via
|
|
17431
|
+
* `result.fromPlatformBroker`. Terminal broker errors (no fallback) retain
|
|
17432
|
+
* true. `brokerErrorName`/`brokerErrorCode` are recorded when the error is an `AuthError`.
|
|
17433
|
+
* @param error error thrown by the broker interaction
|
|
17434
|
+
*/
|
|
17435
|
+
setBrokerErrorTelemetry(error) {
|
|
17436
|
+
if (error instanceof AuthError) {
|
|
17437
|
+
this.performanceClient.addFields({
|
|
17438
|
+
isNativeBroker: true,
|
|
17439
|
+
brokerErrorName: error.name,
|
|
17440
|
+
brokerErrorCode: error.errorCode,
|
|
17441
|
+
}, this.correlationId);
|
|
17442
|
+
}
|
|
17443
|
+
}
|
|
17283
17444
|
/**
|
|
17284
17445
|
* Creates silent flow request
|
|
17285
17446
|
* @param request
|
|
@@ -17287,13 +17448,18 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17287
17448
|
* @returns CommonSilentFlowRequest
|
|
17288
17449
|
*/
|
|
17289
17450
|
createSilentCacheRequest(request, cachedAccount) {
|
|
17290
|
-
|
|
17451
|
+
const silentRequest = {
|
|
17291
17452
|
authority: request.authority,
|
|
17292
17453
|
correlationId: this.correlationId,
|
|
17293
17454
|
scopes: ScopeSet.fromString(request.scope, this.correlationId).asArray(),
|
|
17294
17455
|
account: cachedAccount,
|
|
17295
17456
|
forceRefresh: false,
|
|
17296
17457
|
};
|
|
17458
|
+
// Preserve FMI partition semantics for silent cache filtering.
|
|
17459
|
+
if (request.attributeTokens) {
|
|
17460
|
+
silentRequest.attributeTokens = request.attributeTokens.split(" ");
|
|
17461
|
+
}
|
|
17462
|
+
return silentRequest;
|
|
17297
17463
|
}
|
|
17298
17464
|
/**
|
|
17299
17465
|
* Fetches the tokens from the cache if un-expired
|
|
@@ -17351,11 +17517,21 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17351
17517
|
const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
17352
17518
|
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
17353
17519
|
if (isFatalNativeAuthError(e)) {
|
|
17520
|
+
/*
|
|
17521
|
+
* Fatal error on redirect initiate always falls back to a
|
|
17522
|
+
* regular web redirect, so this request did not complete
|
|
17523
|
+
* natively. Token telemetry for the eventual outcome lands
|
|
17524
|
+
* in handleRedirectPromise (phase 2).
|
|
17525
|
+
*/
|
|
17526
|
+
this.setBrokerErrorTelemetry(e);
|
|
17354
17527
|
throw e;
|
|
17355
17528
|
}
|
|
17356
17529
|
}
|
|
17357
17530
|
}
|
|
17358
|
-
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(
|
|
17531
|
+
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify({
|
|
17532
|
+
...nativeRequest,
|
|
17533
|
+
storeInCache: request.storeInCache,
|
|
17534
|
+
}), true);
|
|
17359
17535
|
const navigationOptions = {
|
|
17360
17536
|
apiId: ApiId.acquireTokenRedirect,
|
|
17361
17537
|
timeout: this.config.system.redirectNavigationTimeout,
|
|
@@ -17385,7 +17561,11 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17385
17561
|
this.performanceClient?.addFields({ errorCode: "no_cached_request" }, this.correlationId);
|
|
17386
17562
|
return null;
|
|
17387
17563
|
}
|
|
17388
|
-
|
|
17564
|
+
/*
|
|
17565
|
+
* storeInCache is a client-side cache directive persisted alongside the cached
|
|
17566
|
+
* request (not a broker-contract parameter), so extract it here before resending.
|
|
17567
|
+
*/
|
|
17568
|
+
const { prompt, storeInCache, ...request } = cachedRequest;
|
|
17389
17569
|
if (prompt) {
|
|
17390
17570
|
this.logger.verbose("0ac34v", this.correlationId);
|
|
17391
17571
|
}
|
|
@@ -17394,13 +17574,13 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17394
17574
|
try {
|
|
17395
17575
|
this.logger.verbose("003x5a", this.correlationId);
|
|
17396
17576
|
const response = await this.platformAuthProvider.sendMessage(request);
|
|
17397
|
-
const authResult = await this.handleNativeResponse(response, request, reqTimestamp);
|
|
17577
|
+
const authResult = await this.handleNativeResponse(response, request, reqTimestamp, storeInCache);
|
|
17398
17578
|
const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
|
|
17399
17579
|
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
17400
|
-
this.performanceClient?.addFields({ isNativeBroker: true }, this.correlationId);
|
|
17401
17580
|
return authResult;
|
|
17402
17581
|
}
|
|
17403
17582
|
catch (e) {
|
|
17583
|
+
this.setBrokerErrorTelemetry(e);
|
|
17404
17584
|
throw e;
|
|
17405
17585
|
}
|
|
17406
17586
|
}
|
|
@@ -17418,7 +17598,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17418
17598
|
* @param request
|
|
17419
17599
|
* @param reqTimestamp
|
|
17420
17600
|
*/
|
|
17421
|
-
async handleNativeResponse(response, request, reqTimestamp) {
|
|
17601
|
+
async handleNativeResponse(response, request, reqTimestamp, storeInCache) {
|
|
17422
17602
|
this.logger.trace("1bojln", this.correlationId);
|
|
17423
17603
|
// generate identifiers
|
|
17424
17604
|
const idTokenClaims = extractTokenClaims(response.id_token, base64Decode, this.correlationId);
|
|
@@ -17447,8 +17627,8 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17447
17627
|
const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
|
|
17448
17628
|
// cache accounts and tokens in the appropriate storage
|
|
17449
17629
|
await this.cacheAccount(baseAccount, isKmsi(idTokenClaims));
|
|
17450
|
-
await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache() // environment
|
|
17451
|
-
);
|
|
17630
|
+
await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
|
|
17631
|
+
storeInCache);
|
|
17452
17632
|
return result;
|
|
17453
17633
|
}
|
|
17454
17634
|
/**
|
|
@@ -17569,7 +17749,9 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17569
17749
|
correlationId: this.correlationId,
|
|
17570
17750
|
state: response.state,
|
|
17571
17751
|
fromPlatformBroker: true,
|
|
17572
|
-
...(request.resource && {
|
|
17752
|
+
...(request.extraParameters?.resource && {
|
|
17753
|
+
resource: request.extraParameters.resource,
|
|
17754
|
+
}),
|
|
17573
17755
|
};
|
|
17574
17756
|
return result;
|
|
17575
17757
|
}
|
|
@@ -17593,7 +17775,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17593
17775
|
* @param tenantId
|
|
17594
17776
|
* @param reqTimestamp
|
|
17595
17777
|
*/
|
|
17596
|
-
async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment) {
|
|
17778
|
+
async cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, tenantId, reqTimestamp, environment, storeInCache) {
|
|
17597
17779
|
const cachedIdToken = createIdTokenEntity(homeAccountIdentifier, environment, response.id_token || "", request.clientId, idTokenClaims.tid || "");
|
|
17598
17780
|
// cache accessToken in inmemory storage
|
|
17599
17781
|
const expiresIn = request.tokenType === AuthenticationScheme.POP
|
|
@@ -17603,16 +17785,21 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17603
17785
|
: response.expires_in) || 0;
|
|
17604
17786
|
const tokenExpirationSeconds = reqTimestamp + expiresIn;
|
|
17605
17787
|
const responseScopes = this.generateScopes(response.scope, request.scope);
|
|
17606
|
-
const
|
|
17788
|
+
const additionalCacheKeyComponents = request.attributeTokens
|
|
17789
|
+
? {
|
|
17790
|
+
attribute_tokens: request.attributeTokens,
|
|
17791
|
+
}
|
|
17792
|
+
: undefined;
|
|
17793
|
+
const cachedAccessToken = createAccessTokenEntity(homeAccountIdentifier, environment, response.access_token, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, request.correlationId, undefined, request.tokenType, undefined, request.keyId, additionalCacheKeyComponents);
|
|
17607
17794
|
// save idtoken credential in configured browser storage
|
|
17608
|
-
if (!!cachedIdToken &&
|
|
17795
|
+
if (!!cachedIdToken && storeInCache?.idToken !== false) {
|
|
17609
17796
|
await this.browserStorage.setIdTokenCredential(cachedIdToken, this.correlationId, isKmsi(idTokenClaims));
|
|
17610
17797
|
}
|
|
17611
17798
|
// save access token credential in memory storage
|
|
17612
17799
|
const nativeCacheRecord = {
|
|
17613
17800
|
accessToken: cachedAccessToken,
|
|
17614
17801
|
};
|
|
17615
|
-
return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId,
|
|
17802
|
+
return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, isKmsi(idTokenClaims), this.apiId, storeInCache);
|
|
17616
17803
|
}
|
|
17617
17804
|
getExpiresInValue(tokenType, expiresIn) {
|
|
17618
17805
|
return tokenType === AuthenticationScheme.POP
|
|
@@ -17684,13 +17871,19 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17684
17871
|
const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
|
|
17685
17872
|
? undefined
|
|
17686
17873
|
: this.config.auth.clientCapabilities;
|
|
17687
|
-
|
|
17688
|
-
|
|
17874
|
+
/*
|
|
17875
|
+
* scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
|
|
17876
|
+
* attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
|
|
17877
|
+
*/
|
|
17878
|
+
const { scopes, claims } = request;
|
|
17689
17879
|
const scopeSet = new ScopeSet(scopes || [], this.correlationId);
|
|
17690
17880
|
scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
|
|
17691
17881
|
const mergedClaims = buildMergedClaims(claims, configClaims?.length ? configClaims : undefined);
|
|
17882
|
+
const hasAttributeTokens = !!request.attributeTokens?.length;
|
|
17883
|
+
this.performanceClient?.addFields({
|
|
17884
|
+
hasAttributeTokens,
|
|
17885
|
+
}, this.correlationId);
|
|
17692
17886
|
const validatedRequest = {
|
|
17693
|
-
...remainingProperties,
|
|
17694
17887
|
claims: mergedClaims,
|
|
17695
17888
|
accountId: this.accountId,
|
|
17696
17889
|
clientId: this.config.auth.clientId,
|
|
@@ -17699,19 +17892,32 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17699
17892
|
redirectUri: getRedirectUri(request.redirectUri, this.config.auth.redirectUri, this.logger, this.correlationId),
|
|
17700
17893
|
prompt: this.getPrompt(request.prompt),
|
|
17701
17894
|
correlationId: this.correlationId,
|
|
17895
|
+
isSts: false,
|
|
17702
17896
|
tokenType: request.authenticationScheme,
|
|
17703
17897
|
windowTitleSubstring: document.title,
|
|
17898
|
+
nonce: request.nonce,
|
|
17899
|
+
state: request.state,
|
|
17900
|
+
loginHint: request.loginHint,
|
|
17704
17901
|
extraParameters: {
|
|
17705
17902
|
...request.extraParameters,
|
|
17903
|
+
...(request.resource && { resource: request.resource }), // resource is set for MCP scenarios
|
|
17706
17904
|
},
|
|
17707
17905
|
extendedExpiryToken: false,
|
|
17708
17906
|
keyId: request.popKid,
|
|
17907
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
17908
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
17909
|
+
shrClaims: request.shrClaims,
|
|
17910
|
+
shrNonce: request.shrNonce,
|
|
17709
17911
|
};
|
|
17912
|
+
if (hasAttributeTokens) {
|
|
17913
|
+
validatedRequest.attributeTokens =
|
|
17914
|
+
serializeAttributeTokens(request.attributeTokens);
|
|
17915
|
+
}
|
|
17710
17916
|
// Check for PoP token requests: signPopToken should only be set to true if popKid is not set
|
|
17711
17917
|
if (validatedRequest.signPopToken && !!request.popKid) {
|
|
17712
17918
|
throw createBrowserAuthError(invalidPopTokenRequest, this.correlationId);
|
|
17713
17919
|
}
|
|
17714
|
-
this.handleExtraBrokerParams(validatedRequest);
|
|
17920
|
+
this.handleExtraBrokerParams(validatedRequest, request.embeddedClientId);
|
|
17715
17921
|
validatedRequest.extraParameters =
|
|
17716
17922
|
validatedRequest.extraParameters || {};
|
|
17717
17923
|
validatedRequest.extraParameters.telemetry =
|
|
@@ -17786,19 +17992,19 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17786
17992
|
* @param request {PlatformAuthRequest}
|
|
17787
17993
|
* @private
|
|
17788
17994
|
*/
|
|
17789
|
-
handleExtraBrokerParams(request) {
|
|
17995
|
+
handleExtraBrokerParams(request, embeddedClientId) {
|
|
17790
17996
|
const hasExtraBrokerParams = request.extraParameters &&
|
|
17791
17997
|
request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
|
|
17792
17998
|
request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
|
|
17793
17999
|
request.extraParameters.hasOwnProperty(CLIENT_ID);
|
|
17794
|
-
if (!
|
|
18000
|
+
if (!embeddedClientId && !hasExtraBrokerParams) {
|
|
17795
18001
|
return;
|
|
17796
18002
|
}
|
|
17797
18003
|
let child_client_id = "";
|
|
17798
18004
|
const child_redirect_uri = request.redirectUri;
|
|
17799
|
-
if (
|
|
18005
|
+
if (embeddedClientId) {
|
|
17800
18006
|
request.redirectUri = this.config.auth.redirectUri;
|
|
17801
|
-
child_client_id =
|
|
18007
|
+
child_client_id = embeddedClientId;
|
|
17802
18008
|
}
|
|
17803
18009
|
else if (request.extraParameters) {
|
|
17804
18010
|
request.redirectUri =
|
|
@@ -17806,7 +18012,15 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
17806
18012
|
child_client_id =
|
|
17807
18013
|
request.extraParameters[CLIENT_ID];
|
|
17808
18014
|
}
|
|
18015
|
+
const {
|
|
18016
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18017
|
+
[BROKER_CLIENT_ID]: _brkClientId,
|
|
18018
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18019
|
+
[BROKER_REDIRECT_URI]: _brkRedirectUri,
|
|
18020
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18021
|
+
[CLIENT_ID]: _clientId, ...remainingExtraParameters } = request.extraParameters || {};
|
|
17809
18022
|
request.extraParameters = {
|
|
18023
|
+
...remainingExtraParameters,
|
|
17810
18024
|
child_client_id,
|
|
17811
18025
|
child_redirect_uri,
|
|
17812
18026
|
};
|
|
@@ -18231,6 +18445,8 @@ class NavigationClient {
|
|
|
18231
18445
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18232
18446
|
* Licensed under the MIT License.
|
|
18233
18447
|
*/
|
|
18448
|
+
const MAX_FETCH_POST_RETRIES = 1;
|
|
18449
|
+
const RETRY_DELAY_MS = 100;
|
|
18234
18450
|
/**
|
|
18235
18451
|
* This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
|
|
18236
18452
|
*/
|
|
@@ -18279,21 +18495,40 @@ class FetchClient {
|
|
|
18279
18495
|
async sendPostRequestAsync(url, options) {
|
|
18280
18496
|
const reqBody = (options && options.body) || "";
|
|
18281
18497
|
const reqHeaders = getFetchHeaders(options);
|
|
18498
|
+
const correlationId = options?.correlationId;
|
|
18499
|
+
const performanceClient = options?.performanceClient;
|
|
18282
18500
|
let response;
|
|
18283
|
-
let
|
|
18284
|
-
let
|
|
18285
|
-
|
|
18286
|
-
|
|
18287
|
-
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18501
|
+
let lastError;
|
|
18502
|
+
for (let attempt = 1; attempt <= MAX_FETCH_POST_RETRIES + 1; attempt++) {
|
|
18503
|
+
try {
|
|
18504
|
+
response = await fetch(url, {
|
|
18505
|
+
method: HTTP_REQUEST_TYPE.POST,
|
|
18506
|
+
headers: reqHeaders,
|
|
18507
|
+
body: reqBody,
|
|
18508
|
+
});
|
|
18509
|
+
break;
|
|
18510
|
+
}
|
|
18511
|
+
catch (e) {
|
|
18512
|
+
lastError = e;
|
|
18513
|
+
if (!shouldRetryPostFetchError(lastError, attempt)) {
|
|
18514
|
+
throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
|
|
18515
|
+
? postRequestFailed
|
|
18516
|
+
: noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
|
|
18517
|
+
}
|
|
18518
|
+
// Brief backoff before retry
|
|
18519
|
+
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS));
|
|
18520
|
+
if (correlationId) {
|
|
18521
|
+
performanceClient?.incrementFields({ fetchRetryCount: 1 }, correlationId);
|
|
18522
|
+
}
|
|
18523
|
+
}
|
|
18291
18524
|
}
|
|
18292
|
-
|
|
18293
|
-
throw createNetworkError(createBrowserAuthError(window.navigator.onLine
|
|
18525
|
+
if (!response) {
|
|
18526
|
+
throw createNetworkError(createBrowserAuthError(window.navigator.onLine !== false
|
|
18294
18527
|
? postRequestFailed
|
|
18295
|
-
: noNetworkConnectivity, ""), undefined, undefined,
|
|
18528
|
+
: noNetworkConnectivity, correlationId || ""), undefined, undefined, lastError);
|
|
18296
18529
|
}
|
|
18530
|
+
let responseStatus = 0;
|
|
18531
|
+
let responseHeaders = {};
|
|
18297
18532
|
responseHeaders = getHeaderDict(response.headers);
|
|
18298
18533
|
try {
|
|
18299
18534
|
responseStatus = response.status;
|
|
@@ -18304,10 +18539,15 @@ class FetchClient {
|
|
|
18304
18539
|
};
|
|
18305
18540
|
}
|
|
18306
18541
|
catch (e) {
|
|
18307
|
-
throw createNetworkError(createBrowserAuthError(failedToParseResponse, ""), responseStatus, responseHeaders, e);
|
|
18542
|
+
throw createNetworkError(createBrowserAuthError(failedToParseResponse, correlationId || ""), responseStatus, responseHeaders, e);
|
|
18308
18543
|
}
|
|
18309
18544
|
}
|
|
18310
18545
|
}
|
|
18546
|
+
function shouldRetryPostFetchError(error, attempt) {
|
|
18547
|
+
return (attempt <= MAX_FETCH_POST_RETRIES &&
|
|
18548
|
+
window.navigator.onLine !== false &&
|
|
18549
|
+
error.name !== "AbortError");
|
|
18550
|
+
}
|
|
18311
18551
|
/**
|
|
18312
18552
|
* Get Fetch API Headers object from string map
|
|
18313
18553
|
* @param inputHeaders
|
|
@@ -18793,7 +19033,7 @@ class PlatformAuthDOMHandler {
|
|
|
18793
19033
|
}
|
|
18794
19034
|
initializePlatformDOMRequest(request) {
|
|
18795
19035
|
this.logger.trace(`15d6yv ${this.platformAuthType}`, request.correlationId);
|
|
18796
|
-
const { accountId, clientId, authority, scope, redirectUri, correlationId, state,
|
|
19036
|
+
const { accountId, clientId, authority, scope, redirectUri, correlationId, state, extraParameters, ...remainingProperties } = request;
|
|
18797
19037
|
const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
|
|
18798
19038
|
const platformDOMRequest = {
|
|
18799
19039
|
accountId: accountId,
|
|
@@ -18809,8 +19049,6 @@ class PlatformAuthDOMHandler {
|
|
|
18809
19049
|
redirectUri: redirectUri,
|
|
18810
19050
|
scope: scope,
|
|
18811
19051
|
state: state,
|
|
18812
|
-
storeInCache: storeInCache,
|
|
18813
|
-
embeddedClientId: embeddedClientId,
|
|
18814
19052
|
};
|
|
18815
19053
|
return platformDOMRequest;
|
|
18816
19054
|
}
|
|
@@ -20565,6 +20803,7 @@ class StandardController {
|
|
|
20565
20803
|
this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, correlationId, InteractionType.Redirect);
|
|
20566
20804
|
rootMeasurement = this.performanceClient.startMeasurement(AcquireTokenRedirect, correlationId);
|
|
20567
20805
|
this.logger.trace("12v7is", correlationId);
|
|
20806
|
+
// Cached nativeAccountId routes directly to the broker (no /authorize call)
|
|
20568
20807
|
rootMeasurement.add({
|
|
20569
20808
|
isPlatformBrokerRequest: true,
|
|
20570
20809
|
});
|
|
@@ -20601,6 +20840,7 @@ class StandardController {
|
|
|
20601
20840
|
}
|
|
20602
20841
|
rootMeasurement.end({
|
|
20603
20842
|
success: true,
|
|
20843
|
+
isNativeBroker: result.fromPlatformBroker ?? false,
|
|
20604
20844
|
}, undefined, result.account);
|
|
20605
20845
|
// Fire-and-forget SSO capability verification in background
|
|
20606
20846
|
this.verifySsoCapability(cachedRedirectRequest, InteractionType.Redirect);
|
|
@@ -20610,8 +20850,8 @@ class StandardController {
|
|
|
20610
20850
|
* Instrument an event only if an error code is set. Otherwise, discard it when the redirect response
|
|
20611
20851
|
* is empty and the error code is missing.
|
|
20612
20852
|
*/
|
|
20613
|
-
if (rootMeasurement.event.errorCode) {
|
|
20614
|
-
rootMeasurement.end({ success: false }
|
|
20853
|
+
if (!!rootMeasurement.event.errorCode) {
|
|
20854
|
+
rootMeasurement.end({ success: false });
|
|
20615
20855
|
}
|
|
20616
20856
|
else {
|
|
20617
20857
|
rootMeasurement.discard();
|
|
@@ -20670,10 +20910,6 @@ class StandardController {
|
|
|
20670
20910
|
this.canUsePlatformBroker(request)) {
|
|
20671
20911
|
const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
|
|
20672
20912
|
result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
|
|
20673
|
-
atrMeasurement.add({
|
|
20674
|
-
brokerErrorName: e.name,
|
|
20675
|
-
brokerErrorCode: e.errorCode,
|
|
20676
|
-
});
|
|
20677
20913
|
if (e instanceof NativeAuthError &&
|
|
20678
20914
|
isFatalNativeAuthError(e)) {
|
|
20679
20915
|
this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
|
|
@@ -20742,6 +20978,7 @@ class StandardController {
|
|
|
20742
20978
|
let result;
|
|
20743
20979
|
const pkce = this.getPreGeneratedPkceCodes(correlationId);
|
|
20744
20980
|
if (this.canUsePlatformBroker(request)) {
|
|
20981
|
+
// Cached nativeAccountId routes directly to the broker (no /authorize call)
|
|
20745
20982
|
atPopupMeasurement.add({
|
|
20746
20983
|
isPlatformBrokerRequest: true,
|
|
20747
20984
|
});
|
|
@@ -20752,15 +20989,11 @@ class StandardController {
|
|
|
20752
20989
|
.then((response) => {
|
|
20753
20990
|
atPopupMeasurement.end({
|
|
20754
20991
|
success: true,
|
|
20755
|
-
isNativeBroker:
|
|
20992
|
+
isNativeBroker: response.fromPlatformBroker ?? false,
|
|
20756
20993
|
}, undefined, response.account);
|
|
20757
20994
|
return response;
|
|
20758
20995
|
})
|
|
20759
20996
|
.catch((e) => {
|
|
20760
|
-
atPopupMeasurement.add({
|
|
20761
|
-
brokerErrorName: e.name,
|
|
20762
|
-
brokerErrorCode: e.errorCode,
|
|
20763
|
-
});
|
|
20764
20997
|
if (e instanceof NativeAuthError &&
|
|
20765
20998
|
isFatalNativeAuthError(e)) {
|
|
20766
20999
|
this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
|
|
@@ -20791,6 +21024,7 @@ class StandardController {
|
|
|
20791
21024
|
}
|
|
20792
21025
|
atPopupMeasurement.end({
|
|
20793
21026
|
success: true,
|
|
21027
|
+
isNativeBroker: result.fromPlatformBroker ?? false,
|
|
20794
21028
|
accessTokenSize: result.accessToken.length,
|
|
20795
21029
|
idTokenSize: result.idToken.length,
|
|
20796
21030
|
}, undefined, result.account);
|
|
@@ -20984,14 +21218,11 @@ class StandardController {
|
|
|
20984
21218
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, InteractionType.Silent, validRequest);
|
|
20985
21219
|
let result;
|
|
20986
21220
|
if (this.canUsePlatformBroker(validRequest)) {
|
|
21221
|
+
// Cached nativeAccountId routes directly to the broker (no /authorize call)
|
|
20987
21222
|
this.ssoSilentMeasurement?.add({
|
|
20988
21223
|
isPlatformBrokerRequest: true,
|
|
20989
21224
|
});
|
|
20990
21225
|
result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
|
|
20991
|
-
this.ssoSilentMeasurement?.add({
|
|
20992
|
-
brokerErrorName: e.name,
|
|
20993
|
-
brokerErrorCode: e.errorCode,
|
|
20994
|
-
});
|
|
20995
21226
|
// If native token acquisition fails for availability reasons fallback to standard flow
|
|
20996
21227
|
if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
|
|
20997
21228
|
this.platformAuthProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt platform broker calls
|
|
@@ -21014,7 +21245,7 @@ class StandardController {
|
|
|
21014
21245
|
}
|
|
21015
21246
|
this.ssoSilentMeasurement?.end({
|
|
21016
21247
|
success: true,
|
|
21017
|
-
isNativeBroker: response.fromPlatformBroker,
|
|
21248
|
+
isNativeBroker: response.fromPlatformBroker ?? false,
|
|
21018
21249
|
accessTokenSize: response.accessToken.length,
|
|
21019
21250
|
idTokenSize: response.idToken.length,
|
|
21020
21251
|
}, undefined, response.account);
|
|
@@ -21067,6 +21298,7 @@ class StandardController {
|
|
|
21067
21298
|
this.hybridAuthCodeResponses.delete(hybridAuthCode);
|
|
21068
21299
|
atbcMeasurement.end({
|
|
21069
21300
|
success: true,
|
|
21301
|
+
isNativeBroker: false,
|
|
21070
21302
|
accessTokenSize: result.accessToken.length,
|
|
21071
21303
|
idTokenSize: result.idToken.length,
|
|
21072
21304
|
}, undefined, result.account);
|
|
@@ -21097,10 +21329,6 @@ class StandardController {
|
|
|
21097
21329
|
...request,
|
|
21098
21330
|
correlationId,
|
|
21099
21331
|
}, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
|
|
21100
|
-
atbcMeasurement.add({
|
|
21101
|
-
brokerErrorName: e.name,
|
|
21102
|
-
brokerErrorCode: e.errorCode,
|
|
21103
|
-
});
|
|
21104
21332
|
// If native token acquisition fails for availability reasons fallback to standard flow
|
|
21105
21333
|
if (e instanceof NativeAuthError &&
|
|
21106
21334
|
isFatalNativeAuthError(e)) {
|
|
@@ -21110,6 +21338,7 @@ class StandardController {
|
|
|
21110
21338
|
});
|
|
21111
21339
|
atbcMeasurement.end({
|
|
21112
21340
|
success: true,
|
|
21341
|
+
isNativeBroker: result.fromPlatformBroker ?? false,
|
|
21113
21342
|
}, undefined, result.account);
|
|
21114
21343
|
return result;
|
|
21115
21344
|
}
|
|
@@ -21150,6 +21379,7 @@ class StandardController {
|
|
|
21150
21379
|
.then((response) => {
|
|
21151
21380
|
this.acquireTokenByCodeAsyncMeasurement?.end({
|
|
21152
21381
|
success: true,
|
|
21382
|
+
isNativeBroker: false,
|
|
21153
21383
|
fromCache: response.fromCache,
|
|
21154
21384
|
});
|
|
21155
21385
|
return response;
|
|
@@ -21303,21 +21533,32 @@ class StandardController {
|
|
|
21303
21533
|
// Create idToken entity and store in browser storage
|
|
21304
21534
|
const idTokenEntity = createIdTokenEntity(result.account.homeAccountId, result.account.environment, result.idToken, this.config.auth.clientId, result.tenantId);
|
|
21305
21535
|
// Create accessToken entity and store in native internal storage
|
|
21536
|
+
const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
|
|
21537
|
+
const additionalCacheKeyComponents = attributeTokenPartition
|
|
21538
|
+
? {
|
|
21539
|
+
attribute_tokens: attributeTokenPartition,
|
|
21540
|
+
}
|
|
21541
|
+
: undefined;
|
|
21306
21542
|
const accessTokenEntity = createAccessTokenEntity(result.account.homeAccountId, result.account.environment, result.accessToken, this.config.auth.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn
|
|
21307
21543
|
? toSecondsFromDate(result.expiresOn)
|
|
21308
21544
|
: 0, result.extExpiresOn
|
|
21309
21545
|
? toSecondsFromDate(result.extExpiresOn)
|
|
21310
21546
|
: 0, base64Decode, request.correlationId || "", undefined, // refreshOn
|
|
21311
21547
|
result.tokenType, undefined, // userAssertionHash
|
|
21312
|
-
request.sshKid);
|
|
21548
|
+
request.sshKid, additionalCacheKeyComponents);
|
|
21313
21549
|
if (request.resource) {
|
|
21314
21550
|
accessTokenEntity.resource = request.resource;
|
|
21315
21551
|
}
|
|
21552
|
+
// Get attribute token partition hash for cache key isolation
|
|
21553
|
+
const components = additionalCacheKeyComponents;
|
|
21554
|
+
const additionalCacheKeyHash = components
|
|
21555
|
+
? await this.browserCrypto.hashString(JSON.stringify(components))
|
|
21556
|
+
: undefined;
|
|
21316
21557
|
const kmsi = isKmsi(result.idTokenClaims);
|
|
21317
21558
|
// Store idToken in browser storage
|
|
21318
21559
|
await this.browserStorage.setIdTokenCredential(idTokenEntity, result.correlationId, kmsi);
|
|
21319
21560
|
// Store accessToken in native internal storage
|
|
21320
|
-
await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi);
|
|
21561
|
+
await this.nativeInternalStorage.setAccessTokenCredential(accessTokenEntity, result.correlationId, kmsi, additionalCacheKeyHash);
|
|
21321
21562
|
}
|
|
21322
21563
|
else {
|
|
21323
21564
|
return this.browserStorage.hydrateCache(result, request);
|
|
@@ -21327,8 +21568,16 @@ class StandardController {
|
|
|
21327
21568
|
/**
|
|
21328
21569
|
* Acquire a token from native device (e.g. WAM)
|
|
21329
21570
|
* @param request
|
|
21571
|
+
* @param apiId
|
|
21572
|
+
* @param accountId
|
|
21573
|
+
* @param cacheLookupPolicy
|
|
21330
21574
|
*/
|
|
21331
21575
|
async acquireTokenNative(request, apiId, accountId, cacheLookupPolicy) {
|
|
21576
|
+
/*
|
|
21577
|
+
* Callers always normalize correlationId onto the request before delegating
|
|
21578
|
+
* here, so it is guaranteed defined and is the single id used to key this
|
|
21579
|
+
* flow's telemetry.
|
|
21580
|
+
*/
|
|
21332
21581
|
const correlationId = this.getRequestCorrelationId(request);
|
|
21333
21582
|
this.logger.trace("0b9y3p", correlationId);
|
|
21334
21583
|
if (!this.platformAuthProvider) {
|
|
@@ -21582,6 +21831,7 @@ class StandardController {
|
|
|
21582
21831
|
.then((result) => {
|
|
21583
21832
|
atsMeasurement.end({
|
|
21584
21833
|
success: true,
|
|
21834
|
+
isNativeBroker: result.fromPlatformBroker ?? false,
|
|
21585
21835
|
fromCache: result.fromCache,
|
|
21586
21836
|
accessTokenSize: result.accessToken.length,
|
|
21587
21837
|
idTokenSize: result.idToken.length,
|
|
@@ -21718,7 +21968,7 @@ class StandardController {
|
|
|
21718
21968
|
if (request.correlationId) {
|
|
21719
21969
|
this.performanceClient.addFields({
|
|
21720
21970
|
fromCache: response.fromCache,
|
|
21721
|
-
isNativeBroker: response.fromPlatformBroker,
|
|
21971
|
+
isNativeBroker: response.fromPlatformBroker ?? false,
|
|
21722
21972
|
}, request.correlationId);
|
|
21723
21973
|
}
|
|
21724
21974
|
return response;
|
|
@@ -21744,10 +21994,6 @@ class StandardController {
|
|
|
21744
21994
|
this.logger.verbose("0sczo4", silentRequest.correlationId);
|
|
21745
21995
|
this.performanceClient.addFields({ isPlatformBrokerRequest: true }, silentRequest.correlationId);
|
|
21746
21996
|
return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow, silentRequest.account.nativeAccountId, cacheLookupPolicy).catch(async (e) => {
|
|
21747
|
-
this.performanceClient.addFields({
|
|
21748
|
-
brokerErrorName: e.name,
|
|
21749
|
-
brokerErrorCode: e.errorCode,
|
|
21750
|
-
}, silentRequest.correlationId);
|
|
21751
21997
|
// If native token acquisition fails for availability reasons fallback to web flow
|
|
21752
21998
|
if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
|
|
21753
21999
|
this.logger.verbose("07rkmb", silentRequest.correlationId);
|