@azure/msal-browser 4.0.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +10 -3
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +32 -6
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CookieStorage.d.ts +6 -1
- package/dist/cache/CookieStorage.d.ts.map +1 -1
- package/dist/cache/CookieStorage.mjs +10 -5
- package/dist/cache/CookieStorage.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/LocalStorage.d.ts +2 -0
- package/dist/cache/LocalStorage.d.ts.map +1 -1
- package/dist/cache/LocalStorage.mjs +52 -4
- package/dist/cache/LocalStorage.mjs.map +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.d.ts +2 -1
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +4 -4
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.d.ts +2 -5
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +16 -63
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +1 -0
- package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +5 -3
- package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/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.d.ts +19 -0
- package/dist/event/EventHandler.d.ts.map +1 -1
- package/dist/event/EventHandler.mjs +56 -16
- package/dist/event/EventHandler.mjs.map +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.mjs +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 +279 -232
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +279 -232
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +63 -63
- package/lib/types/cache/BrowserCacheManager.d.ts +10 -3
- package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/lib/types/cache/CookieStorage.d.ts +6 -1
- package/lib/types/cache/CookieStorage.d.ts.map +1 -1
- package/lib/types/cache/LocalStorage.d.ts +2 -0
- package/lib/types/cache/LocalStorage.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +2 -1
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/lib/types/controllers/StandardController.d.ts +2 -5
- package/lib/types/controllers/StandardController.d.ts.map +1 -1
- package/lib/types/controllers/UnknownOperatingContextController.d.ts +1 -0
- package/lib/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/lib/types/event/EventHandler.d.ts +19 -0
- package/lib/types/event/EventHandler.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 +3 -3
- package/src/cache/BrowserCacheManager.ts +51 -4
- package/src/cache/CookieStorage.ts +12 -3
- package/src/cache/LocalStorage.ts +65 -3
- package/src/config/Configuration.ts +2 -1
- package/src/controllers/NestedAppAuthController.ts +4 -3
- package/src/controllers/StandardController.ts +23 -82
- package/src/controllers/UnknownOperatingContextController.ts +9 -1
- package/src/event/EventHandler.ts +78 -27
- 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.2.0 2025-02-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v15.
|
|
5
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
309
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
326
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
375
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
473
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
725
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
764
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
955
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
956
956
|
/* eslint-disable header/header */
|
|
957
957
|
const name$1 = "@azure/msal-common";
|
|
958
|
-
const version$1 = "15.
|
|
958
|
+
const version$1 = "15.1.1";
|
|
959
959
|
|
|
960
|
-
/*! @azure/msal-common v15.
|
|
960
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
980
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
1041
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
1078
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
1405
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
1459
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
1597
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
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.
|
|
1694
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
1695
1695
|
|
|
1696
1696
|
/*
|
|
1697
1697
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1882,7 +1882,7 @@ class ScopeSet {
|
|
|
1882
1882
|
}
|
|
1883
1883
|
}
|
|
1884
1884
|
|
|
1885
|
-
/*! @azure/msal-common v15.
|
|
1885
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
1886
1886
|
|
|
1887
1887
|
/*
|
|
1888
1888
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1922,7 +1922,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
1922
1922
|
};
|
|
1923
1923
|
}
|
|
1924
1924
|
|
|
1925
|
-
/*! @azure/msal-common v15.
|
|
1925
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
1926
1926
|
/*
|
|
1927
1927
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1928
1928
|
* Licensed under the MIT License.
|
|
@@ -2001,7 +2001,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2001
2001
|
return updatedAccountInfo;
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
|
-
/*! @azure/msal-common v15.
|
|
2004
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2005
2005
|
/*
|
|
2006
2006
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2007
2007
|
* Licensed under the MIT License.
|
|
@@ -2016,7 +2016,7 @@ const AuthorityType = {
|
|
|
2016
2016
|
Ciam: 3,
|
|
2017
2017
|
};
|
|
2018
2018
|
|
|
2019
|
-
/*! @azure/msal-common v15.
|
|
2019
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2020
2020
|
/*
|
|
2021
2021
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2022
2022
|
* Licensed under the MIT License.
|
|
@@ -2038,7 +2038,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2038
2038
|
return null;
|
|
2039
2039
|
}
|
|
2040
2040
|
|
|
2041
|
-
/*! @azure/msal-common v15.
|
|
2041
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2042
2042
|
/*
|
|
2043
2043
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2044
2044
|
* Licensed under the MIT License.
|
|
@@ -2051,7 +2051,7 @@ const ProtocolMode = {
|
|
|
2051
2051
|
OIDC: "OIDC",
|
|
2052
2052
|
};
|
|
2053
2053
|
|
|
2054
|
-
/*! @azure/msal-common v15.
|
|
2054
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2055
2055
|
|
|
2056
2056
|
/*
|
|
2057
2057
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2294,7 +2294,7 @@ class AccountEntity {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
2296
|
|
|
2297
|
-
/*! @azure/msal-common v15.
|
|
2297
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2298
2298
|
|
|
2299
2299
|
/*
|
|
2300
2300
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2341,7 +2341,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2341
2341
|
return null;
|
|
2342
2342
|
}
|
|
2343
2343
|
|
|
2344
|
-
/*! @azure/msal-common v15.
|
|
2344
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2345
2345
|
|
|
2346
2346
|
/*
|
|
2347
2347
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2505,7 +2505,7 @@ class UrlString {
|
|
|
2505
2505
|
}
|
|
2506
2506
|
}
|
|
2507
2507
|
|
|
2508
|
-
/*! @azure/msal-common v15.
|
|
2508
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2509
2509
|
|
|
2510
2510
|
/*
|
|
2511
2511
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2645,7 +2645,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2645
2645
|
return null;
|
|
2646
2646
|
}
|
|
2647
2647
|
|
|
2648
|
-
/*! @azure/msal-common v15.
|
|
2648
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2649
2649
|
/*
|
|
2650
2650
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2651
2651
|
* Licensed under the MIT License.
|
|
@@ -2653,7 +2653,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2653
2653
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2654
2654
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2655
2655
|
|
|
2656
|
-
/*! @azure/msal-common v15.
|
|
2656
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2657
2657
|
|
|
2658
2658
|
/*
|
|
2659
2659
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2680,7 +2680,7 @@ class CacheError extends Error {
|
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
2682
|
|
|
2683
|
-
/*! @azure/msal-common v15.
|
|
2683
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
2684
2684
|
|
|
2685
2685
|
/*
|
|
2686
2686
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3865,7 +3865,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3865
3865
|
}
|
|
3866
3866
|
}
|
|
3867
3867
|
|
|
3868
|
-
/*! @azure/msal-common v15.
|
|
3868
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
3869
3869
|
|
|
3870
3870
|
/*
|
|
3871
3871
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3964,7 +3964,7 @@ function isOidcProtocolMode(config) {
|
|
|
3964
3964
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3965
3965
|
}
|
|
3966
3966
|
|
|
3967
|
-
/*! @azure/msal-common v15.
|
|
3967
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
3968
3968
|
/*
|
|
3969
3969
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3970
3970
|
* Licensed under the MIT License.
|
|
@@ -3974,7 +3974,7 @@ const CcsCredentialType = {
|
|
|
3974
3974
|
UPN: "UPN",
|
|
3975
3975
|
};
|
|
3976
3976
|
|
|
3977
|
-
/*! @azure/msal-common v15.
|
|
3977
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
3978
3978
|
/*
|
|
3979
3979
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3980
3980
|
* Licensed under the MIT License.
|
|
@@ -4024,7 +4024,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
|
4024
4024
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4025
4025
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4026
4026
|
|
|
4027
|
-
/*! @azure/msal-common v15.
|
|
4027
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
4028
4028
|
|
|
4029
4029
|
/*
|
|
4030
4030
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4091,7 +4091,7 @@ class RequestValidator {
|
|
|
4091
4091
|
}
|
|
4092
4092
|
}
|
|
4093
4093
|
|
|
4094
|
-
/*! @azure/msal-common v15.
|
|
4094
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
4095
4095
|
|
|
4096
4096
|
/*
|
|
4097
4097
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4499,7 +4499,7 @@ class RequestParameterBuilder {
|
|
|
4499
4499
|
}
|
|
4500
4500
|
}
|
|
4501
4501
|
|
|
4502
|
-
/*! @azure/msal-common v15.
|
|
4502
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
4503
4503
|
/*
|
|
4504
4504
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4505
4505
|
* Licensed under the MIT License.
|
|
@@ -4511,7 +4511,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4511
4511
|
response.hasOwnProperty("jwks_uri"));
|
|
4512
4512
|
}
|
|
4513
4513
|
|
|
4514
|
-
/*! @azure/msal-common v15.
|
|
4514
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
4515
4515
|
/*
|
|
4516
4516
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4517
4517
|
* Licensed under the MIT License.
|
|
@@ -4521,7 +4521,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4521
4521
|
response.hasOwnProperty("metadata"));
|
|
4522
4522
|
}
|
|
4523
4523
|
|
|
4524
|
-
/*! @azure/msal-common v15.
|
|
4524
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
4525
4525
|
/*
|
|
4526
4526
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4527
4527
|
* Licensed under the MIT License.
|
|
@@ -4531,7 +4531,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4531
4531
|
response.hasOwnProperty("error_description"));
|
|
4532
4532
|
}
|
|
4533
4533
|
|
|
4534
|
-
/*! @azure/msal-common v15.
|
|
4534
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
4535
4535
|
/*
|
|
4536
4536
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4537
4537
|
* Licensed under the MIT License.
|
|
@@ -4769,6 +4769,7 @@ const PerformanceEvents = {
|
|
|
4769
4769
|
CacheManagerGetRefreshToken: "cacheManagerGetRefreshToken",
|
|
4770
4770
|
ImportExistingCache: "importExistingCache",
|
|
4771
4771
|
SetUserData: "setUserData",
|
|
4772
|
+
LocalStorageUpdated: "localStorageUpdated",
|
|
4772
4773
|
/**
|
|
4773
4774
|
* Crypto Operations
|
|
4774
4775
|
*/
|
|
@@ -4870,6 +4871,7 @@ const PerformanceEventAbbreviations = new Map([
|
|
|
4870
4871
|
[PerformanceEvents.InitializeCache, "InitCache"],
|
|
4871
4872
|
[PerformanceEvents.ImportExistingCache, "importCache"],
|
|
4872
4873
|
[PerformanceEvents.SetUserData, "setUserData"],
|
|
4874
|
+
[PerformanceEvents.LocalStorageUpdated, "localStorageUpdated"],
|
|
4873
4875
|
[PerformanceEvents.SilentIframeClientTokenHelper, "SIClientTHelper"],
|
|
4874
4876
|
[
|
|
4875
4877
|
PerformanceEvents.SilentHandlerInitiateAuthRequest,
|
|
@@ -5038,7 +5040,7 @@ const IntFields = new Set([
|
|
|
5038
5040
|
"encryptedCacheExpiredCount",
|
|
5039
5041
|
]);
|
|
5040
5042
|
|
|
5041
|
-
/*! @azure/msal-common v15.
|
|
5043
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
5042
5044
|
/*
|
|
5043
5045
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5044
5046
|
* Licensed under the MIT License.
|
|
@@ -5134,7 +5136,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5134
5136
|
};
|
|
5135
5137
|
};
|
|
5136
5138
|
|
|
5137
|
-
/*! @azure/msal-common v15.
|
|
5139
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
5138
5140
|
|
|
5139
5141
|
/*
|
|
5140
5142
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5243,7 +5245,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5243
5245
|
},
|
|
5244
5246
|
};
|
|
5245
5247
|
|
|
5246
|
-
/*! @azure/msal-common v15.
|
|
5248
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
5247
5249
|
|
|
5248
5250
|
/*
|
|
5249
5251
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6082,7 +6084,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
6082
6084
|
};
|
|
6083
6085
|
}
|
|
6084
6086
|
|
|
6085
|
-
/*! @azure/msal-common v15.
|
|
6087
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6086
6088
|
|
|
6087
6089
|
/*
|
|
6088
6090
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6113,7 +6115,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6113
6115
|
}
|
|
6114
6116
|
}
|
|
6115
6117
|
|
|
6116
|
-
/*! @azure/msal-common v15.
|
|
6118
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6117
6119
|
|
|
6118
6120
|
/*
|
|
6119
6121
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6132,7 +6134,7 @@ class ServerError extends AuthError {
|
|
|
6132
6134
|
}
|
|
6133
6135
|
}
|
|
6134
6136
|
|
|
6135
|
-
/*! @azure/msal-common v15.
|
|
6137
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6136
6138
|
|
|
6137
6139
|
/*
|
|
6138
6140
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6230,7 +6232,7 @@ class ThrottlingUtils {
|
|
|
6230
6232
|
}
|
|
6231
6233
|
}
|
|
6232
6234
|
|
|
6233
|
-
/*! @azure/msal-common v15.
|
|
6235
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6234
6236
|
|
|
6235
6237
|
/*
|
|
6236
6238
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6260,7 +6262,7 @@ function createNetworkError(error, httpStatus, responseHeaders) {
|
|
|
6260
6262
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6261
6263
|
}
|
|
6262
6264
|
|
|
6263
|
-
/*! @azure/msal-common v15.
|
|
6265
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6264
6266
|
|
|
6265
6267
|
/*
|
|
6266
6268
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6410,7 +6412,7 @@ class BaseClient {
|
|
|
6410
6412
|
}
|
|
6411
6413
|
}
|
|
6412
6414
|
|
|
6413
|
-
/*! @azure/msal-common v15.
|
|
6415
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6414
6416
|
/*
|
|
6415
6417
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6416
6418
|
* Licensed under the MIT License.
|
|
@@ -6436,7 +6438,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6436
6438
|
refreshTokenExpired: refreshTokenExpired
|
|
6437
6439
|
});
|
|
6438
6440
|
|
|
6439
|
-
/*! @azure/msal-common v15.
|
|
6441
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6440
6442
|
|
|
6441
6443
|
/*
|
|
6442
6444
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6524,7 +6526,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6524
6526
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6525
6527
|
}
|
|
6526
6528
|
|
|
6527
|
-
/*! @azure/msal-common v15.
|
|
6529
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6528
6530
|
|
|
6529
6531
|
/*
|
|
6530
6532
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6596,7 +6598,7 @@ class ProtocolUtils {
|
|
|
6596
6598
|
}
|
|
6597
6599
|
}
|
|
6598
6600
|
|
|
6599
|
-
/*! @azure/msal-common v15.
|
|
6601
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6600
6602
|
|
|
6601
6603
|
/*
|
|
6602
6604
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6680,7 +6682,7 @@ class PopTokenGenerator {
|
|
|
6680
6682
|
}
|
|
6681
6683
|
}
|
|
6682
6684
|
|
|
6683
|
-
/*! @azure/msal-common v15.
|
|
6685
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6684
6686
|
/*
|
|
6685
6687
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6686
6688
|
* Licensed under the MIT License.
|
|
@@ -6707,7 +6709,7 @@ class PopTokenGenerator {
|
|
|
6707
6709
|
}
|
|
6708
6710
|
}
|
|
6709
6711
|
|
|
6710
|
-
/*! @azure/msal-common v15.
|
|
6712
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
6711
6713
|
|
|
6712
6714
|
/*
|
|
6713
6715
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7084,7 +7086,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
7084
7086
|
return baseAccount;
|
|
7085
7087
|
}
|
|
7086
7088
|
|
|
7087
|
-
/*! @azure/msal-common v15.
|
|
7089
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7088
7090
|
/*
|
|
7089
7091
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7090
7092
|
* Licensed under the MIT License.
|
|
@@ -7102,7 +7104,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
7102
7104
|
}
|
|
7103
7105
|
}
|
|
7104
7106
|
|
|
7105
|
-
/*! @azure/msal-common v15.
|
|
7107
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7106
7108
|
|
|
7107
7109
|
/*
|
|
7108
7110
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7388,7 +7390,9 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7388
7390
|
}
|
|
7389
7391
|
if (request.domainHint) {
|
|
7390
7392
|
parameterBuilder.addDomainHint(request.domainHint);
|
|
7393
|
+
this.performanceClient?.addFields({ domainHintFromRequest: true }, correlationId);
|
|
7391
7394
|
}
|
|
7395
|
+
this.performanceClient?.addFields({ prompt: request.prompt }, correlationId);
|
|
7392
7396
|
// Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
|
|
7393
7397
|
if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
|
|
7394
7398
|
// AAD will throw if prompt=select_account is passed with an account hint
|
|
@@ -7396,6 +7400,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7396
7400
|
// SessionID is only used in silent calls
|
|
7397
7401
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request");
|
|
7398
7402
|
parameterBuilder.addSid(request.sid);
|
|
7403
|
+
this.performanceClient?.addFields({ sidFromRequest: true }, correlationId);
|
|
7399
7404
|
}
|
|
7400
7405
|
else if (request.account) {
|
|
7401
7406
|
const accountSid = this.extractAccountSid(request.account);
|
|
@@ -7408,6 +7413,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7408
7413
|
if (accountLoginHintClaim) {
|
|
7409
7414
|
this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
|
|
7410
7415
|
parameterBuilder.addLoginHint(accountLoginHintClaim);
|
|
7416
|
+
this.performanceClient?.addFields({ loginHintFromClaim: true }, correlationId);
|
|
7411
7417
|
try {
|
|
7412
7418
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7413
7419
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7423,6 +7429,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7423
7429
|
*/
|
|
7424
7430
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
|
|
7425
7431
|
parameterBuilder.addSid(accountSid);
|
|
7432
|
+
this.performanceClient?.addFields({ sidFromClaim: true }, correlationId);
|
|
7426
7433
|
try {
|
|
7427
7434
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7428
7435
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7435,11 +7442,13 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7435
7442
|
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request");
|
|
7436
7443
|
parameterBuilder.addLoginHint(request.loginHint);
|
|
7437
7444
|
parameterBuilder.addCcsUpn(request.loginHint);
|
|
7445
|
+
this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
|
|
7438
7446
|
}
|
|
7439
7447
|
else if (request.account.username) {
|
|
7440
7448
|
// Fallback to account username if provided
|
|
7441
7449
|
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account");
|
|
7442
7450
|
parameterBuilder.addLoginHint(request.account.username);
|
|
7451
|
+
this.performanceClient?.addFields({ loginHintFromUpn: true }, correlationId);
|
|
7443
7452
|
try {
|
|
7444
7453
|
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
7445
7454
|
parameterBuilder.addCcsOid(clientInfo);
|
|
@@ -7453,6 +7462,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7453
7462
|
this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request");
|
|
7454
7463
|
parameterBuilder.addLoginHint(request.loginHint);
|
|
7455
7464
|
parameterBuilder.addCcsUpn(request.loginHint);
|
|
7465
|
+
this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
|
|
7456
7466
|
}
|
|
7457
7467
|
}
|
|
7458
7468
|
else {
|
|
@@ -7544,7 +7554,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7544
7554
|
}
|
|
7545
7555
|
}
|
|
7546
7556
|
|
|
7547
|
-
/*! @azure/msal-common v15.
|
|
7557
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7548
7558
|
|
|
7549
7559
|
/*
|
|
7550
7560
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7624,6 +7634,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7624
7634
|
if (refreshToken.expiresOn &&
|
|
7625
7635
|
isTokenExpired(refreshToken.expiresOn, request.refreshTokenExpirationOffsetSeconds ||
|
|
7626
7636
|
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS)) {
|
|
7637
|
+
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7627
7638
|
throw createInteractionRequiredAuthError(refreshTokenExpired);
|
|
7628
7639
|
}
|
|
7629
7640
|
// attach cached RT size to the current measurement
|
|
@@ -7640,12 +7651,14 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7640
7651
|
return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);
|
|
7641
7652
|
}
|
|
7642
7653
|
catch (e) {
|
|
7643
|
-
if (e instanceof InteractionRequiredAuthError
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7654
|
+
if (e instanceof InteractionRequiredAuthError) {
|
|
7655
|
+
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7656
|
+
if (e.subError === badToken) {
|
|
7657
|
+
// Remove bad refresh token from cache
|
|
7658
|
+
this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
|
|
7659
|
+
const badRefreshTokenKey = generateCredentialKey(refreshToken);
|
|
7660
|
+
this.cacheManager.removeRefreshToken(badRefreshTokenKey);
|
|
7661
|
+
}
|
|
7649
7662
|
}
|
|
7650
7663
|
throw e;
|
|
7651
7664
|
}
|
|
@@ -7764,7 +7777,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7764
7777
|
}
|
|
7765
7778
|
}
|
|
7766
7779
|
|
|
7767
|
-
/*! @azure/msal-common v15.
|
|
7780
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7768
7781
|
|
|
7769
7782
|
/*
|
|
7770
7783
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7775,44 +7788,6 @@ class SilentFlowClient extends BaseClient {
|
|
|
7775
7788
|
constructor(configuration, performanceClient) {
|
|
7776
7789
|
super(configuration, performanceClient);
|
|
7777
7790
|
}
|
|
7778
|
-
/**
|
|
7779
|
-
* Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
|
|
7780
|
-
* the given token and returns the renewed token
|
|
7781
|
-
* @param request
|
|
7782
|
-
*/
|
|
7783
|
-
async acquireToken(request) {
|
|
7784
|
-
try {
|
|
7785
|
-
const [authResponse, cacheOutcome] = await this.acquireCachedToken({
|
|
7786
|
-
...request,
|
|
7787
|
-
scopes: request.scopes?.length
|
|
7788
|
-
? request.scopes
|
|
7789
|
-
: [...OIDC_DEFAULT_SCOPES],
|
|
7790
|
-
});
|
|
7791
|
-
// if the token is not expired but must be refreshed; get a new one in the background
|
|
7792
|
-
if (cacheOutcome === CacheOutcome.PROACTIVELY_REFRESHED) {
|
|
7793
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");
|
|
7794
|
-
// refresh the access token in the background
|
|
7795
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
7796
|
-
refreshTokenClient
|
|
7797
|
-
.acquireTokenByRefreshToken(request)
|
|
7798
|
-
.catch(() => {
|
|
7799
|
-
// do nothing, this is running in the background and no action is to be taken upon success or failure
|
|
7800
|
-
});
|
|
7801
|
-
}
|
|
7802
|
-
// return the cached token
|
|
7803
|
-
return authResponse;
|
|
7804
|
-
}
|
|
7805
|
-
catch (e) {
|
|
7806
|
-
if (e instanceof ClientAuthError &&
|
|
7807
|
-
e.errorCode === tokenRefreshRequired) {
|
|
7808
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
7809
|
-
return refreshTokenClient.acquireTokenByRefreshToken(request);
|
|
7810
|
-
}
|
|
7811
|
-
else {
|
|
7812
|
-
throw e;
|
|
7813
|
-
}
|
|
7814
|
-
}
|
|
7815
|
-
}
|
|
7816
7791
|
/**
|
|
7817
7792
|
* Retrieves token from cache or throws an error if it must be refreshed.
|
|
7818
7793
|
* @param request
|
|
@@ -7900,7 +7875,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7900
7875
|
}
|
|
7901
7876
|
}
|
|
7902
7877
|
|
|
7903
|
-
/*! @azure/msal-common v15.
|
|
7878
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7904
7879
|
|
|
7905
7880
|
/*
|
|
7906
7881
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7915,7 +7890,7 @@ const StubbedNetworkModule = {
|
|
|
7915
7890
|
},
|
|
7916
7891
|
};
|
|
7917
7892
|
|
|
7918
|
-
/*! @azure/msal-common v15.
|
|
7893
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7919
7894
|
|
|
7920
7895
|
/*
|
|
7921
7896
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7973,7 +7948,7 @@ class AuthenticationHeaderParser {
|
|
|
7973
7948
|
}
|
|
7974
7949
|
}
|
|
7975
7950
|
|
|
7976
|
-
/*! @azure/msal-common v15.
|
|
7951
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
7977
7952
|
|
|
7978
7953
|
/*
|
|
7979
7954
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8236,7 +8211,7 @@ class ServerTelemetryManager {
|
|
|
8236
8211
|
}
|
|
8237
8212
|
}
|
|
8238
8213
|
|
|
8239
|
-
/*! @azure/msal-common v15.
|
|
8214
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
8240
8215
|
/*
|
|
8241
8216
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8242
8217
|
* Licensed under the MIT License.
|
|
@@ -8244,7 +8219,7 @@ class ServerTelemetryManager {
|
|
|
8244
8219
|
const missingKidError = "missing_kid_error";
|
|
8245
8220
|
const missingAlgError = "missing_alg_error";
|
|
8246
8221
|
|
|
8247
|
-
/*! @azure/msal-common v15.
|
|
8222
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
8248
8223
|
|
|
8249
8224
|
/*
|
|
8250
8225
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8269,7 +8244,7 @@ function createJoseHeaderError(code) {
|
|
|
8269
8244
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
8270
8245
|
}
|
|
8271
8246
|
|
|
8272
|
-
/*! @azure/msal-common v15.
|
|
8247
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
8273
8248
|
|
|
8274
8249
|
/*
|
|
8275
8250
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8309,7 +8284,7 @@ class JoseHeader {
|
|
|
8309
8284
|
}
|
|
8310
8285
|
}
|
|
8311
8286
|
|
|
8312
|
-
/*! @azure/msal-common v15.
|
|
8287
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
8313
8288
|
|
|
8314
8289
|
/*
|
|
8315
8290
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8388,7 +8363,7 @@ class StubPerformanceClient {
|
|
|
8388
8363
|
}
|
|
8389
8364
|
}
|
|
8390
8365
|
|
|
8391
|
-
/*! @azure/msal-common v15.
|
|
8366
|
+
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
|
8392
8367
|
|
|
8393
8368
|
/*
|
|
8394
8369
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10425,7 +10400,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
10425
10400
|
|
|
10426
10401
|
/* eslint-disable header/header */
|
|
10427
10402
|
const name = "@azure/msal-browser";
|
|
10428
|
-
const version = "4.0
|
|
10403
|
+
const version = "4.2.0";
|
|
10429
10404
|
|
|
10430
10405
|
/*
|
|
10431
10406
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11358,6 +11333,10 @@ function getSortedObjectString(obj) {
|
|
|
11358
11333
|
*/
|
|
11359
11334
|
// Cookie life calculation (hours * minutes * seconds * ms)
|
|
11360
11335
|
const COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
|
|
11336
|
+
const SameSiteOptions = {
|
|
11337
|
+
Lax: "Lax",
|
|
11338
|
+
None: "None",
|
|
11339
|
+
};
|
|
11361
11340
|
class CookieStorage {
|
|
11362
11341
|
initialize() {
|
|
11363
11342
|
return Promise.resolve();
|
|
@@ -11378,13 +11357,14 @@ class CookieStorage {
|
|
|
11378
11357
|
getUserData() {
|
|
11379
11358
|
throw createClientAuthError(methodNotImplemented);
|
|
11380
11359
|
}
|
|
11381
|
-
setItem(key, value, cookieLifeDays, secure = true) {
|
|
11382
|
-
let cookieStr = `${encodeURIComponent(key)}=${encodeURIComponent(value)};path=/;SameSite
|
|
11360
|
+
setItem(key, value, cookieLifeDays, secure = true, sameSite = SameSiteOptions.Lax) {
|
|
11361
|
+
let cookieStr = `${encodeURIComponent(key)}=${encodeURIComponent(value)};path=/;SameSite=${sameSite};`;
|
|
11383
11362
|
if (cookieLifeDays) {
|
|
11384
11363
|
const expireTime = getCookieExpirationTime(cookieLifeDays);
|
|
11385
11364
|
cookieStr += `expires=${expireTime};`;
|
|
11386
11365
|
}
|
|
11387
|
-
if (secure) {
|
|
11366
|
+
if (secure || sameSite === SameSiteOptions.None) {
|
|
11367
|
+
// SameSite None requires Secure flag
|
|
11388
11368
|
cookieStr += "Secure;";
|
|
11389
11369
|
}
|
|
11390
11370
|
document.cookie = cookieStr;
|
|
@@ -11464,6 +11444,7 @@ function getTokenKeys(clientId, storage) {
|
|
|
11464
11444
|
* Licensed under the MIT License.
|
|
11465
11445
|
*/
|
|
11466
11446
|
const ENCRYPTION_KEY = "msal.cache.encryption";
|
|
11447
|
+
const BROADCAST_CHANNEL_NAME$1 = "msal.broadcast.cache";
|
|
11467
11448
|
class LocalStorage {
|
|
11468
11449
|
constructor(clientId, logger, performanceClient) {
|
|
11469
11450
|
if (!window.localStorage) {
|
|
@@ -11474,6 +11455,7 @@ class LocalStorage {
|
|
|
11474
11455
|
this.clientId = clientId;
|
|
11475
11456
|
this.logger = logger;
|
|
11476
11457
|
this.performanceClient = performanceClient;
|
|
11458
|
+
this.broadcast = new BroadcastChannel(BROADCAST_CHANNEL_NAME$1);
|
|
11477
11459
|
}
|
|
11478
11460
|
async initialize(correlationId) {
|
|
11479
11461
|
this.initialized = true;
|
|
@@ -11509,8 +11491,13 @@ class LocalStorage {
|
|
|
11509
11491
|
id: id,
|
|
11510
11492
|
key: keyStr,
|
|
11511
11493
|
};
|
|
11512
|
-
cookies.setItem(ENCRYPTION_KEY, JSON.stringify(cookieData)
|
|
11494
|
+
cookies.setItem(ENCRYPTION_KEY, JSON.stringify(cookieData), 0, // Expiration - 0 means cookie will be cleared at the end of the browser session
|
|
11495
|
+
true, // Secure flag
|
|
11496
|
+
SameSiteOptions.None // SameSite must be None to support iframed apps
|
|
11497
|
+
);
|
|
11513
11498
|
}
|
|
11499
|
+
// Register listener for cache updates in other tabs
|
|
11500
|
+
this.broadcast.addEventListener("message", this.updateCache.bind(this));
|
|
11514
11501
|
}
|
|
11515
11502
|
getItem(key) {
|
|
11516
11503
|
return window.localStorage.getItem(key);
|
|
@@ -11536,9 +11523,22 @@ class LocalStorage {
|
|
|
11536
11523
|
};
|
|
11537
11524
|
this.memoryStorage.setItem(key, value);
|
|
11538
11525
|
this.setItem(key, JSON.stringify(encryptedData));
|
|
11526
|
+
// Notify other frames to update their in-memory cache
|
|
11527
|
+
this.broadcast.postMessage({
|
|
11528
|
+
key: key,
|
|
11529
|
+
value: value,
|
|
11530
|
+
context: this.getContext(key),
|
|
11531
|
+
});
|
|
11539
11532
|
}
|
|
11540
11533
|
removeItem(key) {
|
|
11541
|
-
this.memoryStorage.
|
|
11534
|
+
if (this.memoryStorage.containsKey(key)) {
|
|
11535
|
+
this.memoryStorage.removeItem(key);
|
|
11536
|
+
this.broadcast.postMessage({
|
|
11537
|
+
key: key,
|
|
11538
|
+
value: null,
|
|
11539
|
+
context: this.getContext(key),
|
|
11540
|
+
});
|
|
11541
|
+
}
|
|
11542
11542
|
window.localStorage.removeItem(key);
|
|
11543
11543
|
}
|
|
11544
11544
|
getKeys() {
|
|
@@ -11655,6 +11655,34 @@ class LocalStorage {
|
|
|
11655
11655
|
}
|
|
11656
11656
|
return context;
|
|
11657
11657
|
}
|
|
11658
|
+
updateCache(event) {
|
|
11659
|
+
this.logger.trace("Updating internal cache from broadcast event");
|
|
11660
|
+
const perfMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.LocalStorageUpdated);
|
|
11661
|
+
perfMeasurement.add({ isBackground: true });
|
|
11662
|
+
const { key, value, context } = event.data;
|
|
11663
|
+
if (!key) {
|
|
11664
|
+
this.logger.error("Broadcast event missing key");
|
|
11665
|
+
perfMeasurement.end({ success: false, errorCode: "noKey" });
|
|
11666
|
+
return;
|
|
11667
|
+
}
|
|
11668
|
+
if (context && context !== this.clientId) {
|
|
11669
|
+
this.logger.trace(`Ignoring broadcast event from clientId: ${context}`);
|
|
11670
|
+
perfMeasurement.end({
|
|
11671
|
+
success: false,
|
|
11672
|
+
errorCode: "contextMismatch",
|
|
11673
|
+
});
|
|
11674
|
+
return;
|
|
11675
|
+
}
|
|
11676
|
+
if (!value) {
|
|
11677
|
+
this.memoryStorage.removeItem(key);
|
|
11678
|
+
this.logger.verbose("Removed item from internal cache");
|
|
11679
|
+
}
|
|
11680
|
+
else {
|
|
11681
|
+
this.memoryStorage.setItem(key, value);
|
|
11682
|
+
this.logger.verbose("Updated item in internal cache");
|
|
11683
|
+
}
|
|
11684
|
+
perfMeasurement.end({ success: true });
|
|
11685
|
+
}
|
|
11658
11686
|
}
|
|
11659
11687
|
|
|
11660
11688
|
/*
|
|
@@ -11715,6 +11743,39 @@ function extractBrowserRequestState(browserCrypto, state) {
|
|
|
11715
11743
|
}
|
|
11716
11744
|
}
|
|
11717
11745
|
|
|
11746
|
+
/*
|
|
11747
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11748
|
+
* Licensed under the MIT License.
|
|
11749
|
+
*/
|
|
11750
|
+
const EventType = {
|
|
11751
|
+
INITIALIZE_START: "msal:initializeStart",
|
|
11752
|
+
INITIALIZE_END: "msal:initializeEnd",
|
|
11753
|
+
ACCOUNT_ADDED: "msal:accountAdded",
|
|
11754
|
+
ACCOUNT_REMOVED: "msal:accountRemoved",
|
|
11755
|
+
ACTIVE_ACCOUNT_CHANGED: "msal:activeAccountChanged",
|
|
11756
|
+
LOGIN_START: "msal:loginStart",
|
|
11757
|
+
LOGIN_SUCCESS: "msal:loginSuccess",
|
|
11758
|
+
LOGIN_FAILURE: "msal:loginFailure",
|
|
11759
|
+
ACQUIRE_TOKEN_START: "msal:acquireTokenStart",
|
|
11760
|
+
ACQUIRE_TOKEN_SUCCESS: "msal:acquireTokenSuccess",
|
|
11761
|
+
ACQUIRE_TOKEN_FAILURE: "msal:acquireTokenFailure",
|
|
11762
|
+
ACQUIRE_TOKEN_NETWORK_START: "msal:acquireTokenFromNetworkStart",
|
|
11763
|
+
SSO_SILENT_START: "msal:ssoSilentStart",
|
|
11764
|
+
SSO_SILENT_SUCCESS: "msal:ssoSilentSuccess",
|
|
11765
|
+
SSO_SILENT_FAILURE: "msal:ssoSilentFailure",
|
|
11766
|
+
ACQUIRE_TOKEN_BY_CODE_START: "msal:acquireTokenByCodeStart",
|
|
11767
|
+
ACQUIRE_TOKEN_BY_CODE_SUCCESS: "msal:acquireTokenByCodeSuccess",
|
|
11768
|
+
ACQUIRE_TOKEN_BY_CODE_FAILURE: "msal:acquireTokenByCodeFailure",
|
|
11769
|
+
HANDLE_REDIRECT_START: "msal:handleRedirectStart",
|
|
11770
|
+
HANDLE_REDIRECT_END: "msal:handleRedirectEnd",
|
|
11771
|
+
POPUP_OPENED: "msal:popupOpened",
|
|
11772
|
+
LOGOUT_START: "msal:logoutStart",
|
|
11773
|
+
LOGOUT_SUCCESS: "msal:logoutSuccess",
|
|
11774
|
+
LOGOUT_FAILURE: "msal:logoutFailure",
|
|
11775
|
+
LOGOUT_END: "msal:logoutEnd",
|
|
11776
|
+
RESTORE_FROM_BFCACHE: "msal:restoreFromBFCache",
|
|
11777
|
+
};
|
|
11778
|
+
|
|
11718
11779
|
/*
|
|
11719
11780
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11720
11781
|
* Licensed under the MIT License.
|
|
@@ -11725,7 +11786,7 @@ function extractBrowserRequestState(browserCrypto, state) {
|
|
|
11725
11786
|
* parameters such as state and nonce, generally.
|
|
11726
11787
|
*/
|
|
11727
11788
|
class BrowserCacheManager extends CacheManager {
|
|
11728
|
-
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, staticAuthorityOptions) {
|
|
11789
|
+
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions) {
|
|
11729
11790
|
super(clientId, cryptoImpl, logger, staticAuthorityOptions);
|
|
11730
11791
|
this.cacheConfig = cacheConfig;
|
|
11731
11792
|
this.logger = logger;
|
|
@@ -11734,6 +11795,7 @@ class BrowserCacheManager extends CacheManager {
|
|
|
11734
11795
|
this.temporaryCacheStorage = getStorageImplementation(clientId, cacheConfig.temporaryCacheLocation, logger, performanceClient);
|
|
11735
11796
|
this.cookieStorage = new CookieStorage();
|
|
11736
11797
|
this.performanceClient = performanceClient;
|
|
11798
|
+
this.eventHandler = eventHandler;
|
|
11737
11799
|
}
|
|
11738
11800
|
async initialize(correlationId) {
|
|
11739
11801
|
await this.browserStorage.initialize(correlationId);
|
|
@@ -11787,7 +11849,15 @@ class BrowserCacheManager extends CacheManager {
|
|
|
11787
11849
|
this.logger.trace("BrowserCacheManager.setAccount called");
|
|
11788
11850
|
const key = account.generateAccountKey();
|
|
11789
11851
|
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(key, JSON.stringify(account), correlationId);
|
|
11790
|
-
this.addAccountKeyToMap(key);
|
|
11852
|
+
const wasAdded = this.addAccountKeyToMap(key);
|
|
11853
|
+
/**
|
|
11854
|
+
* @deprecated - Remove this in next major version in favor of more consistent LOGIN event
|
|
11855
|
+
*/
|
|
11856
|
+
if (this.cacheConfig.cacheLocation ===
|
|
11857
|
+
BrowserCacheLocation.LocalStorage &&
|
|
11858
|
+
wasAdded) {
|
|
11859
|
+
this.eventHandler.emitEvent(EventType.ACCOUNT_ADDED, undefined, account.getAccountInfo());
|
|
11860
|
+
}
|
|
11791
11861
|
}
|
|
11792
11862
|
/**
|
|
11793
11863
|
* Returns the array of account keys currently cached
|
|
@@ -11809,9 +11879,11 @@ class BrowserCacheManager extends CacheManager {
|
|
|
11809
11879
|
accountKeys.push(key);
|
|
11810
11880
|
this.browserStorage.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
|
|
11811
11881
|
this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added");
|
|
11882
|
+
return true;
|
|
11812
11883
|
}
|
|
11813
11884
|
else {
|
|
11814
11885
|
this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map");
|
|
11886
|
+
return false;
|
|
11815
11887
|
}
|
|
11816
11888
|
}
|
|
11817
11889
|
/**
|
|
@@ -11840,6 +11912,19 @@ class BrowserCacheManager extends CacheManager {
|
|
|
11840
11912
|
void super.removeAccount(key);
|
|
11841
11913
|
this.removeAccountKeyFromMap(key);
|
|
11842
11914
|
}
|
|
11915
|
+
/**
|
|
11916
|
+
* Removes credentials associated with the provided account
|
|
11917
|
+
* @param account
|
|
11918
|
+
*/
|
|
11919
|
+
async removeAccountContext(account) {
|
|
11920
|
+
await super.removeAccountContext(account);
|
|
11921
|
+
/**
|
|
11922
|
+
* @deprecated - Remove this in next major version in favor of more consistent LOGOUT event
|
|
11923
|
+
*/
|
|
11924
|
+
if (this.cacheConfig.cacheLocation === BrowserCacheLocation.LocalStorage) {
|
|
11925
|
+
this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, account.getAccountInfo());
|
|
11926
|
+
}
|
|
11927
|
+
}
|
|
11843
11928
|
/**
|
|
11844
11929
|
* Removes given idToken from the cache and from the key map
|
|
11845
11930
|
* @param key
|
|
@@ -12194,6 +12279,7 @@ class BrowserCacheManager extends CacheManager {
|
|
|
12194
12279
|
this.logger.verbose("setActiveAccount: No account passed, active account not set");
|
|
12195
12280
|
this.browserStorage.removeItem(activeAccountKey);
|
|
12196
12281
|
}
|
|
12282
|
+
this.eventHandler.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
|
|
12197
12283
|
}
|
|
12198
12284
|
/**
|
|
12199
12285
|
* fetch throttling entity from the platform cache
|
|
@@ -12651,7 +12737,7 @@ function getStorageImplementation(clientId, cacheLocation, logger, performanceCl
|
|
|
12651
12737
|
}
|
|
12652
12738
|
return new MemoryStorage();
|
|
12653
12739
|
}
|
|
12654
|
-
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient) => {
|
|
12740
|
+
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient, eventHandler) => {
|
|
12655
12741
|
const cacheOptions = {
|
|
12656
12742
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
12657
12743
|
temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
@@ -12660,7 +12746,7 @@ const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient) => {
|
|
|
12660
12746
|
cacheMigrationEnabled: false,
|
|
12661
12747
|
claimsBasedCachingEnabled: false,
|
|
12662
12748
|
};
|
|
12663
|
-
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient);
|
|
12749
|
+
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient, eventHandler);
|
|
12664
12750
|
};
|
|
12665
12751
|
|
|
12666
12752
|
/*
|
|
@@ -12794,43 +12880,13 @@ function getActiveAccount(browserStorage) {
|
|
|
12794
12880
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12795
12881
|
* Licensed under the MIT License.
|
|
12796
12882
|
*/
|
|
12797
|
-
const
|
|
12798
|
-
INITIALIZE_START: "msal:initializeStart",
|
|
12799
|
-
INITIALIZE_END: "msal:initializeEnd",
|
|
12800
|
-
ACCOUNT_ADDED: "msal:accountAdded",
|
|
12801
|
-
ACCOUNT_REMOVED: "msal:accountRemoved",
|
|
12802
|
-
ACTIVE_ACCOUNT_CHANGED: "msal:activeAccountChanged",
|
|
12803
|
-
LOGIN_START: "msal:loginStart",
|
|
12804
|
-
LOGIN_SUCCESS: "msal:loginSuccess",
|
|
12805
|
-
LOGIN_FAILURE: "msal:loginFailure",
|
|
12806
|
-
ACQUIRE_TOKEN_START: "msal:acquireTokenStart",
|
|
12807
|
-
ACQUIRE_TOKEN_SUCCESS: "msal:acquireTokenSuccess",
|
|
12808
|
-
ACQUIRE_TOKEN_FAILURE: "msal:acquireTokenFailure",
|
|
12809
|
-
ACQUIRE_TOKEN_NETWORK_START: "msal:acquireTokenFromNetworkStart",
|
|
12810
|
-
SSO_SILENT_START: "msal:ssoSilentStart",
|
|
12811
|
-
SSO_SILENT_SUCCESS: "msal:ssoSilentSuccess",
|
|
12812
|
-
SSO_SILENT_FAILURE: "msal:ssoSilentFailure",
|
|
12813
|
-
ACQUIRE_TOKEN_BY_CODE_START: "msal:acquireTokenByCodeStart",
|
|
12814
|
-
ACQUIRE_TOKEN_BY_CODE_SUCCESS: "msal:acquireTokenByCodeSuccess",
|
|
12815
|
-
ACQUIRE_TOKEN_BY_CODE_FAILURE: "msal:acquireTokenByCodeFailure",
|
|
12816
|
-
HANDLE_REDIRECT_START: "msal:handleRedirectStart",
|
|
12817
|
-
HANDLE_REDIRECT_END: "msal:handleRedirectEnd",
|
|
12818
|
-
POPUP_OPENED: "msal:popupOpened",
|
|
12819
|
-
LOGOUT_START: "msal:logoutStart",
|
|
12820
|
-
LOGOUT_SUCCESS: "msal:logoutSuccess",
|
|
12821
|
-
LOGOUT_FAILURE: "msal:logoutFailure",
|
|
12822
|
-
LOGOUT_END: "msal:logoutEnd",
|
|
12823
|
-
RESTORE_FROM_BFCACHE: "msal:restoreFromBFCache",
|
|
12824
|
-
};
|
|
12825
|
-
|
|
12826
|
-
/*
|
|
12827
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12828
|
-
* Licensed under the MIT License.
|
|
12829
|
-
*/
|
|
12883
|
+
const BROADCAST_CHANNEL_NAME = "msal.broadcast.event";
|
|
12830
12884
|
class EventHandler {
|
|
12831
12885
|
constructor(logger) {
|
|
12832
12886
|
this.eventCallbacks = new Map();
|
|
12833
12887
|
this.logger = logger || new Logger({});
|
|
12888
|
+
this.broadcastChannel = new BroadcastChannel(BROADCAST_CHANNEL_NAME);
|
|
12889
|
+
this.invokeCrossTabCallbacks = this.invokeCrossTabCallbacks.bind(this);
|
|
12834
12890
|
}
|
|
12835
12891
|
/**
|
|
12836
12892
|
* Adds event callbacks to array
|
|
@@ -12867,23 +12923,59 @@ class EventHandler {
|
|
|
12867
12923
|
* @param error
|
|
12868
12924
|
*/
|
|
12869
12925
|
emitEvent(eventType, interactionType, payload, error) {
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12926
|
+
const message = {
|
|
12927
|
+
eventType: eventType,
|
|
12928
|
+
interactionType: interactionType || null,
|
|
12929
|
+
payload: payload || null,
|
|
12930
|
+
error: error || null,
|
|
12931
|
+
timestamp: Date.now(),
|
|
12932
|
+
};
|
|
12933
|
+
switch (eventType) {
|
|
12934
|
+
case EventType.ACCOUNT_ADDED:
|
|
12935
|
+
case EventType.ACCOUNT_REMOVED:
|
|
12936
|
+
case EventType.ACTIVE_ACCOUNT_CHANGED:
|
|
12937
|
+
// Send event to other open tabs / MSAL instances on same domain
|
|
12938
|
+
this.broadcastChannel.postMessage(message);
|
|
12939
|
+
break;
|
|
12940
|
+
default:
|
|
12941
|
+
// Emit event to callbacks registered in this instance
|
|
12942
|
+
this.invokeCallbacks(message);
|
|
12943
|
+
break;
|
|
12885
12944
|
}
|
|
12886
12945
|
}
|
|
12946
|
+
/**
|
|
12947
|
+
* Invoke registered callbacks
|
|
12948
|
+
* @param message
|
|
12949
|
+
*/
|
|
12950
|
+
invokeCallbacks(message) {
|
|
12951
|
+
this.eventCallbacks.forEach(([callback, eventTypes], callbackId) => {
|
|
12952
|
+
if (eventTypes.length === 0 ||
|
|
12953
|
+
eventTypes.includes(message.eventType)) {
|
|
12954
|
+
this.logger.verbose(`Emitting event to callback ${callbackId}: ${message.eventType}`);
|
|
12955
|
+
callback.apply(null, [message]);
|
|
12956
|
+
}
|
|
12957
|
+
});
|
|
12958
|
+
}
|
|
12959
|
+
/**
|
|
12960
|
+
* Wrapper around invokeCallbacks to handle broadcast events received from other tabs/instances
|
|
12961
|
+
* @param event
|
|
12962
|
+
*/
|
|
12963
|
+
invokeCrossTabCallbacks(event) {
|
|
12964
|
+
const message = event.data;
|
|
12965
|
+
this.invokeCallbacks(message);
|
|
12966
|
+
}
|
|
12967
|
+
/**
|
|
12968
|
+
* Listen for events broadcasted from other tabs/instances
|
|
12969
|
+
*/
|
|
12970
|
+
subscribeCrossTab() {
|
|
12971
|
+
this.broadcastChannel.addEventListener("message", this.invokeCrossTabCallbacks);
|
|
12972
|
+
}
|
|
12973
|
+
/**
|
|
12974
|
+
* Unsubscribe from broadcast events
|
|
12975
|
+
*/
|
|
12976
|
+
unsubscribeCrossTab() {
|
|
12977
|
+
this.broadcastChannel.removeEventListener("message", this.invokeCrossTabCallbacks);
|
|
12978
|
+
}
|
|
12887
12979
|
}
|
|
12888
12980
|
|
|
12889
12981
|
/*
|
|
@@ -14501,6 +14593,7 @@ class PopupClient extends StandardInteractionClient {
|
|
|
14501
14593
|
popupWindowAttributes: request.popupWindowAttributes || {},
|
|
14502
14594
|
popupWindowParent: request.popupWindowParent ?? window,
|
|
14503
14595
|
};
|
|
14596
|
+
this.performanceClient.addFields({ isAsyncPopup: this.config.system.asyncPopups }, this.correlationId);
|
|
14504
14597
|
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
|
|
14505
14598
|
if (this.config.system.asyncPopups) {
|
|
14506
14599
|
this.logger.verbose("asyncPopups set to true, acquiring token");
|
|
@@ -16055,8 +16148,8 @@ class StandardController {
|
|
|
16055
16148
|
this.eventHandler = new EventHandler(this.logger);
|
|
16056
16149
|
// Initialize the browser storage class.
|
|
16057
16150
|
this.browserStorage = this.isBrowserEnvironment
|
|
16058
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, buildStaticAuthorityOptions(this.config.auth))
|
|
16059
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
|
|
16151
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))
|
|
16152
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
|
16060
16153
|
// initialize in memory storage for native flows
|
|
16061
16154
|
const nativeCacheOptions = {
|
|
16062
16155
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
@@ -16066,7 +16159,7 @@ class StandardController {
|
|
|
16066
16159
|
cacheMigrationEnabled: false,
|
|
16067
16160
|
claimsBasedCachingEnabled: false,
|
|
16068
16161
|
};
|
|
16069
|
-
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient);
|
|
16162
|
+
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler);
|
|
16070
16163
|
// Initialize the token cache
|
|
16071
16164
|
this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);
|
|
16072
16165
|
this.activeSilentTokenRequests = new Map();
|
|
@@ -16075,10 +16168,6 @@ class StandardController {
|
|
|
16075
16168
|
// Register listener functions
|
|
16076
16169
|
this.trackPageVisibilityWithMeasurement =
|
|
16077
16170
|
this.trackPageVisibilityWithMeasurement.bind(this);
|
|
16078
|
-
// account storage events
|
|
16079
|
-
this.listeningToStorageEvents = false;
|
|
16080
|
-
this.handleAccountCacheChange =
|
|
16081
|
-
this.handleAccountCacheChange.bind(this);
|
|
16082
16171
|
}
|
|
16083
16172
|
static async createController(operatingContext, request) {
|
|
16084
16173
|
const controller = new StandardController(operatingContext);
|
|
@@ -16977,70 +17066,27 @@ class StandardController {
|
|
|
16977
17066
|
}
|
|
16978
17067
|
/**
|
|
16979
17068
|
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
|
17069
|
+
* @deprecated These events will be raised by default and this method will be removed in a future major version.
|
|
16980
17070
|
*/
|
|
16981
17071
|
enableAccountStorageEvents() {
|
|
16982
|
-
if (
|
|
17072
|
+
if (this.config.cache.cacheLocation !==
|
|
17073
|
+
BrowserCacheLocation.LocalStorage) {
|
|
17074
|
+
this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");
|
|
16983
17075
|
return;
|
|
16984
17076
|
}
|
|
16985
|
-
|
|
16986
|
-
this.logger.verbose("Adding account storage listener.");
|
|
16987
|
-
this.listeningToStorageEvents = true;
|
|
16988
|
-
window.addEventListener("storage", this.handleAccountCacheChange);
|
|
16989
|
-
}
|
|
16990
|
-
else {
|
|
16991
|
-
this.logger.verbose("Account storage listener already registered.");
|
|
16992
|
-
}
|
|
17077
|
+
this.eventHandler.subscribeCrossTab();
|
|
16993
17078
|
}
|
|
16994
17079
|
/**
|
|
16995
17080
|
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
|
17081
|
+
* @deprecated These events will be raised by default and this method will be removed in a future major version.
|
|
16996
17082
|
*/
|
|
16997
17083
|
disableAccountStorageEvents() {
|
|
16998
|
-
if (
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
if (this.listeningToStorageEvents) {
|
|
17002
|
-
this.logger.verbose("Removing account storage listener.");
|
|
17003
|
-
window.removeEventListener("storage", this.handleAccountCacheChange);
|
|
17004
|
-
this.listeningToStorageEvents = false;
|
|
17005
|
-
}
|
|
17006
|
-
else {
|
|
17007
|
-
this.logger.verbose("No account storage listener registered.");
|
|
17008
|
-
}
|
|
17009
|
-
}
|
|
17010
|
-
/**
|
|
17011
|
-
* Emit account added/removed events when cached accounts are changed in a different tab or frame
|
|
17012
|
-
*/
|
|
17013
|
-
handleAccountCacheChange(e) {
|
|
17014
|
-
try {
|
|
17015
|
-
// Handle active account filter change
|
|
17016
|
-
if (e.key?.includes(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS)) {
|
|
17017
|
-
// This event has no payload, it only signals cross-tab app instances that the results of calling getActiveAccount() will have changed
|
|
17018
|
-
this.eventHandler.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
|
|
17019
|
-
}
|
|
17020
|
-
// Handle account object change
|
|
17021
|
-
const cacheValue = e.newValue || e.oldValue;
|
|
17022
|
-
if (!cacheValue) {
|
|
17023
|
-
return;
|
|
17024
|
-
}
|
|
17025
|
-
const parsedValue = JSON.parse(cacheValue);
|
|
17026
|
-
if (typeof parsedValue !== "object" ||
|
|
17027
|
-
!AccountEntity.isAccountEntity(parsedValue)) {
|
|
17028
|
-
return;
|
|
17029
|
-
}
|
|
17030
|
-
const accountEntity = CacheManager.toObject(new AccountEntity(), parsedValue);
|
|
17031
|
-
const accountInfo = accountEntity.getAccountInfo();
|
|
17032
|
-
if (!e.oldValue && e.newValue) {
|
|
17033
|
-
this.logger.info("Account was added to cache in a different window");
|
|
17034
|
-
this.eventHandler.emitEvent(EventType.ACCOUNT_ADDED, undefined, accountInfo);
|
|
17035
|
-
}
|
|
17036
|
-
else if (!e.newValue && e.oldValue) {
|
|
17037
|
-
this.logger.info("Account was removed from cache in a different window");
|
|
17038
|
-
this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, accountInfo);
|
|
17039
|
-
}
|
|
17040
|
-
}
|
|
17041
|
-
catch (e) {
|
|
17084
|
+
if (this.config.cache.cacheLocation !==
|
|
17085
|
+
BrowserCacheLocation.LocalStorage) {
|
|
17086
|
+
this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");
|
|
17042
17087
|
return;
|
|
17043
17088
|
}
|
|
17089
|
+
this.eventHandler.unsubscribeCrossTab();
|
|
17044
17090
|
}
|
|
17045
17091
|
/**
|
|
17046
17092
|
* Gets the token cache for the application.
|
|
@@ -17613,11 +17659,11 @@ class NestedAppAuthController {
|
|
|
17613
17659
|
this.browserCrypto = operatingContext.isBrowserEnvironment()
|
|
17614
17660
|
? new CryptoOps(this.logger, this.performanceClient, true)
|
|
17615
17661
|
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
17662
|
+
this.eventHandler = new EventHandler(this.logger);
|
|
17616
17663
|
// Initialize the browser storage class.
|
|
17617
17664
|
this.browserStorage = this.operatingContext.isBrowserEnvironment()
|
|
17618
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, buildStaticAuthorityOptions(this.config.auth))
|
|
17619
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
|
|
17620
|
-
this.eventHandler = new EventHandler(this.logger);
|
|
17665
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))
|
|
17666
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
|
17621
17667
|
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
|
|
17622
17668
|
// Set the active account if available
|
|
17623
17669
|
const accountContext = this.bridgeProxy.getAccountContext();
|
|
@@ -18513,10 +18559,11 @@ class UnknownOperatingContextController {
|
|
|
18513
18559
|
this.browserCrypto = this.isBrowserEnvironment
|
|
18514
18560
|
? new CryptoOps(this.logger, this.performanceClient)
|
|
18515
18561
|
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
18562
|
+
this.eventHandler = new EventHandler(this.logger);
|
|
18516
18563
|
// Initialize the browser storage class.
|
|
18517
18564
|
this.browserStorage = this.isBrowserEnvironment
|
|
18518
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, undefined)
|
|
18519
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
|
|
18565
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, undefined)
|
|
18566
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
|
18520
18567
|
}
|
|
18521
18568
|
getBrowserStorage() {
|
|
18522
18569
|
return this.browserStorage;
|