@azure/msal-browser 4.0.0-alpha.0 → 4.0.1
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.d.ts +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +8 -8
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts +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 +9 -9
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +19 -19
- 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/CookieStorage.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/IWindowStorage.d.ts +2 -2
- package/dist/cache/IWindowStorage.d.ts.map +1 -1
- package/dist/cache/LocalStorage.d.ts +7 -3
- package/dist/cache/LocalStorage.d.ts.map +1 -1
- package/dist/cache/LocalStorage.mjs +48 -34
- 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.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +15 -14
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +2 -2
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +5 -5
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.d.ts +4 -3
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +9 -7
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.d.ts +2 -2
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +27 -23
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +2 -2
- package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +3 -3
- package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +1 -1
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +3 -3
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +1 -1
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +3 -3
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.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/NativeAuthError.mjs.map +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 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +4 -4
- 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 +4 -4
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +2 -2
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +2 -2
- package/dist/interaction_client/SilentIframeClient.mjs.map +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.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +1 -1
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts.map +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.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +4 -2
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +238 -197
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +238 -197
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +63 -63
- package/lib/types/broker/nativeBroker/NativeMessageHandler.d.ts +1 -1
- package/lib/types/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
- package/lib/types/broker/nativeBroker/NativeResponse.d.ts +1 -1
- package/lib/types/cache/BrowserCacheManager.d.ts +9 -9
- package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/lib/types/cache/IWindowStorage.d.ts +2 -2
- package/lib/types/cache/IWindowStorage.d.ts.map +1 -1
- package/lib/types/cache/LocalStorage.d.ts +7 -3
- package/lib/types/cache/LocalStorage.d.ts.map +1 -1
- package/lib/types/cache/TokenCache.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +2 -2
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/controllers/NestedAppAuthController.d.ts +4 -3
- package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/lib/types/controllers/StandardController.d.ts +2 -2
- package/lib/types/controllers/StandardController.d.ts.map +1 -1
- package/lib/types/controllers/UnknownOperatingContextController.d.ts +2 -2
- package/lib/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/lib/types/crypto/BrowserCrypto.d.ts +1 -1
- package/lib/types/crypto/BrowserCrypto.d.ts.map +1 -1
- package/lib/types/crypto/CryptoOps.d.ts +1 -1
- package/lib/types/crypto/CryptoOps.d.ts.map +1 -1
- package/lib/types/interaction_client/NativeInteractionClient.d.ts +1 -1
- 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/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/request/AuthorizationUrlRequest.d.ts +1 -1
- package/lib/types/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/lib/types/request/PopupRequest.d.ts +1 -1
- package/lib/types/request/PopupRequest.d.ts.map +1 -1
- package/lib/types/request/RedirectRequest.d.ts +1 -1
- package/lib/types/request/RedirectRequest.d.ts.map +1 -1
- package/lib/types/request/SsoSilentRequest.d.ts +1 -1
- package/lib/types/request/SsoSilentRequest.d.ts.map +1 -1
- package/lib/types/utils/BrowserUtils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/broker/nativeBroker/NativeMessageHandler.ts +7 -7
- package/src/broker/nativeBroker/NativeResponse.ts +1 -1
- package/src/cache/BrowserCacheManager.ts +56 -30
- package/src/cache/IWindowStorage.ts +2 -2
- package/src/cache/LocalStorage.ts +142 -43
- package/src/cache/TokenCache.ts +28 -11
- package/src/config/Configuration.ts +6 -6
- package/src/controllers/NestedAppAuthController.ts +15 -7
- package/src/controllers/StandardController.ts +41 -24
- package/src/controllers/UnknownOperatingContextController.ts +6 -5
- package/src/crypto/BrowserCrypto.ts +4 -2
- package/src/crypto/CryptoOps.ts +8 -2
- package/src/interaction_client/NativeInteractionClient.ts +5 -4
- package/src/interaction_client/PopupClient.ts +9 -8
- package/src/interaction_client/RedirectClient.ts +1 -1
- package/src/interaction_client/SilentIframeClient.ts +1 -1
- package/src/packageMetadata.ts +1 -1
- package/src/request/AuthorizationUrlRequest.ts +1 -1
- package/src/request/PopupRequest.ts +1 -1
- package/src/request/RedirectRequest.ts +1 -1
- package/src/request/SsoSilentRequest.ts +1 -1
- package/src/utils/BrowserUtils.ts +3 -1
package/lib/msal-browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v4.0.
|
|
1
|
+
/*! @azure/msal-browser v4.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1";
|
|
963
963
|
|
|
964
|
-
/*! @azure/msal-common v15.0.
|
|
964
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
1410
1410
|
/*
|
|
1411
1411
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1412
1412
|
* Licensed under the MIT License.
|
|
@@ -1431,14 +1431,14 @@
|
|
|
1431
1431
|
const missingNonceAuthenticationHeader = "missing_nonce_authentication_header";
|
|
1432
1432
|
const invalidAuthenticationHeader = "invalid_authentication_header";
|
|
1433
1433
|
const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
|
|
1434
|
-
const
|
|
1434
|
+
const cannotAllowPlatformBroker = "cannot_allow_platform_broker";
|
|
1435
1435
|
const authorityMismatch = "authority_mismatch";
|
|
1436
1436
|
|
|
1437
1437
|
var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
1438
1438
|
__proto__: null,
|
|
1439
1439
|
authorityMismatch: authorityMismatch,
|
|
1440
1440
|
authorityUriInsecure: authorityUriInsecure,
|
|
1441
|
-
|
|
1441
|
+
cannotAllowPlatformBroker: cannotAllowPlatformBroker,
|
|
1442
1442
|
cannotSetOIDCOptions: cannotSetOIDCOptions,
|
|
1443
1443
|
claimsRequestParsingError: claimsRequestParsingError,
|
|
1444
1444
|
emptyInputScopesError: emptyInputScopesError,
|
|
@@ -1460,7 +1460,7 @@
|
|
|
1460
1460
|
urlParseError: urlParseError
|
|
1461
1461
|
});
|
|
1462
1462
|
|
|
1463
|
-
/*! @azure/msal-common v15.0.
|
|
1463
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
1464
1464
|
|
|
1465
1465
|
/*
|
|
1466
1466
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1487,7 +1487,7 @@
|
|
|
1487
1487
|
[missingNonceAuthenticationHeader]: "Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",
|
|
1488
1488
|
[invalidAuthenticationHeader]: "Invalid authentication header provided",
|
|
1489
1489
|
[cannotSetOIDCOptions]: "Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",
|
|
1490
|
-
[
|
|
1490
|
+
[cannotAllowPlatformBroker]: "Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",
|
|
1491
1491
|
[authorityMismatch]: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",
|
|
1492
1492
|
};
|
|
1493
1493
|
/**
|
|
@@ -1575,9 +1575,9 @@
|
|
|
1575
1575
|
code: cannotSetOIDCOptions,
|
|
1576
1576
|
desc: ClientConfigurationErrorMessages[cannotSetOIDCOptions],
|
|
1577
1577
|
},
|
|
1578
|
-
|
|
1579
|
-
code:
|
|
1580
|
-
desc: ClientConfigurationErrorMessages[
|
|
1578
|
+
cannotAllowPlatformBroker: {
|
|
1579
|
+
code: cannotAllowPlatformBroker,
|
|
1580
|
+
desc: ClientConfigurationErrorMessages[cannotAllowPlatformBroker],
|
|
1581
1581
|
},
|
|
1582
1582
|
authorityMismatch: {
|
|
1583
1583
|
code: authorityMismatch,
|
|
@@ -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.0.1 2025-01-15 */
|
|
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.0.1 2025-01-15 */
|
|
1699
1699
|
|
|
1700
1700
|
/*
|
|
1701
1701
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1895,7 +1895,7 @@
|
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
1897
1897
|
|
|
1898
|
-
/*! @azure/msal-common v15.0.
|
|
1898
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
1899
1899
|
|
|
1900
1900
|
/*
|
|
1901
1901
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1935,7 +1935,7 @@
|
|
|
1935
1935
|
};
|
|
1936
1936
|
}
|
|
1937
1937
|
|
|
1938
|
-
/*! @azure/msal-common v15.0.
|
|
1938
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
1939
1939
|
/*
|
|
1940
1940
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1941
1941
|
* Licensed under the MIT License.
|
|
@@ -2014,7 +2014,7 @@
|
|
|
2014
2014
|
return updatedAccountInfo;
|
|
2015
2015
|
}
|
|
2016
2016
|
|
|
2017
|
-
/*! @azure/msal-common v15.0.
|
|
2017
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2018
2018
|
/*
|
|
2019
2019
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2020
2020
|
* Licensed under the MIT License.
|
|
@@ -2029,7 +2029,7 @@
|
|
|
2029
2029
|
Ciam: 3,
|
|
2030
2030
|
};
|
|
2031
2031
|
|
|
2032
|
-
/*! @azure/msal-common v15.0.
|
|
2032
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2033
2033
|
/*
|
|
2034
2034
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2035
2035
|
* Licensed under the MIT License.
|
|
@@ -2051,7 +2051,7 @@
|
|
|
2051
2051
|
return null;
|
|
2052
2052
|
}
|
|
2053
2053
|
|
|
2054
|
-
/*! @azure/msal-common v15.0.
|
|
2054
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2055
2055
|
/*
|
|
2056
2056
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2057
2057
|
* Licensed under the MIT License.
|
|
@@ -2064,7 +2064,7 @@
|
|
|
2064
2064
|
OIDC: "OIDC",
|
|
2065
2065
|
};
|
|
2066
2066
|
|
|
2067
|
-
/*! @azure/msal-common v15.0.
|
|
2067
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2068
2068
|
|
|
2069
2069
|
/*
|
|
2070
2070
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2307,7 +2307,7 @@
|
|
|
2307
2307
|
}
|
|
2308
2308
|
}
|
|
2309
2309
|
|
|
2310
|
-
/*! @azure/msal-common v15.0.
|
|
2310
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2311
2311
|
|
|
2312
2312
|
/*
|
|
2313
2313
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2354,7 +2354,7 @@
|
|
|
2354
2354
|
return null;
|
|
2355
2355
|
}
|
|
2356
2356
|
|
|
2357
|
-
/*! @azure/msal-common v15.0.
|
|
2357
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2358
2358
|
|
|
2359
2359
|
/*
|
|
2360
2360
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2518,7 +2518,7 @@
|
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
2520
|
|
|
2521
|
-
/*! @azure/msal-common v15.0.
|
|
2521
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2522
2522
|
|
|
2523
2523
|
/*
|
|
2524
2524
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2658,7 +2658,7 @@
|
|
|
2658
2658
|
return null;
|
|
2659
2659
|
}
|
|
2660
2660
|
|
|
2661
|
-
/*! @azure/msal-common v15.0.
|
|
2661
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2662
2662
|
/*
|
|
2663
2663
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2664
2664
|
* Licensed under the MIT License.
|
|
@@ -2666,7 +2666,7 @@
|
|
|
2666
2666
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2667
2667
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2668
2668
|
|
|
2669
|
-
/*! @azure/msal-common v15.0.
|
|
2669
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2670
2670
|
|
|
2671
2671
|
/*
|
|
2672
2672
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2693,7 +2693,7 @@
|
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
2695
2695
|
|
|
2696
|
-
/*! @azure/msal-common v15.0.
|
|
2696
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
2697
2697
|
|
|
2698
2698
|
/*
|
|
2699
2699
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2858,24 +2858,24 @@
|
|
|
2858
2858
|
* @param storeInCache {?StoreInCache}
|
|
2859
2859
|
* @param correlationId {?string} correlation id
|
|
2860
2860
|
*/
|
|
2861
|
-
async saveCacheRecord(cacheRecord,
|
|
2861
|
+
async saveCacheRecord(cacheRecord, correlationId, storeInCache) {
|
|
2862
2862
|
if (!cacheRecord) {
|
|
2863
2863
|
throw createClientAuthError(invalidCacheRecord);
|
|
2864
2864
|
}
|
|
2865
2865
|
try {
|
|
2866
2866
|
if (!!cacheRecord.account) {
|
|
2867
|
-
await this.setAccount(cacheRecord.account);
|
|
2867
|
+
await this.setAccount(cacheRecord.account, correlationId);
|
|
2868
2868
|
}
|
|
2869
2869
|
if (!!cacheRecord.idToken && storeInCache?.idToken !== false) {
|
|
2870
|
-
await this.setIdTokenCredential(cacheRecord.idToken);
|
|
2870
|
+
await this.setIdTokenCredential(cacheRecord.idToken, correlationId);
|
|
2871
2871
|
}
|
|
2872
2872
|
if (!!cacheRecord.accessToken &&
|
|
2873
2873
|
storeInCache?.accessToken !== false) {
|
|
2874
|
-
await this.saveAccessToken(cacheRecord.accessToken);
|
|
2874
|
+
await this.saveAccessToken(cacheRecord.accessToken, correlationId);
|
|
2875
2875
|
}
|
|
2876
2876
|
if (!!cacheRecord.refreshToken &&
|
|
2877
2877
|
storeInCache?.refreshToken !== false) {
|
|
2878
|
-
await this.setRefreshTokenCredential(cacheRecord.refreshToken);
|
|
2878
|
+
await this.setRefreshTokenCredential(cacheRecord.refreshToken, correlationId);
|
|
2879
2879
|
}
|
|
2880
2880
|
if (!!cacheRecord.appMetadata) {
|
|
2881
2881
|
this.setAppMetadata(cacheRecord.appMetadata);
|
|
@@ -2905,7 +2905,7 @@
|
|
|
2905
2905
|
* saves access token credential
|
|
2906
2906
|
* @param credential
|
|
2907
2907
|
*/
|
|
2908
|
-
async saveAccessToken(credential) {
|
|
2908
|
+
async saveAccessToken(credential, correlationId) {
|
|
2909
2909
|
const accessTokenFilter = {
|
|
2910
2910
|
clientId: credential.clientId,
|
|
2911
2911
|
credentialType: credential.credentialType,
|
|
@@ -2932,7 +2932,7 @@
|
|
|
2932
2932
|
}
|
|
2933
2933
|
});
|
|
2934
2934
|
await Promise.all(removedAccessTokens);
|
|
2935
|
-
await this.setAccessTokenCredential(credential);
|
|
2935
|
+
await this.setAccessTokenCredential(credential, correlationId);
|
|
2936
2936
|
}
|
|
2937
2937
|
/**
|
|
2938
2938
|
* Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
|
|
@@ -3878,7 +3878,7 @@
|
|
|
3878
3878
|
}
|
|
3879
3879
|
}
|
|
3880
3880
|
|
|
3881
|
-
/*! @azure/msal-common v15.0.
|
|
3881
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
3882
3882
|
|
|
3883
3883
|
/*
|
|
3884
3884
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3977,7 +3977,7 @@
|
|
|
3977
3977
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3978
3978
|
}
|
|
3979
3979
|
|
|
3980
|
-
/*! @azure/msal-common v15.0.
|
|
3980
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
3981
3981
|
/*
|
|
3982
3982
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3983
3983
|
* Licensed under the MIT License.
|
|
@@ -3987,7 +3987,7 @@
|
|
|
3987
3987
|
UPN: "UPN",
|
|
3988
3988
|
};
|
|
3989
3989
|
|
|
3990
|
-
/*! @azure/msal-common v15.0.
|
|
3990
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
3991
3991
|
/*
|
|
3992
3992
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3993
3993
|
* Licensed under the MIT License.
|
|
@@ -4037,7 +4037,7 @@
|
|
|
4037
4037
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4038
4038
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4039
4039
|
|
|
4040
|
-
/*! @azure/msal-common v15.0.
|
|
4040
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
4041
4041
|
|
|
4042
4042
|
/*
|
|
4043
4043
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4104,7 +4104,7 @@
|
|
|
4104
4104
|
}
|
|
4105
4105
|
}
|
|
4106
4106
|
|
|
4107
|
-
/*! @azure/msal-common v15.0.
|
|
4107
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
4108
4108
|
|
|
4109
4109
|
/*
|
|
4110
4110
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4512,7 +4512,7 @@
|
|
|
4512
4512
|
}
|
|
4513
4513
|
}
|
|
4514
4514
|
|
|
4515
|
-
/*! @azure/msal-common v15.0.
|
|
4515
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
4516
4516
|
/*
|
|
4517
4517
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4518
4518
|
* Licensed under the MIT License.
|
|
@@ -4524,7 +4524,7 @@
|
|
|
4524
4524
|
response.hasOwnProperty("jwks_uri"));
|
|
4525
4525
|
}
|
|
4526
4526
|
|
|
4527
|
-
/*! @azure/msal-common v15.0.
|
|
4527
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
4528
4528
|
/*
|
|
4529
4529
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4530
4530
|
* Licensed under the MIT License.
|
|
@@ -4534,7 +4534,7 @@
|
|
|
4534
4534
|
response.hasOwnProperty("metadata"));
|
|
4535
4535
|
}
|
|
4536
4536
|
|
|
4537
|
-
/*! @azure/msal-common v15.0.
|
|
4537
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
4538
4538
|
/*
|
|
4539
4539
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4540
4540
|
* Licensed under the MIT License.
|
|
@@ -4544,7 +4544,7 @@
|
|
|
4544
4544
|
response.hasOwnProperty("error_description"));
|
|
4545
4545
|
}
|
|
4546
4546
|
|
|
4547
|
-
/*! @azure/msal-common v15.0.
|
|
4547
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
4548
4548
|
/*
|
|
4549
4549
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4550
4550
|
* Licensed under the MIT License.
|
|
@@ -4702,6 +4702,7 @@
|
|
|
4702
4702
|
*/
|
|
4703
4703
|
InitializeSilentRequest: "initializeSilentRequest",
|
|
4704
4704
|
InitializeClientApplication: "initializeClientApplication",
|
|
4705
|
+
InitializeCache: "initializeCache",
|
|
4705
4706
|
/**
|
|
4706
4707
|
* Helper function in SilentIframeClient class (msal-browser).
|
|
4707
4708
|
*/
|
|
@@ -4779,6 +4780,8 @@
|
|
|
4779
4780
|
*/
|
|
4780
4781
|
ClearTokensAndKeysWithClaims: "clearTokensAndKeysWithClaims",
|
|
4781
4782
|
CacheManagerGetRefreshToken: "cacheManagerGetRefreshToken",
|
|
4783
|
+
ImportExistingCache: "importExistingCache",
|
|
4784
|
+
SetUserData: "setUserData",
|
|
4782
4785
|
/**
|
|
4783
4786
|
* Crypto Operations
|
|
4784
4787
|
*/
|
|
@@ -4787,6 +4790,12 @@
|
|
|
4787
4790
|
GenerateCodeChallengeFromVerifier: "generateCodeChallengeFromVerifier",
|
|
4788
4791
|
Sha256Digest: "sha256Digest",
|
|
4789
4792
|
GetRandomValues: "getRandomValues",
|
|
4793
|
+
GenerateHKDF: "generateHKDF",
|
|
4794
|
+
GenerateBaseKey: "generateBaseKey",
|
|
4795
|
+
Base64Decode: "base64Decode",
|
|
4796
|
+
UrlEncodeArr: "urlEncodeArr",
|
|
4797
|
+
Encrypt: "encrypt",
|
|
4798
|
+
Decrypt: "decrypt",
|
|
4790
4799
|
};
|
|
4791
4800
|
const PerformanceEventAbbreviations = new Map([
|
|
4792
4801
|
[PerformanceEvents.AcquireTokenByCode, "ATByCode"],
|
|
@@ -4871,6 +4880,9 @@
|
|
|
4871
4880
|
PerformanceEvents.InitializeClientApplication,
|
|
4872
4881
|
"InitClientApplication",
|
|
4873
4882
|
],
|
|
4883
|
+
[PerformanceEvents.InitializeCache, "InitCache"],
|
|
4884
|
+
[PerformanceEvents.ImportExistingCache, "importCache"],
|
|
4885
|
+
[PerformanceEvents.SetUserData, "setUserData"],
|
|
4874
4886
|
[PerformanceEvents.SilentIframeClientTokenHelper, "SIClientTHelper"],
|
|
4875
4887
|
[
|
|
4876
4888
|
PerformanceEvents.SilentHandlerInitiateAuthRequest,
|
|
@@ -5004,6 +5016,12 @@
|
|
|
5004
5016
|
],
|
|
5005
5017
|
[PerformanceEvents.Sha256Digest, "Sha256Digest"],
|
|
5006
5018
|
[PerformanceEvents.GetRandomValues, "GetRandomValues"],
|
|
5019
|
+
[PerformanceEvents.GenerateHKDF, "genHKDF"],
|
|
5020
|
+
[PerformanceEvents.GenerateBaseKey, "genBaseKey"],
|
|
5021
|
+
[PerformanceEvents.Base64Decode, "b64Decode"],
|
|
5022
|
+
[PerformanceEvents.UrlEncodeArr, "urlEncArr"],
|
|
5023
|
+
[PerformanceEvents.Encrypt, "encrypt"],
|
|
5024
|
+
[PerformanceEvents.Decrypt, "decrypt"],
|
|
5007
5025
|
]);
|
|
5008
5026
|
/**
|
|
5009
5027
|
* State of the performance event.
|
|
@@ -5029,9 +5047,11 @@
|
|
|
5029
5047
|
"multiMatchedAT",
|
|
5030
5048
|
"multiMatchedID",
|
|
5031
5049
|
"multiMatchedRT",
|
|
5050
|
+
"unencryptedCacheCount",
|
|
5051
|
+
"encryptedCacheExpiredCount",
|
|
5032
5052
|
]);
|
|
5033
5053
|
|
|
5034
|
-
/*! @azure/msal-common v15.0.
|
|
5054
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
5035
5055
|
/*
|
|
5036
5056
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5037
5057
|
* Licensed under the MIT License.
|
|
@@ -5127,7 +5147,7 @@
|
|
|
5127
5147
|
};
|
|
5128
5148
|
};
|
|
5129
5149
|
|
|
5130
|
-
/*! @azure/msal-common v15.0.
|
|
5150
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
5131
5151
|
|
|
5132
5152
|
/*
|
|
5133
5153
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5236,7 +5256,7 @@
|
|
|
5236
5256
|
},
|
|
5237
5257
|
};
|
|
5238
5258
|
|
|
5239
|
-
/*! @azure/msal-common v15.0.
|
|
5259
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
5240
5260
|
|
|
5241
5261
|
/*
|
|
5242
5262
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6075,7 +6095,7 @@
|
|
|
6075
6095
|
};
|
|
6076
6096
|
}
|
|
6077
6097
|
|
|
6078
|
-
/*! @azure/msal-common v15.0.
|
|
6098
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6079
6099
|
|
|
6080
6100
|
/*
|
|
6081
6101
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6106,7 +6126,7 @@
|
|
|
6106
6126
|
}
|
|
6107
6127
|
}
|
|
6108
6128
|
|
|
6109
|
-
/*! @azure/msal-common v15.0.
|
|
6129
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6110
6130
|
|
|
6111
6131
|
/*
|
|
6112
6132
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6125,7 +6145,7 @@
|
|
|
6125
6145
|
}
|
|
6126
6146
|
}
|
|
6127
6147
|
|
|
6128
|
-
/*! @azure/msal-common v15.0.
|
|
6148
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6129
6149
|
|
|
6130
6150
|
/*
|
|
6131
6151
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6223,7 +6243,7 @@
|
|
|
6223
6243
|
}
|
|
6224
6244
|
}
|
|
6225
6245
|
|
|
6226
|
-
/*! @azure/msal-common v15.0.
|
|
6246
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6227
6247
|
|
|
6228
6248
|
/*
|
|
6229
6249
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6253,7 +6273,7 @@
|
|
|
6253
6273
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
6254
6274
|
}
|
|
6255
6275
|
|
|
6256
|
-
/*! @azure/msal-common v15.0.
|
|
6276
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6257
6277
|
|
|
6258
6278
|
/*
|
|
6259
6279
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6403,7 +6423,7 @@
|
|
|
6403
6423
|
}
|
|
6404
6424
|
}
|
|
6405
6425
|
|
|
6406
|
-
/*! @azure/msal-common v15.0.
|
|
6426
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6407
6427
|
/*
|
|
6408
6428
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6409
6429
|
* Licensed under the MIT License.
|
|
@@ -6429,7 +6449,7 @@
|
|
|
6429
6449
|
refreshTokenExpired: refreshTokenExpired
|
|
6430
6450
|
});
|
|
6431
6451
|
|
|
6432
|
-
/*! @azure/msal-common v15.0.
|
|
6452
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6433
6453
|
|
|
6434
6454
|
/*
|
|
6435
6455
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6517,7 +6537,7 @@
|
|
|
6517
6537
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6518
6538
|
}
|
|
6519
6539
|
|
|
6520
|
-
/*! @azure/msal-common v15.0.
|
|
6540
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6521
6541
|
|
|
6522
6542
|
/*
|
|
6523
6543
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6589,7 +6609,7 @@
|
|
|
6589
6609
|
}
|
|
6590
6610
|
}
|
|
6591
6611
|
|
|
6592
|
-
/*! @azure/msal-common v15.0.
|
|
6612
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6593
6613
|
|
|
6594
6614
|
/*
|
|
6595
6615
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6673,7 +6693,7 @@
|
|
|
6673
6693
|
}
|
|
6674
6694
|
}
|
|
6675
6695
|
|
|
6676
|
-
/*! @azure/msal-common v15.0.
|
|
6696
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6677
6697
|
/*
|
|
6678
6698
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6679
6699
|
* Licensed under the MIT License.
|
|
@@ -6700,7 +6720,7 @@
|
|
|
6700
6720
|
}
|
|
6701
6721
|
}
|
|
6702
6722
|
|
|
6703
|
-
/*! @azure/msal-common v15.0.
|
|
6723
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
6704
6724
|
|
|
6705
6725
|
/*
|
|
6706
6726
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6866,7 +6886,7 @@
|
|
|
6866
6886
|
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
|
|
6867
6887
|
}
|
|
6868
6888
|
}
|
|
6869
|
-
await this.cacheStorage.saveCacheRecord(cacheRecord, request.
|
|
6889
|
+
await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, request.storeInCache);
|
|
6870
6890
|
}
|
|
6871
6891
|
finally {
|
|
6872
6892
|
if (this.persistencePlugin &&
|
|
@@ -7077,7 +7097,7 @@
|
|
|
7077
7097
|
return baseAccount;
|
|
7078
7098
|
}
|
|
7079
7099
|
|
|
7080
|
-
/*! @azure/msal-common v15.0.
|
|
7100
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7081
7101
|
/*
|
|
7082
7102
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7083
7103
|
* Licensed under the MIT License.
|
|
@@ -7095,7 +7115,7 @@
|
|
|
7095
7115
|
}
|
|
7096
7116
|
}
|
|
7097
7117
|
|
|
7098
|
-
/*! @azure/msal-common v15.0.
|
|
7118
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7099
7119
|
|
|
7100
7120
|
/*
|
|
7101
7121
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7469,7 +7489,7 @@
|
|
|
7469
7489
|
});
|
|
7470
7490
|
}
|
|
7471
7491
|
this.addExtraQueryParams(request, parameterBuilder);
|
|
7472
|
-
if (request.
|
|
7492
|
+
if (request.platformBroker) {
|
|
7473
7493
|
// signal ests that this is a WAM call
|
|
7474
7494
|
parameterBuilder.addNativeBroker();
|
|
7475
7495
|
// pass the req_cnf for POP
|
|
@@ -7537,7 +7557,7 @@
|
|
|
7537
7557
|
}
|
|
7538
7558
|
}
|
|
7539
7559
|
|
|
7540
|
-
/*! @azure/msal-common v15.0.
|
|
7560
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7541
7561
|
|
|
7542
7562
|
/*
|
|
7543
7563
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7757,7 +7777,7 @@
|
|
|
7757
7777
|
}
|
|
7758
7778
|
}
|
|
7759
7779
|
|
|
7760
|
-
/*! @azure/msal-common v15.0.
|
|
7780
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7761
7781
|
|
|
7762
7782
|
/*
|
|
7763
7783
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7893,7 +7913,7 @@
|
|
|
7893
7913
|
}
|
|
7894
7914
|
}
|
|
7895
7915
|
|
|
7896
|
-
/*! @azure/msal-common v15.0.
|
|
7916
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7897
7917
|
|
|
7898
7918
|
/*
|
|
7899
7919
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7908,7 +7928,7 @@
|
|
|
7908
7928
|
},
|
|
7909
7929
|
};
|
|
7910
7930
|
|
|
7911
|
-
/*! @azure/msal-common v15.0.
|
|
7931
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7912
7932
|
|
|
7913
7933
|
/*
|
|
7914
7934
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7966,7 +7986,7 @@
|
|
|
7966
7986
|
}
|
|
7967
7987
|
}
|
|
7968
7988
|
|
|
7969
|
-
/*! @azure/msal-common v15.0.
|
|
7989
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
7970
7990
|
|
|
7971
7991
|
/*
|
|
7972
7992
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8229,7 +8249,7 @@
|
|
|
8229
8249
|
}
|
|
8230
8250
|
}
|
|
8231
8251
|
|
|
8232
|
-
/*! @azure/msal-common v15.0.
|
|
8252
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
8233
8253
|
/*
|
|
8234
8254
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8235
8255
|
* Licensed under the MIT License.
|
|
@@ -8237,7 +8257,7 @@
|
|
|
8237
8257
|
const missingKidError = "missing_kid_error";
|
|
8238
8258
|
const missingAlgError = "missing_alg_error";
|
|
8239
8259
|
|
|
8240
|
-
/*! @azure/msal-common v15.0.
|
|
8260
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
8241
8261
|
|
|
8242
8262
|
/*
|
|
8243
8263
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8262,7 +8282,7 @@
|
|
|
8262
8282
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
8263
8283
|
}
|
|
8264
8284
|
|
|
8265
|
-
/*! @azure/msal-common v15.0.
|
|
8285
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
8266
8286
|
|
|
8267
8287
|
/*
|
|
8268
8288
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8302,7 +8322,7 @@
|
|
|
8302
8322
|
}
|
|
8303
8323
|
}
|
|
8304
8324
|
|
|
8305
|
-
/*! @azure/msal-common v15.0.
|
|
8325
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
8306
8326
|
|
|
8307
8327
|
/*
|
|
8308
8328
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8381,7 +8401,7 @@
|
|
|
8381
8401
|
}
|
|
8382
8402
|
}
|
|
8383
8403
|
|
|
8384
|
-
/*! @azure/msal-common v15.0.
|
|
8404
|
+
/*! @azure/msal-common v15.0.1 2025-01-15 */
|
|
8385
8405
|
|
|
8386
8406
|
/*
|
|
8387
8407
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9697,14 +9717,14 @@
|
|
|
9697
9717
|
/**
|
|
9698
9718
|
* Check whether browser crypto is available.
|
|
9699
9719
|
*/
|
|
9700
|
-
function validateCryptoAvailable() {
|
|
9720
|
+
function validateCryptoAvailable(skipValidateSubtleCrypto) {
|
|
9701
9721
|
if (!window) {
|
|
9702
9722
|
throw createBrowserAuthError(nonBrowserEnvironment);
|
|
9703
9723
|
}
|
|
9704
9724
|
if (!window.crypto) {
|
|
9705
9725
|
throw createBrowserAuthError(cryptoNonExistent);
|
|
9706
9726
|
}
|
|
9707
|
-
if (!window.crypto.subtle) {
|
|
9727
|
+
if (!skipValidateSubtleCrypto && !window.crypto.subtle) {
|
|
9708
9728
|
throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
|
|
9709
9729
|
}
|
|
9710
9730
|
}
|
|
@@ -9989,7 +10009,9 @@
|
|
|
9989
10009
|
* Returns current window URL as redirect uri
|
|
9990
10010
|
*/
|
|
9991
10011
|
function getCurrentUri() {
|
|
9992
|
-
return window
|
|
10012
|
+
return typeof window !== "undefined" && window.location
|
|
10013
|
+
? window.location.href.split("?")[0].split("#")[0]
|
|
10014
|
+
: "";
|
|
9993
10015
|
}
|
|
9994
10016
|
/**
|
|
9995
10017
|
* Gets the homepage url for the current window location.
|
|
@@ -10369,7 +10391,7 @@
|
|
|
10369
10391
|
redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,
|
|
10370
10392
|
asyncPopups: false,
|
|
10371
10393
|
allowRedirectInIframe: false,
|
|
10372
|
-
|
|
10394
|
+
allowPlatformBroker: false,
|
|
10373
10395
|
nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||
|
|
10374
10396
|
DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
|
|
10375
10397
|
pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,
|
|
@@ -10392,11 +10414,11 @@
|
|
|
10392
10414
|
const logger = new Logger(providedSystemOptions.loggerOptions);
|
|
10393
10415
|
logger.warning(JSON.stringify(createClientConfigurationError(cannotSetOIDCOptions)));
|
|
10394
10416
|
}
|
|
10395
|
-
// Throw an error if user has set
|
|
10417
|
+
// Throw an error if user has set allowPlatformBroker to true without being in AAD protocol mode
|
|
10396
10418
|
if (userInputAuth?.protocolMode &&
|
|
10397
10419
|
userInputAuth.protocolMode !== ProtocolMode.AAD &&
|
|
10398
|
-
providedSystemOptions?.
|
|
10399
|
-
throw createClientConfigurationError(
|
|
10420
|
+
providedSystemOptions?.allowPlatformBroker) {
|
|
10421
|
+
throw createClientConfigurationError(cannotAllowPlatformBroker);
|
|
10400
10422
|
}
|
|
10401
10423
|
const overlayedConfig = {
|
|
10402
10424
|
auth: {
|
|
@@ -10416,7 +10438,7 @@
|
|
|
10416
10438
|
|
|
10417
10439
|
/* eslint-disable header/header */
|
|
10418
10440
|
const name = "@azure/msal-browser";
|
|
10419
|
-
const version = "4.0.
|
|
10441
|
+
const version = "4.0.1";
|
|
10420
10442
|
|
|
10421
10443
|
/*
|
|
10422
10444
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11175,10 +11197,10 @@
|
|
|
11175
11197
|
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
11176
11198
|
*/
|
|
11177
11199
|
class CryptoOps {
|
|
11178
|
-
constructor(logger, performanceClient) {
|
|
11200
|
+
constructor(logger, performanceClient, skipValidateSubtleCrypto) {
|
|
11179
11201
|
this.logger = logger;
|
|
11180
11202
|
// Browser crypto needs to be validated first before any other classes can be set.
|
|
11181
|
-
validateCryptoAvailable();
|
|
11203
|
+
validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
|
|
11182
11204
|
this.cache = new AsyncMemoryStorage(this.logger);
|
|
11183
11205
|
this.performanceClient = performanceClient;
|
|
11184
11206
|
}
|
|
@@ -11456,15 +11478,17 @@
|
|
|
11456
11478
|
*/
|
|
11457
11479
|
const ENCRYPTION_KEY = "msal.cache.encryption";
|
|
11458
11480
|
class LocalStorage {
|
|
11459
|
-
constructor(clientId) {
|
|
11481
|
+
constructor(clientId, logger, performanceClient) {
|
|
11460
11482
|
if (!window.localStorage) {
|
|
11461
11483
|
throw createBrowserConfigurationAuthError(storageNotSupported);
|
|
11462
11484
|
}
|
|
11463
11485
|
this.memoryStorage = new MemoryStorage();
|
|
11464
11486
|
this.initialized = false;
|
|
11465
11487
|
this.clientId = clientId;
|
|
11488
|
+
this.logger = logger;
|
|
11489
|
+
this.performanceClient = performanceClient;
|
|
11466
11490
|
}
|
|
11467
|
-
async initialize() {
|
|
11491
|
+
async initialize(correlationId) {
|
|
11468
11492
|
this.initialized = true;
|
|
11469
11493
|
const cookies = new CookieStorage();
|
|
11470
11494
|
const cookieString = cookies.getItem(ENCRYPTION_KEY);
|
|
@@ -11473,27 +11497,26 @@
|
|
|
11473
11497
|
try {
|
|
11474
11498
|
parsedCookie = JSON.parse(cookieString);
|
|
11475
11499
|
}
|
|
11476
|
-
catch (e) {
|
|
11477
|
-
// TODO: Log telemetry but don't throw
|
|
11478
|
-
}
|
|
11500
|
+
catch (e) { }
|
|
11479
11501
|
}
|
|
11480
11502
|
if (parsedCookie.key && parsedCookie.id) {
|
|
11481
11503
|
// Encryption key already exists, import
|
|
11504
|
+
const baseKey = invoke(base64DecToArr, PerformanceEvents.Base64Decode, this.logger, this.performanceClient, correlationId)(parsedCookie.key);
|
|
11482
11505
|
this.encryptionCookie = {
|
|
11483
11506
|
id: parsedCookie.id,
|
|
11484
|
-
key: await generateHKDF
|
|
11507
|
+
key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),
|
|
11485
11508
|
};
|
|
11486
|
-
await this.importExistingCache();
|
|
11509
|
+
await invokeAsync(this.importExistingCache.bind(this), PerformanceEvents.ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
|
|
11487
11510
|
}
|
|
11488
11511
|
else {
|
|
11489
11512
|
// Encryption key doesn't exist or is invalid, generate a new one and clear existing cache
|
|
11490
11513
|
this.clear();
|
|
11491
11514
|
const id = createNewGuid();
|
|
11492
|
-
const baseKey = await generateBaseKey();
|
|
11493
|
-
const keyStr = urlEncodeArr(new Uint8Array(baseKey));
|
|
11515
|
+
const baseKey = await invokeAsync(generateBaseKey, PerformanceEvents.GenerateBaseKey, this.logger, this.performanceClient, correlationId)();
|
|
11516
|
+
const keyStr = invoke(urlEncodeArr, PerformanceEvents.UrlEncodeArr, this.logger, this.performanceClient, correlationId)(new Uint8Array(baseKey));
|
|
11494
11517
|
this.encryptionCookie = {
|
|
11495
11518
|
id: id,
|
|
11496
|
-
key: await generateHKDF(baseKey),
|
|
11519
|
+
key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),
|
|
11497
11520
|
};
|
|
11498
11521
|
const cookieData = {
|
|
11499
11522
|
id: id,
|
|
@@ -11514,11 +11537,11 @@
|
|
|
11514
11537
|
setItem(key, value) {
|
|
11515
11538
|
window.localStorage.setItem(key, value);
|
|
11516
11539
|
}
|
|
11517
|
-
async setUserData(key, value) {
|
|
11540
|
+
async setUserData(key, value, correlationId) {
|
|
11518
11541
|
if (!this.initialized || !this.encryptionCookie) {
|
|
11519
11542
|
throw createBrowserAuthError(uninitializedPublicClientApplication);
|
|
11520
11543
|
}
|
|
11521
|
-
const { data, nonce } = await encrypt(this.encryptionCookie.key, value, this.getContext(key));
|
|
11544
|
+
const { data, nonce } = await invokeAsync(encrypt, PerformanceEvents.Encrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, value, this.getContext(key));
|
|
11522
11545
|
const encryptedData = {
|
|
11523
11546
|
id: this.encryptionCookie.id,
|
|
11524
11547
|
nonce: nonce,
|
|
@@ -11561,25 +11584,27 @@
|
|
|
11561
11584
|
* Helper to decrypt all known MSAL keys in localStorage and save them to inMemory storage
|
|
11562
11585
|
* @returns
|
|
11563
11586
|
*/
|
|
11564
|
-
async importExistingCache() {
|
|
11587
|
+
async importExistingCache(correlationId) {
|
|
11565
11588
|
if (!this.encryptionCookie) {
|
|
11566
11589
|
return;
|
|
11567
11590
|
}
|
|
11568
|
-
|
|
11569
|
-
await this.importArray(accountKeys);
|
|
11591
|
+
let accountKeys = getAccountKeys(this);
|
|
11592
|
+
accountKeys = await this.importArray(accountKeys, correlationId);
|
|
11593
|
+
// Write valid account keys back to map
|
|
11594
|
+
this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
|
|
11570
11595
|
const tokenKeys = getTokenKeys(this.clientId, this);
|
|
11571
|
-
await
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11596
|
+
tokenKeys.idToken = await this.importArray(tokenKeys.idToken, correlationId);
|
|
11597
|
+
tokenKeys.accessToken = await this.importArray(tokenKeys.accessToken, correlationId);
|
|
11598
|
+
tokenKeys.refreshToken = await this.importArray(tokenKeys.refreshToken, correlationId);
|
|
11599
|
+
// Write valid token keys back to map
|
|
11600
|
+
this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
|
|
11576
11601
|
}
|
|
11577
11602
|
/**
|
|
11578
11603
|
* Helper to decrypt and save cache entries
|
|
11579
11604
|
* @param key
|
|
11580
11605
|
* @returns
|
|
11581
11606
|
*/
|
|
11582
|
-
async getItemFromEncryptedCache(key) {
|
|
11607
|
+
async getItemFromEncryptedCache(key, correlationId) {
|
|
11583
11608
|
if (!this.encryptionCookie) {
|
|
11584
11609
|
return null;
|
|
11585
11610
|
}
|
|
@@ -11590,36 +11615,46 @@
|
|
|
11590
11615
|
let encObj;
|
|
11591
11616
|
try {
|
|
11592
11617
|
encObj = JSON.parse(rawCache);
|
|
11593
|
-
if (!encObj.id || !encObj.nonce || !encObj.data) {
|
|
11594
|
-
throw "Not encrypted!"; // TODO: Typed error
|
|
11595
|
-
}
|
|
11596
|
-
if (encObj.id !== this.encryptionCookie.id) {
|
|
11597
|
-
throw "Old item!"; // TODO: Typed error
|
|
11598
|
-
}
|
|
11599
11618
|
}
|
|
11600
11619
|
catch (e) {
|
|
11601
11620
|
// Not a valid encrypted object, remove
|
|
11602
|
-
this.removeItem(key);
|
|
11603
|
-
// TODO: Log to telemetry
|
|
11604
11621
|
return null;
|
|
11605
11622
|
}
|
|
11606
|
-
|
|
11623
|
+
if (!encObj.id || !encObj.nonce || !encObj.data) {
|
|
11624
|
+
// Data is not encrypted, likely from old version of MSAL. It must be removed because we don't know how old it is.
|
|
11625
|
+
this.performanceClient.incrementFields({ unencryptedCacheCount: 1 }, correlationId);
|
|
11626
|
+
return null;
|
|
11627
|
+
}
|
|
11628
|
+
if (encObj.id !== this.encryptionCookie.id) {
|
|
11629
|
+
// Data was encrypted with a different key. It must be removed because it is from a previous session.
|
|
11630
|
+
this.performanceClient.incrementFields({ encryptedCacheExpiredCount: 1 }, correlationId);
|
|
11631
|
+
return null;
|
|
11632
|
+
}
|
|
11633
|
+
return invokeAsync(decrypt, PerformanceEvents.Decrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, encObj.nonce, this.getContext(key), encObj.data);
|
|
11607
11634
|
}
|
|
11608
11635
|
/**
|
|
11609
11636
|
* Helper to decrypt and save an array of cache keys
|
|
11610
11637
|
* @param arr
|
|
11638
|
+
* @returns Array of keys successfully imported
|
|
11611
11639
|
*/
|
|
11612
|
-
async importArray(arr) {
|
|
11640
|
+
async importArray(arr, correlationId) {
|
|
11641
|
+
const importedArr = [];
|
|
11613
11642
|
const promiseArr = [];
|
|
11614
11643
|
arr.forEach((key) => {
|
|
11615
|
-
const promise = this.getItemFromEncryptedCache(key).then((value) => {
|
|
11644
|
+
const promise = this.getItemFromEncryptedCache(key, correlationId).then((value) => {
|
|
11616
11645
|
if (value) {
|
|
11617
11646
|
this.memoryStorage.setItem(key, value);
|
|
11647
|
+
importedArr.push(key);
|
|
11648
|
+
}
|
|
11649
|
+
else {
|
|
11650
|
+
// If value is empty, unencrypted or expired remove
|
|
11651
|
+
this.removeItem(key);
|
|
11618
11652
|
}
|
|
11619
11653
|
});
|
|
11620
11654
|
promiseArr.push(promise);
|
|
11621
11655
|
});
|
|
11622
11656
|
await Promise.all(promiseArr);
|
|
11657
|
+
return importedArr;
|
|
11623
11658
|
}
|
|
11624
11659
|
/**
|
|
11625
11660
|
* Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries
|
|
@@ -11703,7 +11738,7 @@
|
|
|
11703
11738
|
* parameters such as state and nonce, generally.
|
|
11704
11739
|
*/
|
|
11705
11740
|
class BrowserCacheManager extends CacheManager {
|
|
11706
|
-
constructor(clientId, cacheConfig, cryptoImpl, logger,
|
|
11741
|
+
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, staticAuthorityOptions) {
|
|
11707
11742
|
super(clientId, cryptoImpl, logger, staticAuthorityOptions);
|
|
11708
11743
|
this.cacheConfig = cacheConfig;
|
|
11709
11744
|
this.logger = logger;
|
|
@@ -11713,8 +11748,8 @@
|
|
|
11713
11748
|
this.cookieStorage = new CookieStorage();
|
|
11714
11749
|
this.performanceClient = performanceClient;
|
|
11715
11750
|
}
|
|
11716
|
-
async initialize() {
|
|
11717
|
-
await this.browserStorage.initialize();
|
|
11751
|
+
async initialize(correlationId) {
|
|
11752
|
+
await this.browserStorage.initialize(correlationId);
|
|
11718
11753
|
}
|
|
11719
11754
|
/**
|
|
11720
11755
|
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
@@ -11724,7 +11759,7 @@
|
|
|
11724
11759
|
try {
|
|
11725
11760
|
switch (cacheLocation) {
|
|
11726
11761
|
case BrowserCacheLocation.LocalStorage:
|
|
11727
|
-
return new LocalStorage(this.clientId);
|
|
11762
|
+
return new LocalStorage(this.clientId, this.logger, this.performanceClient);
|
|
11728
11763
|
case BrowserCacheLocation.SessionStorage:
|
|
11729
11764
|
return new SessionStorage();
|
|
11730
11765
|
case BrowserCacheLocation.MemoryStorage:
|
|
@@ -11783,10 +11818,10 @@
|
|
|
11783
11818
|
* set account entity in the platform cache
|
|
11784
11819
|
* @param account
|
|
11785
11820
|
*/
|
|
11786
|
-
async setAccount(account) {
|
|
11821
|
+
async setAccount(account, correlationId) {
|
|
11787
11822
|
this.logger.trace("BrowserCacheManager.setAccount called");
|
|
11788
11823
|
const key = account.generateAccountKey();
|
|
11789
|
-
await this.browserStorage.setUserData(key, JSON.stringify(account));
|
|
11824
|
+
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(key, JSON.stringify(account), correlationId);
|
|
11790
11825
|
this.addAccountKeyToMap(key);
|
|
11791
11826
|
}
|
|
11792
11827
|
/**
|
|
@@ -11976,10 +12011,10 @@
|
|
|
11976
12011
|
* set IdToken credential to the platform cache
|
|
11977
12012
|
* @param idToken
|
|
11978
12013
|
*/
|
|
11979
|
-
async setIdTokenCredential(idToken) {
|
|
12014
|
+
async setIdTokenCredential(idToken, correlationId) {
|
|
11980
12015
|
this.logger.trace("BrowserCacheManager.setIdTokenCredential called");
|
|
11981
12016
|
const idTokenKey = generateCredentialKey(idToken);
|
|
11982
|
-
await this.browserStorage.setUserData(idTokenKey, JSON.stringify(idToken));
|
|
12017
|
+
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(idTokenKey, JSON.stringify(idToken), correlationId);
|
|
11983
12018
|
this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);
|
|
11984
12019
|
}
|
|
11985
12020
|
/**
|
|
@@ -12007,10 +12042,10 @@
|
|
|
12007
12042
|
* set accessToken credential to the platform cache
|
|
12008
12043
|
* @param accessToken
|
|
12009
12044
|
*/
|
|
12010
|
-
async setAccessTokenCredential(accessToken) {
|
|
12045
|
+
async setAccessTokenCredential(accessToken, correlationId) {
|
|
12011
12046
|
this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");
|
|
12012
12047
|
const accessTokenKey = generateCredentialKey(accessToken);
|
|
12013
|
-
await this.browserStorage.setUserData(accessTokenKey, JSON.stringify(accessToken));
|
|
12048
|
+
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(accessTokenKey, JSON.stringify(accessToken), correlationId);
|
|
12014
12049
|
this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
|
|
12015
12050
|
}
|
|
12016
12051
|
/**
|
|
@@ -12038,10 +12073,10 @@
|
|
|
12038
12073
|
* set refreshToken credential to the platform cache
|
|
12039
12074
|
* @param refreshToken
|
|
12040
12075
|
*/
|
|
12041
|
-
async setRefreshTokenCredential(refreshToken) {
|
|
12076
|
+
async setRefreshTokenCredential(refreshToken, correlationId) {
|
|
12042
12077
|
this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");
|
|
12043
12078
|
const refreshTokenKey = generateCredentialKey(refreshToken);
|
|
12044
|
-
await this.browserStorage.setUserData(refreshTokenKey, JSON.stringify(refreshToken));
|
|
12079
|
+
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(refreshTokenKey, JSON.stringify(refreshToken), correlationId);
|
|
12045
12080
|
this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
|
|
12046
12081
|
}
|
|
12047
12082
|
/**
|
|
@@ -12600,7 +12635,7 @@
|
|
|
12600
12635
|
idToken: idTokenEntity,
|
|
12601
12636
|
accessToken: accessTokenEntity,
|
|
12602
12637
|
};
|
|
12603
|
-
return this.saveCacheRecord(cacheRecord);
|
|
12638
|
+
return this.saveCacheRecord(cacheRecord, result.correlationId);
|
|
12604
12639
|
}
|
|
12605
12640
|
/**
|
|
12606
12641
|
* saves a cache record
|
|
@@ -12608,9 +12643,9 @@
|
|
|
12608
12643
|
* @param storeInCache {?StoreInCache}
|
|
12609
12644
|
* @param correlationId {?string} correlation id
|
|
12610
12645
|
*/
|
|
12611
|
-
async saveCacheRecord(cacheRecord,
|
|
12646
|
+
async saveCacheRecord(cacheRecord, correlationId, storeInCache) {
|
|
12612
12647
|
try {
|
|
12613
|
-
await super.saveCacheRecord(cacheRecord,
|
|
12648
|
+
await super.saveCacheRecord(cacheRecord, correlationId, storeInCache);
|
|
12614
12649
|
}
|
|
12615
12650
|
catch (e) {
|
|
12616
12651
|
if (e instanceof CacheError &&
|
|
@@ -12630,7 +12665,7 @@
|
|
|
12630
12665
|
}
|
|
12631
12666
|
}
|
|
12632
12667
|
}
|
|
12633
|
-
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {
|
|
12668
|
+
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient) => {
|
|
12634
12669
|
const cacheOptions = {
|
|
12635
12670
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
12636
12671
|
temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
@@ -12639,7 +12674,7 @@
|
|
|
12639
12674
|
cacheMigrationEnabled: false,
|
|
12640
12675
|
claimsBasedCachingEnabled: false,
|
|
12641
12676
|
};
|
|
12642
|
-
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
|
|
12677
|
+
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient);
|
|
12643
12678
|
};
|
|
12644
12679
|
|
|
12645
12680
|
/*
|
|
@@ -13705,7 +13740,7 @@
|
|
|
13705
13740
|
const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
|
|
13706
13741
|
// cache accounts and tokens in the appropriate storage
|
|
13707
13742
|
await this.cacheAccount(baseAccount);
|
|
13708
|
-
this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, response.access_token, result.tenantId, reqTimestamp);
|
|
13743
|
+
await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, response.access_token, result.tenantId, reqTimestamp);
|
|
13709
13744
|
return result;
|
|
13710
13745
|
}
|
|
13711
13746
|
/**
|
|
@@ -13831,7 +13866,7 @@
|
|
|
13831
13866
|
*/
|
|
13832
13867
|
async cacheAccount(accountEntity) {
|
|
13833
13868
|
// Store the account info and hence `nativeAccountId` in browser cache
|
|
13834
|
-
await this.browserStorage.setAccount(accountEntity);
|
|
13869
|
+
await this.browserStorage.setAccount(accountEntity, this.correlationId);
|
|
13835
13870
|
// Remove any existing cached tokens for this account in browser storage
|
|
13836
13871
|
this.browserStorage.removeAccountContext(accountEntity).catch((e) => {
|
|
13837
13872
|
this.logger.error(`Error occurred while removing account context from browser storage. ${e}`);
|
|
@@ -13862,7 +13897,7 @@
|
|
|
13862
13897
|
idToken: cachedIdToken,
|
|
13863
13898
|
accessToken: cachedAccessToken,
|
|
13864
13899
|
};
|
|
13865
|
-
|
|
13900
|
+
return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, request.storeInCache);
|
|
13866
13901
|
}
|
|
13867
13902
|
addTelemetryFromNativeResponse(response) {
|
|
13868
13903
|
const mats = this.getMATSFromResponse(response);
|
|
@@ -14297,15 +14332,15 @@
|
|
|
14297
14332
|
* @param nativeExtensionProvider
|
|
14298
14333
|
* @param authenticationScheme
|
|
14299
14334
|
*/
|
|
14300
|
-
static
|
|
14301
|
-
logger.trace("
|
|
14302
|
-
if (!config.system.
|
|
14303
|
-
logger.trace("
|
|
14335
|
+
static isPlatformBrokerAvailable(config, logger, nativeExtensionProvider, authenticationScheme) {
|
|
14336
|
+
logger.trace("isPlatformBrokerAvailable called");
|
|
14337
|
+
if (!config.system.allowPlatformBroker) {
|
|
14338
|
+
logger.trace("isPlatformBrokerAvailable: allowPlatformBroker is not enabled, returning false");
|
|
14304
14339
|
// Developer disabled WAM
|
|
14305
14340
|
return false;
|
|
14306
14341
|
}
|
|
14307
14342
|
if (!nativeExtensionProvider) {
|
|
14308
|
-
logger.trace("
|
|
14343
|
+
logger.trace("isPlatformBrokerAvailable: Platform extension provider is not initialized, returning false");
|
|
14309
14344
|
// Extension is not available
|
|
14310
14345
|
return false;
|
|
14311
14346
|
}
|
|
@@ -14313,10 +14348,10 @@
|
|
|
14313
14348
|
switch (authenticationScheme) {
|
|
14314
14349
|
case AuthenticationScheme.BEARER:
|
|
14315
14350
|
case AuthenticationScheme.POP:
|
|
14316
|
-
logger.trace("
|
|
14351
|
+
logger.trace("isPlatformBrokerAvailable: authenticationScheme is supported, returning true");
|
|
14317
14352
|
return true;
|
|
14318
14353
|
default:
|
|
14319
|
-
logger.trace("
|
|
14354
|
+
logger.trace("isPlatformBrokerAvailable: authenticationScheme is not supported, returning false");
|
|
14320
14355
|
return false;
|
|
14321
14356
|
}
|
|
14322
14357
|
}
|
|
@@ -14553,17 +14588,17 @@
|
|
|
14553
14588
|
requestExtraQueryParameters: validRequest.extraQueryParameters,
|
|
14554
14589
|
account: validRequest.account,
|
|
14555
14590
|
});
|
|
14556
|
-
const
|
|
14591
|
+
const isPlatformBroker = NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
|
|
14557
14592
|
// Start measurement for server calls with native brokering enabled
|
|
14558
14593
|
let fetchNativeAccountIdMeasurement;
|
|
14559
|
-
if (
|
|
14594
|
+
if (isPlatformBroker) {
|
|
14560
14595
|
fetchNativeAccountIdMeasurement =
|
|
14561
14596
|
this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
|
|
14562
14597
|
}
|
|
14563
14598
|
// Create acquire token url.
|
|
14564
14599
|
const navigateUrl = await authClient.getAuthCodeUrl({
|
|
14565
14600
|
...validRequest,
|
|
14566
|
-
|
|
14601
|
+
platformBroker: isPlatformBroker,
|
|
14567
14602
|
});
|
|
14568
14603
|
// Create popup interaction handler.
|
|
14569
14604
|
const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
@@ -15080,7 +15115,7 @@
|
|
|
15080
15115
|
// Create acquire token url.
|
|
15081
15116
|
const navigateUrl = await authClient.getAuthCodeUrl({
|
|
15082
15117
|
...validRequest,
|
|
15083
|
-
|
|
15118
|
+
platformBroker: NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme),
|
|
15084
15119
|
});
|
|
15085
15120
|
const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);
|
|
15086
15121
|
this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);
|
|
@@ -15594,7 +15629,7 @@
|
|
|
15594
15629
|
// Create authorize request url
|
|
15595
15630
|
const navigateUrl = await invokeAsync(authClient.getAuthCodeUrl.bind(authClient), PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)({
|
|
15596
15631
|
...silentRequest,
|
|
15597
|
-
|
|
15632
|
+
platformBroker: NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
|
|
15598
15633
|
});
|
|
15599
15634
|
// Create silent handler
|
|
15600
15635
|
const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
@@ -15713,6 +15748,7 @@
|
|
|
15713
15748
|
if (!this.isBrowserEnvironment) {
|
|
15714
15749
|
throw createBrowserAuthError(nonBrowserEnvironment);
|
|
15715
15750
|
}
|
|
15751
|
+
const correlationId = request.correlationId || createNewGuid();
|
|
15716
15752
|
const idTokenClaims = response.id_token
|
|
15717
15753
|
? extractTokenClaims(response.id_token, base64Decode)
|
|
15718
15754
|
: undefined;
|
|
@@ -15726,10 +15762,10 @@
|
|
|
15726
15762
|
const authority = request.authority
|
|
15727
15763
|
? new Authority(Authority.generateAuthority(request.authority, request.azureCloudOptions), this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid())
|
|
15728
15764
|
: undefined;
|
|
15729
|
-
const cacheRecordAccount = await this.loadAccount(request, options.clientInfo || response.client_info || "", idTokenClaims, authority);
|
|
15730
|
-
const idToken = await this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm);
|
|
15731
|
-
const accessToken = await this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options);
|
|
15732
|
-
const refreshToken = await this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment);
|
|
15765
|
+
const cacheRecordAccount = await this.loadAccount(request, options.clientInfo || response.client_info || "", correlationId, idTokenClaims, authority);
|
|
15766
|
+
const idToken = await this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, correlationId);
|
|
15767
|
+
const accessToken = await this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options, correlationId);
|
|
15768
|
+
const refreshToken = await this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, correlationId);
|
|
15733
15769
|
return this.generateAuthenticationResult(request, {
|
|
15734
15770
|
account: cacheRecordAccount,
|
|
15735
15771
|
idToken,
|
|
@@ -15746,11 +15782,11 @@
|
|
|
15746
15782
|
* @param requestHomeAccountId
|
|
15747
15783
|
* @returns `AccountEntity`
|
|
15748
15784
|
*/
|
|
15749
|
-
async loadAccount(request, clientInfo, idTokenClaims, authority) {
|
|
15785
|
+
async loadAccount(request, clientInfo, correlationId, idTokenClaims, authority) {
|
|
15750
15786
|
this.logger.verbose("TokenCache - loading account");
|
|
15751
15787
|
if (request.account) {
|
|
15752
15788
|
const accountEntity = AccountEntity.createFromAccountInfo(request.account);
|
|
15753
|
-
await this.storage.setAccount(accountEntity);
|
|
15789
|
+
await this.storage.setAccount(accountEntity, correlationId);
|
|
15754
15790
|
return accountEntity;
|
|
15755
15791
|
}
|
|
15756
15792
|
else if (!authority || (!clientInfo && !idTokenClaims)) {
|
|
@@ -15762,7 +15798,7 @@
|
|
|
15762
15798
|
const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
|
|
15763
15799
|
undefined, // nativeAccountId
|
|
15764
15800
|
this.logger);
|
|
15765
|
-
await this.storage.setAccount(cachedAccount);
|
|
15801
|
+
await this.storage.setAccount(cachedAccount, correlationId);
|
|
15766
15802
|
return cachedAccount;
|
|
15767
15803
|
}
|
|
15768
15804
|
/**
|
|
@@ -15773,14 +15809,14 @@
|
|
|
15773
15809
|
* @param tenantId
|
|
15774
15810
|
* @returns `IdTokenEntity`
|
|
15775
15811
|
*/
|
|
15776
|
-
async loadIdToken(response, homeAccountId, environment, tenantId) {
|
|
15812
|
+
async loadIdToken(response, homeAccountId, environment, tenantId, correlationId) {
|
|
15777
15813
|
if (!response.id_token) {
|
|
15778
15814
|
this.logger.verbose("TokenCache - no id token found in response");
|
|
15779
15815
|
return null;
|
|
15780
15816
|
}
|
|
15781
15817
|
this.logger.verbose("TokenCache - loading id token");
|
|
15782
15818
|
const idTokenEntity = createIdTokenEntity(homeAccountId, environment, response.id_token, this.config.auth.clientId, tenantId);
|
|
15783
|
-
await this.storage.setIdTokenCredential(idTokenEntity);
|
|
15819
|
+
await this.storage.setIdTokenCredential(idTokenEntity, correlationId);
|
|
15784
15820
|
return idTokenEntity;
|
|
15785
15821
|
}
|
|
15786
15822
|
/**
|
|
@@ -15792,7 +15828,7 @@
|
|
|
15792
15828
|
* @param tenantId
|
|
15793
15829
|
* @returns `AccessTokenEntity`
|
|
15794
15830
|
*/
|
|
15795
|
-
async loadAccessToken(request, response, homeAccountId, environment, tenantId, options) {
|
|
15831
|
+
async loadAccessToken(request, response, homeAccountId, environment, tenantId, options, correlationId) {
|
|
15796
15832
|
if (!response.access_token) {
|
|
15797
15833
|
this.logger.verbose("TokenCache - no access token found in response");
|
|
15798
15834
|
return null;
|
|
@@ -15816,7 +15852,7 @@
|
|
|
15816
15852
|
(response.ext_expires_in || response.expires_in) +
|
|
15817
15853
|
new Date().getTime() / 1000;
|
|
15818
15854
|
const accessTokenEntity = createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);
|
|
15819
|
-
await this.storage.setAccessTokenCredential(accessTokenEntity);
|
|
15855
|
+
await this.storage.setAccessTokenCredential(accessTokenEntity, correlationId);
|
|
15820
15856
|
return accessTokenEntity;
|
|
15821
15857
|
}
|
|
15822
15858
|
/**
|
|
@@ -15827,7 +15863,7 @@
|
|
|
15827
15863
|
* @param environment
|
|
15828
15864
|
* @returns `RefreshTokenEntity`
|
|
15829
15865
|
*/
|
|
15830
|
-
async loadRefreshToken(response, homeAccountId, environment) {
|
|
15866
|
+
async loadRefreshToken(response, homeAccountId, environment, correlationId) {
|
|
15831
15867
|
if (!response.refresh_token) {
|
|
15832
15868
|
this.logger.verbose("TokenCache - no refresh token found in response");
|
|
15833
15869
|
return null;
|
|
@@ -15835,7 +15871,7 @@
|
|
|
15835
15871
|
this.logger.verbose("TokenCache - loading refresh token");
|
|
15836
15872
|
const refreshTokenEntity = createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId, response.foci, undefined, // userAssertionHash
|
|
15837
15873
|
response.refresh_token_expires_in);
|
|
15838
|
-
await this.storage.setRefreshTokenCredential(refreshTokenEntity);
|
|
15874
|
+
await this.storage.setRefreshTokenCredential(refreshTokenEntity, correlationId);
|
|
15839
15875
|
return refreshTokenEntity;
|
|
15840
15876
|
}
|
|
15841
15877
|
/**
|
|
@@ -16031,8 +16067,8 @@
|
|
|
16031
16067
|
this.eventHandler = new EventHandler(this.logger);
|
|
16032
16068
|
// Initialize the browser storage class.
|
|
16033
16069
|
this.browserStorage = this.isBrowserEnvironment
|
|
16034
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth)
|
|
16035
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
|
|
16070
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, buildStaticAuthorityOptions(this.config.auth))
|
|
16071
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
|
|
16036
16072
|
// initialize in memory storage for native flows
|
|
16037
16073
|
const nativeCacheOptions = {
|
|
16038
16074
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
@@ -16042,7 +16078,7 @@
|
|
|
16042
16078
|
cacheMigrationEnabled: false,
|
|
16043
16079
|
claimsBasedCachingEnabled: false,
|
|
16044
16080
|
};
|
|
16045
|
-
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger,
|
|
16081
|
+
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient);
|
|
16046
16082
|
// Initialize the token cache
|
|
16047
16083
|
this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);
|
|
16048
16084
|
this.activeSilentTokenRequests = new Map();
|
|
@@ -16084,12 +16120,12 @@
|
|
|
16084
16120
|
this.eventHandler.emitEvent(EventType.INITIALIZE_END);
|
|
16085
16121
|
return;
|
|
16086
16122
|
}
|
|
16087
|
-
await this.browserStorage.initialize();
|
|
16088
16123
|
const initCorrelationId = request?.correlationId || this.getRequestCorrelationId();
|
|
16089
|
-
const
|
|
16124
|
+
const allowPlatformBroker = this.config.system.allowPlatformBroker;
|
|
16090
16125
|
const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication, initCorrelationId);
|
|
16091
16126
|
this.eventHandler.emitEvent(EventType.INITIALIZE_START);
|
|
16092
|
-
|
|
16127
|
+
await invokeAsync(this.browserStorage.initialize.bind(this.browserStorage), PerformanceEvents.InitializeCache, this.logger, this.performanceClient, initCorrelationId)(initCorrelationId);
|
|
16128
|
+
if (allowPlatformBroker) {
|
|
16093
16129
|
try {
|
|
16094
16130
|
this.nativeExtensionProvider =
|
|
16095
16131
|
await NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient);
|
|
@@ -16104,7 +16140,10 @@
|
|
|
16104
16140
|
}
|
|
16105
16141
|
this.initialized = true;
|
|
16106
16142
|
this.eventHandler.emitEvent(EventType.INITIALIZE_END);
|
|
16107
|
-
initMeasurement.end({
|
|
16143
|
+
initMeasurement.end({
|
|
16144
|
+
allowPlatformBroker: allowPlatformBroker,
|
|
16145
|
+
success: true,
|
|
16146
|
+
});
|
|
16108
16147
|
}
|
|
16109
16148
|
// #region Redirect Flow
|
|
16110
16149
|
/**
|
|
@@ -16148,7 +16187,7 @@
|
|
|
16148
16187
|
const loggedInAccounts = this.getAllAccounts();
|
|
16149
16188
|
const request = this.browserStorage.getCachedNativeRequest();
|
|
16150
16189
|
const useNative = request &&
|
|
16151
|
-
NativeMessageHandler.
|
|
16190
|
+
NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider) &&
|
|
16152
16191
|
this.nativeExtensionProvider &&
|
|
16153
16192
|
!hash;
|
|
16154
16193
|
const correlationId = useNative
|
|
@@ -16277,7 +16316,8 @@
|
|
|
16277
16316
|
this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Redirect, request);
|
|
16278
16317
|
}
|
|
16279
16318
|
let result;
|
|
16280
|
-
if (this.nativeExtensionProvider &&
|
|
16319
|
+
if (this.nativeExtensionProvider &&
|
|
16320
|
+
this.canUsePlatformBroker(request)) {
|
|
16281
16321
|
const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
|
|
16282
16322
|
result = nativeClient
|
|
16283
16323
|
.acquireTokenRedirect(request, atrMeasurement)
|
|
@@ -16348,7 +16388,7 @@
|
|
|
16348
16388
|
this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Popup, request);
|
|
16349
16389
|
}
|
|
16350
16390
|
let result;
|
|
16351
|
-
if (this.
|
|
16391
|
+
if (this.canUsePlatformBroker(request)) {
|
|
16352
16392
|
result = this.acquireTokenNative({
|
|
16353
16393
|
...request,
|
|
16354
16394
|
correlationId,
|
|
@@ -16465,7 +16505,7 @@
|
|
|
16465
16505
|
this.logger.verbose("ssoSilent called", correlationId);
|
|
16466
16506
|
this.eventHandler.emitEvent(EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
|
|
16467
16507
|
let result;
|
|
16468
|
-
if (this.
|
|
16508
|
+
if (this.canUsePlatformBroker(validRequest)) {
|
|
16469
16509
|
result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
|
|
16470
16510
|
// If native token acquisition fails for availability reasons fallback to standard flow
|
|
16471
16511
|
if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {
|
|
@@ -16563,7 +16603,7 @@
|
|
|
16563
16603
|
return await response;
|
|
16564
16604
|
}
|
|
16565
16605
|
else if (request.nativeAccountId) {
|
|
16566
|
-
if (this.
|
|
16606
|
+
if (this.canUsePlatformBroker(request, request.nativeAccountId)) {
|
|
16567
16607
|
const result = await this.acquireTokenNative({
|
|
16568
16608
|
...request,
|
|
16569
16609
|
correlationId,
|
|
@@ -16810,7 +16850,7 @@
|
|
|
16810
16850
|
this.logger.verbose("hydrateCache called");
|
|
16811
16851
|
// Account gets saved to browser storage regardless of native or not
|
|
16812
16852
|
const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
|
|
16813
|
-
await this.browserStorage.setAccount(accountEntity);
|
|
16853
|
+
await this.browserStorage.setAccount(accountEntity, result.correlationId);
|
|
16814
16854
|
if (result.fromNativeBroker) {
|
|
16815
16855
|
this.logger.verbose("Response was from native broker, storing in-memory");
|
|
16816
16856
|
// Tokens from native broker are stored in-memory
|
|
@@ -16834,13 +16874,13 @@
|
|
|
16834
16874
|
return nativeClient.acquireToken(request);
|
|
16835
16875
|
}
|
|
16836
16876
|
/**
|
|
16837
|
-
* Returns boolean indicating if this request can use the
|
|
16877
|
+
* Returns boolean indicating if this request can use the platform broker
|
|
16838
16878
|
* @param request
|
|
16839
16879
|
*/
|
|
16840
|
-
|
|
16841
|
-
this.logger.trace("
|
|
16842
|
-
if (!NativeMessageHandler.
|
|
16843
|
-
this.logger.trace("
|
|
16880
|
+
canUsePlatformBroker(request, accountId) {
|
|
16881
|
+
this.logger.trace("canUsePlatformBroker called");
|
|
16882
|
+
if (!NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {
|
|
16883
|
+
this.logger.trace("canUsePlatformBroker: isPlatformBrokerAvailable returned false, returning false");
|
|
16844
16884
|
return false;
|
|
16845
16885
|
}
|
|
16846
16886
|
if (request.prompt) {
|
|
@@ -16848,15 +16888,15 @@
|
|
|
16848
16888
|
case PromptValue.NONE:
|
|
16849
16889
|
case PromptValue.CONSENT:
|
|
16850
16890
|
case PromptValue.LOGIN:
|
|
16851
|
-
this.logger.trace("
|
|
16891
|
+
this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");
|
|
16852
16892
|
break;
|
|
16853
16893
|
default:
|
|
16854
|
-
this.logger.trace(`
|
|
16894
|
+
this.logger.trace(`canUsePlatformBroker: prompt = ${request.prompt} is not compatible with platform broker flow, returning false`);
|
|
16855
16895
|
return false;
|
|
16856
16896
|
}
|
|
16857
16897
|
}
|
|
16858
16898
|
if (!accountId && !this.getNativeAccountId(request)) {
|
|
16859
|
-
this.logger.trace("
|
|
16899
|
+
this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false");
|
|
16860
16900
|
return false;
|
|
16861
16901
|
}
|
|
16862
16902
|
return true;
|
|
@@ -17297,7 +17337,7 @@
|
|
|
17297
17337
|
* @returns
|
|
17298
17338
|
*/
|
|
17299
17339
|
async acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy) {
|
|
17300
|
-
if (NativeMessageHandler.
|
|
17340
|
+
if (NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider, silentRequest.authenticationScheme) &&
|
|
17301
17341
|
silentRequest.account.nativeAccountId) {
|
|
17302
17342
|
this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");
|
|
17303
17343
|
return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {
|
|
@@ -17583,12 +17623,12 @@
|
|
|
17583
17623
|
this.performanceClient = this.config.telemetry.client;
|
|
17584
17624
|
// Initialize the crypto class.
|
|
17585
17625
|
this.browserCrypto = operatingContext.isBrowserEnvironment()
|
|
17586
|
-
? new CryptoOps(this.logger, this.performanceClient)
|
|
17626
|
+
? new CryptoOps(this.logger, this.performanceClient, true)
|
|
17587
17627
|
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
17588
17628
|
// Initialize the browser storage class.
|
|
17589
17629
|
this.browserStorage = this.operatingContext.isBrowserEnvironment()
|
|
17590
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth))
|
|
17591
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
|
|
17630
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, buildStaticAuthorityOptions(this.config.auth))
|
|
17631
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
|
|
17592
17632
|
this.eventHandler = new EventHandler(this.logger);
|
|
17593
17633
|
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
|
|
17594
17634
|
// Set the active account if available
|
|
@@ -17611,8 +17651,9 @@
|
|
|
17611
17651
|
* Specific implementation of initialize function for NestedAppAuthController
|
|
17612
17652
|
* @returns
|
|
17613
17653
|
*/
|
|
17614
|
-
async initialize() {
|
|
17615
|
-
|
|
17654
|
+
async initialize(request) {
|
|
17655
|
+
const initCorrelationId = request?.correlationId || createNewGuid();
|
|
17656
|
+
await this.browserStorage.initialize(initCorrelationId);
|
|
17616
17657
|
return Promise.resolve();
|
|
17617
17658
|
}
|
|
17618
17659
|
/**
|
|
@@ -18038,7 +18079,7 @@
|
|
|
18038
18079
|
async hydrateCache(result, request) {
|
|
18039
18080
|
this.logger.verbose("hydrateCache called");
|
|
18040
18081
|
const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
|
|
18041
|
-
await this.browserStorage.setAccount(accountEntity);
|
|
18082
|
+
await this.browserStorage.setAccount(accountEntity, result.correlationId);
|
|
18042
18083
|
return this.browserStorage.hydrateCache(result, request);
|
|
18043
18084
|
}
|
|
18044
18085
|
}
|
|
@@ -18470,8 +18511,8 @@
|
|
|
18470
18511
|
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
18471
18512
|
// Initialize the browser storage class.
|
|
18472
18513
|
this.browserStorage = this.isBrowserEnvironment
|
|
18473
|
-
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger,
|
|
18474
|
-
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
|
|
18514
|
+
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, undefined)
|
|
18515
|
+
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient);
|
|
18475
18516
|
}
|
|
18476
18517
|
getBrowserStorage() {
|
|
18477
18518
|
return this.browserStorage;
|