@azure/msal-browser 4.0.1 → 4.1.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.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +4 -2
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +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.d.ts +1 -6
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +25 -26
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.d.ts +2 -0
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +26 -12
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +1 -2
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +8 -6
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +2 -1
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/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.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/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 +145 -163
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +145 -163
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +59 -59
- package/lib/types/app/PublicClientApplication.d.ts.map +1 -1
- package/lib/types/cache/BrowserCacheManager.d.ts +1 -6
- package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/lib/types/controllers/NestedAppAuthController.d.ts +2 -0
- package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/lib/types/interaction_client/NativeInteractionClient.d.ts +1 -2
- package/lib/types/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/lib/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/package.json +2 -2
- package/src/app/PublicClientApplication.ts +6 -1
- package/src/cache/BrowserCacheManager.ts +37 -32
- package/src/controllers/NestedAppAuthController.ts +36 -16
- package/src/interaction_client/NativeInteractionClient.ts +11 -12
- package/src/interaction_client/PopupClient.ts +5 -0
- package/src/packageMetadata.ts +1 -1
package/lib/msal-browser.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v4.0
|
|
1
|
+
/*! @azure/msal-browser v4.1.0 2025-02-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v15.0
|
|
5
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6
6
|
/*
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
@@ -306,7 +306,7 @@ const JsonWebTokenTypes = {
|
|
|
306
306
|
// Token renewal offset default in seconds
|
|
307
307
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
308
308
|
|
|
309
|
-
/*! @azure/msal-common v15.0
|
|
309
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
310
310
|
/*
|
|
311
311
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
312
312
|
* Licensed under the MIT License.
|
|
@@ -323,7 +323,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
323
323
|
unexpectedError: unexpectedError
|
|
324
324
|
});
|
|
325
325
|
|
|
326
|
-
/*! @azure/msal-common v15.0
|
|
326
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
327
327
|
|
|
328
328
|
/*
|
|
329
329
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -372,7 +372,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
372
372
|
: AuthErrorMessages[code]);
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
/*! @azure/msal-common v15.0
|
|
375
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
376
376
|
/*
|
|
377
377
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
378
378
|
* Licensed under the MIT License.
|
|
@@ -470,7 +470,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
470
470
|
userTimeoutReached: userTimeoutReached
|
|
471
471
|
});
|
|
472
472
|
|
|
473
|
-
/*! @azure/msal-common v15.0
|
|
473
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
474
474
|
|
|
475
475
|
/*
|
|
476
476
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -722,7 +722,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
722
722
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
-
/*! @azure/msal-common v15.0
|
|
725
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
726
726
|
|
|
727
727
|
/*
|
|
728
728
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -761,7 +761,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
761
761
|
},
|
|
762
762
|
};
|
|
763
763
|
|
|
764
|
-
/*! @azure/msal-common v15.0
|
|
764
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
765
765
|
|
|
766
766
|
/*
|
|
767
767
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -952,12 +952,12 @@ class Logger {
|
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
|
|
955
|
-
/*! @azure/msal-common v15.0
|
|
955
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
956
956
|
/* eslint-disable header/header */
|
|
957
957
|
const name$1 = "@azure/msal-common";
|
|
958
|
-
const version$1 = "15.0
|
|
958
|
+
const version$1 = "15.1.0";
|
|
959
959
|
|
|
960
|
-
/*! @azure/msal-common v15.0
|
|
960
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
961
961
|
/*
|
|
962
962
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
963
963
|
* Licensed under the MIT License.
|
|
@@ -977,7 +977,7 @@ const AzureCloudInstance = {
|
|
|
977
977
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
978
978
|
};
|
|
979
979
|
|
|
980
|
-
/*! @azure/msal-common v15.0
|
|
980
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
981
981
|
|
|
982
982
|
/*
|
|
983
983
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1038,7 +1038,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
|
|
1041
|
-
/*! @azure/msal-common v15.0
|
|
1041
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1042
1042
|
/*
|
|
1043
1043
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1044
1044
|
* Licensed under the MIT License.
|
|
@@ -1075,7 +1075,7 @@ function wasClockTurnedBack(cachedAt) {
|
|
|
1075
1075
|
return cachedAtSec > nowSeconds();
|
|
1076
1076
|
}
|
|
1077
1077
|
|
|
1078
|
-
/*! @azure/msal-common v15.0
|
|
1078
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1079
1079
|
|
|
1080
1080
|
/*
|
|
1081
1081
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1402,7 +1402,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
1402
1402
|
return metadata.expiresAt <= nowSeconds();
|
|
1403
1403
|
}
|
|
1404
1404
|
|
|
1405
|
-
/*! @azure/msal-common v15.0
|
|
1405
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1406
1406
|
/*
|
|
1407
1407
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1408
1408
|
* Licensed under the MIT License.
|
|
@@ -1456,7 +1456,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1456
1456
|
urlParseError: urlParseError
|
|
1457
1457
|
});
|
|
1458
1458
|
|
|
1459
|
-
/*! @azure/msal-common v15.0
|
|
1459
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1460
1460
|
|
|
1461
1461
|
/*
|
|
1462
1462
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1594,7 +1594,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1594
1594
|
return new ClientConfigurationError(errorCode);
|
|
1595
1595
|
}
|
|
1596
1596
|
|
|
1597
|
-
/*! @azure/msal-common v15.0
|
|
1597
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1598
1598
|
/*
|
|
1599
1599
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1600
1600
|
* Licensed under the MIT License.
|
|
@@ -1691,7 +1691,7 @@ class StringUtils {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
}
|
|
1693
1693
|
|
|
1694
|
-
/*! @azure/msal-common v15.0
|
|
1694
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1695
1695
|
|
|
1696
1696
|
/*
|
|
1697
1697
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1711,8 +1711,10 @@ class ScopeSet {
|
|
|
1711
1711
|
const filteredInput = scopeArr
|
|
1712
1712
|
? StringUtils.removeEmptyStringsFromArray(scopeArr)
|
|
1713
1713
|
: [];
|
|
1714
|
-
//
|
|
1715
|
-
|
|
1714
|
+
// Check if scopes array has at least one member
|
|
1715
|
+
if (!filteredInput || !filteredInput.length) {
|
|
1716
|
+
throw createClientConfigurationError(emptyInputScopesError);
|
|
1717
|
+
}
|
|
1716
1718
|
this.scopes = new Set(); // Iterator in constructor not supported by IE11
|
|
1717
1719
|
filteredInput.forEach((scope) => this.scopes.add(scope));
|
|
1718
1720
|
}
|
|
@@ -1742,17 +1744,6 @@ class ScopeSet {
|
|
|
1742
1744
|
}
|
|
1743
1745
|
return scopeSet;
|
|
1744
1746
|
}
|
|
1745
|
-
/**
|
|
1746
|
-
* Used to validate the scopes input parameter requested by the developer.
|
|
1747
|
-
* @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
|
|
1748
|
-
* @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
|
|
1749
|
-
*/
|
|
1750
|
-
validateInputScopes(inputScopes) {
|
|
1751
|
-
// Check if scopes are required but not given or is an empty array
|
|
1752
|
-
if (!inputScopes || inputScopes.length < 1) {
|
|
1753
|
-
throw createClientConfigurationError(emptyInputScopesError);
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
1747
|
/**
|
|
1757
1748
|
* Check if a given scope is present in this set of scopes.
|
|
1758
1749
|
* @param scope
|
|
@@ -1891,7 +1882,7 @@ class ScopeSet {
|
|
|
1891
1882
|
}
|
|
1892
1883
|
}
|
|
1893
1884
|
|
|
1894
|
-
/*! @azure/msal-common v15.0
|
|
1885
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1895
1886
|
|
|
1896
1887
|
/*
|
|
1897
1888
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1931,7 +1922,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
1931
1922
|
};
|
|
1932
1923
|
}
|
|
1933
1924
|
|
|
1934
|
-
/*! @azure/msal-common v15.0
|
|
1925
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1935
1926
|
/*
|
|
1936
1927
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1937
1928
|
* Licensed under the MIT License.
|
|
@@ -2010,7 +2001,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2010
2001
|
return updatedAccountInfo;
|
|
2011
2002
|
}
|
|
2012
2003
|
|
|
2013
|
-
/*! @azure/msal-common v15.0
|
|
2004
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2014
2005
|
/*
|
|
2015
2006
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2016
2007
|
* Licensed under the MIT License.
|
|
@@ -2025,7 +2016,7 @@ const AuthorityType = {
|
|
|
2025
2016
|
Ciam: 3,
|
|
2026
2017
|
};
|
|
2027
2018
|
|
|
2028
|
-
/*! @azure/msal-common v15.0
|
|
2019
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2029
2020
|
/*
|
|
2030
2021
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2031
2022
|
* Licensed under the MIT License.
|
|
@@ -2047,7 +2038,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2047
2038
|
return null;
|
|
2048
2039
|
}
|
|
2049
2040
|
|
|
2050
|
-
/*! @azure/msal-common v15.0
|
|
2041
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2051
2042
|
/*
|
|
2052
2043
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2053
2044
|
* Licensed under the MIT License.
|
|
@@ -2060,7 +2051,7 @@ const ProtocolMode = {
|
|
|
2060
2051
|
OIDC: "OIDC",
|
|
2061
2052
|
};
|
|
2062
2053
|
|
|
2063
|
-
/*! @azure/msal-common v15.0
|
|
2054
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2064
2055
|
|
|
2065
2056
|
/*
|
|
2066
2057
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2303,7 +2294,7 @@ class AccountEntity {
|
|
|
2303
2294
|
}
|
|
2304
2295
|
}
|
|
2305
2296
|
|
|
2306
|
-
/*! @azure/msal-common v15.0
|
|
2297
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2307
2298
|
|
|
2308
2299
|
/*
|
|
2309
2300
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2350,7 +2341,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2350
2341
|
return null;
|
|
2351
2342
|
}
|
|
2352
2343
|
|
|
2353
|
-
/*! @azure/msal-common v15.0
|
|
2344
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2354
2345
|
|
|
2355
2346
|
/*
|
|
2356
2347
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2514,7 +2505,7 @@ class UrlString {
|
|
|
2514
2505
|
}
|
|
2515
2506
|
}
|
|
2516
2507
|
|
|
2517
|
-
/*! @azure/msal-common v15.0
|
|
2508
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2518
2509
|
|
|
2519
2510
|
/*
|
|
2520
2511
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2654,7 +2645,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2654
2645
|
return null;
|
|
2655
2646
|
}
|
|
2656
2647
|
|
|
2657
|
-
/*! @azure/msal-common v15.0
|
|
2648
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2658
2649
|
/*
|
|
2659
2650
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2660
2651
|
* Licensed under the MIT License.
|
|
@@ -2662,7 +2653,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2662
2653
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2663
2654
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2664
2655
|
|
|
2665
|
-
/*! @azure/msal-common v15.0
|
|
2656
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2666
2657
|
|
|
2667
2658
|
/*
|
|
2668
2659
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2689,7 +2680,7 @@ class CacheError extends Error {
|
|
|
2689
2680
|
}
|
|
2690
2681
|
}
|
|
2691
2682
|
|
|
2692
|
-
/*! @azure/msal-common v15.0
|
|
2683
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2693
2684
|
|
|
2694
2685
|
/*
|
|
2695
2686
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3874,7 +3865,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3874
3865
|
}
|
|
3875
3866
|
}
|
|
3876
3867
|
|
|
3877
|
-
/*! @azure/msal-common v15.0
|
|
3868
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
3878
3869
|
|
|
3879
3870
|
/*
|
|
3880
3871
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3973,7 +3964,7 @@ function isOidcProtocolMode(config) {
|
|
|
3973
3964
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3974
3965
|
}
|
|
3975
3966
|
|
|
3976
|
-
/*! @azure/msal-common v15.0
|
|
3967
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
3977
3968
|
/*
|
|
3978
3969
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3979
3970
|
* Licensed under the MIT License.
|
|
@@ -3983,7 +3974,7 @@ const CcsCredentialType = {
|
|
|
3983
3974
|
UPN: "UPN",
|
|
3984
3975
|
};
|
|
3985
3976
|
|
|
3986
|
-
/*! @azure/msal-common v15.0
|
|
3977
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
3987
3978
|
/*
|
|
3988
3979
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3989
3980
|
* Licensed under the MIT License.
|
|
@@ -4033,7 +4024,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
|
4033
4024
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4034
4025
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4035
4026
|
|
|
4036
|
-
/*! @azure/msal-common v15.0
|
|
4027
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4037
4028
|
|
|
4038
4029
|
/*
|
|
4039
4030
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4100,7 +4091,7 @@ class RequestValidator {
|
|
|
4100
4091
|
}
|
|
4101
4092
|
}
|
|
4102
4093
|
|
|
4103
|
-
/*! @azure/msal-common v15.0
|
|
4094
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4104
4095
|
|
|
4105
4096
|
/*
|
|
4106
4097
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4508,7 +4499,7 @@ class RequestParameterBuilder {
|
|
|
4508
4499
|
}
|
|
4509
4500
|
}
|
|
4510
4501
|
|
|
4511
|
-
/*! @azure/msal-common v15.0
|
|
4502
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4512
4503
|
/*
|
|
4513
4504
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4514
4505
|
* Licensed under the MIT License.
|
|
@@ -4520,7 +4511,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4520
4511
|
response.hasOwnProperty("jwks_uri"));
|
|
4521
4512
|
}
|
|
4522
4513
|
|
|
4523
|
-
/*! @azure/msal-common v15.0
|
|
4514
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4524
4515
|
/*
|
|
4525
4516
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4526
4517
|
* Licensed under the MIT License.
|
|
@@ -4530,7 +4521,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4530
4521
|
response.hasOwnProperty("metadata"));
|
|
4531
4522
|
}
|
|
4532
4523
|
|
|
4533
|
-
/*! @azure/msal-common v15.0
|
|
4524
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4534
4525
|
/*
|
|
4535
4526
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4536
4527
|
* Licensed under the MIT License.
|
|
@@ -4540,7 +4531,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4540
4531
|
response.hasOwnProperty("error_description"));
|
|
4541
4532
|
}
|
|
4542
4533
|
|
|
4543
|
-
/*! @azure/msal-common v15.0
|
|
4534
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4544
4535
|
/*
|
|
4545
4536
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4546
4537
|
* Licensed under the MIT License.
|
|
@@ -5047,7 +5038,7 @@ const IntFields = new Set([
|
|
|
5047
5038
|
"encryptedCacheExpiredCount",
|
|
5048
5039
|
]);
|
|
5049
5040
|
|
|
5050
|
-
/*! @azure/msal-common v15.0
|
|
5041
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
5051
5042
|
/*
|
|
5052
5043
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5053
5044
|
* Licensed under the MIT License.
|
|
@@ -5143,7 +5134,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5143
5134
|
};
|
|
5144
5135
|
};
|
|
5145
5136
|
|
|
5146
|
-
/*! @azure/msal-common v15.0
|
|
5137
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
5147
5138
|
|
|
5148
5139
|
/*
|
|
5149
5140
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5252,7 +5243,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5252
5243
|
},
|
|
5253
5244
|
};
|
|
5254
5245
|
|
|
5255
|
-
/*! @azure/msal-common v15.0
|
|
5246
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
5256
5247
|
|
|
5257
5248
|
/*
|
|
5258
5249
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6091,7 +6082,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
6091
6082
|
};
|
|
6092
6083
|
}
|
|
6093
6084
|
|
|
6094
|
-
/*! @azure/msal-common v15.0
|
|
6085
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6095
6086
|
|
|
6096
6087
|
/*
|
|
6097
6088
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6122,7 +6113,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6122
6113
|
}
|
|
6123
6114
|
}
|
|
6124
6115
|
|
|
6125
|
-
/*! @azure/msal-common v15.0
|
|
6116
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6126
6117
|
|
|
6127
6118
|
/*
|
|
6128
6119
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6141,7 +6132,7 @@ class ServerError extends AuthError {
|
|
|
6141
6132
|
}
|
|
6142
6133
|
}
|
|
6143
6134
|
|
|
6144
|
-
/*! @azure/msal-common v15.0
|
|
6135
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6145
6136
|
|
|
6146
6137
|
/*
|
|
6147
6138
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6239,7 +6230,7 @@ class ThrottlingUtils {
|
|
|
6239
6230
|
}
|
|
6240
6231
|
}
|
|
6241
6232
|
|
|
6242
|
-
/*! @azure/msal-common v15.0
|
|
6233
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6243
6234
|
|
|
6244
6235
|
/*
|
|
6245
6236
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6269,7 +6260,7 @@ function createNetworkError(error, httpStatus, responseHeaders) {
|
|
|
6269
6260
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6270
6261
|
}
|
|
6271
6262
|
|
|
6272
|
-
/*! @azure/msal-common v15.0
|
|
6263
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6273
6264
|
|
|
6274
6265
|
/*
|
|
6275
6266
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6419,7 +6410,7 @@ class BaseClient {
|
|
|
6419
6410
|
}
|
|
6420
6411
|
}
|
|
6421
6412
|
|
|
6422
|
-
/*! @azure/msal-common v15.0
|
|
6413
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6423
6414
|
/*
|
|
6424
6415
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6425
6416
|
* Licensed under the MIT License.
|
|
@@ -6445,7 +6436,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6445
6436
|
refreshTokenExpired: refreshTokenExpired
|
|
6446
6437
|
});
|
|
6447
6438
|
|
|
6448
|
-
/*! @azure/msal-common v15.0
|
|
6439
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6449
6440
|
|
|
6450
6441
|
/*
|
|
6451
6442
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6533,7 +6524,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6533
6524
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6534
6525
|
}
|
|
6535
6526
|
|
|
6536
|
-
/*! @azure/msal-common v15.0
|
|
6527
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6537
6528
|
|
|
6538
6529
|
/*
|
|
6539
6530
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6605,7 +6596,7 @@ class ProtocolUtils {
|
|
|
6605
6596
|
}
|
|
6606
6597
|
}
|
|
6607
6598
|
|
|
6608
|
-
/*! @azure/msal-common v15.0
|
|
6599
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6609
6600
|
|
|
6610
6601
|
/*
|
|
6611
6602
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6689,7 +6680,7 @@ class PopTokenGenerator {
|
|
|
6689
6680
|
}
|
|
6690
6681
|
}
|
|
6691
6682
|
|
|
6692
|
-
/*! @azure/msal-common v15.0
|
|
6683
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6693
6684
|
/*
|
|
6694
6685
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6695
6686
|
* Licensed under the MIT License.
|
|
@@ -6716,7 +6707,7 @@ class PopTokenGenerator {
|
|
|
6716
6707
|
}
|
|
6717
6708
|
}
|
|
6718
6709
|
|
|
6719
|
-
/*! @azure/msal-common v15.0
|
|
6710
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6720
6711
|
|
|
6721
6712
|
/*
|
|
6722
6713
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7093,7 +7084,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
7093
7084
|
return baseAccount;
|
|
7094
7085
|
}
|
|
7095
7086
|
|
|
7096
|
-
/*! @azure/msal-common v15.0
|
|
7087
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7097
7088
|
/*
|
|
7098
7089
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7099
7090
|
* Licensed under the MIT License.
|
|
@@ -7111,7 +7102,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
7111
7102
|
}
|
|
7112
7103
|
}
|
|
7113
7104
|
|
|
7114
|
-
/*! @azure/msal-common v15.0
|
|
7105
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7115
7106
|
|
|
7116
7107
|
/*
|
|
7117
7108
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7397,7 +7388,9 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7397
7388
|
}
|
|
7398
7389
|
if (request.domainHint) {
|
|
7399
7390
|
parameterBuilder.addDomainHint(request.domainHint);
|
|
7391
|
+
this.performanceClient?.addFields({ domainHintFromRequest: true }, correlationId);
|
|
7400
7392
|
}
|
|
7393
|
+
this.performanceClient?.addFields({ prompt: request.prompt }, correlationId);
|
|
7401
7394
|
// Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
|
|
7402
7395
|
if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
|
|
7403
7396
|
// AAD will throw if prompt=select_account is passed with an account hint
|
|
@@ -7405,6 +7398,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7405
7398
|
// SessionID is only used in silent calls
|
|
7406
7399
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request");
|
|
7407
7400
|
parameterBuilder.addSid(request.sid);
|
|
7401
|
+
this.performanceClient?.addFields({ sidFromRequest: true }, correlationId);
|
|
7408
7402
|
}
|
|
7409
7403
|
else if (request.account) {
|
|
7410
7404
|
const accountSid = this.extractAccountSid(request.account);
|
|
@@ -7417,6 +7411,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7417
7411
|
if (accountLoginHintClaim) {
|
|
7418
7412
|
this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
|
|
7419
7413
|
parameterBuilder.addLoginHint(accountLoginHintClaim);
|
|
7414
|
+
this.performanceClient?.addFields({ loginHintFromClaim: true }, correlationId);
|
|
7420
7415
|
try {
|
|
7421
7416
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7422
7417
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7432,6 +7427,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7432
7427
|
*/
|
|
7433
7428
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
|
|
7434
7429
|
parameterBuilder.addSid(accountSid);
|
|
7430
|
+
this.performanceClient?.addFields({ sidFromClaim: true }, correlationId);
|
|
7435
7431
|
try {
|
|
7436
7432
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7437
7433
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7444,11 +7440,13 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7444
7440
|
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request");
|
|
7445
7441
|
parameterBuilder.addLoginHint(request.loginHint);
|
|
7446
7442
|
parameterBuilder.addCcsUpn(request.loginHint);
|
|
7443
|
+
this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
|
|
7447
7444
|
}
|
|
7448
7445
|
else if (request.account.username) {
|
|
7449
7446
|
// Fallback to account username if provided
|
|
7450
7447
|
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account");
|
|
7451
7448
|
parameterBuilder.addLoginHint(request.account.username);
|
|
7449
|
+
this.performanceClient?.addFields({ loginHintFromUpn: true }, correlationId);
|
|
7452
7450
|
try {
|
|
7453
7451
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7454
7452
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7462,6 +7460,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7462
7460
|
this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request");
|
|
7463
7461
|
parameterBuilder.addLoginHint(request.loginHint);
|
|
7464
7462
|
parameterBuilder.addCcsUpn(request.loginHint);
|
|
7463
|
+
this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
|
|
7465
7464
|
}
|
|
7466
7465
|
}
|
|
7467
7466
|
else {
|
|
@@ -7553,7 +7552,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7553
7552
|
}
|
|
7554
7553
|
}
|
|
7555
7554
|
|
|
7556
|
-
/*! @azure/msal-common v15.0
|
|
7555
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7557
7556
|
|
|
7558
7557
|
/*
|
|
7559
7558
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7633,6 +7632,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7633
7632
|
if (refreshToken.expiresOn &&
|
|
7634
7633
|
isTokenExpired(refreshToken.expiresOn, request.refreshTokenExpirationOffsetSeconds ||
|
|
7635
7634
|
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS)) {
|
|
7635
|
+
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7636
7636
|
throw createInteractionRequiredAuthError(refreshTokenExpired);
|
|
7637
7637
|
}
|
|
7638
7638
|
// attach cached RT size to the current measurement
|
|
@@ -7649,12 +7649,14 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7649
7649
|
return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);
|
|
7650
7650
|
}
|
|
7651
7651
|
catch (e) {
|
|
7652
|
-
if (e instanceof InteractionRequiredAuthError
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7652
|
+
if (e instanceof InteractionRequiredAuthError) {
|
|
7653
|
+
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7654
|
+
if (e.subError === badToken) {
|
|
7655
|
+
// Remove bad refresh token from cache
|
|
7656
|
+
this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
|
|
7657
|
+
const badRefreshTokenKey = generateCredentialKey(refreshToken);
|
|
7658
|
+
this.cacheManager.removeRefreshToken(badRefreshTokenKey);
|
|
7659
|
+
}
|
|
7658
7660
|
}
|
|
7659
7661
|
throw e;
|
|
7660
7662
|
}
|
|
@@ -7773,7 +7775,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7773
7775
|
}
|
|
7774
7776
|
}
|
|
7775
7777
|
|
|
7776
|
-
/*! @azure/msal-common v15.0
|
|
7778
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7777
7779
|
|
|
7778
7780
|
/*
|
|
7779
7781
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7784,44 +7786,6 @@ class SilentFlowClient extends BaseClient {
|
|
|
7784
7786
|
constructor(configuration, performanceClient) {
|
|
7785
7787
|
super(configuration, performanceClient);
|
|
7786
7788
|
}
|
|
7787
|
-
/**
|
|
7788
|
-
* Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
|
|
7789
|
-
* the given token and returns the renewed token
|
|
7790
|
-
* @param request
|
|
7791
|
-
*/
|
|
7792
|
-
async acquireToken(request) {
|
|
7793
|
-
try {
|
|
7794
|
-
const [authResponse, cacheOutcome] = await this.acquireCachedToken({
|
|
7795
|
-
...request,
|
|
7796
|
-
scopes: request.scopes?.length
|
|
7797
|
-
? request.scopes
|
|
7798
|
-
: [...OIDC_DEFAULT_SCOPES],
|
|
7799
|
-
});
|
|
7800
|
-
// if the token is not expired but must be refreshed; get a new one in the background
|
|
7801
|
-
if (cacheOutcome === CacheOutcome.PROACTIVELY_REFRESHED) {
|
|
7802
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");
|
|
7803
|
-
// refresh the access token in the background
|
|
7804
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
7805
|
-
refreshTokenClient
|
|
7806
|
-
.acquireTokenByRefreshToken(request)
|
|
7807
|
-
.catch(() => {
|
|
7808
|
-
// do nothing, this is running in the background and no action is to be taken upon success or failure
|
|
7809
|
-
});
|
|
7810
|
-
}
|
|
7811
|
-
// return the cached token
|
|
7812
|
-
return authResponse;
|
|
7813
|
-
}
|
|
7814
|
-
catch (e) {
|
|
7815
|
-
if (e instanceof ClientAuthError &&
|
|
7816
|
-
e.errorCode === tokenRefreshRequired) {
|
|
7817
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
7818
|
-
return refreshTokenClient.acquireTokenByRefreshToken(request);
|
|
7819
|
-
}
|
|
7820
|
-
else {
|
|
7821
|
-
throw e;
|
|
7822
|
-
}
|
|
7823
|
-
}
|
|
7824
|
-
}
|
|
7825
7789
|
/**
|
|
7826
7790
|
* Retrieves token from cache or throws an error if it must be refreshed.
|
|
7827
7791
|
* @param request
|
|
@@ -7909,7 +7873,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7909
7873
|
}
|
|
7910
7874
|
}
|
|
7911
7875
|
|
|
7912
|
-
/*! @azure/msal-common v15.0
|
|
7876
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7913
7877
|
|
|
7914
7878
|
/*
|
|
7915
7879
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7924,7 +7888,7 @@ const StubbedNetworkModule = {
|
|
|
7924
7888
|
},
|
|
7925
7889
|
};
|
|
7926
7890
|
|
|
7927
|
-
/*! @azure/msal-common v15.0
|
|
7891
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7928
7892
|
|
|
7929
7893
|
/*
|
|
7930
7894
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7982,7 +7946,7 @@ class AuthenticationHeaderParser {
|
|
|
7982
7946
|
}
|
|
7983
7947
|
}
|
|
7984
7948
|
|
|
7985
|
-
/*! @azure/msal-common v15.0
|
|
7949
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7986
7950
|
|
|
7987
7951
|
/*
|
|
7988
7952
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8245,7 +8209,7 @@ class ServerTelemetryManager {
|
|
|
8245
8209
|
}
|
|
8246
8210
|
}
|
|
8247
8211
|
|
|
8248
|
-
/*! @azure/msal-common v15.0
|
|
8212
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8249
8213
|
/*
|
|
8250
8214
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8251
8215
|
* Licensed under the MIT License.
|
|
@@ -8253,7 +8217,7 @@ class ServerTelemetryManager {
|
|
|
8253
8217
|
const missingKidError = "missing_kid_error";
|
|
8254
8218
|
const missingAlgError = "missing_alg_error";
|
|
8255
8219
|
|
|
8256
|
-
/*! @azure/msal-common v15.0
|
|
8220
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8257
8221
|
|
|
8258
8222
|
/*
|
|
8259
8223
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8278,7 +8242,7 @@ function createJoseHeaderError(code) {
|
|
|
8278
8242
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
8279
8243
|
}
|
|
8280
8244
|
|
|
8281
|
-
/*! @azure/msal-common v15.0
|
|
8245
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8282
8246
|
|
|
8283
8247
|
/*
|
|
8284
8248
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8318,7 +8282,7 @@ class JoseHeader {
|
|
|
8318
8282
|
}
|
|
8319
8283
|
}
|
|
8320
8284
|
|
|
8321
|
-
/*! @azure/msal-common v15.0
|
|
8285
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8322
8286
|
|
|
8323
8287
|
/*
|
|
8324
8288
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8397,7 +8361,7 @@ class StubPerformanceClient {
|
|
|
8397
8361
|
}
|
|
8398
8362
|
}
|
|
8399
8363
|
|
|
8400
|
-
/*! @azure/msal-common v15.0
|
|
8364
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8401
8365
|
|
|
8402
8366
|
/*
|
|
8403
8367
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10434,7 +10398,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
10434
10398
|
|
|
10435
10399
|
/* eslint-disable header/header */
|
|
10436
10400
|
const name = "@azure/msal-browser";
|
|
10437
|
-
const version = "4.0
|
|
10401
|
+
const version = "4.1.0";
|
|
10438
10402
|
|
|
10439
10403
|
/*
|
|
10440
10404
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11739,36 +11703,14 @@ class BrowserCacheManager extends CacheManager {
|
|
|
11739
11703
|
this.cacheConfig = cacheConfig;
|
|
11740
11704
|
this.logger = logger;
|
|
11741
11705
|
this.internalStorage = new MemoryStorage();
|
|
11742
|
-
this.browserStorage =
|
|
11743
|
-
this.temporaryCacheStorage =
|
|
11706
|
+
this.browserStorage = getStorageImplementation(clientId, cacheConfig.cacheLocation, logger, performanceClient);
|
|
11707
|
+
this.temporaryCacheStorage = getStorageImplementation(clientId, cacheConfig.temporaryCacheLocation, logger, performanceClient);
|
|
11744
11708
|
this.cookieStorage = new CookieStorage();
|
|
11745
11709
|
this.performanceClient = performanceClient;
|
|
11746
11710
|
}
|
|
11747
11711
|
async initialize(correlationId) {
|
|
11748
11712
|
await this.browserStorage.initialize(correlationId);
|
|
11749
11713
|
}
|
|
11750
|
-
/**
|
|
11751
|
-
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
11752
|
-
* @param cacheLocation
|
|
11753
|
-
*/
|
|
11754
|
-
setupBrowserStorage(cacheLocation) {
|
|
11755
|
-
try {
|
|
11756
|
-
switch (cacheLocation) {
|
|
11757
|
-
case BrowserCacheLocation.LocalStorage:
|
|
11758
|
-
return new LocalStorage(this.clientId, this.logger, this.performanceClient);
|
|
11759
|
-
case BrowserCacheLocation.SessionStorage:
|
|
11760
|
-
return new SessionStorage();
|
|
11761
|
-
case BrowserCacheLocation.MemoryStorage:
|
|
11762
|
-
default:
|
|
11763
|
-
break;
|
|
11764
|
-
}
|
|
11765
|
-
}
|
|
11766
|
-
catch (e) {
|
|
11767
|
-
this.logger.error(e);
|
|
11768
|
-
}
|
|
11769
|
-
this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;
|
|
11770
|
-
return new MemoryStorage();
|
|
11771
|
-
}
|
|
11772
11714
|
/**
|
|
11773
11715
|
* Parses passed value as JSON object, JSON.parse() will throw an error.
|
|
11774
11716
|
* @param input
|
|
@@ -12661,6 +12603,27 @@ class BrowserCacheManager extends CacheManager {
|
|
|
12661
12603
|
}
|
|
12662
12604
|
}
|
|
12663
12605
|
}
|
|
12606
|
+
/**
|
|
12607
|
+
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
12608
|
+
* @param cacheLocation
|
|
12609
|
+
*/
|
|
12610
|
+
function getStorageImplementation(clientId, cacheLocation, logger, performanceClient) {
|
|
12611
|
+
try {
|
|
12612
|
+
switch (cacheLocation) {
|
|
12613
|
+
case BrowserCacheLocation.LocalStorage:
|
|
12614
|
+
return new LocalStorage(clientId, logger, performanceClient);
|
|
12615
|
+
case BrowserCacheLocation.SessionStorage:
|
|
12616
|
+
return new SessionStorage();
|
|
12617
|
+
case BrowserCacheLocation.MemoryStorage:
|
|
12618
|
+
default:
|
|
12619
|
+
break;
|
|
12620
|
+
}
|
|
12621
|
+
}
|
|
12622
|
+
catch (e) {
|
|
12623
|
+
logger.error(e);
|
|
12624
|
+
}
|
|
12625
|
+
return new MemoryStorage();
|
|
12626
|
+
}
|
|
12664
12627
|
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient) => {
|
|
12665
12628
|
const cacheOptions = {
|
|
12666
12629
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
@@ -13476,7 +13439,6 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13476
13439
|
this.nativeMessageHandler = provider;
|
|
13477
13440
|
this.nativeStorageManager = nativeStorageImpl;
|
|
13478
13441
|
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
13479
|
-
this.serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13480
13442
|
const extensionName = this.nativeMessageHandler.getExtensionId() ===
|
|
13481
13443
|
NativeConstants.PREFERRED_EXTENSION_ID
|
|
13482
13444
|
? "chrome"
|
|
@@ -13511,6 +13473,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13511
13473
|
// start the perf measurement
|
|
13512
13474
|
const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
|
|
13513
13475
|
const reqTimestamp = nowSeconds();
|
|
13476
|
+
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13514
13477
|
try {
|
|
13515
13478
|
// initialize native request
|
|
13516
13479
|
const nativeRequest = await this.initializeNativeRequest(request);
|
|
@@ -13543,7 +13506,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13543
13506
|
isNativeBroker: true,
|
|
13544
13507
|
requestId: result.requestId,
|
|
13545
13508
|
});
|
|
13546
|
-
|
|
13509
|
+
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
13547
13510
|
return result;
|
|
13548
13511
|
})
|
|
13549
13512
|
.catch((error) => {
|
|
@@ -13558,7 +13521,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13558
13521
|
}
|
|
13559
13522
|
catch (e) {
|
|
13560
13523
|
if (e instanceof NativeAuthError) {
|
|
13561
|
-
|
|
13524
|
+
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
13562
13525
|
}
|
|
13563
13526
|
throw e;
|
|
13564
13527
|
}
|
|
@@ -13635,7 +13598,8 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13635
13598
|
catch (e) {
|
|
13636
13599
|
// Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
|
|
13637
13600
|
if (e instanceof NativeAuthError) {
|
|
13638
|
-
this.
|
|
13601
|
+
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13602
|
+
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
13639
13603
|
if (isFatalNativeAuthError(e)) {
|
|
13640
13604
|
throw e;
|
|
13641
13605
|
}
|
|
@@ -13690,7 +13654,8 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13690
13654
|
const result = this.handleNativeResponse(response, request, reqTimestamp);
|
|
13691
13655
|
this.browserStorage.setInteractionInProgress(false);
|
|
13692
13656
|
const res = await result;
|
|
13693
|
-
this.
|
|
13657
|
+
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13658
|
+
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
13694
13659
|
return res;
|
|
13695
13660
|
}
|
|
13696
13661
|
catch (e) {
|
|
@@ -14509,6 +14474,7 @@ class PopupClient extends StandardInteractionClient {
|
|
|
14509
14474
|
popupWindowAttributes: request.popupWindowAttributes || {},
|
|
14510
14475
|
popupWindowParent: request.popupWindowParent ?? window,
|
|
14511
14476
|
};
|
|
14477
|
+
this.performanceClient.addFields({ isAsyncPopup: this.config.system.asyncPopups }, this.correlationId);
|
|
14512
14478
|
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
|
|
14513
14479
|
if (this.config.system.asyncPopups) {
|
|
14514
14480
|
this.logger.verbose("asyncPopups set to true, acquiring token");
|
|
@@ -17629,10 +17595,7 @@ class NestedAppAuthController {
|
|
|
17629
17595
|
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
|
|
17630
17596
|
// Set the active account if available
|
|
17631
17597
|
const accountContext = this.bridgeProxy.getAccountContext();
|
|
17632
|
-
|
|
17633
|
-
const cachedAccount = getAccount(accountContext, this.logger, this.browserStorage);
|
|
17634
|
-
setActiveAccount(cachedAccount, this.browserStorage);
|
|
17635
|
-
}
|
|
17598
|
+
this.currentAccountContext = accountContext ? accountContext : null;
|
|
17636
17599
|
}
|
|
17637
17600
|
/**
|
|
17638
17601
|
* Factory function to create a new instance of NestedAppAuthController
|
|
@@ -17685,7 +17648,12 @@ class NestedAppAuthController {
|
|
|
17685
17648
|
};
|
|
17686
17649
|
// cache the tokens in the response
|
|
17687
17650
|
await this.hydrateCache(result, request);
|
|
17688
|
-
|
|
17651
|
+
// cache the account context in memory after successful token fetch
|
|
17652
|
+
this.currentAccountContext = {
|
|
17653
|
+
homeAccountId: result.account.homeAccountId,
|
|
17654
|
+
environment: result.account.environment,
|
|
17655
|
+
tenantId: result.account.tenantId,
|
|
17656
|
+
};
|
|
17689
17657
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
|
|
17690
17658
|
atPopupMeasurement.add({
|
|
17691
17659
|
accessTokenSize: result.accessToken.length,
|
|
@@ -17735,7 +17703,12 @@ class NestedAppAuthController {
|
|
|
17735
17703
|
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
|
|
17736
17704
|
// cache the tokens in the response
|
|
17737
17705
|
await this.hydrateCache(result, request);
|
|
17738
|
-
|
|
17706
|
+
// cache the account context in memory after successful token fetch
|
|
17707
|
+
this.currentAccountContext = {
|
|
17708
|
+
homeAccountId: result.account.homeAccountId,
|
|
17709
|
+
environment: result.account.environment,
|
|
17710
|
+
tenantId: result.account.tenantId,
|
|
17711
|
+
};
|
|
17739
17712
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, result);
|
|
17740
17713
|
ssoSilentMeasurement?.add({
|
|
17741
17714
|
accessTokenSize: result.accessToken.length,
|
|
@@ -17771,8 +17744,16 @@ class NestedAppAuthController {
|
|
|
17771
17744
|
this.logger.verbose("Claims are present in the request, skipping cache lookup");
|
|
17772
17745
|
return null;
|
|
17773
17746
|
}
|
|
17747
|
+
// if the request has forceRefresh, we cannot look up in the cache
|
|
17748
|
+
if (request.forceRefresh) {
|
|
17749
|
+
this.logger.verbose("forceRefresh is set to true, skipping cache lookup");
|
|
17750
|
+
return null;
|
|
17751
|
+
}
|
|
17774
17752
|
// respect cache lookup policy
|
|
17775
17753
|
let result = null;
|
|
17754
|
+
if (!request.cacheLookupPolicy) {
|
|
17755
|
+
request.cacheLookupPolicy = CacheLookupPolicy.Default;
|
|
17756
|
+
}
|
|
17776
17757
|
switch (request.cacheLookupPolicy) {
|
|
17777
17758
|
case CacheLookupPolicy.Default:
|
|
17778
17759
|
case CacheLookupPolicy.AccessToken:
|
|
@@ -17806,12 +17787,11 @@ class NestedAppAuthController {
|
|
|
17806
17787
|
* @returns
|
|
17807
17788
|
*/
|
|
17808
17789
|
async acquireTokenFromCacheInternal(request) {
|
|
17809
|
-
|
|
17790
|
+
// always prioritize the account context from the bridge
|
|
17791
|
+
const accountContext = this.bridgeProxy.getAccountContext() || this.currentAccountContext;
|
|
17810
17792
|
let currentAccount = null;
|
|
17811
17793
|
if (accountContext) {
|
|
17812
|
-
|
|
17813
|
-
// always prioritize for hub account context, the reqirement of `request.account` will be removed soon
|
|
17814
|
-
currentAccount = hubAccount || request.account;
|
|
17794
|
+
currentAccount = getAccount(accountContext, this.logger, this.browserStorage);
|
|
17815
17795
|
}
|
|
17816
17796
|
// fall back to brokering if no cached account is found
|
|
17817
17797
|
if (!currentAccount) {
|
|
@@ -18455,7 +18435,9 @@ async function createNestablePublicClientApplication(configuration) {
|
|
|
18455
18435
|
await nestedAppAuth.initialize();
|
|
18456
18436
|
if (nestedAppAuth.isAvailable()) {
|
|
18457
18437
|
const controller = new NestedAppAuthController(nestedAppAuth);
|
|
18458
|
-
|
|
18438
|
+
const nestablePCA = new PublicClientApplication(configuration, controller);
|
|
18439
|
+
await nestablePCA.initialize();
|
|
18440
|
+
return nestablePCA;
|
|
18459
18441
|
}
|
|
18460
18442
|
return createStandardPublicClientApplication(configuration);
|
|
18461
18443
|
}
|