@azure/msal-browser 3.26.1 → 3.27.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/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts +1 -0
- package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +4 -3
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +1 -8
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +2 -2
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +10 -7
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +2 -2
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.d.ts +4 -2
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.mjs +8 -6
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.d.ts +2 -0
- package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +5 -3
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +2 -4
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +25 -17
- package/dist/interaction_client/NativeInteractionClient.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.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +2 -1
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- 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.d.ts.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +4 -5
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.d.ts +0 -6
- package/dist/network/FetchClient.d.ts.map +1 -1
- package/dist/network/FetchClient.mjs +51 -32
- 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/operatingcontext/UnknownOperatingContext.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.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/lib/msal-browser.cjs +456 -325
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +456 -325
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +66 -66
- package/lib/types/broker/nativeBroker/NativeRequest.d.ts +1 -0
- package/lib/types/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/controllers/StandardController.d.ts.map +1 -1
- package/lib/types/crypto/BrowserCrypto.d.ts +2 -2
- package/lib/types/crypto/BrowserCrypto.d.ts.map +1 -1
- package/lib/types/error/BrowserAuthError.d.ts +4 -2
- package/lib/types/error/BrowserAuthError.d.ts.map +1 -1
- package/lib/types/error/BrowserAuthErrorCodes.d.ts +2 -0
- package/lib/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/lib/types/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/lib/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/lib/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
- package/lib/types/network/FetchClient.d.ts +0 -6
- package/lib/types/network/FetchClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/package.json +3 -3
- package/src/broker/nativeBroker/NativeRequest.ts +1 -0
- package/src/config/Configuration.ts +3 -1
- package/src/controllers/StandardController.ts +0 -7
- package/src/crypto/BrowserCrypto.ts +15 -6
- package/src/crypto/CryptoOps.ts +1 -1
- package/src/error/BrowserAuthError.ts +11 -4
- package/src/error/BrowserAuthErrorCodes.ts +2 -0
- package/src/interaction_client/BaseInteractionClient.ts +1 -4
- package/src/interaction_client/NativeInteractionClient.ts +35 -25
- package/src/interaction_client/StandardInteractionClient.ts +1 -0
- package/src/naa/mapping/NestedAppAuthAdapter.ts +4 -5
- package/src/network/FetchClient.ts +67 -40
- package/src/packageMetadata.ts +1 -1
package/lib/msal-browser.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.27.0 2024-11-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v14.
|
|
5
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6
6
|
/*
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
@@ -97,6 +97,7 @@ const OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES, Constants.EMAIL_SCOPE];
|
|
|
97
97
|
*/
|
|
98
98
|
const HeaderNames = {
|
|
99
99
|
CONTENT_TYPE: "Content-Type",
|
|
100
|
+
CONTENT_LENGTH: "Content-Length",
|
|
100
101
|
RETRY_AFTER: "Retry-After",
|
|
101
102
|
CCS_HEADER: "X-AnchorMailbox",
|
|
102
103
|
WWWAuthenticate: "WWW-Authenticate",
|
|
@@ -311,7 +312,7 @@ const JsonWebTokenTypes = {
|
|
|
311
312
|
// Token renewal offset default in seconds
|
|
312
313
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
313
314
|
|
|
314
|
-
/*! @azure/msal-common v14.
|
|
315
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
315
316
|
/*
|
|
316
317
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
317
318
|
* Licensed under the MIT License.
|
|
@@ -328,7 +329,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
328
329
|
unexpectedError: unexpectedError
|
|
329
330
|
});
|
|
330
331
|
|
|
331
|
-
/*! @azure/msal-common v14.
|
|
332
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
332
333
|
|
|
333
334
|
/*
|
|
334
335
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -377,7 +378,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
377
378
|
: AuthErrorMessages[code]);
|
|
378
379
|
}
|
|
379
380
|
|
|
380
|
-
/*! @azure/msal-common v14.
|
|
381
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
381
382
|
/*
|
|
382
383
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
383
384
|
* Licensed under the MIT License.
|
|
@@ -475,7 +476,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
475
476
|
userTimeoutReached: userTimeoutReached
|
|
476
477
|
});
|
|
477
478
|
|
|
478
|
-
/*! @azure/msal-common v14.
|
|
479
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
479
480
|
|
|
480
481
|
/*
|
|
481
482
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -727,7 +728,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
727
728
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
728
729
|
}
|
|
729
730
|
|
|
730
|
-
/*! @azure/msal-common v14.
|
|
731
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
731
732
|
|
|
732
733
|
/*
|
|
733
734
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -766,7 +767,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
766
767
|
},
|
|
767
768
|
};
|
|
768
769
|
|
|
769
|
-
/*! @azure/msal-common v14.
|
|
770
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
770
771
|
|
|
771
772
|
/*
|
|
772
773
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -957,12 +958,12 @@ class Logger {
|
|
|
957
958
|
}
|
|
958
959
|
}
|
|
959
960
|
|
|
960
|
-
/*! @azure/msal-common v14.
|
|
961
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
961
962
|
/* eslint-disable header/header */
|
|
962
963
|
const name$1 = "@azure/msal-common";
|
|
963
|
-
const version$1 = "14.
|
|
964
|
+
const version$1 = "14.16.0";
|
|
964
965
|
|
|
965
|
-
/*! @azure/msal-common v14.
|
|
966
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
966
967
|
/*
|
|
967
968
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
968
969
|
* Licensed under the MIT License.
|
|
@@ -982,7 +983,7 @@ const AzureCloudInstance = {
|
|
|
982
983
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
983
984
|
};
|
|
984
985
|
|
|
985
|
-
/*! @azure/msal-common v14.
|
|
986
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
986
987
|
|
|
987
988
|
/*
|
|
988
989
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1043,7 +1044,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1043
1044
|
}
|
|
1044
1045
|
}
|
|
1045
1046
|
|
|
1046
|
-
/*! @azure/msal-common v14.
|
|
1047
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1047
1048
|
/*
|
|
1048
1049
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1049
1050
|
* Licensed under the MIT License.
|
|
@@ -1080,7 +1081,7 @@ function wasClockTurnedBack(cachedAt) {
|
|
|
1080
1081
|
return cachedAtSec > nowSeconds();
|
|
1081
1082
|
}
|
|
1082
1083
|
|
|
1083
|
-
/*! @azure/msal-common v14.
|
|
1084
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1084
1085
|
|
|
1085
1086
|
/*
|
|
1086
1087
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1407,7 +1408,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
1407
1408
|
return metadata.expiresAt <= nowSeconds();
|
|
1408
1409
|
}
|
|
1409
1410
|
|
|
1410
|
-
/*! @azure/msal-common v14.
|
|
1411
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1411
1412
|
/*
|
|
1412
1413
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1413
1414
|
* Licensed under the MIT License.
|
|
@@ -1461,7 +1462,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1461
1462
|
urlParseError: urlParseError
|
|
1462
1463
|
});
|
|
1463
1464
|
|
|
1464
|
-
/*! @azure/msal-common v14.
|
|
1465
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1465
1466
|
|
|
1466
1467
|
/*
|
|
1467
1468
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1599,7 +1600,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1599
1600
|
return new ClientConfigurationError(errorCode);
|
|
1600
1601
|
}
|
|
1601
1602
|
|
|
1602
|
-
/*! @azure/msal-common v14.
|
|
1603
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1603
1604
|
/*
|
|
1604
1605
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1605
1606
|
* Licensed under the MIT License.
|
|
@@ -1696,7 +1697,7 @@ class StringUtils {
|
|
|
1696
1697
|
}
|
|
1697
1698
|
}
|
|
1698
1699
|
|
|
1699
|
-
/*! @azure/msal-common v14.
|
|
1700
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1700
1701
|
|
|
1701
1702
|
/*
|
|
1702
1703
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1896,7 +1897,7 @@ class ScopeSet {
|
|
|
1896
1897
|
}
|
|
1897
1898
|
}
|
|
1898
1899
|
|
|
1899
|
-
/*! @azure/msal-common v14.
|
|
1900
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1900
1901
|
|
|
1901
1902
|
/*
|
|
1902
1903
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1936,7 +1937,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
1936
1937
|
};
|
|
1937
1938
|
}
|
|
1938
1939
|
|
|
1939
|
-
/*! @azure/msal-common v14.
|
|
1940
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1940
1941
|
/*
|
|
1941
1942
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1942
1943
|
* Licensed under the MIT License.
|
|
@@ -2015,7 +2016,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2015
2016
|
return updatedAccountInfo;
|
|
2016
2017
|
}
|
|
2017
2018
|
|
|
2018
|
-
/*! @azure/msal-common v14.
|
|
2019
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2019
2020
|
/*
|
|
2020
2021
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2021
2022
|
* Licensed under the MIT License.
|
|
@@ -2030,7 +2031,7 @@ const AuthorityType = {
|
|
|
2030
2031
|
Ciam: 3,
|
|
2031
2032
|
};
|
|
2032
2033
|
|
|
2033
|
-
/*! @azure/msal-common v14.
|
|
2034
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2034
2035
|
/*
|
|
2035
2036
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2036
2037
|
* Licensed under the MIT License.
|
|
@@ -2052,7 +2053,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2052
2053
|
return null;
|
|
2053
2054
|
}
|
|
2054
2055
|
|
|
2055
|
-
/*! @azure/msal-common v14.
|
|
2056
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2056
2057
|
/*
|
|
2057
2058
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2058
2059
|
* Licensed under the MIT License.
|
|
@@ -2065,7 +2066,7 @@ const ProtocolMode = {
|
|
|
2065
2066
|
OIDC: "OIDC",
|
|
2066
2067
|
};
|
|
2067
2068
|
|
|
2068
|
-
/*! @azure/msal-common v14.
|
|
2069
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2069
2070
|
|
|
2070
2071
|
/*
|
|
2071
2072
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2308,7 +2309,7 @@ class AccountEntity {
|
|
|
2308
2309
|
}
|
|
2309
2310
|
}
|
|
2310
2311
|
|
|
2311
|
-
/*! @azure/msal-common v14.
|
|
2312
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2312
2313
|
|
|
2313
2314
|
/*
|
|
2314
2315
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2355,7 +2356,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2355
2356
|
return null;
|
|
2356
2357
|
}
|
|
2357
2358
|
|
|
2358
|
-
/*! @azure/msal-common v14.
|
|
2359
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2359
2360
|
|
|
2360
2361
|
/*
|
|
2361
2362
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2519,7 +2520,7 @@ class UrlString {
|
|
|
2519
2520
|
}
|
|
2520
2521
|
}
|
|
2521
2522
|
|
|
2522
|
-
/*! @azure/msal-common v14.
|
|
2523
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2523
2524
|
|
|
2524
2525
|
/*
|
|
2525
2526
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2659,7 +2660,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2659
2660
|
return null;
|
|
2660
2661
|
}
|
|
2661
2662
|
|
|
2662
|
-
/*! @azure/msal-common v14.
|
|
2663
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2663
2664
|
/*
|
|
2664
2665
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2665
2666
|
* Licensed under the MIT License.
|
|
@@ -2667,7 +2668,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2667
2668
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2668
2669
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2669
2670
|
|
|
2670
|
-
/*! @azure/msal-common v14.
|
|
2671
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2671
2672
|
|
|
2672
2673
|
/*
|
|
2673
2674
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2694,7 +2695,7 @@ class CacheError extends Error {
|
|
|
2694
2695
|
}
|
|
2695
2696
|
}
|
|
2696
2697
|
|
|
2697
|
-
/*! @azure/msal-common v14.
|
|
2698
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2698
2699
|
|
|
2699
2700
|
/*
|
|
2700
2701
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3935,9 +3936,6 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3935
3936
|
getTokenKeys() {
|
|
3936
3937
|
throw createClientAuthError(methodNotImplemented);
|
|
3937
3938
|
}
|
|
3938
|
-
async clear() {
|
|
3939
|
-
throw createClientAuthError(methodNotImplemented);
|
|
3940
|
-
}
|
|
3941
3939
|
updateCredentialCacheKey() {
|
|
3942
3940
|
throw createClientAuthError(methodNotImplemented);
|
|
3943
3941
|
}
|
|
@@ -3946,7 +3944,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3946
3944
|
}
|
|
3947
3945
|
}
|
|
3948
3946
|
|
|
3949
|
-
/*! @azure/msal-common v14.
|
|
3947
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
3950
3948
|
|
|
3951
3949
|
/*
|
|
3952
3950
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4045,161 +4043,7 @@ function isOidcProtocolMode(config) {
|
|
|
4045
4043
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4046
4044
|
}
|
|
4047
4045
|
|
|
4048
|
-
/*! @azure/msal-common v14.
|
|
4049
|
-
|
|
4050
|
-
/*
|
|
4051
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4052
|
-
* Licensed under the MIT License.
|
|
4053
|
-
*/
|
|
4054
|
-
/**
|
|
4055
|
-
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
4056
|
-
*/
|
|
4057
|
-
class ServerError extends AuthError {
|
|
4058
|
-
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
4059
|
-
super(errorCode, errorMessage, subError);
|
|
4060
|
-
this.name = "ServerError";
|
|
4061
|
-
this.errorNo = errorNo;
|
|
4062
|
-
this.status = status;
|
|
4063
|
-
Object.setPrototypeOf(this, ServerError.prototype);
|
|
4064
|
-
}
|
|
4065
|
-
}
|
|
4066
|
-
|
|
4067
|
-
/*! @azure/msal-common v14.15.0 2024-10-08 */
|
|
4068
|
-
|
|
4069
|
-
/*
|
|
4070
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4071
|
-
* Licensed under the MIT License.
|
|
4072
|
-
*/
|
|
4073
|
-
/** @internal */
|
|
4074
|
-
class ThrottlingUtils {
|
|
4075
|
-
/**
|
|
4076
|
-
* Prepares a RequestThumbprint to be stored as a key.
|
|
4077
|
-
* @param thumbprint
|
|
4078
|
-
*/
|
|
4079
|
-
static generateThrottlingStorageKey(thumbprint) {
|
|
4080
|
-
return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;
|
|
4081
|
-
}
|
|
4082
|
-
/**
|
|
4083
|
-
* Performs necessary throttling checks before a network request.
|
|
4084
|
-
* @param cacheManager
|
|
4085
|
-
* @param thumbprint
|
|
4086
|
-
*/
|
|
4087
|
-
static preProcess(cacheManager, thumbprint) {
|
|
4088
|
-
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
4089
|
-
const value = cacheManager.getThrottlingCache(key);
|
|
4090
|
-
if (value) {
|
|
4091
|
-
if (value.throttleTime < Date.now()) {
|
|
4092
|
-
cacheManager.removeItem(key);
|
|
4093
|
-
return;
|
|
4094
|
-
}
|
|
4095
|
-
throw new ServerError(value.errorCodes?.join(" ") || Constants.EMPTY_STRING, value.errorMessage, value.subError);
|
|
4096
|
-
}
|
|
4097
|
-
}
|
|
4098
|
-
/**
|
|
4099
|
-
* Performs necessary throttling checks after a network request.
|
|
4100
|
-
* @param cacheManager
|
|
4101
|
-
* @param thumbprint
|
|
4102
|
-
* @param response
|
|
4103
|
-
*/
|
|
4104
|
-
static postProcess(cacheManager, thumbprint, response) {
|
|
4105
|
-
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
4106
|
-
ThrottlingUtils.checkResponseForRetryAfter(response)) {
|
|
4107
|
-
const thumbprintValue = {
|
|
4108
|
-
throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),
|
|
4109
|
-
error: response.body.error,
|
|
4110
|
-
errorCodes: response.body.error_codes,
|
|
4111
|
-
errorMessage: response.body.error_description,
|
|
4112
|
-
subError: response.body.suberror,
|
|
4113
|
-
};
|
|
4114
|
-
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
|
|
4115
|
-
}
|
|
4116
|
-
}
|
|
4117
|
-
/**
|
|
4118
|
-
* Checks a NetworkResponse object's status codes against 429 or 5xx
|
|
4119
|
-
* @param response
|
|
4120
|
-
*/
|
|
4121
|
-
static checkResponseStatus(response) {
|
|
4122
|
-
return (response.status === 429 ||
|
|
4123
|
-
(response.status >= 500 && response.status < 600));
|
|
4124
|
-
}
|
|
4125
|
-
/**
|
|
4126
|
-
* Checks a NetworkResponse object's RetryAfter header
|
|
4127
|
-
* @param response
|
|
4128
|
-
*/
|
|
4129
|
-
static checkResponseForRetryAfter(response) {
|
|
4130
|
-
if (response.headers) {
|
|
4131
|
-
return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&
|
|
4132
|
-
(response.status < 200 || response.status >= 300));
|
|
4133
|
-
}
|
|
4134
|
-
return false;
|
|
4135
|
-
}
|
|
4136
|
-
/**
|
|
4137
|
-
* Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
|
|
4138
|
-
* @param throttleTime
|
|
4139
|
-
*/
|
|
4140
|
-
static calculateThrottleTime(throttleTime) {
|
|
4141
|
-
const time = throttleTime <= 0 ? 0 : throttleTime;
|
|
4142
|
-
const currentSeconds = Date.now() / 1000;
|
|
4143
|
-
return Math.floor(Math.min(currentSeconds +
|
|
4144
|
-
(time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds +
|
|
4145
|
-
ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);
|
|
4146
|
-
}
|
|
4147
|
-
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
4148
|
-
const thumbprint = {
|
|
4149
|
-
clientId: clientId,
|
|
4150
|
-
authority: request.authority,
|
|
4151
|
-
scopes: request.scopes,
|
|
4152
|
-
homeAccountIdentifier: homeAccountIdentifier,
|
|
4153
|
-
claims: request.claims,
|
|
4154
|
-
authenticationScheme: request.authenticationScheme,
|
|
4155
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
4156
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
4157
|
-
shrClaims: request.shrClaims,
|
|
4158
|
-
sshKid: request.sshKid,
|
|
4159
|
-
};
|
|
4160
|
-
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
4161
|
-
cacheManager.removeItem(key);
|
|
4162
|
-
}
|
|
4163
|
-
}
|
|
4164
|
-
|
|
4165
|
-
/*! @azure/msal-common v14.15.0 2024-10-08 */
|
|
4166
|
-
|
|
4167
|
-
/*
|
|
4168
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4169
|
-
* Licensed under the MIT License.
|
|
4170
|
-
*/
|
|
4171
|
-
/** @internal */
|
|
4172
|
-
class NetworkManager {
|
|
4173
|
-
constructor(networkClient, cacheManager) {
|
|
4174
|
-
this.networkClient = networkClient;
|
|
4175
|
-
this.cacheManager = cacheManager;
|
|
4176
|
-
}
|
|
4177
|
-
/**
|
|
4178
|
-
* Wraps sendPostRequestAsync with necessary preflight and postflight logic
|
|
4179
|
-
* @param thumbprint
|
|
4180
|
-
* @param tokenEndpoint
|
|
4181
|
-
* @param options
|
|
4182
|
-
*/
|
|
4183
|
-
async sendPostRequest(thumbprint, tokenEndpoint, options) {
|
|
4184
|
-
ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
|
|
4185
|
-
let response;
|
|
4186
|
-
try {
|
|
4187
|
-
response = await this.networkClient.sendPostRequestAsync(tokenEndpoint, options);
|
|
4188
|
-
}
|
|
4189
|
-
catch (e) {
|
|
4190
|
-
if (e instanceof AuthError) {
|
|
4191
|
-
throw e;
|
|
4192
|
-
}
|
|
4193
|
-
else {
|
|
4194
|
-
throw createClientAuthError(networkError);
|
|
4195
|
-
}
|
|
4196
|
-
}
|
|
4197
|
-
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
|
|
4198
|
-
return response;
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
|
|
4202
|
-
/*! @azure/msal-common v14.15.0 2024-10-08 */
|
|
4046
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4203
4047
|
/*
|
|
4204
4048
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4205
4049
|
* Licensed under the MIT License.
|
|
@@ -4209,7 +4053,7 @@ const CcsCredentialType = {
|
|
|
4209
4053
|
UPN: "UPN",
|
|
4210
4054
|
};
|
|
4211
4055
|
|
|
4212
|
-
/*! @azure/msal-common v14.
|
|
4056
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4213
4057
|
/*
|
|
4214
4058
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4215
4059
|
* Licensed under the MIT License.
|
|
@@ -4255,9 +4099,11 @@ const LOGOUT_HINT = "logout_hint";
|
|
|
4255
4099
|
const SID = "sid";
|
|
4256
4100
|
const LOGIN_HINT = "login_hint";
|
|
4257
4101
|
const DOMAIN_HINT = "domain_hint";
|
|
4258
|
-
const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
4102
|
+
const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
4103
|
+
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4104
|
+
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4259
4105
|
|
|
4260
|
-
/*! @azure/msal-common v14.
|
|
4106
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4261
4107
|
|
|
4262
4108
|
/*
|
|
4263
4109
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4324,16 +4170,30 @@ class RequestValidator {
|
|
|
4324
4170
|
}
|
|
4325
4171
|
}
|
|
4326
4172
|
|
|
4327
|
-
/*! @azure/msal-common v14.
|
|
4173
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4328
4174
|
|
|
4329
4175
|
/*
|
|
4330
4176
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4331
4177
|
* Licensed under the MIT License.
|
|
4332
4178
|
*/
|
|
4179
|
+
function instrumentBrokerParams(parameters, correlationId, performanceClient) {
|
|
4180
|
+
if (!correlationId) {
|
|
4181
|
+
return;
|
|
4182
|
+
}
|
|
4183
|
+
const clientId = parameters.get(CLIENT_ID);
|
|
4184
|
+
if (clientId && parameters.has(BROKER_CLIENT_ID)) {
|
|
4185
|
+
performanceClient?.addFields({
|
|
4186
|
+
embeddedClientId: clientId,
|
|
4187
|
+
embeddedRedirectUri: parameters.get(REDIRECT_URI),
|
|
4188
|
+
}, correlationId);
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4333
4191
|
/** @internal */
|
|
4334
4192
|
class RequestParameterBuilder {
|
|
4335
|
-
constructor() {
|
|
4193
|
+
constructor(correlationId, performanceClient) {
|
|
4336
4194
|
this.parameters = new Map();
|
|
4195
|
+
this.performanceClient = performanceClient;
|
|
4196
|
+
this.correlationId = correlationId;
|
|
4337
4197
|
}
|
|
4338
4198
|
/**
|
|
4339
4199
|
* add response_type = code
|
|
@@ -4697,6 +4557,14 @@ class RequestParameterBuilder {
|
|
|
4697
4557
|
addLogoutHint(logoutHint) {
|
|
4698
4558
|
this.parameters.set(LOGOUT_HINT, encodeURIComponent(logoutHint));
|
|
4699
4559
|
}
|
|
4560
|
+
addBrokerParameters(params) {
|
|
4561
|
+
const brokerParams = {};
|
|
4562
|
+
brokerParams[BROKER_CLIENT_ID] =
|
|
4563
|
+
params.brokerClientId;
|
|
4564
|
+
brokerParams[BROKER_REDIRECT_URI] =
|
|
4565
|
+
params.brokerRedirectUri;
|
|
4566
|
+
this.addExtraQueryParameters(brokerParams);
|
|
4567
|
+
}
|
|
4700
4568
|
/**
|
|
4701
4569
|
* Utility to create a URL from the params map
|
|
4702
4570
|
*/
|
|
@@ -4705,11 +4573,12 @@ class RequestParameterBuilder {
|
|
|
4705
4573
|
this.parameters.forEach((value, key) => {
|
|
4706
4574
|
queryParameterArray.push(`${key}=${value}`);
|
|
4707
4575
|
});
|
|
4576
|
+
instrumentBrokerParams(this.parameters, this.correlationId, this.performanceClient);
|
|
4708
4577
|
return queryParameterArray.join("&");
|
|
4709
4578
|
}
|
|
4710
4579
|
}
|
|
4711
4580
|
|
|
4712
|
-
/*! @azure/msal-common v14.
|
|
4581
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4713
4582
|
/*
|
|
4714
4583
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4715
4584
|
* Licensed under the MIT License.
|
|
@@ -4721,7 +4590,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4721
4590
|
response.hasOwnProperty("jwks_uri"));
|
|
4722
4591
|
}
|
|
4723
4592
|
|
|
4724
|
-
/*! @azure/msal-common v14.
|
|
4593
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4725
4594
|
/*
|
|
4726
4595
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4727
4596
|
* Licensed under the MIT License.
|
|
@@ -4731,7 +4600,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4731
4600
|
response.hasOwnProperty("metadata"));
|
|
4732
4601
|
}
|
|
4733
4602
|
|
|
4734
|
-
/*! @azure/msal-common v14.
|
|
4603
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4735
4604
|
/*
|
|
4736
4605
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4737
4606
|
* Licensed under the MIT License.
|
|
@@ -4741,7 +4610,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4741
4610
|
response.hasOwnProperty("error_description"));
|
|
4742
4611
|
}
|
|
4743
4612
|
|
|
4744
|
-
/*! @azure/msal-common v14.
|
|
4613
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4745
4614
|
/*
|
|
4746
4615
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4747
4616
|
* Licensed under the MIT License.
|
|
@@ -4843,6 +4712,7 @@ const PerformanceEvents = {
|
|
|
4843
4712
|
/**
|
|
4844
4713
|
* Time spent sending/waiting for the response of a request to the token endpoint
|
|
4845
4714
|
*/
|
|
4715
|
+
NetworkClientSendPostRequestAsync: "networkClientSendPostRequestAsync",
|
|
4846
4716
|
RefreshTokenClientExecutePostToTokenEndpoint: "refreshTokenClientExecutePostToTokenEndpoint",
|
|
4847
4717
|
AuthorizationCodeClientExecutePostToTokenEndpoint: "authorizationCodeClientExecutePostToTokenEndpoint",
|
|
4848
4718
|
/**
|
|
@@ -5016,6 +4886,10 @@ const PerformanceEventAbbreviations = new Map([
|
|
|
5016
4886
|
PerformanceEvents.BaseClientCreateTokenRequestHeaders,
|
|
5017
4887
|
"BaseClientCreateTReqHead",
|
|
5018
4888
|
],
|
|
4889
|
+
[
|
|
4890
|
+
PerformanceEvents.NetworkClientSendPostRequestAsync,
|
|
4891
|
+
"NetClientSendPost",
|
|
4892
|
+
],
|
|
5019
4893
|
[
|
|
5020
4894
|
PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint,
|
|
5021
4895
|
"RTClientExecPost",
|
|
@@ -5223,7 +5097,7 @@ const IntFields = new Set([
|
|
|
5223
5097
|
"multiMatchedRT",
|
|
5224
5098
|
]);
|
|
5225
5099
|
|
|
5226
|
-
/*! @azure/msal-common v14.
|
|
5100
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
5227
5101
|
/*
|
|
5228
5102
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5229
5103
|
* Licensed under the MIT License.
|
|
@@ -5319,7 +5193,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5319
5193
|
};
|
|
5320
5194
|
};
|
|
5321
5195
|
|
|
5322
|
-
/*! @azure/msal-common v14.
|
|
5196
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
5323
5197
|
|
|
5324
5198
|
/*
|
|
5325
5199
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5428,7 +5302,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5428
5302
|
},
|
|
5429
5303
|
};
|
|
5430
5304
|
|
|
5431
|
-
/*! @azure/msal-common v14.
|
|
5305
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
5432
5306
|
|
|
5433
5307
|
/*
|
|
5434
5308
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6267,7 +6141,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
6267
6141
|
};
|
|
6268
6142
|
}
|
|
6269
6143
|
|
|
6270
|
-
/*! @azure/msal-common v14.
|
|
6144
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6271
6145
|
|
|
6272
6146
|
/*
|
|
6273
6147
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6298,7 +6172,154 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6298
6172
|
}
|
|
6299
6173
|
}
|
|
6300
6174
|
|
|
6301
|
-
/*! @azure/msal-common v14.
|
|
6175
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6176
|
+
|
|
6177
|
+
/*
|
|
6178
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6179
|
+
* Licensed under the MIT License.
|
|
6180
|
+
*/
|
|
6181
|
+
/**
|
|
6182
|
+
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
6183
|
+
*/
|
|
6184
|
+
class ServerError extends AuthError {
|
|
6185
|
+
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
6186
|
+
super(errorCode, errorMessage, subError);
|
|
6187
|
+
this.name = "ServerError";
|
|
6188
|
+
this.errorNo = errorNo;
|
|
6189
|
+
this.status = status;
|
|
6190
|
+
Object.setPrototypeOf(this, ServerError.prototype);
|
|
6191
|
+
}
|
|
6192
|
+
}
|
|
6193
|
+
|
|
6194
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6195
|
+
|
|
6196
|
+
/*
|
|
6197
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6198
|
+
* Licensed under the MIT License.
|
|
6199
|
+
*/
|
|
6200
|
+
/** @internal */
|
|
6201
|
+
class ThrottlingUtils {
|
|
6202
|
+
/**
|
|
6203
|
+
* Prepares a RequestThumbprint to be stored as a key.
|
|
6204
|
+
* @param thumbprint
|
|
6205
|
+
*/
|
|
6206
|
+
static generateThrottlingStorageKey(thumbprint) {
|
|
6207
|
+
return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;
|
|
6208
|
+
}
|
|
6209
|
+
/**
|
|
6210
|
+
* Performs necessary throttling checks before a network request.
|
|
6211
|
+
* @param cacheManager
|
|
6212
|
+
* @param thumbprint
|
|
6213
|
+
*/
|
|
6214
|
+
static preProcess(cacheManager, thumbprint) {
|
|
6215
|
+
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
6216
|
+
const value = cacheManager.getThrottlingCache(key);
|
|
6217
|
+
if (value) {
|
|
6218
|
+
if (value.throttleTime < Date.now()) {
|
|
6219
|
+
cacheManager.removeItem(key);
|
|
6220
|
+
return;
|
|
6221
|
+
}
|
|
6222
|
+
throw new ServerError(value.errorCodes?.join(" ") || Constants.EMPTY_STRING, value.errorMessage, value.subError);
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
/**
|
|
6226
|
+
* Performs necessary throttling checks after a network request.
|
|
6227
|
+
* @param cacheManager
|
|
6228
|
+
* @param thumbprint
|
|
6229
|
+
* @param response
|
|
6230
|
+
*/
|
|
6231
|
+
static postProcess(cacheManager, thumbprint, response) {
|
|
6232
|
+
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
6233
|
+
ThrottlingUtils.checkResponseForRetryAfter(response)) {
|
|
6234
|
+
const thumbprintValue = {
|
|
6235
|
+
throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),
|
|
6236
|
+
error: response.body.error,
|
|
6237
|
+
errorCodes: response.body.error_codes,
|
|
6238
|
+
errorMessage: response.body.error_description,
|
|
6239
|
+
subError: response.body.suberror,
|
|
6240
|
+
};
|
|
6241
|
+
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
|
|
6242
|
+
}
|
|
6243
|
+
}
|
|
6244
|
+
/**
|
|
6245
|
+
* Checks a NetworkResponse object's status codes against 429 or 5xx
|
|
6246
|
+
* @param response
|
|
6247
|
+
*/
|
|
6248
|
+
static checkResponseStatus(response) {
|
|
6249
|
+
return (response.status === 429 ||
|
|
6250
|
+
(response.status >= 500 && response.status < 600));
|
|
6251
|
+
}
|
|
6252
|
+
/**
|
|
6253
|
+
* Checks a NetworkResponse object's RetryAfter header
|
|
6254
|
+
* @param response
|
|
6255
|
+
*/
|
|
6256
|
+
static checkResponseForRetryAfter(response) {
|
|
6257
|
+
if (response.headers) {
|
|
6258
|
+
return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&
|
|
6259
|
+
(response.status < 200 || response.status >= 300));
|
|
6260
|
+
}
|
|
6261
|
+
return false;
|
|
6262
|
+
}
|
|
6263
|
+
/**
|
|
6264
|
+
* Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
|
|
6265
|
+
* @param throttleTime
|
|
6266
|
+
*/
|
|
6267
|
+
static calculateThrottleTime(throttleTime) {
|
|
6268
|
+
const time = throttleTime <= 0 ? 0 : throttleTime;
|
|
6269
|
+
const currentSeconds = Date.now() / 1000;
|
|
6270
|
+
return Math.floor(Math.min(currentSeconds +
|
|
6271
|
+
(time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds +
|
|
6272
|
+
ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);
|
|
6273
|
+
}
|
|
6274
|
+
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
6275
|
+
const thumbprint = {
|
|
6276
|
+
clientId: clientId,
|
|
6277
|
+
authority: request.authority,
|
|
6278
|
+
scopes: request.scopes,
|
|
6279
|
+
homeAccountIdentifier: homeAccountIdentifier,
|
|
6280
|
+
claims: request.claims,
|
|
6281
|
+
authenticationScheme: request.authenticationScheme,
|
|
6282
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
6283
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
6284
|
+
shrClaims: request.shrClaims,
|
|
6285
|
+
sshKid: request.sshKid,
|
|
6286
|
+
};
|
|
6287
|
+
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
6288
|
+
cacheManager.removeItem(key);
|
|
6289
|
+
}
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6292
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6293
|
+
|
|
6294
|
+
/*
|
|
6295
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6296
|
+
* Licensed under the MIT License.
|
|
6297
|
+
*/
|
|
6298
|
+
/**
|
|
6299
|
+
* Represents network related errors
|
|
6300
|
+
*/
|
|
6301
|
+
class NetworkError extends AuthError {
|
|
6302
|
+
constructor(error, httpStatus, responseHeaders) {
|
|
6303
|
+
super(error.errorCode, error.errorMessage, error.subError);
|
|
6304
|
+
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
6305
|
+
this.name = "NetworkError";
|
|
6306
|
+
this.error = error;
|
|
6307
|
+
this.httpStatus = httpStatus;
|
|
6308
|
+
this.responseHeaders = responseHeaders;
|
|
6309
|
+
}
|
|
6310
|
+
}
|
|
6311
|
+
/**
|
|
6312
|
+
* Creates NetworkError object for a failed network request
|
|
6313
|
+
* @param error - Error to be thrown back to the caller
|
|
6314
|
+
* @param httpStatus - Status code of the network request
|
|
6315
|
+
* @param responseHeaders - Response headers of the network request, when available
|
|
6316
|
+
* @returns NetworkError object
|
|
6317
|
+
*/
|
|
6318
|
+
function createNetworkError(error, httpStatus, responseHeaders) {
|
|
6319
|
+
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6320
|
+
}
|
|
6321
|
+
|
|
6322
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6302
6323
|
|
|
6303
6324
|
/*
|
|
6304
6325
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6320,8 +6341,6 @@ class BaseClient {
|
|
|
6320
6341
|
this.cacheManager = this.config.storageInterface;
|
|
6321
6342
|
// Set the network interface
|
|
6322
6343
|
this.networkClient = this.config.networkInterface;
|
|
6323
|
-
// Set the NetworkManager
|
|
6324
|
-
this.networkManager = new NetworkManager(this.networkClient, this.cacheManager);
|
|
6325
6344
|
// Set TelemetryManager
|
|
6326
6345
|
this.serverTelemetryManager = this.config.serverTelemetryManager;
|
|
6327
6346
|
// set Authority
|
|
@@ -6365,11 +6384,7 @@ class BaseClient {
|
|
|
6365
6384
|
if (queuedEvent) {
|
|
6366
6385
|
this.performanceClient?.addQueueMeasurement(queuedEvent, correlationId);
|
|
6367
6386
|
}
|
|
6368
|
-
const response = await this.
|
|
6369
|
-
this.performanceClient?.addFields({
|
|
6370
|
-
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
6371
|
-
httpVerToken: response.headers?.[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
6372
|
-
}, correlationId);
|
|
6387
|
+
const response = await this.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers }, correlationId);
|
|
6373
6388
|
if (this.config.serverTelemetryManager &&
|
|
6374
6389
|
response.status < 500 &&
|
|
6375
6390
|
response.status !== 429) {
|
|
@@ -6378,6 +6393,52 @@ class BaseClient {
|
|
|
6378
6393
|
}
|
|
6379
6394
|
return response;
|
|
6380
6395
|
}
|
|
6396
|
+
/**
|
|
6397
|
+
* Wraps sendPostRequestAsync with necessary preflight and postflight logic
|
|
6398
|
+
* @param thumbprint - Request thumbprint for throttling
|
|
6399
|
+
* @param tokenEndpoint - Endpoint to make the POST to
|
|
6400
|
+
* @param options - Body and Headers to include on the POST request
|
|
6401
|
+
* @param correlationId - CorrelationId for telemetry
|
|
6402
|
+
*/
|
|
6403
|
+
async sendPostRequest(thumbprint, tokenEndpoint, options, correlationId) {
|
|
6404
|
+
ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
|
|
6405
|
+
let response;
|
|
6406
|
+
try {
|
|
6407
|
+
response = await invokeAsync((this.networkClient.sendPostRequestAsync.bind(this.networkClient)), PerformanceEvents.NetworkClientSendPostRequestAsync, this.logger, this.performanceClient, correlationId)(tokenEndpoint, options);
|
|
6408
|
+
const responseHeaders = response.headers || {};
|
|
6409
|
+
this.performanceClient?.addFields({
|
|
6410
|
+
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
6411
|
+
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
6412
|
+
requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] || "",
|
|
6413
|
+
}, correlationId);
|
|
6414
|
+
}
|
|
6415
|
+
catch (e) {
|
|
6416
|
+
if (e instanceof NetworkError) {
|
|
6417
|
+
const responseHeaders = e.responseHeaders;
|
|
6418
|
+
if (responseHeaders) {
|
|
6419
|
+
this.performanceClient?.addFields({
|
|
6420
|
+
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
6421
|
+
requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] ||
|
|
6422
|
+
"",
|
|
6423
|
+
contentTypeHeader: responseHeaders[HeaderNames.CONTENT_TYPE] ||
|
|
6424
|
+
undefined,
|
|
6425
|
+
contentLengthHeader: responseHeaders[HeaderNames.CONTENT_LENGTH] ||
|
|
6426
|
+
undefined,
|
|
6427
|
+
httpStatus: e.httpStatus,
|
|
6428
|
+
}, correlationId);
|
|
6429
|
+
}
|
|
6430
|
+
throw e.error;
|
|
6431
|
+
}
|
|
6432
|
+
if (e instanceof AuthError) {
|
|
6433
|
+
throw e;
|
|
6434
|
+
}
|
|
6435
|
+
else {
|
|
6436
|
+
throw createClientAuthError(networkError);
|
|
6437
|
+
}
|
|
6438
|
+
}
|
|
6439
|
+
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
|
|
6440
|
+
return response;
|
|
6441
|
+
}
|
|
6381
6442
|
/**
|
|
6382
6443
|
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
6383
6444
|
* @param updatedAuthority
|
|
@@ -6393,15 +6454,22 @@ class BaseClient {
|
|
|
6393
6454
|
* @param request
|
|
6394
6455
|
*/
|
|
6395
6456
|
createTokenQueryParameters(request) {
|
|
6396
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
6457
|
+
const parameterBuilder = new RequestParameterBuilder(request.correlationId, this.performanceClient);
|
|
6458
|
+
if (request.embeddedClientId) {
|
|
6459
|
+
parameterBuilder.addBrokerParameters({
|
|
6460
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
6461
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
6462
|
+
});
|
|
6463
|
+
}
|
|
6397
6464
|
if (request.tokenQueryParameters) {
|
|
6398
6465
|
parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);
|
|
6399
6466
|
}
|
|
6467
|
+
parameterBuilder.addCorrelationId(request.correlationId);
|
|
6400
6468
|
return parameterBuilder.createQueryString();
|
|
6401
6469
|
}
|
|
6402
6470
|
}
|
|
6403
6471
|
|
|
6404
|
-
/*! @azure/msal-common v14.
|
|
6472
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6405
6473
|
/*
|
|
6406
6474
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6407
6475
|
* Licensed under the MIT License.
|
|
@@ -6427,7 +6495,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6427
6495
|
refreshTokenExpired: refreshTokenExpired
|
|
6428
6496
|
});
|
|
6429
6497
|
|
|
6430
|
-
/*! @azure/msal-common v14.
|
|
6498
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6431
6499
|
|
|
6432
6500
|
/*
|
|
6433
6501
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6515,7 +6583,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6515
6583
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6516
6584
|
}
|
|
6517
6585
|
|
|
6518
|
-
/*! @azure/msal-common v14.
|
|
6586
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6519
6587
|
|
|
6520
6588
|
/*
|
|
6521
6589
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6587,7 +6655,7 @@ class ProtocolUtils {
|
|
|
6587
6655
|
}
|
|
6588
6656
|
}
|
|
6589
6657
|
|
|
6590
|
-
/*! @azure/msal-common v14.
|
|
6658
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6591
6659
|
|
|
6592
6660
|
/*
|
|
6593
6661
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6671,7 +6739,7 @@ class PopTokenGenerator {
|
|
|
6671
6739
|
}
|
|
6672
6740
|
}
|
|
6673
6741
|
|
|
6674
|
-
/*! @azure/msal-common v14.
|
|
6742
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6675
6743
|
/*
|
|
6676
6744
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6677
6745
|
* Licensed under the MIT License.
|
|
@@ -6698,7 +6766,7 @@ class PopTokenGenerator {
|
|
|
6698
6766
|
}
|
|
6699
6767
|
}
|
|
6700
6768
|
|
|
6701
|
-
/*! @azure/msal-common v14.
|
|
6769
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6702
6770
|
|
|
6703
6771
|
/*
|
|
6704
6772
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7075,7 +7143,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
7075
7143
|
return baseAccount;
|
|
7076
7144
|
}
|
|
7077
7145
|
|
|
7078
|
-
/*! @azure/msal-common v14.
|
|
7146
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7079
7147
|
/*
|
|
7080
7148
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7081
7149
|
* Licensed under the MIT License.
|
|
@@ -7093,7 +7161,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
7093
7161
|
}
|
|
7094
7162
|
}
|
|
7095
7163
|
|
|
7096
|
-
/*! @azure/msal-common v14.
|
|
7164
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7097
7165
|
|
|
7098
7166
|
/*
|
|
7099
7167
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7219,8 +7287,9 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7219
7287
|
*/
|
|
7220
7288
|
async createTokenRequestBody(request) {
|
|
7221
7289
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
|
|
7222
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
7223
|
-
parameterBuilder.addClientId(request.
|
|
7290
|
+
const parameterBuilder = new RequestParameterBuilder(request.correlationId, this.performanceClient);
|
|
7291
|
+
parameterBuilder.addClientId(request.embeddedClientId ||
|
|
7292
|
+
request.tokenBodyParameters?.[CLIENT_ID] ||
|
|
7224
7293
|
this.config.authOptions.clientId);
|
|
7225
7294
|
/*
|
|
7226
7295
|
* For hybrid spa flow, there will be a code but no verifier
|
|
@@ -7280,9 +7349,6 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7280
7349
|
throw createClientConfigurationError(missingSshJwk);
|
|
7281
7350
|
}
|
|
7282
7351
|
}
|
|
7283
|
-
const correlationId = request.correlationId ||
|
|
7284
|
-
this.config.cryptoInterface.createNewGuid();
|
|
7285
|
-
parameterBuilder.addCorrelationId(correlationId);
|
|
7286
7352
|
if (!StringUtils.isEmptyObj(request.claims) ||
|
|
7287
7353
|
(this.config.authOptions.clientCapabilities &&
|
|
7288
7354
|
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
@@ -7322,6 +7388,12 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7322
7388
|
break;
|
|
7323
7389
|
}
|
|
7324
7390
|
}
|
|
7391
|
+
if (request.embeddedClientId) {
|
|
7392
|
+
parameterBuilder.addBrokerParameters({
|
|
7393
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
7394
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
7395
|
+
});
|
|
7396
|
+
}
|
|
7325
7397
|
if (request.tokenBodyParameters) {
|
|
7326
7398
|
parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
|
|
7327
7399
|
}
|
|
@@ -7340,9 +7412,13 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7340
7412
|
* @param request
|
|
7341
7413
|
*/
|
|
7342
7414
|
async createAuthCodeUrlQueryString(request) {
|
|
7343
|
-
|
|
7344
|
-
const
|
|
7345
|
-
|
|
7415
|
+
// generate the correlationId if not set by the user and add
|
|
7416
|
+
const correlationId = request.correlationId ||
|
|
7417
|
+
this.config.cryptoInterface.createNewGuid();
|
|
7418
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, correlationId);
|
|
7419
|
+
const parameterBuilder = new RequestParameterBuilder(correlationId, this.performanceClient);
|
|
7420
|
+
parameterBuilder.addClientId(request.embeddedClientId ||
|
|
7421
|
+
request.extraQueryParameters?.[CLIENT_ID] ||
|
|
7346
7422
|
this.config.authOptions.clientId);
|
|
7347
7423
|
const requestScopes = [
|
|
7348
7424
|
...(request.scopes || []),
|
|
@@ -7351,9 +7427,6 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7351
7427
|
parameterBuilder.addScopes(requestScopes, true, this.oidcDefaultScopes);
|
|
7352
7428
|
// validate the redirectUri (to be a non null value)
|
|
7353
7429
|
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
7354
|
-
// generate the correlationId if not set by the user and add
|
|
7355
|
-
const correlationId = request.correlationId ||
|
|
7356
|
-
this.config.cryptoInterface.createNewGuid();
|
|
7357
7430
|
parameterBuilder.addCorrelationId(correlationId);
|
|
7358
7431
|
// add response_mode. If not passed in it defaults to query.
|
|
7359
7432
|
parameterBuilder.addResponseMode(request.responseMode);
|
|
@@ -7455,6 +7528,12 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7455
7528
|
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
7456
7529
|
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
7457
7530
|
}
|
|
7531
|
+
if (request.embeddedClientId) {
|
|
7532
|
+
parameterBuilder.addBrokerParameters({
|
|
7533
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
7534
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
7535
|
+
});
|
|
7536
|
+
}
|
|
7458
7537
|
this.addExtraQueryParams(request, parameterBuilder);
|
|
7459
7538
|
if (request.nativeBroker) {
|
|
7460
7539
|
// signal ests that this is a WAM call
|
|
@@ -7481,7 +7560,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7481
7560
|
* @param request
|
|
7482
7561
|
*/
|
|
7483
7562
|
createLogoutUrlQueryString(request) {
|
|
7484
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
7563
|
+
const parameterBuilder = new RequestParameterBuilder(request.correlationId, this.performanceClient);
|
|
7485
7564
|
if (request.postLogoutRedirectUri) {
|
|
7486
7565
|
parameterBuilder.addPostLogoutRedirectUri(request.postLogoutRedirectUri);
|
|
7487
7566
|
}
|
|
@@ -7524,7 +7603,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7524
7603
|
}
|
|
7525
7604
|
}
|
|
7526
7605
|
|
|
7527
|
-
/*! @azure/msal-common v14.
|
|
7606
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7528
7607
|
|
|
7529
7608
|
/*
|
|
7530
7609
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7662,8 +7741,9 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7662
7741
|
async createTokenRequestBody(request) {
|
|
7663
7742
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
|
|
7664
7743
|
const correlationId = request.correlationId;
|
|
7665
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
7666
|
-
parameterBuilder.addClientId(request.
|
|
7744
|
+
const parameterBuilder = new RequestParameterBuilder(correlationId, this.performanceClient);
|
|
7745
|
+
parameterBuilder.addClientId(request.embeddedClientId ||
|
|
7746
|
+
request.tokenBodyParameters?.[CLIENT_ID] ||
|
|
7667
7747
|
this.config.authOptions.clientId);
|
|
7668
7748
|
if (request.redirectUri) {
|
|
7669
7749
|
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
@@ -7677,7 +7757,6 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7677
7757
|
if (this.serverTelemetryManager && !isOidcProtocolMode(this.config)) {
|
|
7678
7758
|
parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
|
|
7679
7759
|
}
|
|
7680
|
-
parameterBuilder.addCorrelationId(correlationId);
|
|
7681
7760
|
parameterBuilder.addRefreshToken(request.refreshToken);
|
|
7682
7761
|
if (this.config.clientCredentials.clientSecret) {
|
|
7683
7762
|
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
@@ -7731,6 +7810,12 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7731
7810
|
break;
|
|
7732
7811
|
}
|
|
7733
7812
|
}
|
|
7813
|
+
if (request.embeddedClientId) {
|
|
7814
|
+
parameterBuilder.addBrokerParameters({
|
|
7815
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
7816
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
7817
|
+
});
|
|
7818
|
+
}
|
|
7734
7819
|
if (request.tokenBodyParameters) {
|
|
7735
7820
|
parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
|
|
7736
7821
|
}
|
|
@@ -7738,7 +7823,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7738
7823
|
}
|
|
7739
7824
|
}
|
|
7740
7825
|
|
|
7741
|
-
/*! @azure/msal-common v14.
|
|
7826
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7742
7827
|
|
|
7743
7828
|
/*
|
|
7744
7829
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7874,7 +7959,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7874
7959
|
}
|
|
7875
7960
|
}
|
|
7876
7961
|
|
|
7877
|
-
/*! @azure/msal-common v14.
|
|
7962
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7878
7963
|
|
|
7879
7964
|
/*
|
|
7880
7965
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7889,7 +7974,7 @@ const StubbedNetworkModule = {
|
|
|
7889
7974
|
},
|
|
7890
7975
|
};
|
|
7891
7976
|
|
|
7892
|
-
/*! @azure/msal-common v14.
|
|
7977
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7893
7978
|
|
|
7894
7979
|
/*
|
|
7895
7980
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7947,7 +8032,7 @@ class AuthenticationHeaderParser {
|
|
|
7947
8032
|
}
|
|
7948
8033
|
}
|
|
7949
8034
|
|
|
7950
|
-
/*! @azure/msal-common v14.
|
|
8035
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7951
8036
|
|
|
7952
8037
|
/*
|
|
7953
8038
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8210,7 +8295,7 @@ class ServerTelemetryManager {
|
|
|
8210
8295
|
}
|
|
8211
8296
|
}
|
|
8212
8297
|
|
|
8213
|
-
/*! @azure/msal-common v14.
|
|
8298
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8214
8299
|
/*
|
|
8215
8300
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8216
8301
|
* Licensed under the MIT License.
|
|
@@ -8218,7 +8303,7 @@ class ServerTelemetryManager {
|
|
|
8218
8303
|
const missingKidError = "missing_kid_error";
|
|
8219
8304
|
const missingAlgError = "missing_alg_error";
|
|
8220
8305
|
|
|
8221
|
-
/*! @azure/msal-common v14.
|
|
8306
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8222
8307
|
|
|
8223
8308
|
/*
|
|
8224
8309
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8243,7 +8328,7 @@ function createJoseHeaderError(code) {
|
|
|
8243
8328
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
8244
8329
|
}
|
|
8245
8330
|
|
|
8246
|
-
/*! @azure/msal-common v14.
|
|
8331
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8247
8332
|
|
|
8248
8333
|
/*
|
|
8249
8334
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8283,7 +8368,7 @@ class JoseHeader {
|
|
|
8283
8368
|
}
|
|
8284
8369
|
}
|
|
8285
8370
|
|
|
8286
|
-
/*! @azure/msal-common v14.
|
|
8371
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8287
8372
|
|
|
8288
8373
|
/*
|
|
8289
8374
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8362,7 +8447,7 @@ class StubPerformanceClient {
|
|
|
8362
8447
|
}
|
|
8363
8448
|
}
|
|
8364
8449
|
|
|
8365
|
-
/*! @azure/msal-common v14.
|
|
8450
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8366
8451
|
|
|
8367
8452
|
/*
|
|
8368
8453
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8494,18 +8579,30 @@ function compactStack(stack, stackMaxSize) {
|
|
|
8494
8579
|
return [];
|
|
8495
8580
|
}
|
|
8496
8581
|
const stackArr = stack.split("\n") || [];
|
|
8497
|
-
if (stackArr.length < 2) {
|
|
8498
|
-
return [];
|
|
8499
|
-
}
|
|
8500
8582
|
const res = [];
|
|
8583
|
+
// Check for a handful of known, common runtime errors and log them (with redaction where applicable).
|
|
8584
|
+
const firstLine = stackArr[0];
|
|
8585
|
+
if (firstLine.startsWith("TypeError: Cannot read property") ||
|
|
8586
|
+
firstLine.startsWith("TypeError: Cannot read properties of") ||
|
|
8587
|
+
firstLine.startsWith("TypeError: Cannot set property") ||
|
|
8588
|
+
firstLine.startsWith("TypeError: Cannot set properties of") ||
|
|
8589
|
+
firstLine.endsWith("is not a function")) {
|
|
8590
|
+
// These types of errors are not at risk of leaking PII. They will indicate unavailable APIs
|
|
8591
|
+
res.push(compactStackLine(firstLine));
|
|
8592
|
+
}
|
|
8593
|
+
else if (firstLine.startsWith("SyntaxError") ||
|
|
8594
|
+
firstLine.startsWith("TypeError")) {
|
|
8595
|
+
// Prevent unintentional leaking of arbitrary info by redacting contents between both single and double quotes
|
|
8596
|
+
res.push(compactStackLine(
|
|
8597
|
+
// Example: SyntaxError: Unexpected token 'e', "test" is not valid JSON -> SyntaxError: Unexpected token <redacted>, <redacted> is not valid JSON
|
|
8598
|
+
firstLine.replace(/['].*[']|["].*["]/g, "<redacted>")));
|
|
8599
|
+
}
|
|
8501
8600
|
// Get top N stack lines
|
|
8502
|
-
for (
|
|
8503
|
-
// Skip first line as it may contain PII data
|
|
8504
|
-
let ix = Math.max(stackArr.length - stackMaxSize - 1, 1); ix < stackArr.length; ix++) {
|
|
8505
|
-
const line = stackArr[ix];
|
|
8601
|
+
for (let ix = 1; ix < stackArr.length; ix++) {
|
|
8506
8602
|
if (res.length >= stackMaxSize) {
|
|
8507
8603
|
break;
|
|
8508
8604
|
}
|
|
8605
|
+
const line = stackArr[ix];
|
|
8509
8606
|
res.push(compactStackLine(line));
|
|
8510
8607
|
}
|
|
8511
8608
|
return res;
|
|
@@ -8752,13 +8849,20 @@ class PerformanceClient {
|
|
|
8752
8849
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
8753
8850
|
}
|
|
8754
8851
|
this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`, event.correlationId);
|
|
8852
|
+
if (error) {
|
|
8853
|
+
addError(error, this.logger, rootEvent);
|
|
8854
|
+
}
|
|
8755
8855
|
// Add sub-measurement attribute to root event.
|
|
8756
8856
|
if (!isRoot) {
|
|
8757
8857
|
rootEvent[event.name + "DurationMs"] = Math.floor(event.durationMs);
|
|
8758
8858
|
return { ...rootEvent };
|
|
8759
8859
|
}
|
|
8760
|
-
if (
|
|
8761
|
-
|
|
8860
|
+
if (isRoot &&
|
|
8861
|
+
!error &&
|
|
8862
|
+
(rootEvent.errorCode || rootEvent.subErrorCode)) {
|
|
8863
|
+
this.logger.trace(`PerformanceClient: Remove error and sub-error codes for root event ${event.name} as intermediate error was successfully handled`, event.correlationId);
|
|
8864
|
+
rootEvent.errorCode = undefined;
|
|
8865
|
+
rootEvent.subErrorCode = undefined;
|
|
8762
8866
|
}
|
|
8763
8867
|
let finalEvent = { ...rootEvent, ...event };
|
|
8764
8868
|
let incompleteSubsCount = 0;
|
|
@@ -9001,7 +9105,9 @@ const nativeConnectionNotEstablished = "native_connection_not_established";
|
|
|
9001
9105
|
const uninitializedPublicClientApplication = "uninitialized_public_client_application";
|
|
9002
9106
|
const nativePromptNotSupported = "native_prompt_not_supported";
|
|
9003
9107
|
const invalidBase64String = "invalid_base64_string";
|
|
9004
|
-
const invalidPopTokenRequest = "invalid_pop_token_request";
|
|
9108
|
+
const invalidPopTokenRequest = "invalid_pop_token_request";
|
|
9109
|
+
const failedToBuildHeaders = "failed_to_build_headers";
|
|
9110
|
+
const failedToParseHeaders = "failed_to_parse_headers";
|
|
9005
9111
|
|
|
9006
9112
|
var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
9007
9113
|
__proto__: null,
|
|
@@ -9016,6 +9122,8 @@ var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
9016
9122
|
databaseUnavailable: databaseUnavailable,
|
|
9017
9123
|
emptyNavigateUri: emptyNavigateUri,
|
|
9018
9124
|
emptyWindowError: emptyWindowError,
|
|
9125
|
+
failedToBuildHeaders: failedToBuildHeaders,
|
|
9126
|
+
failedToParseHeaders: failedToParseHeaders,
|
|
9019
9127
|
failedToParseResponse: failedToParseResponse,
|
|
9020
9128
|
getRequestFailed: getRequestFailed,
|
|
9021
9129
|
hashDoesNotContainKnownProperties: hashDoesNotContainKnownProperties,
|
|
@@ -9108,6 +9216,8 @@ const BrowserAuthErrorMessages = {
|
|
|
9108
9216
|
[nativePromptNotSupported]: "The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",
|
|
9109
9217
|
[invalidBase64String]: "Invalid base64 encoded string.",
|
|
9110
9218
|
[invalidPopTokenRequest]: "Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",
|
|
9219
|
+
[failedToBuildHeaders]: "Failed to build request headers object.",
|
|
9220
|
+
[failedToParseHeaders]: "Failed to parse response headers",
|
|
9111
9221
|
};
|
|
9112
9222
|
/**
|
|
9113
9223
|
* BrowserAuthErrorMessage class containing string constants used by error codes and messages.
|
|
@@ -9307,14 +9417,14 @@ const BrowserAuthErrorMessage = {
|
|
|
9307
9417
|
* Browser library error class thrown by the MSAL.js library for SPAs
|
|
9308
9418
|
*/
|
|
9309
9419
|
class BrowserAuthError extends AuthError {
|
|
9310
|
-
constructor(errorCode) {
|
|
9311
|
-
super(errorCode, BrowserAuthErrorMessages[errorCode]);
|
|
9420
|
+
constructor(errorCode, subError) {
|
|
9421
|
+
super(errorCode, BrowserAuthErrorMessages[errorCode], subError);
|
|
9312
9422
|
Object.setPrototypeOf(this, BrowserAuthError.prototype);
|
|
9313
9423
|
this.name = "BrowserAuthError";
|
|
9314
9424
|
}
|
|
9315
9425
|
}
|
|
9316
|
-
function createBrowserAuthError(errorCode) {
|
|
9317
|
-
return new BrowserAuthError(errorCode);
|
|
9426
|
+
function createBrowserAuthError(errorCode, subError) {
|
|
9427
|
+
return new BrowserAuthError(errorCode, subError);
|
|
9318
9428
|
}
|
|
9319
9429
|
|
|
9320
9430
|
/*
|
|
@@ -9597,6 +9707,7 @@ const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
|
|
9597
9707
|
const UUID_CHARS = "0123456789abcdef";
|
|
9598
9708
|
// Array to store UINT32 random value
|
|
9599
9709
|
const UINT32_ARR = new Uint32Array(1);
|
|
9710
|
+
const SUBTLE_SUBERROR = "crypto_subtle_undefined";
|
|
9600
9711
|
const keygenAlgorithmOptions = {
|
|
9601
9712
|
name: PKCS1_V15_KEYGEN_ALG,
|
|
9602
9713
|
hash: S256_HASH_ALG,
|
|
@@ -9606,14 +9717,16 @@ const keygenAlgorithmOptions = {
|
|
|
9606
9717
|
/**
|
|
9607
9718
|
* Check whether browser crypto is available.
|
|
9608
9719
|
*/
|
|
9609
|
-
function validateCryptoAvailable(
|
|
9610
|
-
if (
|
|
9611
|
-
|
|
9720
|
+
function validateCryptoAvailable() {
|
|
9721
|
+
if (!window) {
|
|
9722
|
+
throw createBrowserAuthError(nonBrowserEnvironment);
|
|
9612
9723
|
}
|
|
9613
|
-
|
|
9614
|
-
logger.error("BrowserCrypto: crypto interface is unavailable");
|
|
9724
|
+
if (!window.crypto) {
|
|
9615
9725
|
throw createBrowserAuthError(cryptoNonExistent);
|
|
9616
9726
|
}
|
|
9727
|
+
if (!window.crypto.subtle) {
|
|
9728
|
+
throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
|
|
9729
|
+
}
|
|
9617
9730
|
}
|
|
9618
9731
|
/**
|
|
9619
9732
|
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
@@ -10018,29 +10131,31 @@ class FetchClient {
|
|
|
10018
10131
|
*/
|
|
10019
10132
|
async sendGetRequestAsync(url, options) {
|
|
10020
10133
|
let response;
|
|
10134
|
+
let responseHeaders = {};
|
|
10135
|
+
let responseStatus = 0;
|
|
10136
|
+
const reqHeaders = getFetchHeaders(options);
|
|
10021
10137
|
try {
|
|
10022
10138
|
response = await fetch(url, {
|
|
10023
10139
|
method: HTTP_REQUEST_TYPE.GET,
|
|
10024
|
-
headers:
|
|
10140
|
+
headers: reqHeaders,
|
|
10025
10141
|
});
|
|
10026
10142
|
}
|
|
10027
10143
|
catch (e) {
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
else {
|
|
10032
|
-
throw createBrowserAuthError(noNetworkConnectivity);
|
|
10033
|
-
}
|
|
10144
|
+
throw createBrowserAuthError(window.navigator.onLine
|
|
10145
|
+
? getRequestFailed
|
|
10146
|
+
: noNetworkConnectivity);
|
|
10034
10147
|
}
|
|
10148
|
+
responseHeaders = getHeaderDict(response.headers);
|
|
10035
10149
|
try {
|
|
10150
|
+
responseStatus = response.status;
|
|
10036
10151
|
return {
|
|
10037
|
-
headers:
|
|
10152
|
+
headers: responseHeaders,
|
|
10038
10153
|
body: (await response.json()),
|
|
10039
|
-
status:
|
|
10154
|
+
status: responseStatus,
|
|
10040
10155
|
};
|
|
10041
10156
|
}
|
|
10042
10157
|
catch (e) {
|
|
10043
|
-
throw createBrowserAuthError(failedToParseResponse);
|
|
10158
|
+
throw createNetworkError(createBrowserAuthError(failedToParseResponse), responseStatus, responseHeaders);
|
|
10044
10159
|
}
|
|
10045
10160
|
}
|
|
10046
10161
|
/**
|
|
@@ -10050,56 +10165,73 @@ class FetchClient {
|
|
|
10050
10165
|
* @param body
|
|
10051
10166
|
*/
|
|
10052
10167
|
async sendPostRequestAsync(url, options) {
|
|
10053
|
-
const reqBody = (options && options.body) ||
|
|
10168
|
+
const reqBody = (options && options.body) || "";
|
|
10169
|
+
const reqHeaders = getFetchHeaders(options);
|
|
10054
10170
|
let response;
|
|
10171
|
+
let responseStatus = 0;
|
|
10172
|
+
let responseHeaders = {};
|
|
10055
10173
|
try {
|
|
10056
10174
|
response = await fetch(url, {
|
|
10057
10175
|
method: HTTP_REQUEST_TYPE.POST,
|
|
10058
|
-
headers:
|
|
10176
|
+
headers: reqHeaders,
|
|
10059
10177
|
body: reqBody,
|
|
10060
10178
|
});
|
|
10061
10179
|
}
|
|
10062
10180
|
catch (e) {
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
else {
|
|
10067
|
-
throw createBrowserAuthError(noNetworkConnectivity);
|
|
10068
|
-
}
|
|
10181
|
+
throw createBrowserAuthError(window.navigator.onLine
|
|
10182
|
+
? postRequestFailed
|
|
10183
|
+
: noNetworkConnectivity);
|
|
10069
10184
|
}
|
|
10185
|
+
responseHeaders = getHeaderDict(response.headers);
|
|
10070
10186
|
try {
|
|
10187
|
+
responseStatus = response.status;
|
|
10071
10188
|
return {
|
|
10072
|
-
headers:
|
|
10189
|
+
headers: responseHeaders,
|
|
10073
10190
|
body: (await response.json()),
|
|
10074
|
-
status:
|
|
10191
|
+
status: responseStatus,
|
|
10075
10192
|
};
|
|
10076
10193
|
}
|
|
10077
10194
|
catch (e) {
|
|
10078
|
-
throw createBrowserAuthError(failedToParseResponse);
|
|
10195
|
+
throw createNetworkError(createBrowserAuthError(failedToParseResponse), responseStatus, responseHeaders);
|
|
10079
10196
|
}
|
|
10080
10197
|
}
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10198
|
+
}
|
|
10199
|
+
/**
|
|
10200
|
+
* Get Fetch API Headers object from string map
|
|
10201
|
+
* @param inputHeaders
|
|
10202
|
+
*/
|
|
10203
|
+
function getFetchHeaders(options) {
|
|
10204
|
+
try {
|
|
10086
10205
|
const headers = new Headers();
|
|
10087
10206
|
if (!(options && options.headers)) {
|
|
10088
10207
|
return headers;
|
|
10089
10208
|
}
|
|
10090
10209
|
const optionsHeaders = options.headers;
|
|
10091
|
-
Object.
|
|
10092
|
-
headers.append(key,
|
|
10210
|
+
Object.entries(optionsHeaders).forEach(([key, value]) => {
|
|
10211
|
+
headers.append(key, value);
|
|
10093
10212
|
});
|
|
10094
10213
|
return headers;
|
|
10095
10214
|
}
|
|
10096
|
-
|
|
10215
|
+
catch (e) {
|
|
10216
|
+
throw createBrowserAuthError(failedToBuildHeaders);
|
|
10217
|
+
}
|
|
10218
|
+
}
|
|
10219
|
+
/**
|
|
10220
|
+
* Returns object representing response headers
|
|
10221
|
+
* @param headers
|
|
10222
|
+
* @returns
|
|
10223
|
+
*/
|
|
10224
|
+
function getHeaderDict(headers) {
|
|
10225
|
+
try {
|
|
10097
10226
|
const headerDict = {};
|
|
10098
10227
|
headers.forEach((value, key) => {
|
|
10099
10228
|
headerDict[key] = value;
|
|
10100
10229
|
});
|
|
10101
10230
|
return headerDict;
|
|
10102
10231
|
}
|
|
10232
|
+
catch (e) {
|
|
10233
|
+
throw createBrowserAuthError(failedToParseHeaders);
|
|
10234
|
+
}
|
|
10103
10235
|
}
|
|
10104
10236
|
|
|
10105
10237
|
/*
|
|
@@ -10128,7 +10260,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
10128
10260
|
knownAuthorities: [],
|
|
10129
10261
|
cloudDiscoveryMetadata: Constants.EMPTY_STRING,
|
|
10130
10262
|
authorityMetadata: Constants.EMPTY_STRING,
|
|
10131
|
-
redirectUri:
|
|
10263
|
+
redirectUri: typeof window !== "undefined" ? getCurrentUri() : "",
|
|
10132
10264
|
postLogoutRedirectUri: Constants.EMPTY_STRING,
|
|
10133
10265
|
navigateToLoginRequestUrl: true,
|
|
10134
10266
|
clientCapabilities: [],
|
|
@@ -10234,7 +10366,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
10234
10366
|
|
|
10235
10367
|
/* eslint-disable header/header */
|
|
10236
10368
|
const name = "@azure/msal-browser";
|
|
10237
|
-
const version = "3.
|
|
10369
|
+
const version = "3.27.0";
|
|
10238
10370
|
|
|
10239
10371
|
/*
|
|
10240
10372
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11024,7 +11156,7 @@ class CryptoOps {
|
|
|
11024
11156
|
constructor(logger, performanceClient) {
|
|
11025
11157
|
this.logger = logger;
|
|
11026
11158
|
// Browser crypto needs to be validated first before any other classes can be set.
|
|
11027
|
-
validateCryptoAvailable(
|
|
11159
|
+
validateCryptoAvailable();
|
|
11028
11160
|
this.cache = new AsyncMemoryStorage(this.logger);
|
|
11029
11161
|
this.performanceClient = performanceClient;
|
|
11030
11162
|
}
|
|
@@ -12817,9 +12949,7 @@ class BaseInteractionClient {
|
|
|
12817
12949
|
*/
|
|
12818
12950
|
getRedirectUri(requestRedirectUri) {
|
|
12819
12951
|
this.logger.verbose("getRedirectUri called");
|
|
12820
|
-
const redirectUri = requestRedirectUri ||
|
|
12821
|
-
this.config.auth.redirectUri ||
|
|
12822
|
-
getCurrentUri();
|
|
12952
|
+
const redirectUri = requestRedirectUri || this.config.auth.redirectUri;
|
|
12823
12953
|
return UrlString.getAbsoluteUrl(redirectUri, getCurrentUri());
|
|
12824
12954
|
}
|
|
12825
12955
|
/**
|
|
@@ -13142,6 +13272,7 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
13142
13272
|
clientId: this.config.auth.clientId,
|
|
13143
13273
|
authority: discoveredAuthority,
|
|
13144
13274
|
clientCapabilities: this.config.auth.clientCapabilities,
|
|
13275
|
+
redirectUri: this.config.auth.redirectUri,
|
|
13145
13276
|
},
|
|
13146
13277
|
systemOptions: {
|
|
13147
13278
|
tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,
|
|
@@ -13339,10 +13470,6 @@ class SilentCacheClient extends StandardInteractionClient {
|
|
|
13339
13470
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
13340
13471
|
* Licensed under the MIT License.
|
|
13341
13472
|
*/
|
|
13342
|
-
const BrokerServerParamKeys = {
|
|
13343
|
-
BROKER_CLIENT_ID: "brk_client_id",
|
|
13344
|
-
BROKER_REDIRECT_URI: "brk_redirect_uri",
|
|
13345
|
-
};
|
|
13346
13473
|
class NativeInteractionClient extends BaseInteractionClient {
|
|
13347
13474
|
constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
|
|
13348
13475
|
super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
@@ -13945,21 +14072,33 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13945
14072
|
* @private
|
|
13946
14073
|
*/
|
|
13947
14074
|
handleExtraBrokerParams(request) {
|
|
13948
|
-
|
|
14075
|
+
const hasExtraBrokerParams = request.extraParameters &&
|
|
14076
|
+
request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
|
|
14077
|
+
request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
|
|
14078
|
+
request.extraParameters.hasOwnProperty(CLIENT_ID);
|
|
14079
|
+
if (!request.embeddedClientId && !hasExtraBrokerParams) {
|
|
13949
14080
|
return;
|
|
13950
14081
|
}
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
|
|
14082
|
+
let child_client_id = "";
|
|
14083
|
+
const child_redirect_uri = request.redirectUri;
|
|
14084
|
+
if (request.embeddedClientId) {
|
|
14085
|
+
request.redirectUri = this.config.auth.redirectUri;
|
|
14086
|
+
child_client_id = request.embeddedClientId;
|
|
14087
|
+
}
|
|
14088
|
+
else if (request.extraParameters) {
|
|
14089
|
+
request.redirectUri =
|
|
14090
|
+
request.extraParameters[BROKER_REDIRECT_URI];
|
|
14091
|
+
child_client_id =
|
|
14092
|
+
request.extraParameters[CLIENT_ID];
|
|
13962
14093
|
}
|
|
14094
|
+
request.extraParameters = {
|
|
14095
|
+
child_client_id,
|
|
14096
|
+
child_redirect_uri,
|
|
14097
|
+
};
|
|
14098
|
+
this.performanceClient?.addFields({
|
|
14099
|
+
embeddedClientId: child_client_id,
|
|
14100
|
+
embeddedRedirectUri: child_redirect_uri,
|
|
14101
|
+
}, request.correlationId);
|
|
13963
14102
|
}
|
|
13964
14103
|
}
|
|
13965
14104
|
|
|
@@ -16251,7 +16390,6 @@ class StandardController {
|
|
|
16251
16390
|
atPopupMeasurement.end({
|
|
16252
16391
|
success: true,
|
|
16253
16392
|
isNativeBroker: true,
|
|
16254
|
-
requestId: response.requestId,
|
|
16255
16393
|
accountType: getAccountType(response.account),
|
|
16256
16394
|
});
|
|
16257
16395
|
return response;
|
|
@@ -16290,7 +16428,6 @@ class StandardController {
|
|
|
16290
16428
|
}
|
|
16291
16429
|
atPopupMeasurement.end({
|
|
16292
16430
|
success: true,
|
|
16293
|
-
requestId: result.requestId,
|
|
16294
16431
|
accessTokenSize: result.accessToken.length,
|
|
16295
16432
|
idTokenSize: result.idToken.length,
|
|
16296
16433
|
accountType: getAccountType(result.account),
|
|
@@ -16381,7 +16518,6 @@ class StandardController {
|
|
|
16381
16518
|
this.ssoSilentMeasurement?.end({
|
|
16382
16519
|
success: true,
|
|
16383
16520
|
isNativeBroker: response.fromNativeBroker,
|
|
16384
|
-
requestId: response.requestId,
|
|
16385
16521
|
accessTokenSize: response.accessToken.length,
|
|
16386
16522
|
idTokenSize: response.idToken.length,
|
|
16387
16523
|
accountType: getAccountType(response.account),
|
|
@@ -16436,7 +16572,6 @@ class StandardController {
|
|
|
16436
16572
|
atbcMeasurement.end({
|
|
16437
16573
|
success: true,
|
|
16438
16574
|
isNativeBroker: result.fromNativeBroker,
|
|
16439
|
-
requestId: result.requestId,
|
|
16440
16575
|
accessTokenSize: result.accessToken.length,
|
|
16441
16576
|
idTokenSize: result.idToken.length,
|
|
16442
16577
|
accountType: getAccountType(result.account),
|
|
@@ -16515,7 +16650,6 @@ class StandardController {
|
|
|
16515
16650
|
success: true,
|
|
16516
16651
|
fromCache: response.fromCache,
|
|
16517
16652
|
isNativeBroker: response.fromNativeBroker,
|
|
16518
|
-
requestId: response.requestId,
|
|
16519
16653
|
});
|
|
16520
16654
|
return response;
|
|
16521
16655
|
})
|
|
@@ -17066,7 +17200,6 @@ class StandardController {
|
|
|
17066
17200
|
fromCache: result.fromCache,
|
|
17067
17201
|
isNativeBroker: result.fromNativeBroker,
|
|
17068
17202
|
cacheLookupPolicy: request.cacheLookupPolicy,
|
|
17069
|
-
requestId: result.requestId,
|
|
17070
17203
|
accessTokenSize: result.accessToken.length,
|
|
17071
17204
|
idTokenSize: result.idToken.length,
|
|
17072
17205
|
});
|
|
@@ -17177,7 +17310,6 @@ class StandardController {
|
|
|
17177
17310
|
this.performanceClient.addFields({
|
|
17178
17311
|
fromCache: response.fromCache,
|
|
17179
17312
|
isNativeBroker: response.fromNativeBroker,
|
|
17180
|
-
requestId: response.requestId,
|
|
17181
17313
|
}, request.correlationId);
|
|
17182
17314
|
}
|
|
17183
17315
|
return response;
|
|
@@ -17277,7 +17409,8 @@ class NestedAppAuthAdapter {
|
|
|
17277
17409
|
else {
|
|
17278
17410
|
extraParams = new Map(Object.entries(request.extraQueryParameters));
|
|
17279
17411
|
}
|
|
17280
|
-
const
|
|
17412
|
+
const correlationId = request.correlationId || this.crypto.createNewGuid();
|
|
17413
|
+
const requestBuilder = new RequestParameterBuilder(correlationId);
|
|
17281
17414
|
const claims = requestBuilder.addClientCapabilitiesToClaims(request.claims, this.clientCapabilities);
|
|
17282
17415
|
const scopes = request.scopes || OIDC_DEFAULT_SCOPES;
|
|
17283
17416
|
const tokenRequest = {
|
|
@@ -17285,9 +17418,7 @@ class NestedAppAuthAdapter {
|
|
|
17285
17418
|
clientId: this.clientId,
|
|
17286
17419
|
authority: request.authority,
|
|
17287
17420
|
scope: scopes.join(" "),
|
|
17288
|
-
correlationId
|
|
17289
|
-
? request.correlationId
|
|
17290
|
-
: this.crypto.createNewGuid(),
|
|
17421
|
+
correlationId,
|
|
17291
17422
|
claims: !StringUtils.isEmptyObj(claims) ? claims : undefined,
|
|
17292
17423
|
state: request.state,
|
|
17293
17424
|
authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,
|