@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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v4.0
|
|
1
|
+
/*! @azure/msal-browser v4.1.0 2025-02-03 */
|
|
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 v15.0
|
|
9
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
10
10
|
/*
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
12
|
* Licensed under the MIT License.
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
// Token renewal offset default in seconds
|
|
311
311
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
312
312
|
|
|
313
|
-
/*! @azure/msal-common v15.0
|
|
313
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
314
314
|
/*
|
|
315
315
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
316
316
|
* Licensed under the MIT License.
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
unexpectedError: unexpectedError
|
|
328
328
|
});
|
|
329
329
|
|
|
330
|
-
/*! @azure/msal-common v15.0
|
|
330
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
331
331
|
|
|
332
332
|
/*
|
|
333
333
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
: AuthErrorMessages[code]);
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
/*! @azure/msal-common v15.0
|
|
379
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
380
380
|
/*
|
|
381
381
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
382
382
|
* Licensed under the MIT License.
|
|
@@ -474,7 +474,7 @@
|
|
|
474
474
|
userTimeoutReached: userTimeoutReached
|
|
475
475
|
});
|
|
476
476
|
|
|
477
|
-
/*! @azure/msal-common v15.0
|
|
477
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
478
478
|
|
|
479
479
|
/*
|
|
480
480
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -726,7 +726,7 @@
|
|
|
726
726
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
-
/*! @azure/msal-common v15.0
|
|
729
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
730
730
|
|
|
731
731
|
/*
|
|
732
732
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -765,7 +765,7 @@
|
|
|
765
765
|
},
|
|
766
766
|
};
|
|
767
767
|
|
|
768
|
-
/*! @azure/msal-common v15.0
|
|
768
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
769
769
|
|
|
770
770
|
/*
|
|
771
771
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -956,12 +956,12 @@
|
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
-
/*! @azure/msal-common v15.0
|
|
959
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
960
960
|
/* eslint-disable header/header */
|
|
961
961
|
const name$1 = "@azure/msal-common";
|
|
962
|
-
const version$1 = "15.0
|
|
962
|
+
const version$1 = "15.1.0";
|
|
963
963
|
|
|
964
|
-
/*! @azure/msal-common v15.0
|
|
964
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
965
965
|
/*
|
|
966
966
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
967
967
|
* Licensed under the MIT License.
|
|
@@ -981,7 +981,7 @@
|
|
|
981
981
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
982
982
|
};
|
|
983
983
|
|
|
984
|
-
/*! @azure/msal-common v15.0
|
|
984
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
985
985
|
|
|
986
986
|
/*
|
|
987
987
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1042,7 +1042,7 @@
|
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
|
-
/*! @azure/msal-common v15.0
|
|
1045
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1046
1046
|
/*
|
|
1047
1047
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1048
1048
|
* Licensed under the MIT License.
|
|
@@ -1079,7 +1079,7 @@
|
|
|
1079
1079
|
return cachedAtSec > nowSeconds();
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
|
-
/*! @azure/msal-common v15.0
|
|
1082
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1083
1083
|
|
|
1084
1084
|
/*
|
|
1085
1085
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1406,7 +1406,7 @@
|
|
|
1406
1406
|
return metadata.expiresAt <= nowSeconds();
|
|
1407
1407
|
}
|
|
1408
1408
|
|
|
1409
|
-
/*! @azure/msal-common v15.0
|
|
1409
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1410
1410
|
/*
|
|
1411
1411
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1412
1412
|
* Licensed under the MIT License.
|
|
@@ -1460,7 +1460,7 @@
|
|
|
1460
1460
|
urlParseError: urlParseError
|
|
1461
1461
|
});
|
|
1462
1462
|
|
|
1463
|
-
/*! @azure/msal-common v15.0
|
|
1463
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1464
1464
|
|
|
1465
1465
|
/*
|
|
1466
1466
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1598,7 +1598,7 @@
|
|
|
1598
1598
|
return new ClientConfigurationError(errorCode);
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
|
-
/*! @azure/msal-common v15.0
|
|
1601
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1602
1602
|
/*
|
|
1603
1603
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1604
1604
|
* Licensed under the MIT License.
|
|
@@ -1695,7 +1695,7 @@
|
|
|
1695
1695
|
}
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
/*! @azure/msal-common v15.0
|
|
1698
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1699
1699
|
|
|
1700
1700
|
/*
|
|
1701
1701
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1715,8 +1715,10 @@
|
|
|
1715
1715
|
const filteredInput = scopeArr
|
|
1716
1716
|
? StringUtils.removeEmptyStringsFromArray(scopeArr)
|
|
1717
1717
|
: [];
|
|
1718
|
-
//
|
|
1719
|
-
|
|
1718
|
+
// Check if scopes array has at least one member
|
|
1719
|
+
if (!filteredInput || !filteredInput.length) {
|
|
1720
|
+
throw createClientConfigurationError(emptyInputScopesError);
|
|
1721
|
+
}
|
|
1720
1722
|
this.scopes = new Set(); // Iterator in constructor not supported by IE11
|
|
1721
1723
|
filteredInput.forEach((scope) => this.scopes.add(scope));
|
|
1722
1724
|
}
|
|
@@ -1746,17 +1748,6 @@
|
|
|
1746
1748
|
}
|
|
1747
1749
|
return scopeSet;
|
|
1748
1750
|
}
|
|
1749
|
-
/**
|
|
1750
|
-
* Used to validate the scopes input parameter requested by the developer.
|
|
1751
|
-
* @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
|
|
1752
|
-
* @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
|
|
1753
|
-
*/
|
|
1754
|
-
validateInputScopes(inputScopes) {
|
|
1755
|
-
// Check if scopes are required but not given or is an empty array
|
|
1756
|
-
if (!inputScopes || inputScopes.length < 1) {
|
|
1757
|
-
throw createClientConfigurationError(emptyInputScopesError);
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
1751
|
/**
|
|
1761
1752
|
* Check if a given scope is present in this set of scopes.
|
|
1762
1753
|
* @param scope
|
|
@@ -1895,7 +1886,7 @@
|
|
|
1895
1886
|
}
|
|
1896
1887
|
}
|
|
1897
1888
|
|
|
1898
|
-
/*! @azure/msal-common v15.0
|
|
1889
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1899
1890
|
|
|
1900
1891
|
/*
|
|
1901
1892
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1935,7 +1926,7 @@
|
|
|
1935
1926
|
};
|
|
1936
1927
|
}
|
|
1937
1928
|
|
|
1938
|
-
/*! @azure/msal-common v15.0
|
|
1929
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
1939
1930
|
/*
|
|
1940
1931
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1941
1932
|
* Licensed under the MIT License.
|
|
@@ -2014,7 +2005,7 @@
|
|
|
2014
2005
|
return updatedAccountInfo;
|
|
2015
2006
|
}
|
|
2016
2007
|
|
|
2017
|
-
/*! @azure/msal-common v15.0
|
|
2008
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2018
2009
|
/*
|
|
2019
2010
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2020
2011
|
* Licensed under the MIT License.
|
|
@@ -2029,7 +2020,7 @@
|
|
|
2029
2020
|
Ciam: 3,
|
|
2030
2021
|
};
|
|
2031
2022
|
|
|
2032
|
-
/*! @azure/msal-common v15.0
|
|
2023
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2033
2024
|
/*
|
|
2034
2025
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2035
2026
|
* Licensed under the MIT License.
|
|
@@ -2051,7 +2042,7 @@
|
|
|
2051
2042
|
return null;
|
|
2052
2043
|
}
|
|
2053
2044
|
|
|
2054
|
-
/*! @azure/msal-common v15.0
|
|
2045
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2055
2046
|
/*
|
|
2056
2047
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2057
2048
|
* Licensed under the MIT License.
|
|
@@ -2064,7 +2055,7 @@
|
|
|
2064
2055
|
OIDC: "OIDC",
|
|
2065
2056
|
};
|
|
2066
2057
|
|
|
2067
|
-
/*! @azure/msal-common v15.0
|
|
2058
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2068
2059
|
|
|
2069
2060
|
/*
|
|
2070
2061
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2307,7 +2298,7 @@
|
|
|
2307
2298
|
}
|
|
2308
2299
|
}
|
|
2309
2300
|
|
|
2310
|
-
/*! @azure/msal-common v15.0
|
|
2301
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2311
2302
|
|
|
2312
2303
|
/*
|
|
2313
2304
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2354,7 +2345,7 @@
|
|
|
2354
2345
|
return null;
|
|
2355
2346
|
}
|
|
2356
2347
|
|
|
2357
|
-
/*! @azure/msal-common v15.0
|
|
2348
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2358
2349
|
|
|
2359
2350
|
/*
|
|
2360
2351
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2518,7 +2509,7 @@
|
|
|
2518
2509
|
}
|
|
2519
2510
|
}
|
|
2520
2511
|
|
|
2521
|
-
/*! @azure/msal-common v15.0
|
|
2512
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2522
2513
|
|
|
2523
2514
|
/*
|
|
2524
2515
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2658,7 +2649,7 @@
|
|
|
2658
2649
|
return null;
|
|
2659
2650
|
}
|
|
2660
2651
|
|
|
2661
|
-
/*! @azure/msal-common v15.0
|
|
2652
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2662
2653
|
/*
|
|
2663
2654
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2664
2655
|
* Licensed under the MIT License.
|
|
@@ -2666,7 +2657,7 @@
|
|
|
2666
2657
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2667
2658
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2668
2659
|
|
|
2669
|
-
/*! @azure/msal-common v15.0
|
|
2660
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2670
2661
|
|
|
2671
2662
|
/*
|
|
2672
2663
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2693,7 +2684,7 @@
|
|
|
2693
2684
|
}
|
|
2694
2685
|
}
|
|
2695
2686
|
|
|
2696
|
-
/*! @azure/msal-common v15.0
|
|
2687
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
2697
2688
|
|
|
2698
2689
|
/*
|
|
2699
2690
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3878,7 +3869,7 @@
|
|
|
3878
3869
|
}
|
|
3879
3870
|
}
|
|
3880
3871
|
|
|
3881
|
-
/*! @azure/msal-common v15.0
|
|
3872
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
3882
3873
|
|
|
3883
3874
|
/*
|
|
3884
3875
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3977,7 +3968,7 @@
|
|
|
3977
3968
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3978
3969
|
}
|
|
3979
3970
|
|
|
3980
|
-
/*! @azure/msal-common v15.0
|
|
3971
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
3981
3972
|
/*
|
|
3982
3973
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3983
3974
|
* Licensed under the MIT License.
|
|
@@ -3987,7 +3978,7 @@
|
|
|
3987
3978
|
UPN: "UPN",
|
|
3988
3979
|
};
|
|
3989
3980
|
|
|
3990
|
-
/*! @azure/msal-common v15.0
|
|
3981
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
3991
3982
|
/*
|
|
3992
3983
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3993
3984
|
* Licensed under the MIT License.
|
|
@@ -4037,7 +4028,7 @@
|
|
|
4037
4028
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4038
4029
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4039
4030
|
|
|
4040
|
-
/*! @azure/msal-common v15.0
|
|
4031
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4041
4032
|
|
|
4042
4033
|
/*
|
|
4043
4034
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4104,7 +4095,7 @@
|
|
|
4104
4095
|
}
|
|
4105
4096
|
}
|
|
4106
4097
|
|
|
4107
|
-
/*! @azure/msal-common v15.0
|
|
4098
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4108
4099
|
|
|
4109
4100
|
/*
|
|
4110
4101
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4512,7 +4503,7 @@
|
|
|
4512
4503
|
}
|
|
4513
4504
|
}
|
|
4514
4505
|
|
|
4515
|
-
/*! @azure/msal-common v15.0
|
|
4506
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4516
4507
|
/*
|
|
4517
4508
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4518
4509
|
* Licensed under the MIT License.
|
|
@@ -4524,7 +4515,7 @@
|
|
|
4524
4515
|
response.hasOwnProperty("jwks_uri"));
|
|
4525
4516
|
}
|
|
4526
4517
|
|
|
4527
|
-
/*! @azure/msal-common v15.0
|
|
4518
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4528
4519
|
/*
|
|
4529
4520
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4530
4521
|
* Licensed under the MIT License.
|
|
@@ -4534,7 +4525,7 @@
|
|
|
4534
4525
|
response.hasOwnProperty("metadata"));
|
|
4535
4526
|
}
|
|
4536
4527
|
|
|
4537
|
-
/*! @azure/msal-common v15.0
|
|
4528
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4538
4529
|
/*
|
|
4539
4530
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4540
4531
|
* Licensed under the MIT License.
|
|
@@ -4544,7 +4535,7 @@
|
|
|
4544
4535
|
response.hasOwnProperty("error_description"));
|
|
4545
4536
|
}
|
|
4546
4537
|
|
|
4547
|
-
/*! @azure/msal-common v15.0
|
|
4538
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
4548
4539
|
/*
|
|
4549
4540
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4550
4541
|
* Licensed under the MIT License.
|
|
@@ -5051,7 +5042,7 @@
|
|
|
5051
5042
|
"encryptedCacheExpiredCount",
|
|
5052
5043
|
]);
|
|
5053
5044
|
|
|
5054
|
-
/*! @azure/msal-common v15.0
|
|
5045
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
5055
5046
|
/*
|
|
5056
5047
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5057
5048
|
* Licensed under the MIT License.
|
|
@@ -5147,7 +5138,7 @@
|
|
|
5147
5138
|
};
|
|
5148
5139
|
};
|
|
5149
5140
|
|
|
5150
|
-
/*! @azure/msal-common v15.0
|
|
5141
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
5151
5142
|
|
|
5152
5143
|
/*
|
|
5153
5144
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5256,7 +5247,7 @@
|
|
|
5256
5247
|
},
|
|
5257
5248
|
};
|
|
5258
5249
|
|
|
5259
|
-
/*! @azure/msal-common v15.0
|
|
5250
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
5260
5251
|
|
|
5261
5252
|
/*
|
|
5262
5253
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6095,7 +6086,7 @@
|
|
|
6095
6086
|
};
|
|
6096
6087
|
}
|
|
6097
6088
|
|
|
6098
|
-
/*! @azure/msal-common v15.0
|
|
6089
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6099
6090
|
|
|
6100
6091
|
/*
|
|
6101
6092
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6126,7 +6117,7 @@
|
|
|
6126
6117
|
}
|
|
6127
6118
|
}
|
|
6128
6119
|
|
|
6129
|
-
/*! @azure/msal-common v15.0
|
|
6120
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6130
6121
|
|
|
6131
6122
|
/*
|
|
6132
6123
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6145,7 +6136,7 @@
|
|
|
6145
6136
|
}
|
|
6146
6137
|
}
|
|
6147
6138
|
|
|
6148
|
-
/*! @azure/msal-common v15.0
|
|
6139
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6149
6140
|
|
|
6150
6141
|
/*
|
|
6151
6142
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6243,7 +6234,7 @@
|
|
|
6243
6234
|
}
|
|
6244
6235
|
}
|
|
6245
6236
|
|
|
6246
|
-
/*! @azure/msal-common v15.0
|
|
6237
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6247
6238
|
|
|
6248
6239
|
/*
|
|
6249
6240
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6273,7 +6264,7 @@
|
|
|
6273
6264
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6274
6265
|
}
|
|
6275
6266
|
|
|
6276
|
-
/*! @azure/msal-common v15.0
|
|
6267
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6277
6268
|
|
|
6278
6269
|
/*
|
|
6279
6270
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6423,7 +6414,7 @@
|
|
|
6423
6414
|
}
|
|
6424
6415
|
}
|
|
6425
6416
|
|
|
6426
|
-
/*! @azure/msal-common v15.0
|
|
6417
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6427
6418
|
/*
|
|
6428
6419
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6429
6420
|
* Licensed under the MIT License.
|
|
@@ -6449,7 +6440,7 @@
|
|
|
6449
6440
|
refreshTokenExpired: refreshTokenExpired
|
|
6450
6441
|
});
|
|
6451
6442
|
|
|
6452
|
-
/*! @azure/msal-common v15.0
|
|
6443
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6453
6444
|
|
|
6454
6445
|
/*
|
|
6455
6446
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6537,7 +6528,7 @@
|
|
|
6537
6528
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6538
6529
|
}
|
|
6539
6530
|
|
|
6540
|
-
/*! @azure/msal-common v15.0
|
|
6531
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6541
6532
|
|
|
6542
6533
|
/*
|
|
6543
6534
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6609,7 +6600,7 @@
|
|
|
6609
6600
|
}
|
|
6610
6601
|
}
|
|
6611
6602
|
|
|
6612
|
-
/*! @azure/msal-common v15.0
|
|
6603
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6613
6604
|
|
|
6614
6605
|
/*
|
|
6615
6606
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6693,7 +6684,7 @@
|
|
|
6693
6684
|
}
|
|
6694
6685
|
}
|
|
6695
6686
|
|
|
6696
|
-
/*! @azure/msal-common v15.0
|
|
6687
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6697
6688
|
/*
|
|
6698
6689
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6699
6690
|
* Licensed under the MIT License.
|
|
@@ -6720,7 +6711,7 @@
|
|
|
6720
6711
|
}
|
|
6721
6712
|
}
|
|
6722
6713
|
|
|
6723
|
-
/*! @azure/msal-common v15.0
|
|
6714
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
6724
6715
|
|
|
6725
6716
|
/*
|
|
6726
6717
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7097,7 +7088,7 @@
|
|
|
7097
7088
|
return baseAccount;
|
|
7098
7089
|
}
|
|
7099
7090
|
|
|
7100
|
-
/*! @azure/msal-common v15.0
|
|
7091
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7101
7092
|
/*
|
|
7102
7093
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7103
7094
|
* Licensed under the MIT License.
|
|
@@ -7115,7 +7106,7 @@
|
|
|
7115
7106
|
}
|
|
7116
7107
|
}
|
|
7117
7108
|
|
|
7118
|
-
/*! @azure/msal-common v15.0
|
|
7109
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7119
7110
|
|
|
7120
7111
|
/*
|
|
7121
7112
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7401,7 +7392,9 @@
|
|
|
7401
7392
|
}
|
|
7402
7393
|
if (request.domainHint) {
|
|
7403
7394
|
parameterBuilder.addDomainHint(request.domainHint);
|
|
7395
|
+
this.performanceClient?.addFields({ domainHintFromRequest: true }, correlationId);
|
|
7404
7396
|
}
|
|
7397
|
+
this.performanceClient?.addFields({ prompt: request.prompt }, correlationId);
|
|
7405
7398
|
// Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
|
|
7406
7399
|
if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
|
|
7407
7400
|
// AAD will throw if prompt=select_account is passed with an account hint
|
|
@@ -7409,6 +7402,7 @@
|
|
|
7409
7402
|
// SessionID is only used in silent calls
|
|
7410
7403
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request");
|
|
7411
7404
|
parameterBuilder.addSid(request.sid);
|
|
7405
|
+
this.performanceClient?.addFields({ sidFromRequest: true }, correlationId);
|
|
7412
7406
|
}
|
|
7413
7407
|
else if (request.account) {
|
|
7414
7408
|
const accountSid = this.extractAccountSid(request.account);
|
|
@@ -7421,6 +7415,7 @@
|
|
|
7421
7415
|
if (accountLoginHintClaim) {
|
|
7422
7416
|
this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
|
|
7423
7417
|
parameterBuilder.addLoginHint(accountLoginHintClaim);
|
|
7418
|
+
this.performanceClient?.addFields({ loginHintFromClaim: true }, correlationId);
|
|
7424
7419
|
try {
|
|
7425
7420
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7426
7421
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7436,6 +7431,7 @@
|
|
|
7436
7431
|
*/
|
|
7437
7432
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
|
|
7438
7433
|
parameterBuilder.addSid(accountSid);
|
|
7434
|
+
this.performanceClient?.addFields({ sidFromClaim: true }, correlationId);
|
|
7439
7435
|
try {
|
|
7440
7436
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7441
7437
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7448,11 +7444,13 @@
|
|
|
7448
7444
|
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request");
|
|
7449
7445
|
parameterBuilder.addLoginHint(request.loginHint);
|
|
7450
7446
|
parameterBuilder.addCcsUpn(request.loginHint);
|
|
7447
|
+
this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
|
|
7451
7448
|
}
|
|
7452
7449
|
else if (request.account.username) {
|
|
7453
7450
|
// Fallback to account username if provided
|
|
7454
7451
|
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account");
|
|
7455
7452
|
parameterBuilder.addLoginHint(request.account.username);
|
|
7453
|
+
this.performanceClient?.addFields({ loginHintFromUpn: true }, correlationId);
|
|
7456
7454
|
try {
|
|
7457
7455
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7458
7456
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7466,6 +7464,7 @@
|
|
|
7466
7464
|
this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request");
|
|
7467
7465
|
parameterBuilder.addLoginHint(request.loginHint);
|
|
7468
7466
|
parameterBuilder.addCcsUpn(request.loginHint);
|
|
7467
|
+
this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
|
|
7469
7468
|
}
|
|
7470
7469
|
}
|
|
7471
7470
|
else {
|
|
@@ -7557,7 +7556,7 @@
|
|
|
7557
7556
|
}
|
|
7558
7557
|
}
|
|
7559
7558
|
|
|
7560
|
-
/*! @azure/msal-common v15.0
|
|
7559
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7561
7560
|
|
|
7562
7561
|
/*
|
|
7563
7562
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7637,6 +7636,7 @@
|
|
|
7637
7636
|
if (refreshToken.expiresOn &&
|
|
7638
7637
|
isTokenExpired(refreshToken.expiresOn, request.refreshTokenExpirationOffsetSeconds ||
|
|
7639
7638
|
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS)) {
|
|
7639
|
+
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7640
7640
|
throw createInteractionRequiredAuthError(refreshTokenExpired);
|
|
7641
7641
|
}
|
|
7642
7642
|
// attach cached RT size to the current measurement
|
|
@@ -7653,12 +7653,14 @@
|
|
|
7653
7653
|
return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);
|
|
7654
7654
|
}
|
|
7655
7655
|
catch (e) {
|
|
7656
|
-
if (e instanceof InteractionRequiredAuthError
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7656
|
+
if (e instanceof InteractionRequiredAuthError) {
|
|
7657
|
+
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7658
|
+
if (e.subError === badToken) {
|
|
7659
|
+
// Remove bad refresh token from cache
|
|
7660
|
+
this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
|
|
7661
|
+
const badRefreshTokenKey = generateCredentialKey(refreshToken);
|
|
7662
|
+
this.cacheManager.removeRefreshToken(badRefreshTokenKey);
|
|
7663
|
+
}
|
|
7662
7664
|
}
|
|
7663
7665
|
throw e;
|
|
7664
7666
|
}
|
|
@@ -7777,7 +7779,7 @@
|
|
|
7777
7779
|
}
|
|
7778
7780
|
}
|
|
7779
7781
|
|
|
7780
|
-
/*! @azure/msal-common v15.0
|
|
7782
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7781
7783
|
|
|
7782
7784
|
/*
|
|
7783
7785
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7788,44 +7790,6 @@
|
|
|
7788
7790
|
constructor(configuration, performanceClient) {
|
|
7789
7791
|
super(configuration, performanceClient);
|
|
7790
7792
|
}
|
|
7791
|
-
/**
|
|
7792
|
-
* Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
|
|
7793
|
-
* the given token and returns the renewed token
|
|
7794
|
-
* @param request
|
|
7795
|
-
*/
|
|
7796
|
-
async acquireToken(request) {
|
|
7797
|
-
try {
|
|
7798
|
-
const [authResponse, cacheOutcome] = await this.acquireCachedToken({
|
|
7799
|
-
...request,
|
|
7800
|
-
scopes: request.scopes?.length
|
|
7801
|
-
? request.scopes
|
|
7802
|
-
: [...OIDC_DEFAULT_SCOPES],
|
|
7803
|
-
});
|
|
7804
|
-
// if the token is not expired but must be refreshed; get a new one in the background
|
|
7805
|
-
if (cacheOutcome === CacheOutcome.PROACTIVELY_REFRESHED) {
|
|
7806
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");
|
|
7807
|
-
// refresh the access token in the background
|
|
7808
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
7809
|
-
refreshTokenClient
|
|
7810
|
-
.acquireTokenByRefreshToken(request)
|
|
7811
|
-
.catch(() => {
|
|
7812
|
-
// do nothing, this is running in the background and no action is to be taken upon success or failure
|
|
7813
|
-
});
|
|
7814
|
-
}
|
|
7815
|
-
// return the cached token
|
|
7816
|
-
return authResponse;
|
|
7817
|
-
}
|
|
7818
|
-
catch (e) {
|
|
7819
|
-
if (e instanceof ClientAuthError &&
|
|
7820
|
-
e.errorCode === tokenRefreshRequired) {
|
|
7821
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
7822
|
-
return refreshTokenClient.acquireTokenByRefreshToken(request);
|
|
7823
|
-
}
|
|
7824
|
-
else {
|
|
7825
|
-
throw e;
|
|
7826
|
-
}
|
|
7827
|
-
}
|
|
7828
|
-
}
|
|
7829
7793
|
/**
|
|
7830
7794
|
* Retrieves token from cache or throws an error if it must be refreshed.
|
|
7831
7795
|
* @param request
|
|
@@ -7913,7 +7877,7 @@
|
|
|
7913
7877
|
}
|
|
7914
7878
|
}
|
|
7915
7879
|
|
|
7916
|
-
/*! @azure/msal-common v15.0
|
|
7880
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7917
7881
|
|
|
7918
7882
|
/*
|
|
7919
7883
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7928,7 +7892,7 @@
|
|
|
7928
7892
|
},
|
|
7929
7893
|
};
|
|
7930
7894
|
|
|
7931
|
-
/*! @azure/msal-common v15.0
|
|
7895
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7932
7896
|
|
|
7933
7897
|
/*
|
|
7934
7898
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7986,7 +7950,7 @@
|
|
|
7986
7950
|
}
|
|
7987
7951
|
}
|
|
7988
7952
|
|
|
7989
|
-
/*! @azure/msal-common v15.0
|
|
7953
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
7990
7954
|
|
|
7991
7955
|
/*
|
|
7992
7956
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8249,7 +8213,7 @@
|
|
|
8249
8213
|
}
|
|
8250
8214
|
}
|
|
8251
8215
|
|
|
8252
|
-
/*! @azure/msal-common v15.0
|
|
8216
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8253
8217
|
/*
|
|
8254
8218
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8255
8219
|
* Licensed under the MIT License.
|
|
@@ -8257,7 +8221,7 @@
|
|
|
8257
8221
|
const missingKidError = "missing_kid_error";
|
|
8258
8222
|
const missingAlgError = "missing_alg_error";
|
|
8259
8223
|
|
|
8260
|
-
/*! @azure/msal-common v15.0
|
|
8224
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8261
8225
|
|
|
8262
8226
|
/*
|
|
8263
8227
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8282,7 +8246,7 @@
|
|
|
8282
8246
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
8283
8247
|
}
|
|
8284
8248
|
|
|
8285
|
-
/*! @azure/msal-common v15.0
|
|
8249
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8286
8250
|
|
|
8287
8251
|
/*
|
|
8288
8252
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8322,7 +8286,7 @@
|
|
|
8322
8286
|
}
|
|
8323
8287
|
}
|
|
8324
8288
|
|
|
8325
|
-
/*! @azure/msal-common v15.0
|
|
8289
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8326
8290
|
|
|
8327
8291
|
/*
|
|
8328
8292
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8401,7 +8365,7 @@
|
|
|
8401
8365
|
}
|
|
8402
8366
|
}
|
|
8403
8367
|
|
|
8404
|
-
/*! @azure/msal-common v15.0
|
|
8368
|
+
/*! @azure/msal-common v15.1.0 2025-02-03 */
|
|
8405
8369
|
|
|
8406
8370
|
/*
|
|
8407
8371
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10438,7 +10402,7 @@
|
|
|
10438
10402
|
|
|
10439
10403
|
/* eslint-disable header/header */
|
|
10440
10404
|
const name = "@azure/msal-browser";
|
|
10441
|
-
const version = "4.0
|
|
10405
|
+
const version = "4.1.0";
|
|
10442
10406
|
|
|
10443
10407
|
/*
|
|
10444
10408
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11743,36 +11707,14 @@
|
|
|
11743
11707
|
this.cacheConfig = cacheConfig;
|
|
11744
11708
|
this.logger = logger;
|
|
11745
11709
|
this.internalStorage = new MemoryStorage();
|
|
11746
|
-
this.browserStorage =
|
|
11747
|
-
this.temporaryCacheStorage =
|
|
11710
|
+
this.browserStorage = getStorageImplementation(clientId, cacheConfig.cacheLocation, logger, performanceClient);
|
|
11711
|
+
this.temporaryCacheStorage = getStorageImplementation(clientId, cacheConfig.temporaryCacheLocation, logger, performanceClient);
|
|
11748
11712
|
this.cookieStorage = new CookieStorage();
|
|
11749
11713
|
this.performanceClient = performanceClient;
|
|
11750
11714
|
}
|
|
11751
11715
|
async initialize(correlationId) {
|
|
11752
11716
|
await this.browserStorage.initialize(correlationId);
|
|
11753
11717
|
}
|
|
11754
|
-
/**
|
|
11755
|
-
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
11756
|
-
* @param cacheLocation
|
|
11757
|
-
*/
|
|
11758
|
-
setupBrowserStorage(cacheLocation) {
|
|
11759
|
-
try {
|
|
11760
|
-
switch (cacheLocation) {
|
|
11761
|
-
case BrowserCacheLocation.LocalStorage:
|
|
11762
|
-
return new LocalStorage(this.clientId, this.logger, this.performanceClient);
|
|
11763
|
-
case BrowserCacheLocation.SessionStorage:
|
|
11764
|
-
return new SessionStorage();
|
|
11765
|
-
case BrowserCacheLocation.MemoryStorage:
|
|
11766
|
-
default:
|
|
11767
|
-
break;
|
|
11768
|
-
}
|
|
11769
|
-
}
|
|
11770
|
-
catch (e) {
|
|
11771
|
-
this.logger.error(e);
|
|
11772
|
-
}
|
|
11773
|
-
this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;
|
|
11774
|
-
return new MemoryStorage();
|
|
11775
|
-
}
|
|
11776
11718
|
/**
|
|
11777
11719
|
* Parses passed value as JSON object, JSON.parse() will throw an error.
|
|
11778
11720
|
* @param input
|
|
@@ -12665,6 +12607,27 @@
|
|
|
12665
12607
|
}
|
|
12666
12608
|
}
|
|
12667
12609
|
}
|
|
12610
|
+
/**
|
|
12611
|
+
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
12612
|
+
* @param cacheLocation
|
|
12613
|
+
*/
|
|
12614
|
+
function getStorageImplementation(clientId, cacheLocation, logger, performanceClient) {
|
|
12615
|
+
try {
|
|
12616
|
+
switch (cacheLocation) {
|
|
12617
|
+
case BrowserCacheLocation.LocalStorage:
|
|
12618
|
+
return new LocalStorage(clientId, logger, performanceClient);
|
|
12619
|
+
case BrowserCacheLocation.SessionStorage:
|
|
12620
|
+
return new SessionStorage();
|
|
12621
|
+
case BrowserCacheLocation.MemoryStorage:
|
|
12622
|
+
default:
|
|
12623
|
+
break;
|
|
12624
|
+
}
|
|
12625
|
+
}
|
|
12626
|
+
catch (e) {
|
|
12627
|
+
logger.error(e);
|
|
12628
|
+
}
|
|
12629
|
+
return new MemoryStorage();
|
|
12630
|
+
}
|
|
12668
12631
|
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient) => {
|
|
12669
12632
|
const cacheOptions = {
|
|
12670
12633
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
@@ -13480,7 +13443,6 @@
|
|
|
13480
13443
|
this.nativeMessageHandler = provider;
|
|
13481
13444
|
this.nativeStorageManager = nativeStorageImpl;
|
|
13482
13445
|
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
13483
|
-
this.serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13484
13446
|
const extensionName = this.nativeMessageHandler.getExtensionId() ===
|
|
13485
13447
|
NativeConstants.PREFERRED_EXTENSION_ID
|
|
13486
13448
|
? "chrome"
|
|
@@ -13515,6 +13477,7 @@
|
|
|
13515
13477
|
// start the perf measurement
|
|
13516
13478
|
const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
|
|
13517
13479
|
const reqTimestamp = nowSeconds();
|
|
13480
|
+
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13518
13481
|
try {
|
|
13519
13482
|
// initialize native request
|
|
13520
13483
|
const nativeRequest = await this.initializeNativeRequest(request);
|
|
@@ -13547,7 +13510,7 @@
|
|
|
13547
13510
|
isNativeBroker: true,
|
|
13548
13511
|
requestId: result.requestId,
|
|
13549
13512
|
});
|
|
13550
|
-
|
|
13513
|
+
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
13551
13514
|
return result;
|
|
13552
13515
|
})
|
|
13553
13516
|
.catch((error) => {
|
|
@@ -13562,7 +13525,7 @@
|
|
|
13562
13525
|
}
|
|
13563
13526
|
catch (e) {
|
|
13564
13527
|
if (e instanceof NativeAuthError) {
|
|
13565
|
-
|
|
13528
|
+
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
13566
13529
|
}
|
|
13567
13530
|
throw e;
|
|
13568
13531
|
}
|
|
@@ -13639,7 +13602,8 @@
|
|
|
13639
13602
|
catch (e) {
|
|
13640
13603
|
// Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
|
|
13641
13604
|
if (e instanceof NativeAuthError) {
|
|
13642
|
-
this.
|
|
13605
|
+
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13606
|
+
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
13643
13607
|
if (isFatalNativeAuthError(e)) {
|
|
13644
13608
|
throw e;
|
|
13645
13609
|
}
|
|
@@ -13694,7 +13658,8 @@
|
|
|
13694
13658
|
const result = this.handleNativeResponse(response, request, reqTimestamp);
|
|
13695
13659
|
this.browserStorage.setInteractionInProgress(false);
|
|
13696
13660
|
const res = await result;
|
|
13697
|
-
this.
|
|
13661
|
+
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
13662
|
+
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
13698
13663
|
return res;
|
|
13699
13664
|
}
|
|
13700
13665
|
catch (e) {
|
|
@@ -14513,6 +14478,7 @@
|
|
|
14513
14478
|
popupWindowAttributes: request.popupWindowAttributes || {},
|
|
14514
14479
|
popupWindowParent: request.popupWindowParent ?? window,
|
|
14515
14480
|
};
|
|
14481
|
+
this.performanceClient.addFields({ isAsyncPopup: this.config.system.asyncPopups }, this.correlationId);
|
|
14516
14482
|
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
|
|
14517
14483
|
if (this.config.system.asyncPopups) {
|
|
14518
14484
|
this.logger.verbose("asyncPopups set to true, acquiring token");
|
|
@@ -17633,10 +17599,7 @@
|
|
|
17633
17599
|
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
|
|
17634
17600
|
// Set the active account if available
|
|
17635
17601
|
const accountContext = this.bridgeProxy.getAccountContext();
|
|
17636
|
-
|
|
17637
|
-
const cachedAccount = getAccount(accountContext, this.logger, this.browserStorage);
|
|
17638
|
-
setActiveAccount(cachedAccount, this.browserStorage);
|
|
17639
|
-
}
|
|
17602
|
+
this.currentAccountContext = accountContext ? accountContext : null;
|
|
17640
17603
|
}
|
|
17641
17604
|
/**
|
|
17642
17605
|
* Factory function to create a new instance of NestedAppAuthController
|
|
@@ -17689,7 +17652,12 @@
|
|
|
17689
17652
|
};
|
|
17690
17653
|
// cache the tokens in the response
|
|
17691
17654
|
await this.hydrateCache(result, request);
|
|
17692
|
-
|
|
17655
|
+
// cache the account context in memory after successful token fetch
|
|
17656
|
+
this.currentAccountContext = {
|
|
17657
|
+
homeAccountId: result.account.homeAccountId,
|
|
17658
|
+
environment: result.account.environment,
|
|
17659
|
+
tenantId: result.account.tenantId,
|
|
17660
|
+
};
|
|
17693
17661
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
|
|
17694
17662
|
atPopupMeasurement.add({
|
|
17695
17663
|
accessTokenSize: result.accessToken.length,
|
|
@@ -17739,7 +17707,12 @@
|
|
|
17739
17707
|
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
|
|
17740
17708
|
// cache the tokens in the response
|
|
17741
17709
|
await this.hydrateCache(result, request);
|
|
17742
|
-
|
|
17710
|
+
// cache the account context in memory after successful token fetch
|
|
17711
|
+
this.currentAccountContext = {
|
|
17712
|
+
homeAccountId: result.account.homeAccountId,
|
|
17713
|
+
environment: result.account.environment,
|
|
17714
|
+
tenantId: result.account.tenantId,
|
|
17715
|
+
};
|
|
17743
17716
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, result);
|
|
17744
17717
|
ssoSilentMeasurement?.add({
|
|
17745
17718
|
accessTokenSize: result.accessToken.length,
|
|
@@ -17775,8 +17748,16 @@
|
|
|
17775
17748
|
this.logger.verbose("Claims are present in the request, skipping cache lookup");
|
|
17776
17749
|
return null;
|
|
17777
17750
|
}
|
|
17751
|
+
// if the request has forceRefresh, we cannot look up in the cache
|
|
17752
|
+
if (request.forceRefresh) {
|
|
17753
|
+
this.logger.verbose("forceRefresh is set to true, skipping cache lookup");
|
|
17754
|
+
return null;
|
|
17755
|
+
}
|
|
17778
17756
|
// respect cache lookup policy
|
|
17779
17757
|
let result = null;
|
|
17758
|
+
if (!request.cacheLookupPolicy) {
|
|
17759
|
+
request.cacheLookupPolicy = CacheLookupPolicy.Default;
|
|
17760
|
+
}
|
|
17780
17761
|
switch (request.cacheLookupPolicy) {
|
|
17781
17762
|
case CacheLookupPolicy.Default:
|
|
17782
17763
|
case CacheLookupPolicy.AccessToken:
|
|
@@ -17810,12 +17791,11 @@
|
|
|
17810
17791
|
* @returns
|
|
17811
17792
|
*/
|
|
17812
17793
|
async acquireTokenFromCacheInternal(request) {
|
|
17813
|
-
|
|
17794
|
+
// always prioritize the account context from the bridge
|
|
17795
|
+
const accountContext = this.bridgeProxy.getAccountContext() || this.currentAccountContext;
|
|
17814
17796
|
let currentAccount = null;
|
|
17815
17797
|
if (accountContext) {
|
|
17816
|
-
|
|
17817
|
-
// always prioritize for hub account context, the reqirement of `request.account` will be removed soon
|
|
17818
|
-
currentAccount = hubAccount || request.account;
|
|
17798
|
+
currentAccount = getAccount(accountContext, this.logger, this.browserStorage);
|
|
17819
17799
|
}
|
|
17820
17800
|
// fall back to brokering if no cached account is found
|
|
17821
17801
|
if (!currentAccount) {
|
|
@@ -18459,7 +18439,9 @@
|
|
|
18459
18439
|
await nestedAppAuth.initialize();
|
|
18460
18440
|
if (nestedAppAuth.isAvailable()) {
|
|
18461
18441
|
const controller = new NestedAppAuthController(nestedAppAuth);
|
|
18462
|
-
|
|
18442
|
+
const nestablePCA = new PublicClientApplication(configuration, controller);
|
|
18443
|
+
await nestablePCA.initialize();
|
|
18444
|
+
return nestablePCA;
|
|
18463
18445
|
}
|
|
18464
18446
|
return createStandardPublicClientApplication(configuration);
|
|
18465
18447
|
}
|