@azure/msal-browser 3.26.0 → 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.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +22 -8
- package/dist/controllers/NestedAppAuthController.mjs.map +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 +476 -331
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +476 -331
- 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/NestedAppAuthController.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/NestedAppAuthController.ts +25 -12
- 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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.27.0 2024-11-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
|
|
7
7
|
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
|
-
/*! @azure/msal-common v14.
|
|
9
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
10
10
|
/*
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
12
|
* Licensed under the MIT License.
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
*/
|
|
102
102
|
const HeaderNames = {
|
|
103
103
|
CONTENT_TYPE: "Content-Type",
|
|
104
|
+
CONTENT_LENGTH: "Content-Length",
|
|
104
105
|
RETRY_AFTER: "Retry-After",
|
|
105
106
|
CCS_HEADER: "X-AnchorMailbox",
|
|
106
107
|
WWWAuthenticate: "WWW-Authenticate",
|
|
@@ -315,7 +316,7 @@
|
|
|
315
316
|
// Token renewal offset default in seconds
|
|
316
317
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
317
318
|
|
|
318
|
-
/*! @azure/msal-common v14.
|
|
319
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
319
320
|
/*
|
|
320
321
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
321
322
|
* Licensed under the MIT License.
|
|
@@ -332,7 +333,7 @@
|
|
|
332
333
|
unexpectedError: unexpectedError
|
|
333
334
|
});
|
|
334
335
|
|
|
335
|
-
/*! @azure/msal-common v14.
|
|
336
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
336
337
|
|
|
337
338
|
/*
|
|
338
339
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -381,7 +382,7 @@
|
|
|
381
382
|
: AuthErrorMessages[code]);
|
|
382
383
|
}
|
|
383
384
|
|
|
384
|
-
/*! @azure/msal-common v14.
|
|
385
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
385
386
|
/*
|
|
386
387
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
387
388
|
* Licensed under the MIT License.
|
|
@@ -479,7 +480,7 @@
|
|
|
479
480
|
userTimeoutReached: userTimeoutReached
|
|
480
481
|
});
|
|
481
482
|
|
|
482
|
-
/*! @azure/msal-common v14.
|
|
483
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
483
484
|
|
|
484
485
|
/*
|
|
485
486
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -731,7 +732,7 @@
|
|
|
731
732
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
732
733
|
}
|
|
733
734
|
|
|
734
|
-
/*! @azure/msal-common v14.
|
|
735
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
735
736
|
|
|
736
737
|
/*
|
|
737
738
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -770,7 +771,7 @@
|
|
|
770
771
|
},
|
|
771
772
|
};
|
|
772
773
|
|
|
773
|
-
/*! @azure/msal-common v14.
|
|
774
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
774
775
|
|
|
775
776
|
/*
|
|
776
777
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -961,12 +962,12 @@
|
|
|
961
962
|
}
|
|
962
963
|
}
|
|
963
964
|
|
|
964
|
-
/*! @azure/msal-common v14.
|
|
965
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
965
966
|
/* eslint-disable header/header */
|
|
966
967
|
const name$1 = "@azure/msal-common";
|
|
967
|
-
const version$1 = "14.
|
|
968
|
+
const version$1 = "14.16.0";
|
|
968
969
|
|
|
969
|
-
/*! @azure/msal-common v14.
|
|
970
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
970
971
|
/*
|
|
971
972
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
972
973
|
* Licensed under the MIT License.
|
|
@@ -986,7 +987,7 @@
|
|
|
986
987
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
987
988
|
};
|
|
988
989
|
|
|
989
|
-
/*! @azure/msal-common v14.
|
|
990
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
990
991
|
|
|
991
992
|
/*
|
|
992
993
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1047,7 +1048,7 @@
|
|
|
1047
1048
|
}
|
|
1048
1049
|
}
|
|
1049
1050
|
|
|
1050
|
-
/*! @azure/msal-common v14.
|
|
1051
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1051
1052
|
/*
|
|
1052
1053
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1053
1054
|
* Licensed under the MIT License.
|
|
@@ -1084,7 +1085,7 @@
|
|
|
1084
1085
|
return cachedAtSec > nowSeconds();
|
|
1085
1086
|
}
|
|
1086
1087
|
|
|
1087
|
-
/*! @azure/msal-common v14.
|
|
1088
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1088
1089
|
|
|
1089
1090
|
/*
|
|
1090
1091
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1411,7 +1412,7 @@
|
|
|
1411
1412
|
return metadata.expiresAt <= nowSeconds();
|
|
1412
1413
|
}
|
|
1413
1414
|
|
|
1414
|
-
/*! @azure/msal-common v14.
|
|
1415
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1415
1416
|
/*
|
|
1416
1417
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1417
1418
|
* Licensed under the MIT License.
|
|
@@ -1465,7 +1466,7 @@
|
|
|
1465
1466
|
urlParseError: urlParseError
|
|
1466
1467
|
});
|
|
1467
1468
|
|
|
1468
|
-
/*! @azure/msal-common v14.
|
|
1469
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1469
1470
|
|
|
1470
1471
|
/*
|
|
1471
1472
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1603,7 +1604,7 @@
|
|
|
1603
1604
|
return new ClientConfigurationError(errorCode);
|
|
1604
1605
|
}
|
|
1605
1606
|
|
|
1606
|
-
/*! @azure/msal-common v14.
|
|
1607
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1607
1608
|
/*
|
|
1608
1609
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1609
1610
|
* Licensed under the MIT License.
|
|
@@ -1700,7 +1701,7 @@
|
|
|
1700
1701
|
}
|
|
1701
1702
|
}
|
|
1702
1703
|
|
|
1703
|
-
/*! @azure/msal-common v14.
|
|
1704
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1704
1705
|
|
|
1705
1706
|
/*
|
|
1706
1707
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1900,7 +1901,7 @@
|
|
|
1900
1901
|
}
|
|
1901
1902
|
}
|
|
1902
1903
|
|
|
1903
|
-
/*! @azure/msal-common v14.
|
|
1904
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1904
1905
|
|
|
1905
1906
|
/*
|
|
1906
1907
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1940,7 +1941,7 @@
|
|
|
1940
1941
|
};
|
|
1941
1942
|
}
|
|
1942
1943
|
|
|
1943
|
-
/*! @azure/msal-common v14.
|
|
1944
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
1944
1945
|
/*
|
|
1945
1946
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1946
1947
|
* Licensed under the MIT License.
|
|
@@ -2019,7 +2020,7 @@
|
|
|
2019
2020
|
return updatedAccountInfo;
|
|
2020
2021
|
}
|
|
2021
2022
|
|
|
2022
|
-
/*! @azure/msal-common v14.
|
|
2023
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2023
2024
|
/*
|
|
2024
2025
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2025
2026
|
* Licensed under the MIT License.
|
|
@@ -2034,7 +2035,7 @@
|
|
|
2034
2035
|
Ciam: 3,
|
|
2035
2036
|
};
|
|
2036
2037
|
|
|
2037
|
-
/*! @azure/msal-common v14.
|
|
2038
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2038
2039
|
/*
|
|
2039
2040
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2040
2041
|
* Licensed under the MIT License.
|
|
@@ -2056,7 +2057,7 @@
|
|
|
2056
2057
|
return null;
|
|
2057
2058
|
}
|
|
2058
2059
|
|
|
2059
|
-
/*! @azure/msal-common v14.
|
|
2060
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2060
2061
|
/*
|
|
2061
2062
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2062
2063
|
* Licensed under the MIT License.
|
|
@@ -2069,7 +2070,7 @@
|
|
|
2069
2070
|
OIDC: "OIDC",
|
|
2070
2071
|
};
|
|
2071
2072
|
|
|
2072
|
-
/*! @azure/msal-common v14.
|
|
2073
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2073
2074
|
|
|
2074
2075
|
/*
|
|
2075
2076
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2312,7 +2313,7 @@
|
|
|
2312
2313
|
}
|
|
2313
2314
|
}
|
|
2314
2315
|
|
|
2315
|
-
/*! @azure/msal-common v14.
|
|
2316
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2316
2317
|
|
|
2317
2318
|
/*
|
|
2318
2319
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2359,7 +2360,7 @@
|
|
|
2359
2360
|
return null;
|
|
2360
2361
|
}
|
|
2361
2362
|
|
|
2362
|
-
/*! @azure/msal-common v14.
|
|
2363
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2363
2364
|
|
|
2364
2365
|
/*
|
|
2365
2366
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2523,7 +2524,7 @@
|
|
|
2523
2524
|
}
|
|
2524
2525
|
}
|
|
2525
2526
|
|
|
2526
|
-
/*! @azure/msal-common v14.
|
|
2527
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2527
2528
|
|
|
2528
2529
|
/*
|
|
2529
2530
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2663,7 +2664,7 @@
|
|
|
2663
2664
|
return null;
|
|
2664
2665
|
}
|
|
2665
2666
|
|
|
2666
|
-
/*! @azure/msal-common v14.
|
|
2667
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2667
2668
|
/*
|
|
2668
2669
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2669
2670
|
* Licensed under the MIT License.
|
|
@@ -2671,7 +2672,7 @@
|
|
|
2671
2672
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2672
2673
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2673
2674
|
|
|
2674
|
-
/*! @azure/msal-common v14.
|
|
2675
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2675
2676
|
|
|
2676
2677
|
/*
|
|
2677
2678
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2698,7 +2699,7 @@
|
|
|
2698
2699
|
}
|
|
2699
2700
|
}
|
|
2700
2701
|
|
|
2701
|
-
/*! @azure/msal-common v14.
|
|
2702
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
2702
2703
|
|
|
2703
2704
|
/*
|
|
2704
2705
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3939,9 +3940,6 @@
|
|
|
3939
3940
|
getTokenKeys() {
|
|
3940
3941
|
throw createClientAuthError(methodNotImplemented);
|
|
3941
3942
|
}
|
|
3942
|
-
async clear() {
|
|
3943
|
-
throw createClientAuthError(methodNotImplemented);
|
|
3944
|
-
}
|
|
3945
3943
|
updateCredentialCacheKey() {
|
|
3946
3944
|
throw createClientAuthError(methodNotImplemented);
|
|
3947
3945
|
}
|
|
@@ -3950,7 +3948,7 @@
|
|
|
3950
3948
|
}
|
|
3951
3949
|
}
|
|
3952
3950
|
|
|
3953
|
-
/*! @azure/msal-common v14.
|
|
3951
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
3954
3952
|
|
|
3955
3953
|
/*
|
|
3956
3954
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4049,161 +4047,7 @@
|
|
|
4049
4047
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4050
4048
|
}
|
|
4051
4049
|
|
|
4052
|
-
/*! @azure/msal-common v14.
|
|
4053
|
-
|
|
4054
|
-
/*
|
|
4055
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4056
|
-
* Licensed under the MIT License.
|
|
4057
|
-
*/
|
|
4058
|
-
/**
|
|
4059
|
-
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
4060
|
-
*/
|
|
4061
|
-
class ServerError extends AuthError {
|
|
4062
|
-
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
4063
|
-
super(errorCode, errorMessage, subError);
|
|
4064
|
-
this.name = "ServerError";
|
|
4065
|
-
this.errorNo = errorNo;
|
|
4066
|
-
this.status = status;
|
|
4067
|
-
Object.setPrototypeOf(this, ServerError.prototype);
|
|
4068
|
-
}
|
|
4069
|
-
}
|
|
4070
|
-
|
|
4071
|
-
/*! @azure/msal-common v14.15.0 2024-10-08 */
|
|
4072
|
-
|
|
4073
|
-
/*
|
|
4074
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4075
|
-
* Licensed under the MIT License.
|
|
4076
|
-
*/
|
|
4077
|
-
/** @internal */
|
|
4078
|
-
class ThrottlingUtils {
|
|
4079
|
-
/**
|
|
4080
|
-
* Prepares a RequestThumbprint to be stored as a key.
|
|
4081
|
-
* @param thumbprint
|
|
4082
|
-
*/
|
|
4083
|
-
static generateThrottlingStorageKey(thumbprint) {
|
|
4084
|
-
return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;
|
|
4085
|
-
}
|
|
4086
|
-
/**
|
|
4087
|
-
* Performs necessary throttling checks before a network request.
|
|
4088
|
-
* @param cacheManager
|
|
4089
|
-
* @param thumbprint
|
|
4090
|
-
*/
|
|
4091
|
-
static preProcess(cacheManager, thumbprint) {
|
|
4092
|
-
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
4093
|
-
const value = cacheManager.getThrottlingCache(key);
|
|
4094
|
-
if (value) {
|
|
4095
|
-
if (value.throttleTime < Date.now()) {
|
|
4096
|
-
cacheManager.removeItem(key);
|
|
4097
|
-
return;
|
|
4098
|
-
}
|
|
4099
|
-
throw new ServerError(value.errorCodes?.join(" ") || Constants.EMPTY_STRING, value.errorMessage, value.subError);
|
|
4100
|
-
}
|
|
4101
|
-
}
|
|
4102
|
-
/**
|
|
4103
|
-
* Performs necessary throttling checks after a network request.
|
|
4104
|
-
* @param cacheManager
|
|
4105
|
-
* @param thumbprint
|
|
4106
|
-
* @param response
|
|
4107
|
-
*/
|
|
4108
|
-
static postProcess(cacheManager, thumbprint, response) {
|
|
4109
|
-
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
4110
|
-
ThrottlingUtils.checkResponseForRetryAfter(response)) {
|
|
4111
|
-
const thumbprintValue = {
|
|
4112
|
-
throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),
|
|
4113
|
-
error: response.body.error,
|
|
4114
|
-
errorCodes: response.body.error_codes,
|
|
4115
|
-
errorMessage: response.body.error_description,
|
|
4116
|
-
subError: response.body.suberror,
|
|
4117
|
-
};
|
|
4118
|
-
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
|
|
4119
|
-
}
|
|
4120
|
-
}
|
|
4121
|
-
/**
|
|
4122
|
-
* Checks a NetworkResponse object's status codes against 429 or 5xx
|
|
4123
|
-
* @param response
|
|
4124
|
-
*/
|
|
4125
|
-
static checkResponseStatus(response) {
|
|
4126
|
-
return (response.status === 429 ||
|
|
4127
|
-
(response.status >= 500 && response.status < 600));
|
|
4128
|
-
}
|
|
4129
|
-
/**
|
|
4130
|
-
* Checks a NetworkResponse object's RetryAfter header
|
|
4131
|
-
* @param response
|
|
4132
|
-
*/
|
|
4133
|
-
static checkResponseForRetryAfter(response) {
|
|
4134
|
-
if (response.headers) {
|
|
4135
|
-
return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&
|
|
4136
|
-
(response.status < 200 || response.status >= 300));
|
|
4137
|
-
}
|
|
4138
|
-
return false;
|
|
4139
|
-
}
|
|
4140
|
-
/**
|
|
4141
|
-
* Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
|
|
4142
|
-
* @param throttleTime
|
|
4143
|
-
*/
|
|
4144
|
-
static calculateThrottleTime(throttleTime) {
|
|
4145
|
-
const time = throttleTime <= 0 ? 0 : throttleTime;
|
|
4146
|
-
const currentSeconds = Date.now() / 1000;
|
|
4147
|
-
return Math.floor(Math.min(currentSeconds +
|
|
4148
|
-
(time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds +
|
|
4149
|
-
ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);
|
|
4150
|
-
}
|
|
4151
|
-
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
4152
|
-
const thumbprint = {
|
|
4153
|
-
clientId: clientId,
|
|
4154
|
-
authority: request.authority,
|
|
4155
|
-
scopes: request.scopes,
|
|
4156
|
-
homeAccountIdentifier: homeAccountIdentifier,
|
|
4157
|
-
claims: request.claims,
|
|
4158
|
-
authenticationScheme: request.authenticationScheme,
|
|
4159
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
4160
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
4161
|
-
shrClaims: request.shrClaims,
|
|
4162
|
-
sshKid: request.sshKid,
|
|
4163
|
-
};
|
|
4164
|
-
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
4165
|
-
cacheManager.removeItem(key);
|
|
4166
|
-
}
|
|
4167
|
-
}
|
|
4168
|
-
|
|
4169
|
-
/*! @azure/msal-common v14.15.0 2024-10-08 */
|
|
4170
|
-
|
|
4171
|
-
/*
|
|
4172
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4173
|
-
* Licensed under the MIT License.
|
|
4174
|
-
*/
|
|
4175
|
-
/** @internal */
|
|
4176
|
-
class NetworkManager {
|
|
4177
|
-
constructor(networkClient, cacheManager) {
|
|
4178
|
-
this.networkClient = networkClient;
|
|
4179
|
-
this.cacheManager = cacheManager;
|
|
4180
|
-
}
|
|
4181
|
-
/**
|
|
4182
|
-
* Wraps sendPostRequestAsync with necessary preflight and postflight logic
|
|
4183
|
-
* @param thumbprint
|
|
4184
|
-
* @param tokenEndpoint
|
|
4185
|
-
* @param options
|
|
4186
|
-
*/
|
|
4187
|
-
async sendPostRequest(thumbprint, tokenEndpoint, options) {
|
|
4188
|
-
ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
|
|
4189
|
-
let response;
|
|
4190
|
-
try {
|
|
4191
|
-
response = await this.networkClient.sendPostRequestAsync(tokenEndpoint, options);
|
|
4192
|
-
}
|
|
4193
|
-
catch (e) {
|
|
4194
|
-
if (e instanceof AuthError) {
|
|
4195
|
-
throw e;
|
|
4196
|
-
}
|
|
4197
|
-
else {
|
|
4198
|
-
throw createClientAuthError(networkError);
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
|
|
4202
|
-
return response;
|
|
4203
|
-
}
|
|
4204
|
-
}
|
|
4205
|
-
|
|
4206
|
-
/*! @azure/msal-common v14.15.0 2024-10-08 */
|
|
4050
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4207
4051
|
/*
|
|
4208
4052
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4209
4053
|
* Licensed under the MIT License.
|
|
@@ -4213,7 +4057,7 @@
|
|
|
4213
4057
|
UPN: "UPN",
|
|
4214
4058
|
};
|
|
4215
4059
|
|
|
4216
|
-
/*! @azure/msal-common v14.
|
|
4060
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4217
4061
|
/*
|
|
4218
4062
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4219
4063
|
* Licensed under the MIT License.
|
|
@@ -4259,9 +4103,11 @@
|
|
|
4259
4103
|
const SID = "sid";
|
|
4260
4104
|
const LOGIN_HINT = "login_hint";
|
|
4261
4105
|
const DOMAIN_HINT = "domain_hint";
|
|
4262
|
-
const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
4106
|
+
const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
4107
|
+
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4108
|
+
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4263
4109
|
|
|
4264
|
-
/*! @azure/msal-common v14.
|
|
4110
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4265
4111
|
|
|
4266
4112
|
/*
|
|
4267
4113
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4328,16 +4174,30 @@
|
|
|
4328
4174
|
}
|
|
4329
4175
|
}
|
|
4330
4176
|
|
|
4331
|
-
/*! @azure/msal-common v14.
|
|
4177
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4332
4178
|
|
|
4333
4179
|
/*
|
|
4334
4180
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4335
4181
|
* Licensed under the MIT License.
|
|
4336
4182
|
*/
|
|
4183
|
+
function instrumentBrokerParams(parameters, correlationId, performanceClient) {
|
|
4184
|
+
if (!correlationId) {
|
|
4185
|
+
return;
|
|
4186
|
+
}
|
|
4187
|
+
const clientId = parameters.get(CLIENT_ID);
|
|
4188
|
+
if (clientId && parameters.has(BROKER_CLIENT_ID)) {
|
|
4189
|
+
performanceClient?.addFields({
|
|
4190
|
+
embeddedClientId: clientId,
|
|
4191
|
+
embeddedRedirectUri: parameters.get(REDIRECT_URI),
|
|
4192
|
+
}, correlationId);
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4337
4195
|
/** @internal */
|
|
4338
4196
|
class RequestParameterBuilder {
|
|
4339
|
-
constructor() {
|
|
4197
|
+
constructor(correlationId, performanceClient) {
|
|
4340
4198
|
this.parameters = new Map();
|
|
4199
|
+
this.performanceClient = performanceClient;
|
|
4200
|
+
this.correlationId = correlationId;
|
|
4341
4201
|
}
|
|
4342
4202
|
/**
|
|
4343
4203
|
* add response_type = code
|
|
@@ -4701,6 +4561,14 @@
|
|
|
4701
4561
|
addLogoutHint(logoutHint) {
|
|
4702
4562
|
this.parameters.set(LOGOUT_HINT, encodeURIComponent(logoutHint));
|
|
4703
4563
|
}
|
|
4564
|
+
addBrokerParameters(params) {
|
|
4565
|
+
const brokerParams = {};
|
|
4566
|
+
brokerParams[BROKER_CLIENT_ID] =
|
|
4567
|
+
params.brokerClientId;
|
|
4568
|
+
brokerParams[BROKER_REDIRECT_URI] =
|
|
4569
|
+
params.brokerRedirectUri;
|
|
4570
|
+
this.addExtraQueryParameters(brokerParams);
|
|
4571
|
+
}
|
|
4704
4572
|
/**
|
|
4705
4573
|
* Utility to create a URL from the params map
|
|
4706
4574
|
*/
|
|
@@ -4709,11 +4577,12 @@
|
|
|
4709
4577
|
this.parameters.forEach((value, key) => {
|
|
4710
4578
|
queryParameterArray.push(`${key}=${value}`);
|
|
4711
4579
|
});
|
|
4580
|
+
instrumentBrokerParams(this.parameters, this.correlationId, this.performanceClient);
|
|
4712
4581
|
return queryParameterArray.join("&");
|
|
4713
4582
|
}
|
|
4714
4583
|
}
|
|
4715
4584
|
|
|
4716
|
-
/*! @azure/msal-common v14.
|
|
4585
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4717
4586
|
/*
|
|
4718
4587
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4719
4588
|
* Licensed under the MIT License.
|
|
@@ -4725,7 +4594,7 @@
|
|
|
4725
4594
|
response.hasOwnProperty("jwks_uri"));
|
|
4726
4595
|
}
|
|
4727
4596
|
|
|
4728
|
-
/*! @azure/msal-common v14.
|
|
4597
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4729
4598
|
/*
|
|
4730
4599
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4731
4600
|
* Licensed under the MIT License.
|
|
@@ -4735,7 +4604,7 @@
|
|
|
4735
4604
|
response.hasOwnProperty("metadata"));
|
|
4736
4605
|
}
|
|
4737
4606
|
|
|
4738
|
-
/*! @azure/msal-common v14.
|
|
4607
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4739
4608
|
/*
|
|
4740
4609
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4741
4610
|
* Licensed under the MIT License.
|
|
@@ -4745,7 +4614,7 @@
|
|
|
4745
4614
|
response.hasOwnProperty("error_description"));
|
|
4746
4615
|
}
|
|
4747
4616
|
|
|
4748
|
-
/*! @azure/msal-common v14.
|
|
4617
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
4749
4618
|
/*
|
|
4750
4619
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4751
4620
|
* Licensed under the MIT License.
|
|
@@ -4847,6 +4716,7 @@
|
|
|
4847
4716
|
/**
|
|
4848
4717
|
* Time spent sending/waiting for the response of a request to the token endpoint
|
|
4849
4718
|
*/
|
|
4719
|
+
NetworkClientSendPostRequestAsync: "networkClientSendPostRequestAsync",
|
|
4850
4720
|
RefreshTokenClientExecutePostToTokenEndpoint: "refreshTokenClientExecutePostToTokenEndpoint",
|
|
4851
4721
|
AuthorizationCodeClientExecutePostToTokenEndpoint: "authorizationCodeClientExecutePostToTokenEndpoint",
|
|
4852
4722
|
/**
|
|
@@ -5020,6 +4890,10 @@
|
|
|
5020
4890
|
PerformanceEvents.BaseClientCreateTokenRequestHeaders,
|
|
5021
4891
|
"BaseClientCreateTReqHead",
|
|
5022
4892
|
],
|
|
4893
|
+
[
|
|
4894
|
+
PerformanceEvents.NetworkClientSendPostRequestAsync,
|
|
4895
|
+
"NetClientSendPost",
|
|
4896
|
+
],
|
|
5023
4897
|
[
|
|
5024
4898
|
PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint,
|
|
5025
4899
|
"RTClientExecPost",
|
|
@@ -5227,7 +5101,7 @@
|
|
|
5227
5101
|
"multiMatchedRT",
|
|
5228
5102
|
]);
|
|
5229
5103
|
|
|
5230
|
-
/*! @azure/msal-common v14.
|
|
5104
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
5231
5105
|
/*
|
|
5232
5106
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5233
5107
|
* Licensed under the MIT License.
|
|
@@ -5323,7 +5197,7 @@
|
|
|
5323
5197
|
};
|
|
5324
5198
|
};
|
|
5325
5199
|
|
|
5326
|
-
/*! @azure/msal-common v14.
|
|
5200
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
5327
5201
|
|
|
5328
5202
|
/*
|
|
5329
5203
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5432,7 +5306,7 @@
|
|
|
5432
5306
|
},
|
|
5433
5307
|
};
|
|
5434
5308
|
|
|
5435
|
-
/*! @azure/msal-common v14.
|
|
5309
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
5436
5310
|
|
|
5437
5311
|
/*
|
|
5438
5312
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6271,7 +6145,7 @@
|
|
|
6271
6145
|
};
|
|
6272
6146
|
}
|
|
6273
6147
|
|
|
6274
|
-
/*! @azure/msal-common v14.
|
|
6148
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6275
6149
|
|
|
6276
6150
|
/*
|
|
6277
6151
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6302,7 +6176,154 @@
|
|
|
6302
6176
|
}
|
|
6303
6177
|
}
|
|
6304
6178
|
|
|
6305
|
-
/*! @azure/msal-common v14.
|
|
6179
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6180
|
+
|
|
6181
|
+
/*
|
|
6182
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6183
|
+
* Licensed under the MIT License.
|
|
6184
|
+
*/
|
|
6185
|
+
/**
|
|
6186
|
+
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
6187
|
+
*/
|
|
6188
|
+
class ServerError extends AuthError {
|
|
6189
|
+
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
6190
|
+
super(errorCode, errorMessage, subError);
|
|
6191
|
+
this.name = "ServerError";
|
|
6192
|
+
this.errorNo = errorNo;
|
|
6193
|
+
this.status = status;
|
|
6194
|
+
Object.setPrototypeOf(this, ServerError.prototype);
|
|
6195
|
+
}
|
|
6196
|
+
}
|
|
6197
|
+
|
|
6198
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6199
|
+
|
|
6200
|
+
/*
|
|
6201
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6202
|
+
* Licensed under the MIT License.
|
|
6203
|
+
*/
|
|
6204
|
+
/** @internal */
|
|
6205
|
+
class ThrottlingUtils {
|
|
6206
|
+
/**
|
|
6207
|
+
* Prepares a RequestThumbprint to be stored as a key.
|
|
6208
|
+
* @param thumbprint
|
|
6209
|
+
*/
|
|
6210
|
+
static generateThrottlingStorageKey(thumbprint) {
|
|
6211
|
+
return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;
|
|
6212
|
+
}
|
|
6213
|
+
/**
|
|
6214
|
+
* Performs necessary throttling checks before a network request.
|
|
6215
|
+
* @param cacheManager
|
|
6216
|
+
* @param thumbprint
|
|
6217
|
+
*/
|
|
6218
|
+
static preProcess(cacheManager, thumbprint) {
|
|
6219
|
+
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
6220
|
+
const value = cacheManager.getThrottlingCache(key);
|
|
6221
|
+
if (value) {
|
|
6222
|
+
if (value.throttleTime < Date.now()) {
|
|
6223
|
+
cacheManager.removeItem(key);
|
|
6224
|
+
return;
|
|
6225
|
+
}
|
|
6226
|
+
throw new ServerError(value.errorCodes?.join(" ") || Constants.EMPTY_STRING, value.errorMessage, value.subError);
|
|
6227
|
+
}
|
|
6228
|
+
}
|
|
6229
|
+
/**
|
|
6230
|
+
* Performs necessary throttling checks after a network request.
|
|
6231
|
+
* @param cacheManager
|
|
6232
|
+
* @param thumbprint
|
|
6233
|
+
* @param response
|
|
6234
|
+
*/
|
|
6235
|
+
static postProcess(cacheManager, thumbprint, response) {
|
|
6236
|
+
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
6237
|
+
ThrottlingUtils.checkResponseForRetryAfter(response)) {
|
|
6238
|
+
const thumbprintValue = {
|
|
6239
|
+
throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),
|
|
6240
|
+
error: response.body.error,
|
|
6241
|
+
errorCodes: response.body.error_codes,
|
|
6242
|
+
errorMessage: response.body.error_description,
|
|
6243
|
+
subError: response.body.suberror,
|
|
6244
|
+
};
|
|
6245
|
+
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6248
|
+
/**
|
|
6249
|
+
* Checks a NetworkResponse object's status codes against 429 or 5xx
|
|
6250
|
+
* @param response
|
|
6251
|
+
*/
|
|
6252
|
+
static checkResponseStatus(response) {
|
|
6253
|
+
return (response.status === 429 ||
|
|
6254
|
+
(response.status >= 500 && response.status < 600));
|
|
6255
|
+
}
|
|
6256
|
+
/**
|
|
6257
|
+
* Checks a NetworkResponse object's RetryAfter header
|
|
6258
|
+
* @param response
|
|
6259
|
+
*/
|
|
6260
|
+
static checkResponseForRetryAfter(response) {
|
|
6261
|
+
if (response.headers) {
|
|
6262
|
+
return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&
|
|
6263
|
+
(response.status < 200 || response.status >= 300));
|
|
6264
|
+
}
|
|
6265
|
+
return false;
|
|
6266
|
+
}
|
|
6267
|
+
/**
|
|
6268
|
+
* Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
|
|
6269
|
+
* @param throttleTime
|
|
6270
|
+
*/
|
|
6271
|
+
static calculateThrottleTime(throttleTime) {
|
|
6272
|
+
const time = throttleTime <= 0 ? 0 : throttleTime;
|
|
6273
|
+
const currentSeconds = Date.now() / 1000;
|
|
6274
|
+
return Math.floor(Math.min(currentSeconds +
|
|
6275
|
+
(time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds +
|
|
6276
|
+
ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);
|
|
6277
|
+
}
|
|
6278
|
+
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
6279
|
+
const thumbprint = {
|
|
6280
|
+
clientId: clientId,
|
|
6281
|
+
authority: request.authority,
|
|
6282
|
+
scopes: request.scopes,
|
|
6283
|
+
homeAccountIdentifier: homeAccountIdentifier,
|
|
6284
|
+
claims: request.claims,
|
|
6285
|
+
authenticationScheme: request.authenticationScheme,
|
|
6286
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
6287
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
6288
|
+
shrClaims: request.shrClaims,
|
|
6289
|
+
sshKid: request.sshKid,
|
|
6290
|
+
};
|
|
6291
|
+
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
6292
|
+
cacheManager.removeItem(key);
|
|
6293
|
+
}
|
|
6294
|
+
}
|
|
6295
|
+
|
|
6296
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6297
|
+
|
|
6298
|
+
/*
|
|
6299
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6300
|
+
* Licensed under the MIT License.
|
|
6301
|
+
*/
|
|
6302
|
+
/**
|
|
6303
|
+
* Represents network related errors
|
|
6304
|
+
*/
|
|
6305
|
+
class NetworkError extends AuthError {
|
|
6306
|
+
constructor(error, httpStatus, responseHeaders) {
|
|
6307
|
+
super(error.errorCode, error.errorMessage, error.subError);
|
|
6308
|
+
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
6309
|
+
this.name = "NetworkError";
|
|
6310
|
+
this.error = error;
|
|
6311
|
+
this.httpStatus = httpStatus;
|
|
6312
|
+
this.responseHeaders = responseHeaders;
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
/**
|
|
6316
|
+
* Creates NetworkError object for a failed network request
|
|
6317
|
+
* @param error - Error to be thrown back to the caller
|
|
6318
|
+
* @param httpStatus - Status code of the network request
|
|
6319
|
+
* @param responseHeaders - Response headers of the network request, when available
|
|
6320
|
+
* @returns NetworkError object
|
|
6321
|
+
*/
|
|
6322
|
+
function createNetworkError(error, httpStatus, responseHeaders) {
|
|
6323
|
+
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6326
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6306
6327
|
|
|
6307
6328
|
/*
|
|
6308
6329
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6324,8 +6345,6 @@
|
|
|
6324
6345
|
this.cacheManager = this.config.storageInterface;
|
|
6325
6346
|
// Set the network interface
|
|
6326
6347
|
this.networkClient = this.config.networkInterface;
|
|
6327
|
-
// Set the NetworkManager
|
|
6328
|
-
this.networkManager = new NetworkManager(this.networkClient, this.cacheManager);
|
|
6329
6348
|
// Set TelemetryManager
|
|
6330
6349
|
this.serverTelemetryManager = this.config.serverTelemetryManager;
|
|
6331
6350
|
// set Authority
|
|
@@ -6369,11 +6388,7 @@
|
|
|
6369
6388
|
if (queuedEvent) {
|
|
6370
6389
|
this.performanceClient?.addQueueMeasurement(queuedEvent, correlationId);
|
|
6371
6390
|
}
|
|
6372
|
-
const response = await this.
|
|
6373
|
-
this.performanceClient?.addFields({
|
|
6374
|
-
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
6375
|
-
httpVerToken: response.headers?.[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
6376
|
-
}, correlationId);
|
|
6391
|
+
const response = await this.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers }, correlationId);
|
|
6377
6392
|
if (this.config.serverTelemetryManager &&
|
|
6378
6393
|
response.status < 500 &&
|
|
6379
6394
|
response.status !== 429) {
|
|
@@ -6382,6 +6397,52 @@
|
|
|
6382
6397
|
}
|
|
6383
6398
|
return response;
|
|
6384
6399
|
}
|
|
6400
|
+
/**
|
|
6401
|
+
* Wraps sendPostRequestAsync with necessary preflight and postflight logic
|
|
6402
|
+
* @param thumbprint - Request thumbprint for throttling
|
|
6403
|
+
* @param tokenEndpoint - Endpoint to make the POST to
|
|
6404
|
+
* @param options - Body and Headers to include on the POST request
|
|
6405
|
+
* @param correlationId - CorrelationId for telemetry
|
|
6406
|
+
*/
|
|
6407
|
+
async sendPostRequest(thumbprint, tokenEndpoint, options, correlationId) {
|
|
6408
|
+
ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
|
|
6409
|
+
let response;
|
|
6410
|
+
try {
|
|
6411
|
+
response = await invokeAsync((this.networkClient.sendPostRequestAsync.bind(this.networkClient)), PerformanceEvents.NetworkClientSendPostRequestAsync, this.logger, this.performanceClient, correlationId)(tokenEndpoint, options);
|
|
6412
|
+
const responseHeaders = response.headers || {};
|
|
6413
|
+
this.performanceClient?.addFields({
|
|
6414
|
+
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
6415
|
+
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
6416
|
+
requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] || "",
|
|
6417
|
+
}, correlationId);
|
|
6418
|
+
}
|
|
6419
|
+
catch (e) {
|
|
6420
|
+
if (e instanceof NetworkError) {
|
|
6421
|
+
const responseHeaders = e.responseHeaders;
|
|
6422
|
+
if (responseHeaders) {
|
|
6423
|
+
this.performanceClient?.addFields({
|
|
6424
|
+
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
6425
|
+
requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] ||
|
|
6426
|
+
"",
|
|
6427
|
+
contentTypeHeader: responseHeaders[HeaderNames.CONTENT_TYPE] ||
|
|
6428
|
+
undefined,
|
|
6429
|
+
contentLengthHeader: responseHeaders[HeaderNames.CONTENT_LENGTH] ||
|
|
6430
|
+
undefined,
|
|
6431
|
+
httpStatus: e.httpStatus,
|
|
6432
|
+
}, correlationId);
|
|
6433
|
+
}
|
|
6434
|
+
throw e.error;
|
|
6435
|
+
}
|
|
6436
|
+
if (e instanceof AuthError) {
|
|
6437
|
+
throw e;
|
|
6438
|
+
}
|
|
6439
|
+
else {
|
|
6440
|
+
throw createClientAuthError(networkError);
|
|
6441
|
+
}
|
|
6442
|
+
}
|
|
6443
|
+
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
|
|
6444
|
+
return response;
|
|
6445
|
+
}
|
|
6385
6446
|
/**
|
|
6386
6447
|
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
6387
6448
|
* @param updatedAuthority
|
|
@@ -6397,15 +6458,22 @@
|
|
|
6397
6458
|
* @param request
|
|
6398
6459
|
*/
|
|
6399
6460
|
createTokenQueryParameters(request) {
|
|
6400
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
6461
|
+
const parameterBuilder = new RequestParameterBuilder(request.correlationId, this.performanceClient);
|
|
6462
|
+
if (request.embeddedClientId) {
|
|
6463
|
+
parameterBuilder.addBrokerParameters({
|
|
6464
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
6465
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
6466
|
+
});
|
|
6467
|
+
}
|
|
6401
6468
|
if (request.tokenQueryParameters) {
|
|
6402
6469
|
parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);
|
|
6403
6470
|
}
|
|
6471
|
+
parameterBuilder.addCorrelationId(request.correlationId);
|
|
6404
6472
|
return parameterBuilder.createQueryString();
|
|
6405
6473
|
}
|
|
6406
6474
|
}
|
|
6407
6475
|
|
|
6408
|
-
/*! @azure/msal-common v14.
|
|
6476
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6409
6477
|
/*
|
|
6410
6478
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6411
6479
|
* Licensed under the MIT License.
|
|
@@ -6431,7 +6499,7 @@
|
|
|
6431
6499
|
refreshTokenExpired: refreshTokenExpired
|
|
6432
6500
|
});
|
|
6433
6501
|
|
|
6434
|
-
/*! @azure/msal-common v14.
|
|
6502
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6435
6503
|
|
|
6436
6504
|
/*
|
|
6437
6505
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6519,7 +6587,7 @@
|
|
|
6519
6587
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6520
6588
|
}
|
|
6521
6589
|
|
|
6522
|
-
/*! @azure/msal-common v14.
|
|
6590
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6523
6591
|
|
|
6524
6592
|
/*
|
|
6525
6593
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6591,7 +6659,7 @@
|
|
|
6591
6659
|
}
|
|
6592
6660
|
}
|
|
6593
6661
|
|
|
6594
|
-
/*! @azure/msal-common v14.
|
|
6662
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6595
6663
|
|
|
6596
6664
|
/*
|
|
6597
6665
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6675,7 +6743,7 @@
|
|
|
6675
6743
|
}
|
|
6676
6744
|
}
|
|
6677
6745
|
|
|
6678
|
-
/*! @azure/msal-common v14.
|
|
6746
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6679
6747
|
/*
|
|
6680
6748
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6681
6749
|
* Licensed under the MIT License.
|
|
@@ -6702,7 +6770,7 @@
|
|
|
6702
6770
|
}
|
|
6703
6771
|
}
|
|
6704
6772
|
|
|
6705
|
-
/*! @azure/msal-common v14.
|
|
6773
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
6706
6774
|
|
|
6707
6775
|
/*
|
|
6708
6776
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7079,7 +7147,7 @@
|
|
|
7079
7147
|
return baseAccount;
|
|
7080
7148
|
}
|
|
7081
7149
|
|
|
7082
|
-
/*! @azure/msal-common v14.
|
|
7150
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7083
7151
|
/*
|
|
7084
7152
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7085
7153
|
* Licensed under the MIT License.
|
|
@@ -7097,7 +7165,7 @@
|
|
|
7097
7165
|
}
|
|
7098
7166
|
}
|
|
7099
7167
|
|
|
7100
|
-
/*! @azure/msal-common v14.
|
|
7168
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7101
7169
|
|
|
7102
7170
|
/*
|
|
7103
7171
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7223,8 +7291,9 @@
|
|
|
7223
7291
|
*/
|
|
7224
7292
|
async createTokenRequestBody(request) {
|
|
7225
7293
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
|
|
7226
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
7227
|
-
parameterBuilder.addClientId(request.
|
|
7294
|
+
const parameterBuilder = new RequestParameterBuilder(request.correlationId, this.performanceClient);
|
|
7295
|
+
parameterBuilder.addClientId(request.embeddedClientId ||
|
|
7296
|
+
request.tokenBodyParameters?.[CLIENT_ID] ||
|
|
7228
7297
|
this.config.authOptions.clientId);
|
|
7229
7298
|
/*
|
|
7230
7299
|
* For hybrid spa flow, there will be a code but no verifier
|
|
@@ -7284,9 +7353,6 @@
|
|
|
7284
7353
|
throw createClientConfigurationError(missingSshJwk);
|
|
7285
7354
|
}
|
|
7286
7355
|
}
|
|
7287
|
-
const correlationId = request.correlationId ||
|
|
7288
|
-
this.config.cryptoInterface.createNewGuid();
|
|
7289
|
-
parameterBuilder.addCorrelationId(correlationId);
|
|
7290
7356
|
if (!StringUtils.isEmptyObj(request.claims) ||
|
|
7291
7357
|
(this.config.authOptions.clientCapabilities &&
|
|
7292
7358
|
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
@@ -7326,6 +7392,12 @@
|
|
|
7326
7392
|
break;
|
|
7327
7393
|
}
|
|
7328
7394
|
}
|
|
7395
|
+
if (request.embeddedClientId) {
|
|
7396
|
+
parameterBuilder.addBrokerParameters({
|
|
7397
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
7398
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
7399
|
+
});
|
|
7400
|
+
}
|
|
7329
7401
|
if (request.tokenBodyParameters) {
|
|
7330
7402
|
parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
|
|
7331
7403
|
}
|
|
@@ -7344,9 +7416,13 @@
|
|
|
7344
7416
|
* @param request
|
|
7345
7417
|
*/
|
|
7346
7418
|
async createAuthCodeUrlQueryString(request) {
|
|
7347
|
-
|
|
7348
|
-
const
|
|
7349
|
-
|
|
7419
|
+
// generate the correlationId if not set by the user and add
|
|
7420
|
+
const correlationId = request.correlationId ||
|
|
7421
|
+
this.config.cryptoInterface.createNewGuid();
|
|
7422
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, correlationId);
|
|
7423
|
+
const parameterBuilder = new RequestParameterBuilder(correlationId, this.performanceClient);
|
|
7424
|
+
parameterBuilder.addClientId(request.embeddedClientId ||
|
|
7425
|
+
request.extraQueryParameters?.[CLIENT_ID] ||
|
|
7350
7426
|
this.config.authOptions.clientId);
|
|
7351
7427
|
const requestScopes = [
|
|
7352
7428
|
...(request.scopes || []),
|
|
@@ -7355,9 +7431,6 @@
|
|
|
7355
7431
|
parameterBuilder.addScopes(requestScopes, true, this.oidcDefaultScopes);
|
|
7356
7432
|
// validate the redirectUri (to be a non null value)
|
|
7357
7433
|
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
7358
|
-
// generate the correlationId if not set by the user and add
|
|
7359
|
-
const correlationId = request.correlationId ||
|
|
7360
|
-
this.config.cryptoInterface.createNewGuid();
|
|
7361
7434
|
parameterBuilder.addCorrelationId(correlationId);
|
|
7362
7435
|
// add response_mode. If not passed in it defaults to query.
|
|
7363
7436
|
parameterBuilder.addResponseMode(request.responseMode);
|
|
@@ -7459,6 +7532,12 @@
|
|
|
7459
7532
|
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
7460
7533
|
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
7461
7534
|
}
|
|
7535
|
+
if (request.embeddedClientId) {
|
|
7536
|
+
parameterBuilder.addBrokerParameters({
|
|
7537
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
7538
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
7539
|
+
});
|
|
7540
|
+
}
|
|
7462
7541
|
this.addExtraQueryParams(request, parameterBuilder);
|
|
7463
7542
|
if (request.nativeBroker) {
|
|
7464
7543
|
// signal ests that this is a WAM call
|
|
@@ -7485,7 +7564,7 @@
|
|
|
7485
7564
|
* @param request
|
|
7486
7565
|
*/
|
|
7487
7566
|
createLogoutUrlQueryString(request) {
|
|
7488
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
7567
|
+
const parameterBuilder = new RequestParameterBuilder(request.correlationId, this.performanceClient);
|
|
7489
7568
|
if (request.postLogoutRedirectUri) {
|
|
7490
7569
|
parameterBuilder.addPostLogoutRedirectUri(request.postLogoutRedirectUri);
|
|
7491
7570
|
}
|
|
@@ -7528,7 +7607,7 @@
|
|
|
7528
7607
|
}
|
|
7529
7608
|
}
|
|
7530
7609
|
|
|
7531
|
-
/*! @azure/msal-common v14.
|
|
7610
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7532
7611
|
|
|
7533
7612
|
/*
|
|
7534
7613
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7666,8 +7745,9 @@
|
|
|
7666
7745
|
async createTokenRequestBody(request) {
|
|
7667
7746
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
|
|
7668
7747
|
const correlationId = request.correlationId;
|
|
7669
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
7670
|
-
parameterBuilder.addClientId(request.
|
|
7748
|
+
const parameterBuilder = new RequestParameterBuilder(correlationId, this.performanceClient);
|
|
7749
|
+
parameterBuilder.addClientId(request.embeddedClientId ||
|
|
7750
|
+
request.tokenBodyParameters?.[CLIENT_ID] ||
|
|
7671
7751
|
this.config.authOptions.clientId);
|
|
7672
7752
|
if (request.redirectUri) {
|
|
7673
7753
|
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
@@ -7681,7 +7761,6 @@
|
|
|
7681
7761
|
if (this.serverTelemetryManager && !isOidcProtocolMode(this.config)) {
|
|
7682
7762
|
parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
|
|
7683
7763
|
}
|
|
7684
|
-
parameterBuilder.addCorrelationId(correlationId);
|
|
7685
7764
|
parameterBuilder.addRefreshToken(request.refreshToken);
|
|
7686
7765
|
if (this.config.clientCredentials.clientSecret) {
|
|
7687
7766
|
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
@@ -7735,6 +7814,12 @@
|
|
|
7735
7814
|
break;
|
|
7736
7815
|
}
|
|
7737
7816
|
}
|
|
7817
|
+
if (request.embeddedClientId) {
|
|
7818
|
+
parameterBuilder.addBrokerParameters({
|
|
7819
|
+
brokerClientId: this.config.authOptions.clientId,
|
|
7820
|
+
brokerRedirectUri: this.config.authOptions.redirectUri,
|
|
7821
|
+
});
|
|
7822
|
+
}
|
|
7738
7823
|
if (request.tokenBodyParameters) {
|
|
7739
7824
|
parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
|
|
7740
7825
|
}
|
|
@@ -7742,7 +7827,7 @@
|
|
|
7742
7827
|
}
|
|
7743
7828
|
}
|
|
7744
7829
|
|
|
7745
|
-
/*! @azure/msal-common v14.
|
|
7830
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7746
7831
|
|
|
7747
7832
|
/*
|
|
7748
7833
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7878,7 +7963,7 @@
|
|
|
7878
7963
|
}
|
|
7879
7964
|
}
|
|
7880
7965
|
|
|
7881
|
-
/*! @azure/msal-common v14.
|
|
7966
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7882
7967
|
|
|
7883
7968
|
/*
|
|
7884
7969
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7893,7 +7978,7 @@
|
|
|
7893
7978
|
},
|
|
7894
7979
|
};
|
|
7895
7980
|
|
|
7896
|
-
/*! @azure/msal-common v14.
|
|
7981
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7897
7982
|
|
|
7898
7983
|
/*
|
|
7899
7984
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7951,7 +8036,7 @@
|
|
|
7951
8036
|
}
|
|
7952
8037
|
}
|
|
7953
8038
|
|
|
7954
|
-
/*! @azure/msal-common v14.
|
|
8039
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
7955
8040
|
|
|
7956
8041
|
/*
|
|
7957
8042
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8214,7 +8299,7 @@
|
|
|
8214
8299
|
}
|
|
8215
8300
|
}
|
|
8216
8301
|
|
|
8217
|
-
/*! @azure/msal-common v14.
|
|
8302
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8218
8303
|
/*
|
|
8219
8304
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8220
8305
|
* Licensed under the MIT License.
|
|
@@ -8222,7 +8307,7 @@
|
|
|
8222
8307
|
const missingKidError = "missing_kid_error";
|
|
8223
8308
|
const missingAlgError = "missing_alg_error";
|
|
8224
8309
|
|
|
8225
|
-
/*! @azure/msal-common v14.
|
|
8310
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8226
8311
|
|
|
8227
8312
|
/*
|
|
8228
8313
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8247,7 +8332,7 @@
|
|
|
8247
8332
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
8248
8333
|
}
|
|
8249
8334
|
|
|
8250
|
-
/*! @azure/msal-common v14.
|
|
8335
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8251
8336
|
|
|
8252
8337
|
/*
|
|
8253
8338
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8287,7 +8372,7 @@
|
|
|
8287
8372
|
}
|
|
8288
8373
|
}
|
|
8289
8374
|
|
|
8290
|
-
/*! @azure/msal-common v14.
|
|
8375
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8291
8376
|
|
|
8292
8377
|
/*
|
|
8293
8378
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8366,7 +8451,7 @@
|
|
|
8366
8451
|
}
|
|
8367
8452
|
}
|
|
8368
8453
|
|
|
8369
|
-
/*! @azure/msal-common v14.
|
|
8454
|
+
/*! @azure/msal-common v14.16.0 2024-11-05 */
|
|
8370
8455
|
|
|
8371
8456
|
/*
|
|
8372
8457
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8498,18 +8583,30 @@
|
|
|
8498
8583
|
return [];
|
|
8499
8584
|
}
|
|
8500
8585
|
const stackArr = stack.split("\n") || [];
|
|
8501
|
-
if (stackArr.length < 2) {
|
|
8502
|
-
return [];
|
|
8503
|
-
}
|
|
8504
8586
|
const res = [];
|
|
8587
|
+
// Check for a handful of known, common runtime errors and log them (with redaction where applicable).
|
|
8588
|
+
const firstLine = stackArr[0];
|
|
8589
|
+
if (firstLine.startsWith("TypeError: Cannot read property") ||
|
|
8590
|
+
firstLine.startsWith("TypeError: Cannot read properties of") ||
|
|
8591
|
+
firstLine.startsWith("TypeError: Cannot set property") ||
|
|
8592
|
+
firstLine.startsWith("TypeError: Cannot set properties of") ||
|
|
8593
|
+
firstLine.endsWith("is not a function")) {
|
|
8594
|
+
// These types of errors are not at risk of leaking PII. They will indicate unavailable APIs
|
|
8595
|
+
res.push(compactStackLine(firstLine));
|
|
8596
|
+
}
|
|
8597
|
+
else if (firstLine.startsWith("SyntaxError") ||
|
|
8598
|
+
firstLine.startsWith("TypeError")) {
|
|
8599
|
+
// Prevent unintentional leaking of arbitrary info by redacting contents between both single and double quotes
|
|
8600
|
+
res.push(compactStackLine(
|
|
8601
|
+
// Example: SyntaxError: Unexpected token 'e', "test" is not valid JSON -> SyntaxError: Unexpected token <redacted>, <redacted> is not valid JSON
|
|
8602
|
+
firstLine.replace(/['].*[']|["].*["]/g, "<redacted>")));
|
|
8603
|
+
}
|
|
8505
8604
|
// Get top N stack lines
|
|
8506
|
-
for (
|
|
8507
|
-
// Skip first line as it may contain PII data
|
|
8508
|
-
let ix = Math.max(stackArr.length - stackMaxSize - 1, 1); ix < stackArr.length; ix++) {
|
|
8509
|
-
const line = stackArr[ix];
|
|
8605
|
+
for (let ix = 1; ix < stackArr.length; ix++) {
|
|
8510
8606
|
if (res.length >= stackMaxSize) {
|
|
8511
8607
|
break;
|
|
8512
8608
|
}
|
|
8609
|
+
const line = stackArr[ix];
|
|
8513
8610
|
res.push(compactStackLine(line));
|
|
8514
8611
|
}
|
|
8515
8612
|
return res;
|
|
@@ -8756,13 +8853,20 @@
|
|
|
8756
8853
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
8757
8854
|
}
|
|
8758
8855
|
this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`, event.correlationId);
|
|
8856
|
+
if (error) {
|
|
8857
|
+
addError(error, this.logger, rootEvent);
|
|
8858
|
+
}
|
|
8759
8859
|
// Add sub-measurement attribute to root event.
|
|
8760
8860
|
if (!isRoot) {
|
|
8761
8861
|
rootEvent[event.name + "DurationMs"] = Math.floor(event.durationMs);
|
|
8762
8862
|
return { ...rootEvent };
|
|
8763
8863
|
}
|
|
8764
|
-
if (
|
|
8765
|
-
|
|
8864
|
+
if (isRoot &&
|
|
8865
|
+
!error &&
|
|
8866
|
+
(rootEvent.errorCode || rootEvent.subErrorCode)) {
|
|
8867
|
+
this.logger.trace(`PerformanceClient: Remove error and sub-error codes for root event ${event.name} as intermediate error was successfully handled`, event.correlationId);
|
|
8868
|
+
rootEvent.errorCode = undefined;
|
|
8869
|
+
rootEvent.subErrorCode = undefined;
|
|
8766
8870
|
}
|
|
8767
8871
|
let finalEvent = { ...rootEvent, ...event };
|
|
8768
8872
|
let incompleteSubsCount = 0;
|
|
@@ -9005,7 +9109,9 @@
|
|
|
9005
9109
|
const uninitializedPublicClientApplication = "uninitialized_public_client_application";
|
|
9006
9110
|
const nativePromptNotSupported = "native_prompt_not_supported";
|
|
9007
9111
|
const invalidBase64String = "invalid_base64_string";
|
|
9008
|
-
const invalidPopTokenRequest = "invalid_pop_token_request";
|
|
9112
|
+
const invalidPopTokenRequest = "invalid_pop_token_request";
|
|
9113
|
+
const failedToBuildHeaders = "failed_to_build_headers";
|
|
9114
|
+
const failedToParseHeaders = "failed_to_parse_headers";
|
|
9009
9115
|
|
|
9010
9116
|
var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
9011
9117
|
__proto__: null,
|
|
@@ -9020,6 +9126,8 @@
|
|
|
9020
9126
|
databaseUnavailable: databaseUnavailable,
|
|
9021
9127
|
emptyNavigateUri: emptyNavigateUri,
|
|
9022
9128
|
emptyWindowError: emptyWindowError,
|
|
9129
|
+
failedToBuildHeaders: failedToBuildHeaders,
|
|
9130
|
+
failedToParseHeaders: failedToParseHeaders,
|
|
9023
9131
|
failedToParseResponse: failedToParseResponse,
|
|
9024
9132
|
getRequestFailed: getRequestFailed,
|
|
9025
9133
|
hashDoesNotContainKnownProperties: hashDoesNotContainKnownProperties,
|
|
@@ -9112,6 +9220,8 @@
|
|
|
9112
9220
|
[nativePromptNotSupported]: "The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",
|
|
9113
9221
|
[invalidBase64String]: "Invalid base64 encoded string.",
|
|
9114
9222
|
[invalidPopTokenRequest]: "Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",
|
|
9223
|
+
[failedToBuildHeaders]: "Failed to build request headers object.",
|
|
9224
|
+
[failedToParseHeaders]: "Failed to parse response headers",
|
|
9115
9225
|
};
|
|
9116
9226
|
/**
|
|
9117
9227
|
* BrowserAuthErrorMessage class containing string constants used by error codes and messages.
|
|
@@ -9311,14 +9421,14 @@
|
|
|
9311
9421
|
* Browser library error class thrown by the MSAL.js library for SPAs
|
|
9312
9422
|
*/
|
|
9313
9423
|
class BrowserAuthError extends AuthError {
|
|
9314
|
-
constructor(errorCode) {
|
|
9315
|
-
super(errorCode, BrowserAuthErrorMessages[errorCode]);
|
|
9424
|
+
constructor(errorCode, subError) {
|
|
9425
|
+
super(errorCode, BrowserAuthErrorMessages[errorCode], subError);
|
|
9316
9426
|
Object.setPrototypeOf(this, BrowserAuthError.prototype);
|
|
9317
9427
|
this.name = "BrowserAuthError";
|
|
9318
9428
|
}
|
|
9319
9429
|
}
|
|
9320
|
-
function createBrowserAuthError(errorCode) {
|
|
9321
|
-
return new BrowserAuthError(errorCode);
|
|
9430
|
+
function createBrowserAuthError(errorCode, subError) {
|
|
9431
|
+
return new BrowserAuthError(errorCode, subError);
|
|
9322
9432
|
}
|
|
9323
9433
|
|
|
9324
9434
|
/*
|
|
@@ -9601,6 +9711,7 @@
|
|
|
9601
9711
|
const UUID_CHARS = "0123456789abcdef";
|
|
9602
9712
|
// Array to store UINT32 random value
|
|
9603
9713
|
const UINT32_ARR = new Uint32Array(1);
|
|
9714
|
+
const SUBTLE_SUBERROR = "crypto_subtle_undefined";
|
|
9604
9715
|
const keygenAlgorithmOptions = {
|
|
9605
9716
|
name: PKCS1_V15_KEYGEN_ALG,
|
|
9606
9717
|
hash: S256_HASH_ALG,
|
|
@@ -9610,14 +9721,16 @@
|
|
|
9610
9721
|
/**
|
|
9611
9722
|
* Check whether browser crypto is available.
|
|
9612
9723
|
*/
|
|
9613
|
-
function validateCryptoAvailable(
|
|
9614
|
-
if (
|
|
9615
|
-
|
|
9724
|
+
function validateCryptoAvailable() {
|
|
9725
|
+
if (!window) {
|
|
9726
|
+
throw createBrowserAuthError(nonBrowserEnvironment);
|
|
9616
9727
|
}
|
|
9617
|
-
|
|
9618
|
-
logger.error("BrowserCrypto: crypto interface is unavailable");
|
|
9728
|
+
if (!window.crypto) {
|
|
9619
9729
|
throw createBrowserAuthError(cryptoNonExistent);
|
|
9620
9730
|
}
|
|
9731
|
+
if (!window.crypto.subtle) {
|
|
9732
|
+
throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
|
|
9733
|
+
}
|
|
9621
9734
|
}
|
|
9622
9735
|
/**
|
|
9623
9736
|
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
@@ -10022,29 +10135,31 @@
|
|
|
10022
10135
|
*/
|
|
10023
10136
|
async sendGetRequestAsync(url, options) {
|
|
10024
10137
|
let response;
|
|
10138
|
+
let responseHeaders = {};
|
|
10139
|
+
let responseStatus = 0;
|
|
10140
|
+
const reqHeaders = getFetchHeaders(options);
|
|
10025
10141
|
try {
|
|
10026
10142
|
response = await fetch(url, {
|
|
10027
10143
|
method: HTTP_REQUEST_TYPE.GET,
|
|
10028
|
-
headers:
|
|
10144
|
+
headers: reqHeaders,
|
|
10029
10145
|
});
|
|
10030
10146
|
}
|
|
10031
10147
|
catch (e) {
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
else {
|
|
10036
|
-
throw createBrowserAuthError(noNetworkConnectivity);
|
|
10037
|
-
}
|
|
10148
|
+
throw createBrowserAuthError(window.navigator.onLine
|
|
10149
|
+
? getRequestFailed
|
|
10150
|
+
: noNetworkConnectivity);
|
|
10038
10151
|
}
|
|
10152
|
+
responseHeaders = getHeaderDict(response.headers);
|
|
10039
10153
|
try {
|
|
10154
|
+
responseStatus = response.status;
|
|
10040
10155
|
return {
|
|
10041
|
-
headers:
|
|
10156
|
+
headers: responseHeaders,
|
|
10042
10157
|
body: (await response.json()),
|
|
10043
|
-
status:
|
|
10158
|
+
status: responseStatus,
|
|
10044
10159
|
};
|
|
10045
10160
|
}
|
|
10046
10161
|
catch (e) {
|
|
10047
|
-
throw createBrowserAuthError(failedToParseResponse);
|
|
10162
|
+
throw createNetworkError(createBrowserAuthError(failedToParseResponse), responseStatus, responseHeaders);
|
|
10048
10163
|
}
|
|
10049
10164
|
}
|
|
10050
10165
|
/**
|
|
@@ -10054,56 +10169,73 @@
|
|
|
10054
10169
|
* @param body
|
|
10055
10170
|
*/
|
|
10056
10171
|
async sendPostRequestAsync(url, options) {
|
|
10057
|
-
const reqBody = (options && options.body) ||
|
|
10172
|
+
const reqBody = (options && options.body) || "";
|
|
10173
|
+
const reqHeaders = getFetchHeaders(options);
|
|
10058
10174
|
let response;
|
|
10175
|
+
let responseStatus = 0;
|
|
10176
|
+
let responseHeaders = {};
|
|
10059
10177
|
try {
|
|
10060
10178
|
response = await fetch(url, {
|
|
10061
10179
|
method: HTTP_REQUEST_TYPE.POST,
|
|
10062
|
-
headers:
|
|
10180
|
+
headers: reqHeaders,
|
|
10063
10181
|
body: reqBody,
|
|
10064
10182
|
});
|
|
10065
10183
|
}
|
|
10066
10184
|
catch (e) {
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
else {
|
|
10071
|
-
throw createBrowserAuthError(noNetworkConnectivity);
|
|
10072
|
-
}
|
|
10185
|
+
throw createBrowserAuthError(window.navigator.onLine
|
|
10186
|
+
? postRequestFailed
|
|
10187
|
+
: noNetworkConnectivity);
|
|
10073
10188
|
}
|
|
10189
|
+
responseHeaders = getHeaderDict(response.headers);
|
|
10074
10190
|
try {
|
|
10191
|
+
responseStatus = response.status;
|
|
10075
10192
|
return {
|
|
10076
|
-
headers:
|
|
10193
|
+
headers: responseHeaders,
|
|
10077
10194
|
body: (await response.json()),
|
|
10078
|
-
status:
|
|
10195
|
+
status: responseStatus,
|
|
10079
10196
|
};
|
|
10080
10197
|
}
|
|
10081
10198
|
catch (e) {
|
|
10082
|
-
throw createBrowserAuthError(failedToParseResponse);
|
|
10199
|
+
throw createNetworkError(createBrowserAuthError(failedToParseResponse), responseStatus, responseHeaders);
|
|
10083
10200
|
}
|
|
10084
10201
|
}
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10202
|
+
}
|
|
10203
|
+
/**
|
|
10204
|
+
* Get Fetch API Headers object from string map
|
|
10205
|
+
* @param inputHeaders
|
|
10206
|
+
*/
|
|
10207
|
+
function getFetchHeaders(options) {
|
|
10208
|
+
try {
|
|
10090
10209
|
const headers = new Headers();
|
|
10091
10210
|
if (!(options && options.headers)) {
|
|
10092
10211
|
return headers;
|
|
10093
10212
|
}
|
|
10094
10213
|
const optionsHeaders = options.headers;
|
|
10095
|
-
Object.
|
|
10096
|
-
headers.append(key,
|
|
10214
|
+
Object.entries(optionsHeaders).forEach(([key, value]) => {
|
|
10215
|
+
headers.append(key, value);
|
|
10097
10216
|
});
|
|
10098
10217
|
return headers;
|
|
10099
10218
|
}
|
|
10100
|
-
|
|
10219
|
+
catch (e) {
|
|
10220
|
+
throw createBrowserAuthError(failedToBuildHeaders);
|
|
10221
|
+
}
|
|
10222
|
+
}
|
|
10223
|
+
/**
|
|
10224
|
+
* Returns object representing response headers
|
|
10225
|
+
* @param headers
|
|
10226
|
+
* @returns
|
|
10227
|
+
*/
|
|
10228
|
+
function getHeaderDict(headers) {
|
|
10229
|
+
try {
|
|
10101
10230
|
const headerDict = {};
|
|
10102
10231
|
headers.forEach((value, key) => {
|
|
10103
10232
|
headerDict[key] = value;
|
|
10104
10233
|
});
|
|
10105
10234
|
return headerDict;
|
|
10106
10235
|
}
|
|
10236
|
+
catch (e) {
|
|
10237
|
+
throw createBrowserAuthError(failedToParseHeaders);
|
|
10238
|
+
}
|
|
10107
10239
|
}
|
|
10108
10240
|
|
|
10109
10241
|
/*
|
|
@@ -10132,7 +10264,7 @@
|
|
|
10132
10264
|
knownAuthorities: [],
|
|
10133
10265
|
cloudDiscoveryMetadata: Constants.EMPTY_STRING,
|
|
10134
10266
|
authorityMetadata: Constants.EMPTY_STRING,
|
|
10135
|
-
redirectUri:
|
|
10267
|
+
redirectUri: typeof window !== "undefined" ? getCurrentUri() : "",
|
|
10136
10268
|
postLogoutRedirectUri: Constants.EMPTY_STRING,
|
|
10137
10269
|
navigateToLoginRequestUrl: true,
|
|
10138
10270
|
clientCapabilities: [],
|
|
@@ -10238,7 +10370,7 @@
|
|
|
10238
10370
|
|
|
10239
10371
|
/* eslint-disable header/header */
|
|
10240
10372
|
const name = "@azure/msal-browser";
|
|
10241
|
-
const version = "3.
|
|
10373
|
+
const version = "3.27.0";
|
|
10242
10374
|
|
|
10243
10375
|
/*
|
|
10244
10376
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11028,7 +11160,7 @@
|
|
|
11028
11160
|
constructor(logger, performanceClient) {
|
|
11029
11161
|
this.logger = logger;
|
|
11030
11162
|
// Browser crypto needs to be validated first before any other classes can be set.
|
|
11031
|
-
validateCryptoAvailable(
|
|
11163
|
+
validateCryptoAvailable();
|
|
11032
11164
|
this.cache = new AsyncMemoryStorage(this.logger);
|
|
11033
11165
|
this.performanceClient = performanceClient;
|
|
11034
11166
|
}
|
|
@@ -12821,9 +12953,7 @@
|
|
|
12821
12953
|
*/
|
|
12822
12954
|
getRedirectUri(requestRedirectUri) {
|
|
12823
12955
|
this.logger.verbose("getRedirectUri called");
|
|
12824
|
-
const redirectUri = requestRedirectUri ||
|
|
12825
|
-
this.config.auth.redirectUri ||
|
|
12826
|
-
getCurrentUri();
|
|
12956
|
+
const redirectUri = requestRedirectUri || this.config.auth.redirectUri;
|
|
12827
12957
|
return UrlString.getAbsoluteUrl(redirectUri, getCurrentUri());
|
|
12828
12958
|
}
|
|
12829
12959
|
/**
|
|
@@ -13146,6 +13276,7 @@
|
|
|
13146
13276
|
clientId: this.config.auth.clientId,
|
|
13147
13277
|
authority: discoveredAuthority,
|
|
13148
13278
|
clientCapabilities: this.config.auth.clientCapabilities,
|
|
13279
|
+
redirectUri: this.config.auth.redirectUri,
|
|
13149
13280
|
},
|
|
13150
13281
|
systemOptions: {
|
|
13151
13282
|
tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,
|
|
@@ -13343,10 +13474,6 @@
|
|
|
13343
13474
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
13344
13475
|
* Licensed under the MIT License.
|
|
13345
13476
|
*/
|
|
13346
|
-
const BrokerServerParamKeys = {
|
|
13347
|
-
BROKER_CLIENT_ID: "brk_client_id",
|
|
13348
|
-
BROKER_REDIRECT_URI: "brk_redirect_uri",
|
|
13349
|
-
};
|
|
13350
13477
|
class NativeInteractionClient extends BaseInteractionClient {
|
|
13351
13478
|
constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
|
|
13352
13479
|
super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
@@ -13949,21 +14076,33 @@
|
|
|
13949
14076
|
* @private
|
|
13950
14077
|
*/
|
|
13951
14078
|
handleExtraBrokerParams(request) {
|
|
13952
|
-
|
|
14079
|
+
const hasExtraBrokerParams = request.extraParameters &&
|
|
14080
|
+
request.extraParameters.hasOwnProperty(BROKER_CLIENT_ID) &&
|
|
14081
|
+
request.extraParameters.hasOwnProperty(BROKER_REDIRECT_URI) &&
|
|
14082
|
+
request.extraParameters.hasOwnProperty(CLIENT_ID);
|
|
14083
|
+
if (!request.embeddedClientId && !hasExtraBrokerParams) {
|
|
13953
14084
|
return;
|
|
13954
14085
|
}
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
14086
|
+
let child_client_id = "";
|
|
14087
|
+
const child_redirect_uri = request.redirectUri;
|
|
14088
|
+
if (request.embeddedClientId) {
|
|
14089
|
+
request.redirectUri = this.config.auth.redirectUri;
|
|
14090
|
+
child_client_id = request.embeddedClientId;
|
|
14091
|
+
}
|
|
14092
|
+
else if (request.extraParameters) {
|
|
14093
|
+
request.redirectUri =
|
|
14094
|
+
request.extraParameters[BROKER_REDIRECT_URI];
|
|
14095
|
+
child_client_id =
|
|
14096
|
+
request.extraParameters[CLIENT_ID];
|
|
13966
14097
|
}
|
|
14098
|
+
request.extraParameters = {
|
|
14099
|
+
child_client_id,
|
|
14100
|
+
child_redirect_uri,
|
|
14101
|
+
};
|
|
14102
|
+
this.performanceClient?.addFields({
|
|
14103
|
+
embeddedClientId: child_client_id,
|
|
14104
|
+
embeddedRedirectUri: child_redirect_uri,
|
|
14105
|
+
}, request.correlationId);
|
|
13967
14106
|
}
|
|
13968
14107
|
}
|
|
13969
14108
|
|
|
@@ -16255,7 +16394,6 @@
|
|
|
16255
16394
|
atPopupMeasurement.end({
|
|
16256
16395
|
success: true,
|
|
16257
16396
|
isNativeBroker: true,
|
|
16258
|
-
requestId: response.requestId,
|
|
16259
16397
|
accountType: getAccountType(response.account),
|
|
16260
16398
|
});
|
|
16261
16399
|
return response;
|
|
@@ -16294,7 +16432,6 @@
|
|
|
16294
16432
|
}
|
|
16295
16433
|
atPopupMeasurement.end({
|
|
16296
16434
|
success: true,
|
|
16297
|
-
requestId: result.requestId,
|
|
16298
16435
|
accessTokenSize: result.accessToken.length,
|
|
16299
16436
|
idTokenSize: result.idToken.length,
|
|
16300
16437
|
accountType: getAccountType(result.account),
|
|
@@ -16385,7 +16522,6 @@
|
|
|
16385
16522
|
this.ssoSilentMeasurement?.end({
|
|
16386
16523
|
success: true,
|
|
16387
16524
|
isNativeBroker: response.fromNativeBroker,
|
|
16388
|
-
requestId: response.requestId,
|
|
16389
16525
|
accessTokenSize: response.accessToken.length,
|
|
16390
16526
|
idTokenSize: response.idToken.length,
|
|
16391
16527
|
accountType: getAccountType(response.account),
|
|
@@ -16440,7 +16576,6 @@
|
|
|
16440
16576
|
atbcMeasurement.end({
|
|
16441
16577
|
success: true,
|
|
16442
16578
|
isNativeBroker: result.fromNativeBroker,
|
|
16443
|
-
requestId: result.requestId,
|
|
16444
16579
|
accessTokenSize: result.accessToken.length,
|
|
16445
16580
|
idTokenSize: result.idToken.length,
|
|
16446
16581
|
accountType: getAccountType(result.account),
|
|
@@ -16519,7 +16654,6 @@
|
|
|
16519
16654
|
success: true,
|
|
16520
16655
|
fromCache: response.fromCache,
|
|
16521
16656
|
isNativeBroker: response.fromNativeBroker,
|
|
16522
|
-
requestId: response.requestId,
|
|
16523
16657
|
});
|
|
16524
16658
|
return response;
|
|
16525
16659
|
})
|
|
@@ -17070,7 +17204,6 @@
|
|
|
17070
17204
|
fromCache: result.fromCache,
|
|
17071
17205
|
isNativeBroker: result.fromNativeBroker,
|
|
17072
17206
|
cacheLookupPolicy: request.cacheLookupPolicy,
|
|
17073
|
-
requestId: result.requestId,
|
|
17074
17207
|
accessTokenSize: result.accessToken.length,
|
|
17075
17208
|
idTokenSize: result.idToken.length,
|
|
17076
17209
|
});
|
|
@@ -17181,7 +17314,6 @@
|
|
|
17181
17314
|
this.performanceClient.addFields({
|
|
17182
17315
|
fromCache: response.fromCache,
|
|
17183
17316
|
isNativeBroker: response.fromNativeBroker,
|
|
17184
|
-
requestId: response.requestId,
|
|
17185
17317
|
}, request.correlationId);
|
|
17186
17318
|
}
|
|
17187
17319
|
return response;
|
|
@@ -17281,7 +17413,8 @@
|
|
|
17281
17413
|
else {
|
|
17282
17414
|
extraParams = new Map(Object.entries(request.extraQueryParameters));
|
|
17283
17415
|
}
|
|
17284
|
-
const
|
|
17416
|
+
const correlationId = request.correlationId || this.crypto.createNewGuid();
|
|
17417
|
+
const requestBuilder = new RequestParameterBuilder(correlationId);
|
|
17285
17418
|
const claims = requestBuilder.addClientCapabilitiesToClaims(request.claims, this.clientCapabilities);
|
|
17286
17419
|
const scopes = request.scopes || OIDC_DEFAULT_SCOPES;
|
|
17287
17420
|
const tokenRequest = {
|
|
@@ -17289,9 +17422,7 @@
|
|
|
17289
17422
|
clientId: this.clientId,
|
|
17290
17423
|
authority: request.authority,
|
|
17291
17424
|
scope: scopes.join(" "),
|
|
17292
|
-
correlationId
|
|
17293
|
-
? request.correlationId
|
|
17294
|
-
: this.crypto.createNewGuid(),
|
|
17425
|
+
correlationId,
|
|
17295
17426
|
claims: !StringUtils.isEmptyObj(claims) ? claims : undefined,
|
|
17296
17427
|
state: request.state,
|
|
17297
17428
|
authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,
|
|
@@ -17548,7 +17679,9 @@
|
|
|
17548
17679
|
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
|
|
17549
17680
|
const reqTimestamp = nowSeconds();
|
|
17550
17681
|
const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
|
|
17551
|
-
const result =
|
|
17682
|
+
const result = {
|
|
17683
|
+
...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
|
|
17684
|
+
};
|
|
17552
17685
|
// cache the tokens in the response
|
|
17553
17686
|
await this.hydrateCache(result, request);
|
|
17554
17687
|
this.browserStorage.setActiveAccount(result.account);
|
|
@@ -17632,7 +17765,22 @@
|
|
|
17632
17765
|
atsMeasurement?.add({
|
|
17633
17766
|
nestedAppAuthRequest: true,
|
|
17634
17767
|
});
|
|
17635
|
-
|
|
17768
|
+
// if the request has claims, we cannot look up in the cache
|
|
17769
|
+
if (request.claims) {
|
|
17770
|
+
this.logger.verbose("Claims are present in the request, skipping cache lookup");
|
|
17771
|
+
return null;
|
|
17772
|
+
}
|
|
17773
|
+
// respect cache lookup policy
|
|
17774
|
+
let result = null;
|
|
17775
|
+
switch (request.cacheLookupPolicy) {
|
|
17776
|
+
case CacheLookupPolicy.Default:
|
|
17777
|
+
case CacheLookupPolicy.AccessToken:
|
|
17778
|
+
case CacheLookupPolicy.AccessTokenAndRefreshToken:
|
|
17779
|
+
result = await this.acquireTokenFromCacheInternal(request);
|
|
17780
|
+
break;
|
|
17781
|
+
default:
|
|
17782
|
+
return null;
|
|
17783
|
+
}
|
|
17636
17784
|
if (result) {
|
|
17637
17785
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, result);
|
|
17638
17786
|
atsMeasurement?.add({
|
|
@@ -17685,13 +17833,10 @@
|
|
|
17685
17833
|
if (!cachedAccessToken) {
|
|
17686
17834
|
this.logger.verbose("No cached access token found");
|
|
17687
17835
|
return Promise.resolve(null);
|
|
17688
|
-
// If access token has expired, remove the token from cache and return null
|
|
17689
17836
|
}
|
|
17690
17837
|
else if (wasClockTurnedBack(cachedAccessToken.cachedAt) ||
|
|
17691
17838
|
isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
|
|
17692
|
-
this.logger.verbose("Cached access token has expired
|
|
17693
|
-
const accountEntity = AccountEntity.createFromAccountInfo(currentAccount);
|
|
17694
|
-
await this.browserStorage.removeAccountContext(accountEntity);
|
|
17839
|
+
this.logger.verbose("Cached access token has expired");
|
|
17695
17840
|
return Promise.resolve(null);
|
|
17696
17841
|
}
|
|
17697
17842
|
const cachedIdToken = this.browserStorage.getIdToken(currentAccount, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);
|