@azure/msal-browser 3.17.0 → 3.19.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.d.ts +2 -1
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +8 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +9 -4
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +2 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +9 -5
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +90 -117
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.d.ts +2 -1
- package/dist/controllers/ControllerFactory.d.ts.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +3 -3
- package/dist/controllers/ControllerFactory.mjs.map +1 -1
- package/dist/controllers/IController.d.ts +2 -1
- package/dist/controllers/IController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.d.ts +4 -2
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +11 -8
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +2 -2
- package/dist/error/NestedAppAuthError.mjs.map +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.d.ts +1 -0
- package/dist/index.d.ts.map +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.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +11 -7
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.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/InitializeApplicationRequest.d.ts +9 -0
- package/dist/request/InitializeApplicationRequest.d.ts.map +1 -0
- 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 +214 -248
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +214 -248
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +63 -64
- package/package.json +3 -2
- package/src/app/IPublicClientApplication.ts +3 -1
- package/src/app/PublicClientApplication.ts +9 -3
- package/src/cache/BrowserCacheManager.ts +9 -7
- package/src/cache/TokenCache.ts +158 -243
- package/src/controllers/ControllerFactory.ts +4 -2
- package/src/controllers/IController.ts +3 -1
- package/src/controllers/StandardController.ts +19 -11
- package/src/error/NestedAppAuthError.ts +1 -1
- package/src/index.ts +1 -0
- package/src/interaction_client/NativeInteractionClient.ts +12 -10
- package/src/packageMetadata.ts +1 -1
- package/src/request/InitializeApplicationRequest.ts +13 -0
package/lib/msal-browser.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.19.0 2024-07-12 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v14.
|
|
5
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6
6
|
/*
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
@@ -48,6 +48,7 @@ const Constants = {
|
|
|
48
48
|
NOT_DEFINED: "not_defined",
|
|
49
49
|
EMPTY_STRING: "",
|
|
50
50
|
NOT_APPLICABLE: "N/A",
|
|
51
|
+
NOT_AVAILABLE: "Not Available",
|
|
51
52
|
FORWARD_SLASH: "/",
|
|
52
53
|
IMDS_ENDPOINT: "http://169.254.169.254/metadata/instance/compute/location",
|
|
53
54
|
IMDS_VERSION: "2020-06-01",
|
|
@@ -310,7 +311,7 @@ const JsonWebTokenTypes = {
|
|
|
310
311
|
// Token renewal offset default in seconds
|
|
311
312
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
312
313
|
|
|
313
|
-
/*! @azure/msal-common v14.
|
|
314
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
314
315
|
/*
|
|
315
316
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
316
317
|
* Licensed under the MIT License.
|
|
@@ -327,7 +328,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
327
328
|
unexpectedError: unexpectedError
|
|
328
329
|
});
|
|
329
330
|
|
|
330
|
-
/*! @azure/msal-common v14.
|
|
331
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
331
332
|
|
|
332
333
|
/*
|
|
333
334
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -376,7 +377,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
376
377
|
: AuthErrorMessages[code]);
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
/*! @azure/msal-common v14.
|
|
380
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
380
381
|
/*
|
|
381
382
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
382
383
|
* Licensed under the MIT License.
|
|
@@ -474,7 +475,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
474
475
|
userTimeoutReached: userTimeoutReached
|
|
475
476
|
});
|
|
476
477
|
|
|
477
|
-
/*! @azure/msal-common v14.
|
|
478
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
478
479
|
|
|
479
480
|
/*
|
|
480
481
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -726,7 +727,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
726
727
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
727
728
|
}
|
|
728
729
|
|
|
729
|
-
/*! @azure/msal-common v14.
|
|
730
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
730
731
|
|
|
731
732
|
/*
|
|
732
733
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -787,7 +788,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
787
788
|
}
|
|
788
789
|
}
|
|
789
790
|
|
|
790
|
-
/*! @azure/msal-common v14.
|
|
791
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
791
792
|
/*
|
|
792
793
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
793
794
|
* Licensed under the MIT License.
|
|
@@ -802,7 +803,7 @@ const AuthorityType = {
|
|
|
802
803
|
Ciam: 3,
|
|
803
804
|
};
|
|
804
805
|
|
|
805
|
-
/*! @azure/msal-common v14.
|
|
806
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
806
807
|
/*
|
|
807
808
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
808
809
|
* Licensed under the MIT License.
|
|
@@ -814,7 +815,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
814
815
|
response.hasOwnProperty("jwks_uri"));
|
|
815
816
|
}
|
|
816
817
|
|
|
817
|
-
/*! @azure/msal-common v14.
|
|
818
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
818
819
|
/*
|
|
819
820
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
820
821
|
* Licensed under the MIT License.
|
|
@@ -868,7 +869,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
868
869
|
urlParseError: urlParseError
|
|
869
870
|
});
|
|
870
871
|
|
|
871
|
-
/*! @azure/msal-common v14.
|
|
872
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
872
873
|
|
|
873
874
|
/*
|
|
874
875
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1006,7 +1007,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1006
1007
|
return new ClientConfigurationError(errorCode);
|
|
1007
1008
|
}
|
|
1008
1009
|
|
|
1009
|
-
/*! @azure/msal-common v14.
|
|
1010
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1010
1011
|
/*
|
|
1011
1012
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1012
1013
|
* Licensed under the MIT License.
|
|
@@ -1103,7 +1104,7 @@ class StringUtils {
|
|
|
1103
1104
|
}
|
|
1104
1105
|
}
|
|
1105
1106
|
|
|
1106
|
-
/*! @azure/msal-common v14.
|
|
1107
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1107
1108
|
|
|
1108
1109
|
/*
|
|
1109
1110
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1150,7 +1151,7 @@ function getDeserializedResponse(responseString) {
|
|
|
1150
1151
|
return null;
|
|
1151
1152
|
}
|
|
1152
1153
|
|
|
1153
|
-
/*! @azure/msal-common v14.
|
|
1154
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1154
1155
|
|
|
1155
1156
|
/*
|
|
1156
1157
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1314,7 +1315,7 @@ class UrlString {
|
|
|
1314
1315
|
}
|
|
1315
1316
|
}
|
|
1316
1317
|
|
|
1317
|
-
/*! @azure/msal-common v14.
|
|
1318
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1318
1319
|
|
|
1319
1320
|
/*
|
|
1320
1321
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1454,7 +1455,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
1454
1455
|
return null;
|
|
1455
1456
|
}
|
|
1456
1457
|
|
|
1457
|
-
/*! @azure/msal-common v14.
|
|
1458
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1458
1459
|
/*
|
|
1459
1460
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1460
1461
|
* Licensed under the MIT License.
|
|
@@ -1467,7 +1468,7 @@ const ProtocolMode = {
|
|
|
1467
1468
|
OIDC: "OIDC",
|
|
1468
1469
|
};
|
|
1469
1470
|
|
|
1470
|
-
/*! @azure/msal-common v14.
|
|
1471
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1471
1472
|
/*
|
|
1472
1473
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1473
1474
|
* Licensed under the MIT License.
|
|
@@ -1487,7 +1488,7 @@ const AzureCloudInstance = {
|
|
|
1487
1488
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1488
1489
|
};
|
|
1489
1490
|
|
|
1490
|
-
/*! @azure/msal-common v14.
|
|
1491
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1491
1492
|
/*
|
|
1492
1493
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1493
1494
|
* Licensed under the MIT License.
|
|
@@ -1497,7 +1498,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
1497
1498
|
response.hasOwnProperty("metadata"));
|
|
1498
1499
|
}
|
|
1499
1500
|
|
|
1500
|
-
/*! @azure/msal-common v14.
|
|
1501
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1501
1502
|
/*
|
|
1502
1503
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1503
1504
|
* Licensed under the MIT License.
|
|
@@ -1507,7 +1508,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
1507
1508
|
response.hasOwnProperty("error_description"));
|
|
1508
1509
|
}
|
|
1509
1510
|
|
|
1510
|
-
/*! @azure/msal-common v14.
|
|
1511
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1511
1512
|
/*
|
|
1512
1513
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1513
1514
|
* Licensed under the MIT License.
|
|
@@ -1989,7 +1990,7 @@ const IntFields = new Set([
|
|
|
1989
1990
|
"multiMatchedRT",
|
|
1990
1991
|
]);
|
|
1991
1992
|
|
|
1992
|
-
/*! @azure/msal-common v14.
|
|
1993
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
1993
1994
|
/*
|
|
1994
1995
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1995
1996
|
* Licensed under the MIT License.
|
|
@@ -2085,7 +2086,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
2085
2086
|
};
|
|
2086
2087
|
};
|
|
2087
2088
|
|
|
2088
|
-
/*! @azure/msal-common v14.
|
|
2089
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
2089
2090
|
|
|
2090
2091
|
/*
|
|
2091
2092
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2194,7 +2195,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
2194
2195
|
},
|
|
2195
2196
|
};
|
|
2196
2197
|
|
|
2197
|
-
/*! @azure/msal-common v14.
|
|
2198
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
2198
2199
|
/*
|
|
2199
2200
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2200
2201
|
* Licensed under the MIT License.
|
|
@@ -2231,7 +2232,7 @@ function wasClockTurnedBack(cachedAt) {
|
|
|
2231
2232
|
return cachedAtSec > nowSeconds();
|
|
2232
2233
|
}
|
|
2233
2234
|
|
|
2234
|
-
/*! @azure/msal-common v14.
|
|
2235
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
2235
2236
|
|
|
2236
2237
|
/*
|
|
2237
2238
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2558,7 +2559,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
2558
2559
|
return metadata.expiresAt <= nowSeconds();
|
|
2559
2560
|
}
|
|
2560
2561
|
|
|
2561
|
-
/*! @azure/msal-common v14.
|
|
2562
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
2562
2563
|
|
|
2563
2564
|
/*
|
|
2564
2565
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3397,7 +3398,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
3397
3398
|
};
|
|
3398
3399
|
}
|
|
3399
3400
|
|
|
3400
|
-
/*! @azure/msal-common v14.
|
|
3401
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3401
3402
|
|
|
3402
3403
|
/*
|
|
3403
3404
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3428,7 +3429,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
3428
3429
|
}
|
|
3429
3430
|
}
|
|
3430
3431
|
|
|
3431
|
-
/*! @azure/msal-common v14.
|
|
3432
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3432
3433
|
/*
|
|
3433
3434
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3434
3435
|
* Licensed under the MIT License.
|
|
@@ -3446,7 +3447,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
3446
3447
|
}
|
|
3447
3448
|
}
|
|
3448
3449
|
|
|
3449
|
-
/*! @azure/msal-common v14.
|
|
3450
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3450
3451
|
/*
|
|
3451
3452
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3452
3453
|
* Licensed under the MIT License.
|
|
@@ -3493,7 +3494,7 @@ const SID = "sid";
|
|
|
3493
3494
|
const LOGIN_HINT = "login_hint";
|
|
3494
3495
|
const DOMAIN_HINT = "domain_hint";
|
|
3495
3496
|
|
|
3496
|
-
/*! @azure/msal-common v14.
|
|
3497
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3497
3498
|
|
|
3498
3499
|
/*
|
|
3499
3500
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3532,7 +3533,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
3532
3533
|
},
|
|
3533
3534
|
};
|
|
3534
3535
|
|
|
3535
|
-
/*! @azure/msal-common v14.
|
|
3536
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3536
3537
|
|
|
3537
3538
|
/*
|
|
3538
3539
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3723,12 +3724,12 @@ class Logger {
|
|
|
3723
3724
|
}
|
|
3724
3725
|
}
|
|
3725
3726
|
|
|
3726
|
-
/*! @azure/msal-common v14.
|
|
3727
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3727
3728
|
/* eslint-disable header/header */
|
|
3728
3729
|
const name$1 = "@azure/msal-common";
|
|
3729
|
-
const version$1 = "14.
|
|
3730
|
+
const version$1 = "14.13.0";
|
|
3730
3731
|
|
|
3731
|
-
/*! @azure/msal-common v14.
|
|
3732
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3732
3733
|
|
|
3733
3734
|
/*
|
|
3734
3735
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3928,7 +3929,7 @@ class ScopeSet {
|
|
|
3928
3929
|
}
|
|
3929
3930
|
}
|
|
3930
3931
|
|
|
3931
|
-
/*! @azure/msal-common v14.
|
|
3932
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3932
3933
|
|
|
3933
3934
|
/*
|
|
3934
3935
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3968,7 +3969,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
3968
3969
|
};
|
|
3969
3970
|
}
|
|
3970
3971
|
|
|
3971
|
-
/*! @azure/msal-common v14.
|
|
3972
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
3972
3973
|
/*
|
|
3973
3974
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3974
3975
|
* Licensed under the MIT License.
|
|
@@ -4030,7 +4031,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
4030
4031
|
return updatedAccountInfo;
|
|
4031
4032
|
}
|
|
4032
4033
|
|
|
4033
|
-
/*! @azure/msal-common v14.
|
|
4034
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
4034
4035
|
/*
|
|
4035
4036
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4036
4037
|
* Licensed under the MIT License.
|
|
@@ -4052,7 +4053,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
4052
4053
|
return null;
|
|
4053
4054
|
}
|
|
4054
4055
|
|
|
4055
|
-
/*! @azure/msal-common v14.
|
|
4056
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
4056
4057
|
|
|
4057
4058
|
/*
|
|
4058
4059
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4175,21 +4176,21 @@ class AccountEntity {
|
|
|
4175
4176
|
// How do you account for MSA CID here?
|
|
4176
4177
|
account.localAccountId =
|
|
4177
4178
|
clientInfo?.uid ||
|
|
4178
|
-
accountDetails.idTokenClaims
|
|
4179
|
-
accountDetails.idTokenClaims
|
|
4179
|
+
accountDetails.idTokenClaims?.oid ||
|
|
4180
|
+
accountDetails.idTokenClaims?.sub ||
|
|
4180
4181
|
"";
|
|
4181
4182
|
/*
|
|
4182
4183
|
* In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
|
|
4183
4184
|
* In most cases it will contain a single email. This field should not be relied upon if a custom
|
|
4184
4185
|
* policy is configured to return more than 1 email.
|
|
4185
4186
|
*/
|
|
4186
|
-
const preferredUsername = accountDetails.idTokenClaims
|
|
4187
|
-
accountDetails.idTokenClaims
|
|
4188
|
-
const email = accountDetails.idTokenClaims
|
|
4187
|
+
const preferredUsername = accountDetails.idTokenClaims?.preferred_username ||
|
|
4188
|
+
accountDetails.idTokenClaims?.upn;
|
|
4189
|
+
const email = accountDetails.idTokenClaims?.emails
|
|
4189
4190
|
? accountDetails.idTokenClaims.emails[0]
|
|
4190
4191
|
: null;
|
|
4191
4192
|
account.username = preferredUsername || email || "";
|
|
4192
|
-
account.name = accountDetails.idTokenClaims
|
|
4193
|
+
account.name = accountDetails.idTokenClaims?.name || "";
|
|
4193
4194
|
account.cloudGraphHostName = accountDetails.cloudGraphHostName;
|
|
4194
4195
|
account.msGraphHost = accountDetails.msGraphHost;
|
|
4195
4196
|
if (accountDetails.tenantProfiles) {
|
|
@@ -4299,7 +4300,7 @@ class AccountEntity {
|
|
|
4299
4300
|
}
|
|
4300
4301
|
}
|
|
4301
4302
|
|
|
4302
|
-
/*! @azure/msal-common v14.
|
|
4303
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
4303
4304
|
/*
|
|
4304
4305
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4305
4306
|
* Licensed under the MIT License.
|
|
@@ -4307,7 +4308,7 @@ class AccountEntity {
|
|
|
4307
4308
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
4308
4309
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
4309
4310
|
|
|
4310
|
-
/*! @azure/msal-common v14.
|
|
4311
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
4311
4312
|
|
|
4312
4313
|
/*
|
|
4313
4314
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4334,7 +4335,7 @@ class CacheError extends Error {
|
|
|
4334
4335
|
}
|
|
4335
4336
|
}
|
|
4336
4337
|
|
|
4337
|
-
/*! @azure/msal-common v14.
|
|
4338
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
4338
4339
|
|
|
4339
4340
|
/*
|
|
4340
4341
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5589,7 +5590,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
5589
5590
|
}
|
|
5590
5591
|
}
|
|
5591
5592
|
|
|
5592
|
-
/*! @azure/msal-common v14.
|
|
5593
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5593
5594
|
|
|
5594
5595
|
/*
|
|
5595
5596
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5687,7 +5688,7 @@ function isOidcProtocolMode(config) {
|
|
|
5687
5688
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
5688
5689
|
}
|
|
5689
5690
|
|
|
5690
|
-
/*! @azure/msal-common v14.
|
|
5691
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5691
5692
|
|
|
5692
5693
|
/*
|
|
5693
5694
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5697,15 +5698,16 @@ function isOidcProtocolMode(config) {
|
|
|
5697
5698
|
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
5698
5699
|
*/
|
|
5699
5700
|
class ServerError extends AuthError {
|
|
5700
|
-
constructor(errorCode, errorMessage, subError, errorNo) {
|
|
5701
|
+
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
5701
5702
|
super(errorCode, errorMessage, subError);
|
|
5702
5703
|
this.name = "ServerError";
|
|
5703
5704
|
this.errorNo = errorNo;
|
|
5705
|
+
this.status = status;
|
|
5704
5706
|
Object.setPrototypeOf(this, ServerError.prototype);
|
|
5705
5707
|
}
|
|
5706
5708
|
}
|
|
5707
5709
|
|
|
5708
|
-
/*! @azure/msal-common v14.
|
|
5710
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5709
5711
|
|
|
5710
5712
|
/*
|
|
5711
5713
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5803,7 +5805,7 @@ class ThrottlingUtils {
|
|
|
5803
5805
|
}
|
|
5804
5806
|
}
|
|
5805
5807
|
|
|
5806
|
-
/*! @azure/msal-common v14.
|
|
5808
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5807
5809
|
|
|
5808
5810
|
/*
|
|
5809
5811
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5840,7 +5842,7 @@ class NetworkManager {
|
|
|
5840
5842
|
}
|
|
5841
5843
|
}
|
|
5842
5844
|
|
|
5843
|
-
/*! @azure/msal-common v14.
|
|
5845
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5844
5846
|
/*
|
|
5845
5847
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5846
5848
|
* Licensed under the MIT License.
|
|
@@ -5850,7 +5852,7 @@ const CcsCredentialType = {
|
|
|
5850
5852
|
UPN: "UPN",
|
|
5851
5853
|
};
|
|
5852
5854
|
|
|
5853
|
-
/*! @azure/msal-common v14.
|
|
5855
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5854
5856
|
|
|
5855
5857
|
/*
|
|
5856
5858
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5915,26 +5917,9 @@ class RequestValidator {
|
|
|
5915
5917
|
throw createClientConfigurationError(invalidCodeChallengeMethod);
|
|
5916
5918
|
}
|
|
5917
5919
|
}
|
|
5918
|
-
/**
|
|
5919
|
-
* Removes unnecessary, duplicate, and empty string query parameters from extraQueryParameters
|
|
5920
|
-
* @param request
|
|
5921
|
-
*/
|
|
5922
|
-
static sanitizeEQParams(eQParams, queryParams) {
|
|
5923
|
-
if (!eQParams) {
|
|
5924
|
-
return {};
|
|
5925
|
-
}
|
|
5926
|
-
// Remove any query parameters already included in SSO params
|
|
5927
|
-
queryParams.forEach((_value, key) => {
|
|
5928
|
-
if (eQParams[key]) {
|
|
5929
|
-
delete eQParams[key];
|
|
5930
|
-
}
|
|
5931
|
-
});
|
|
5932
|
-
// remove empty string parameters
|
|
5933
|
-
return Object.fromEntries(Object.entries(eQParams).filter((kv) => kv[1] !== ""));
|
|
5934
|
-
}
|
|
5935
5920
|
}
|
|
5936
5921
|
|
|
5937
|
-
/*! @azure/msal-common v14.
|
|
5922
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
5938
5923
|
|
|
5939
5924
|
/*
|
|
5940
5925
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6222,9 +6207,10 @@ class RequestParameterBuilder {
|
|
|
6222
6207
|
* @param eQParams
|
|
6223
6208
|
*/
|
|
6224
6209
|
addExtraQueryParameters(eQParams) {
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6210
|
+
Object.entries(eQParams).forEach(([key, value]) => {
|
|
6211
|
+
if (!this.parameters.has(key) && value) {
|
|
6212
|
+
this.parameters.set(key, value);
|
|
6213
|
+
}
|
|
6228
6214
|
});
|
|
6229
6215
|
}
|
|
6230
6216
|
addClientCapabilitiesToClaims(claims, clientCapabilities) {
|
|
@@ -6318,7 +6304,7 @@ class RequestParameterBuilder {
|
|
|
6318
6304
|
}
|
|
6319
6305
|
}
|
|
6320
6306
|
|
|
6321
|
-
/*! @azure/msal-common v14.
|
|
6307
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6322
6308
|
|
|
6323
6309
|
/*
|
|
6324
6310
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6421,7 +6407,7 @@ class BaseClient {
|
|
|
6421
6407
|
}
|
|
6422
6408
|
}
|
|
6423
6409
|
|
|
6424
|
-
/*! @azure/msal-common v14.
|
|
6410
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6425
6411
|
/*
|
|
6426
6412
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6427
6413
|
* Licensed under the MIT License.
|
|
@@ -6447,7 +6433,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6447
6433
|
refreshTokenExpired: refreshTokenExpired
|
|
6448
6434
|
});
|
|
6449
6435
|
|
|
6450
|
-
/*! @azure/msal-common v14.
|
|
6436
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6451
6437
|
|
|
6452
6438
|
/*
|
|
6453
6439
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6535,23 +6521,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6535
6521
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6536
6522
|
}
|
|
6537
6523
|
|
|
6538
|
-
/*! @azure/msal-common v14.
|
|
6539
|
-
/*
|
|
6540
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6541
|
-
* Licensed under the MIT License.
|
|
6542
|
-
*/
|
|
6543
|
-
/** @internal */
|
|
6544
|
-
class CacheRecord {
|
|
6545
|
-
constructor(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
|
|
6546
|
-
this.account = accountEntity || null;
|
|
6547
|
-
this.idToken = idTokenEntity || null;
|
|
6548
|
-
this.accessToken = accessTokenEntity || null;
|
|
6549
|
-
this.refreshToken = refreshTokenEntity || null;
|
|
6550
|
-
this.appMetadata = appMetadataEntity || null;
|
|
6551
|
-
}
|
|
6552
|
-
}
|
|
6553
|
-
|
|
6554
|
-
/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
6524
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6555
6525
|
|
|
6556
6526
|
/*
|
|
6557
6527
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6623,7 +6593,7 @@ class ProtocolUtils {
|
|
|
6623
6593
|
}
|
|
6624
6594
|
}
|
|
6625
6595
|
|
|
6626
|
-
/*! @azure/msal-common v14.
|
|
6596
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6627
6597
|
|
|
6628
6598
|
/*
|
|
6629
6599
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6707,7 +6677,7 @@ class PopTokenGenerator {
|
|
|
6707
6677
|
}
|
|
6708
6678
|
}
|
|
6709
6679
|
|
|
6710
|
-
/*! @azure/msal-common v14.
|
|
6680
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6711
6681
|
/*
|
|
6712
6682
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6713
6683
|
* Licensed under the MIT License.
|
|
@@ -6734,7 +6704,7 @@ class PopTokenGenerator {
|
|
|
6734
6704
|
}
|
|
6735
6705
|
}
|
|
6736
6706
|
|
|
6737
|
-
/*! @azure/msal-common v14.
|
|
6707
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
6738
6708
|
|
|
6739
6709
|
/*
|
|
6740
6710
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6811,11 +6781,11 @@ class ResponseHandler {
|
|
|
6811
6781
|
if (serverResponse.error ||
|
|
6812
6782
|
serverResponse.error_description ||
|
|
6813
6783
|
serverResponse.suberror) {
|
|
6814
|
-
const errString =
|
|
6784
|
+
const errString = `Error(s): ${serverResponse.error_codes || Constants.NOT_AVAILABLE} - Timestamp: ${serverResponse.timestamp || Constants.NOT_AVAILABLE} - Description: ${serverResponse.error_description || Constants.NOT_AVAILABLE} - Correlation ID: ${serverResponse.correlation_id || Constants.NOT_AVAILABLE} - Trace ID: ${serverResponse.trace_id || Constants.NOT_AVAILABLE}`;
|
|
6815
6785
|
const serverErrorNo = serverResponse.error_codes?.length
|
|
6816
6786
|
? serverResponse.error_codes[0]
|
|
6817
6787
|
: undefined;
|
|
6818
|
-
const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo);
|
|
6788
|
+
const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo, serverResponse.status);
|
|
6819
6789
|
// check if 500 error
|
|
6820
6790
|
if (refreshAccessToken &&
|
|
6821
6791
|
serverResponse.status &&
|
|
@@ -6929,7 +6899,7 @@ class ResponseHandler {
|
|
|
6929
6899
|
let cachedAccount;
|
|
6930
6900
|
if (serverTokenResponse.id_token && !!idTokenClaims) {
|
|
6931
6901
|
cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || "");
|
|
6932
|
-
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier,
|
|
6902
|
+
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
|
|
6933
6903
|
this.logger);
|
|
6934
6904
|
}
|
|
6935
6905
|
// AccessToken
|
|
@@ -6982,7 +6952,13 @@ class ResponseHandler {
|
|
|
6982
6952
|
familyId: serverTokenResponse.foci,
|
|
6983
6953
|
};
|
|
6984
6954
|
}
|
|
6985
|
-
return
|
|
6955
|
+
return {
|
|
6956
|
+
account: cachedAccount,
|
|
6957
|
+
idToken: cachedIdToken,
|
|
6958
|
+
accessToken: cachedAccessToken,
|
|
6959
|
+
refreshToken: cachedRefreshToken,
|
|
6960
|
+
appMetadata: cachedAppMetadata,
|
|
6961
|
+
};
|
|
6986
6962
|
}
|
|
6987
6963
|
/**
|
|
6988
6964
|
* Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
|
|
@@ -7071,7 +7047,7 @@ class ResponseHandler {
|
|
|
7071
7047
|
};
|
|
7072
7048
|
}
|
|
7073
7049
|
}
|
|
7074
|
-
function buildAccountToCache(cacheStorage, authority, homeAccountId,
|
|
7050
|
+
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
7075
7051
|
logger?.verbose("setCachedAccount called");
|
|
7076
7052
|
// Check if base account is already cached
|
|
7077
7053
|
const accountKeys = cacheStorage.getAccountKeys();
|
|
@@ -7094,6 +7070,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, idTokenClai
|
|
|
7094
7070
|
}, authority, base64Decode);
|
|
7095
7071
|
const tenantProfiles = baseAccount.tenantProfiles || [];
|
|
7096
7072
|
if (claimsTenantId &&
|
|
7073
|
+
idTokenClaims &&
|
|
7097
7074
|
!tenantProfiles.find((tenantProfile) => {
|
|
7098
7075
|
return tenantProfile.tenantId === claimsTenantId;
|
|
7099
7076
|
})) {
|
|
@@ -7104,7 +7081,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, idTokenClai
|
|
|
7104
7081
|
return baseAccount;
|
|
7105
7082
|
}
|
|
7106
7083
|
|
|
7107
|
-
/*! @azure/msal-common v14.
|
|
7084
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7108
7085
|
|
|
7109
7086
|
/*
|
|
7110
7087
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7527,7 +7504,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7527
7504
|
}
|
|
7528
7505
|
}
|
|
7529
7506
|
|
|
7530
|
-
/*! @azure/msal-common v14.
|
|
7507
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7531
7508
|
|
|
7532
7509
|
/*
|
|
7533
7510
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7741,7 +7718,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7741
7718
|
}
|
|
7742
7719
|
}
|
|
7743
7720
|
|
|
7744
|
-
/*! @azure/msal-common v14.
|
|
7721
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7745
7722
|
|
|
7746
7723
|
/*
|
|
7747
7724
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7877,7 +7854,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7877
7854
|
}
|
|
7878
7855
|
}
|
|
7879
7856
|
|
|
7880
|
-
/*! @azure/msal-common v14.
|
|
7857
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7881
7858
|
|
|
7882
7859
|
/*
|
|
7883
7860
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7892,7 +7869,7 @@ const StubbedNetworkModule = {
|
|
|
7892
7869
|
},
|
|
7893
7870
|
};
|
|
7894
7871
|
|
|
7895
|
-
/*! @azure/msal-common v14.
|
|
7872
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7896
7873
|
/*
|
|
7897
7874
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7898
7875
|
* Licensed under the MIT License.
|
|
@@ -7900,7 +7877,7 @@ const StubbedNetworkModule = {
|
|
|
7900
7877
|
const missingKidError = "missing_kid_error";
|
|
7901
7878
|
const missingAlgError = "missing_alg_error";
|
|
7902
7879
|
|
|
7903
|
-
/*! @azure/msal-common v14.
|
|
7880
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7904
7881
|
|
|
7905
7882
|
/*
|
|
7906
7883
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7925,7 +7902,7 @@ function createJoseHeaderError(code) {
|
|
|
7925
7902
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
7926
7903
|
}
|
|
7927
7904
|
|
|
7928
|
-
/*! @azure/msal-common v14.
|
|
7905
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7929
7906
|
|
|
7930
7907
|
/*
|
|
7931
7908
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7965,7 +7942,7 @@ class JoseHeader {
|
|
|
7965
7942
|
}
|
|
7966
7943
|
}
|
|
7967
7944
|
|
|
7968
|
-
/*! @azure/msal-common v14.
|
|
7945
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
7969
7946
|
|
|
7970
7947
|
/*
|
|
7971
7948
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8023,7 +8000,7 @@ class AuthenticationHeaderParser {
|
|
|
8023
8000
|
}
|
|
8024
8001
|
}
|
|
8025
8002
|
|
|
8026
|
-
/*! @azure/msal-common v14.
|
|
8003
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
8027
8004
|
|
|
8028
8005
|
/*
|
|
8029
8006
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8227,7 +8204,7 @@ class ServerTelemetryManager {
|
|
|
8227
8204
|
}
|
|
8228
8205
|
}
|
|
8229
8206
|
|
|
8230
|
-
/*! @azure/msal-common v14.
|
|
8207
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
8231
8208
|
|
|
8232
8209
|
/*
|
|
8233
8210
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8306,7 +8283,7 @@ class StubPerformanceClient {
|
|
|
8306
8283
|
}
|
|
8307
8284
|
}
|
|
8308
8285
|
|
|
8309
|
-
/*! @azure/msal-common v14.
|
|
8286
|
+
/*! @azure/msal-common v14.13.0 2024-07-12 */
|
|
8310
8287
|
|
|
8311
8288
|
/*
|
|
8312
8289
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10177,7 +10154,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
10177
10154
|
|
|
10178
10155
|
/* eslint-disable header/header */
|
|
10179
10156
|
const name = "@azure/msal-browser";
|
|
10180
|
-
const version = "3.
|
|
10157
|
+
const version = "3.19.0";
|
|
10181
10158
|
|
|
10182
10159
|
/*
|
|
10183
10160
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -12033,10 +12010,11 @@ class BrowserCacheManager extends CacheManager {
|
|
|
12033
12010
|
/**
|
|
12034
12011
|
* Clears all access tokes that have claims prior to saving the current one
|
|
12035
12012
|
* @param performanceClient {IPerformanceClient}
|
|
12013
|
+
* @param correlationId {string} correlation id
|
|
12036
12014
|
* @returns
|
|
12037
12015
|
*/
|
|
12038
|
-
async clearTokensAndKeysWithClaims(performanceClient) {
|
|
12039
|
-
performanceClient.addQueueMeasurement(PerformanceEvents.ClearTokensAndKeysWithClaims);
|
|
12016
|
+
async clearTokensAndKeysWithClaims(performanceClient, correlationId) {
|
|
12017
|
+
performanceClient.addQueueMeasurement(PerformanceEvents.ClearTokensAndKeysWithClaims, correlationId);
|
|
12040
12018
|
const tokenKeys = this.getTokenKeys();
|
|
12041
12019
|
const removedAccessTokens = [];
|
|
12042
12020
|
tokenKeys.accessToken.forEach((key) => {
|
|
@@ -12437,7 +12415,10 @@ class BrowserCacheManager extends CacheManager {
|
|
|
12437
12415
|
const accessTokenEntity = createAccessTokenEntity(result.account?.homeAccountId, result.account.environment, result.accessToken, this.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn ? result.expiresOn.getTime() / 1000 : 0, result.extExpiresOn ? result.extExpiresOn.getTime() / 1000 : 0, base64Decode, undefined, // refreshOn
|
|
12438
12416
|
result.tokenType, undefined, // userAssertionHash
|
|
12439
12417
|
request.sshKid, request.claims, claimsHash);
|
|
12440
|
-
const cacheRecord =
|
|
12418
|
+
const cacheRecord = {
|
|
12419
|
+
idToken: idTokenEntity,
|
|
12420
|
+
accessToken: accessTokenEntity,
|
|
12421
|
+
};
|
|
12441
12422
|
return this.saveCacheRecord(cacheRecord);
|
|
12442
12423
|
}
|
|
12443
12424
|
/**
|
|
@@ -13433,11 +13414,12 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13433
13414
|
*/
|
|
13434
13415
|
async acquireTokenRedirect(request, rootMeasurement) {
|
|
13435
13416
|
this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");
|
|
13436
|
-
const
|
|
13437
|
-
|
|
13417
|
+
const { ...remainingParameters } = request;
|
|
13418
|
+
delete remainingParameters.onRedirectNavigate;
|
|
13419
|
+
const nativeRequest = await this.initializeNativeRequest(remainingParameters);
|
|
13438
13420
|
const messageBody = {
|
|
13439
13421
|
method: NativeExtensionMethod.GetToken,
|
|
13440
|
-
request:
|
|
13422
|
+
request: nativeRequest,
|
|
13441
13423
|
};
|
|
13442
13424
|
try {
|
|
13443
13425
|
const response = await this.nativeMessageHandler.sendMessage(messageBody);
|
|
@@ -13533,7 +13515,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13533
13515
|
}
|
|
13534
13516
|
// Get the preferred_cache domain for the given authority
|
|
13535
13517
|
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
13536
|
-
const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier,
|
|
13518
|
+
const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier, base64Decode, idTokenClaims, response.client_info, undefined, // environment
|
|
13537
13519
|
idTokenClaims.tid, undefined, // auth code payload
|
|
13538
13520
|
response.account.id, this.logger);
|
|
13539
13521
|
// generate authenticationResult
|
|
@@ -13693,7 +13675,10 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13693
13675
|
const tokenExpirationSeconds = reqTimestamp + expiresIn;
|
|
13694
13676
|
const responseScopes = this.generateScopes(response, request);
|
|
13695
13677
|
const cachedAccessToken = createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, undefined, request.tokenType, undefined, request.keyId);
|
|
13696
|
-
const nativeCacheRecord =
|
|
13678
|
+
const nativeCacheRecord = {
|
|
13679
|
+
idToken: cachedIdToken,
|
|
13680
|
+
accessToken: cachedAccessToken,
|
|
13681
|
+
};
|
|
13697
13682
|
void this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, request.storeInCache);
|
|
13698
13683
|
}
|
|
13699
13684
|
addTelemetryFromNativeResponse(response) {
|
|
@@ -15461,47 +15446,32 @@ class TokenCache {
|
|
|
15461
15446
|
* @returns `AuthenticationResult` for the response that was loaded.
|
|
15462
15447
|
*/
|
|
15463
15448
|
loadExternalTokens(request, response, options) {
|
|
15464
|
-
this.
|
|
15465
|
-
|
|
15466
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15449
|
+
if (!this.isBrowserEnvironment) {
|
|
15450
|
+
throw createBrowserAuthError(nonBrowserEnvironment);
|
|
15467
15451
|
}
|
|
15468
|
-
const idTokenClaims =
|
|
15469
|
-
|
|
15470
|
-
|
|
15471
|
-
|
|
15472
|
-
|
|
15473
|
-
|
|
15474
|
-
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
}
|
|
15492
|
-
else if (response.client_info) {
|
|
15493
|
-
this.logger.trace("TokenCache - homeAccountId from response");
|
|
15494
|
-
cacheRecordAccount = this.loadAccount(idTokenClaims, authority, response.client_info);
|
|
15495
|
-
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(response.id_token, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
|
|
15496
|
-
}
|
|
15497
|
-
else {
|
|
15498
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15499
|
-
}
|
|
15500
|
-
}
|
|
15501
|
-
else {
|
|
15502
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15503
|
-
}
|
|
15504
|
-
return this.generateAuthenticationResult(request, idTokenClaims, cacheRecord, cacheRecordAccount, authority);
|
|
15452
|
+
const idTokenClaims = response.id_token
|
|
15453
|
+
? extractTokenClaims(response.id_token, base64Decode)
|
|
15454
|
+
: undefined;
|
|
15455
|
+
const authorityOptions = {
|
|
15456
|
+
protocolMode: this.config.auth.protocolMode,
|
|
15457
|
+
knownAuthorities: this.config.auth.knownAuthorities,
|
|
15458
|
+
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
15459
|
+
authorityMetadata: this.config.auth.authorityMetadata,
|
|
15460
|
+
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
15461
|
+
};
|
|
15462
|
+
const authority = request.authority
|
|
15463
|
+
? new Authority(Authority.generateAuthority(request.authority, request.azureCloudOptions), this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid())
|
|
15464
|
+
: undefined;
|
|
15465
|
+
const cacheRecordAccount = this.loadAccount(request, options.clientInfo || response.client_info || "", idTokenClaims, authority);
|
|
15466
|
+
const idToken = this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm);
|
|
15467
|
+
const accessToken = this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options);
|
|
15468
|
+
const refreshToken = this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment);
|
|
15469
|
+
return this.generateAuthenticationResult(request, {
|
|
15470
|
+
account: cacheRecordAccount,
|
|
15471
|
+
idToken,
|
|
15472
|
+
accessToken,
|
|
15473
|
+
refreshToken,
|
|
15474
|
+
}, idTokenClaims, authority);
|
|
15505
15475
|
}
|
|
15506
15476
|
/**
|
|
15507
15477
|
* Helper function to load account to msal-browser cache
|
|
@@ -15512,29 +15482,24 @@ class TokenCache {
|
|
|
15512
15482
|
* @param requestHomeAccountId
|
|
15513
15483
|
* @returns `AccountEntity`
|
|
15514
15484
|
*/
|
|
15515
|
-
loadAccount(
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
}
|
|
15522
|
-
else if (authority.authorityType !== undefined && clientInfo) {
|
|
15523
|
-
homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);
|
|
15524
|
-
}
|
|
15525
|
-
if (!homeAccountId) {
|
|
15526
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15527
|
-
}
|
|
15528
|
-
const claimsTenantId = idTokenClaims.tid;
|
|
15529
|
-
const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, idTokenClaims, base64Decode, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
|
|
15530
|
-
undefined, // nativeAccountId
|
|
15531
|
-
this.logger);
|
|
15532
|
-
this.storage.setAccount(cachedAccount);
|
|
15533
|
-
return cachedAccount;
|
|
15485
|
+
loadAccount(request, clientInfo, idTokenClaims, authority) {
|
|
15486
|
+
this.logger.verbose("TokenCache - loading account");
|
|
15487
|
+
if (request.account) {
|
|
15488
|
+
const accountEntity = AccountEntity.createFromAccountInfo(request.account);
|
|
15489
|
+
this.storage.setAccount(accountEntity);
|
|
15490
|
+
return accountEntity;
|
|
15534
15491
|
}
|
|
15535
|
-
else {
|
|
15492
|
+
else if (!authority || (!clientInfo && !idTokenClaims)) {
|
|
15493
|
+
this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead.");
|
|
15536
15494
|
throw createBrowserAuthError(unableToLoadToken);
|
|
15537
15495
|
}
|
|
15496
|
+
const homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);
|
|
15497
|
+
const claimsTenantId = idTokenClaims?.tid;
|
|
15498
|
+
const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
|
|
15499
|
+
undefined, // nativeAccountId
|
|
15500
|
+
this.logger);
|
|
15501
|
+
this.storage.setAccount(cachedAccount);
|
|
15502
|
+
return cachedAccount;
|
|
15538
15503
|
}
|
|
15539
15504
|
/**
|
|
15540
15505
|
* Helper function to load id tokens to msal-browser cache
|
|
@@ -15544,16 +15509,15 @@ class TokenCache {
|
|
|
15544
15509
|
* @param tenantId
|
|
15545
15510
|
* @returns `IdTokenEntity`
|
|
15546
15511
|
*/
|
|
15547
|
-
loadIdToken(
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
this.storage.setIdTokenCredential(idTokenEntity);
|
|
15552
|
-
return idTokenEntity;
|
|
15553
|
-
}
|
|
15554
|
-
else {
|
|
15555
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15512
|
+
loadIdToken(response, homeAccountId, environment, tenantId) {
|
|
15513
|
+
if (!response.id_token) {
|
|
15514
|
+
this.logger.verbose("TokenCache - no id token found in response");
|
|
15515
|
+
return null;
|
|
15556
15516
|
}
|
|
15517
|
+
this.logger.verbose("TokenCache - loading id token");
|
|
15518
|
+
const idTokenEntity = createIdTokenEntity(homeAccountId, environment, response.id_token, this.config.auth.clientId, tenantId);
|
|
15519
|
+
this.storage.setIdTokenCredential(idTokenEntity);
|
|
15520
|
+
return idTokenEntity;
|
|
15557
15521
|
}
|
|
15558
15522
|
/**
|
|
15559
15523
|
* Helper function to load access tokens to msal-browser cache
|
|
@@ -15566,28 +15530,30 @@ class TokenCache {
|
|
|
15566
15530
|
*/
|
|
15567
15531
|
loadAccessToken(request, response, homeAccountId, environment, tenantId, options) {
|
|
15568
15532
|
if (!response.access_token) {
|
|
15569
|
-
this.logger.verbose("TokenCache -
|
|
15533
|
+
this.logger.verbose("TokenCache - no access token found in response");
|
|
15570
15534
|
return null;
|
|
15571
15535
|
}
|
|
15572
|
-
if (!response.expires_in) {
|
|
15573
|
-
|
|
15536
|
+
else if (!response.expires_in) {
|
|
15537
|
+
this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache.");
|
|
15538
|
+
return null;
|
|
15574
15539
|
}
|
|
15575
|
-
if (!
|
|
15576
|
-
|
|
15540
|
+
else if (!response.scope &&
|
|
15541
|
+
(!request.scopes || !request.scopes.length)) {
|
|
15542
|
+
this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache.");
|
|
15543
|
+
return null;
|
|
15577
15544
|
}
|
|
15578
|
-
|
|
15545
|
+
this.logger.verbose("TokenCache - loading access token");
|
|
15546
|
+
const scopes = response.scope
|
|
15547
|
+
? ScopeSet.fromString(response.scope)
|
|
15548
|
+
: new ScopeSet(request.scopes);
|
|
15579
15549
|
const expiresOn = options.expiresOn ||
|
|
15580
15550
|
response.expires_in + new Date().getTime() / 1000;
|
|
15581
|
-
const extendedExpiresOn = options.extendedExpiresOn
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
}
|
|
15588
|
-
else {
|
|
15589
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15590
|
-
}
|
|
15551
|
+
const extendedExpiresOn = options.extendedExpiresOn ||
|
|
15552
|
+
(response.ext_expires_in || response.expires_in) +
|
|
15553
|
+
new Date().getTime() / 1000;
|
|
15554
|
+
const accessTokenEntity = createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);
|
|
15555
|
+
this.storage.setAccessTokenCredential(accessTokenEntity);
|
|
15556
|
+
return accessTokenEntity;
|
|
15591
15557
|
}
|
|
15592
15558
|
/**
|
|
15593
15559
|
* Helper function to load refresh tokens to msal-browser cache
|
|
@@ -15597,20 +15563,16 @@ class TokenCache {
|
|
|
15597
15563
|
* @param environment
|
|
15598
15564
|
* @returns `RefreshTokenEntity`
|
|
15599
15565
|
*/
|
|
15600
|
-
loadRefreshToken(
|
|
15566
|
+
loadRefreshToken(response, homeAccountId, environment) {
|
|
15601
15567
|
if (!response.refresh_token) {
|
|
15602
|
-
this.logger.verbose("TokenCache -
|
|
15568
|
+
this.logger.verbose("TokenCache - no refresh token found in response");
|
|
15603
15569
|
return null;
|
|
15604
15570
|
}
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
15609
|
-
|
|
15610
|
-
}
|
|
15611
|
-
else {
|
|
15612
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15613
|
-
}
|
|
15571
|
+
this.logger.verbose("TokenCache - loading refresh token");
|
|
15572
|
+
const refreshTokenEntity = createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId, response.foci, undefined, // userAssertionHash
|
|
15573
|
+
response.refresh_token_expires_in);
|
|
15574
|
+
this.storage.setRefreshTokenCredential(refreshTokenEntity);
|
|
15575
|
+
return refreshTokenEntity;
|
|
15614
15576
|
}
|
|
15615
15577
|
/**
|
|
15616
15578
|
* Helper function to generate an `AuthenticationResult` for the result.
|
|
@@ -15620,8 +15582,8 @@ class TokenCache {
|
|
|
15620
15582
|
* @param authority
|
|
15621
15583
|
* @returns `AuthenticationResult`
|
|
15622
15584
|
*/
|
|
15623
|
-
generateAuthenticationResult(request,
|
|
15624
|
-
let accessToken =
|
|
15585
|
+
generateAuthenticationResult(request, cacheRecord, idTokenClaims, authority) {
|
|
15586
|
+
let accessToken = "";
|
|
15625
15587
|
let responseScopes = [];
|
|
15626
15588
|
let expiresOn = null;
|
|
15627
15589
|
let extExpiresOn;
|
|
@@ -15631,14 +15593,11 @@ class TokenCache {
|
|
|
15631
15593
|
expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
|
|
15632
15594
|
extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
|
|
15633
15595
|
}
|
|
15634
|
-
const
|
|
15635
|
-
const tid = idTokenClaims.tid || Constants.EMPTY_STRING;
|
|
15596
|
+
const accountEntity = cacheRecord.account;
|
|
15636
15597
|
return {
|
|
15637
|
-
authority: authority
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
uniqueId: uid,
|
|
15641
|
-
tenantId: tid,
|
|
15598
|
+
authority: authority ? authority.canonicalAuthority : "",
|
|
15599
|
+
uniqueId: cacheRecord.account.localAccountId,
|
|
15600
|
+
tenantId: cacheRecord.account.realm,
|
|
15642
15601
|
scopes: responseScopes,
|
|
15643
15602
|
account: accountEntity.getAccountInfo(),
|
|
15644
15603
|
idToken: cacheRecord.idToken?.secret || "",
|
|
@@ -15646,15 +15605,14 @@ class TokenCache {
|
|
|
15646
15605
|
accessToken: accessToken,
|
|
15647
15606
|
fromCache: true,
|
|
15648
15607
|
expiresOn: expiresOn,
|
|
15649
|
-
correlationId: request.correlationId ||
|
|
15650
|
-
requestId:
|
|
15608
|
+
correlationId: request.correlationId || "",
|
|
15609
|
+
requestId: "",
|
|
15651
15610
|
extExpiresOn: extExpiresOn,
|
|
15652
|
-
familyId:
|
|
15653
|
-
tokenType: cacheRecord?.accessToken?.tokenType ||
|
|
15654
|
-
state:
|
|
15655
|
-
cloudGraphHostName: accountEntity.cloudGraphHostName ||
|
|
15656
|
-
msGraphHost: accountEntity.msGraphHost ||
|
|
15657
|
-
code: undefined,
|
|
15611
|
+
familyId: cacheRecord.refreshToken?.familyId || "",
|
|
15612
|
+
tokenType: cacheRecord?.accessToken?.tokenType || "",
|
|
15613
|
+
state: request.state || "",
|
|
15614
|
+
cloudGraphHostName: accountEntity.cloudGraphHostName || "",
|
|
15615
|
+
msGraphHost: accountEntity.msGraphHost || "",
|
|
15658
15616
|
fromNativeBroker: false,
|
|
15659
15617
|
};
|
|
15660
15618
|
}
|
|
@@ -15824,9 +15782,9 @@ class StandardController {
|
|
|
15824
15782
|
this.trackPageVisibilityWithMeasurement =
|
|
15825
15783
|
this.trackPageVisibilityWithMeasurement.bind(this);
|
|
15826
15784
|
}
|
|
15827
|
-
static async createController(operatingContext) {
|
|
15785
|
+
static async createController(operatingContext, request) {
|
|
15828
15786
|
const controller = new StandardController(operatingContext);
|
|
15829
|
-
await controller.initialize();
|
|
15787
|
+
await controller.initialize(request);
|
|
15830
15788
|
return controller;
|
|
15831
15789
|
}
|
|
15832
15790
|
trackPageVisibility(correlationId) {
|
|
@@ -15838,15 +15796,17 @@ class StandardController {
|
|
|
15838
15796
|
}
|
|
15839
15797
|
/**
|
|
15840
15798
|
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
|
15799
|
+
* @param request {?InitializeApplicationRequest} correlation id
|
|
15841
15800
|
*/
|
|
15842
|
-
async initialize() {
|
|
15801
|
+
async initialize(request) {
|
|
15843
15802
|
this.logger.trace("initialize called");
|
|
15844
15803
|
if (this.initialized) {
|
|
15845
15804
|
this.logger.info("initialize has already been called, exiting early.");
|
|
15846
15805
|
return;
|
|
15847
15806
|
}
|
|
15807
|
+
const initCorrelationId = request?.correlationId || this.getRequestCorrelationId();
|
|
15848
15808
|
const allowNativeBroker = this.config.system.allowNativeBroker;
|
|
15849
|
-
const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication);
|
|
15809
|
+
const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication, initCorrelationId);
|
|
15850
15810
|
this.eventHandler.emitEvent(EventType.INITIALIZE_START);
|
|
15851
15811
|
if (allowNativeBroker) {
|
|
15852
15812
|
try {
|
|
@@ -15859,7 +15819,7 @@ class StandardController {
|
|
|
15859
15819
|
}
|
|
15860
15820
|
if (!this.config.cache.claimsBasedCachingEnabled) {
|
|
15861
15821
|
this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims");
|
|
15862
|
-
await invokeAsync(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage), PerformanceEvents.ClearTokensAndKeysWithClaims, this.logger, this.performanceClient)(this.performanceClient);
|
|
15822
|
+
await invokeAsync(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage), PerformanceEvents.ClearTokensAndKeysWithClaims, this.logger, this.performanceClient, initCorrelationId)(this.performanceClient, initCorrelationId);
|
|
15863
15823
|
}
|
|
15864
15824
|
this.initialized = true;
|
|
15865
15825
|
this.eventHandler.emitEvent(EventType.INITIALIZE_END);
|
|
@@ -16896,12 +16856,13 @@ class StandardController {
|
|
|
16896
16856
|
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
|
|
16897
16857
|
*/
|
|
16898
16858
|
async acquireTokenSilentAsync(request, account) {
|
|
16859
|
+
const trackPageVisibility = () => this.trackPageVisibility(request.correlationId);
|
|
16899
16860
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
|
|
16900
16861
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
|
|
16901
16862
|
if (request.correlationId) {
|
|
16902
16863
|
this.performanceClient.incrementFields({ visibilityChangeCount: 0 }, request.correlationId);
|
|
16903
16864
|
}
|
|
16904
|
-
document.addEventListener("visibilitychange",
|
|
16865
|
+
document.addEventListener("visibilitychange", trackPageVisibility);
|
|
16905
16866
|
const silentRequest = await invokeAsync(initializeSilentRequest, PerformanceEvents.InitializeSilentRequest, this.logger, this.performanceClient, request.correlationId)(request, account, this.config, this.performanceClient, this.logger);
|
|
16906
16867
|
const cacheLookupPolicy = request.cacheLookupPolicy || CacheLookupPolicy.Default;
|
|
16907
16868
|
const result = this.acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy).catch(async (refreshTokenError) => {
|
|
@@ -16980,7 +16941,7 @@ class StandardController {
|
|
|
16980
16941
|
throw tokenRenewalError;
|
|
16981
16942
|
})
|
|
16982
16943
|
.finally(() => {
|
|
16983
|
-
document.removeEventListener("visibilitychange",
|
|
16944
|
+
document.removeEventListener("visibilitychange", trackPageVisibility);
|
|
16984
16945
|
});
|
|
16985
16946
|
}
|
|
16986
16947
|
/**
|
|
@@ -17241,7 +17202,7 @@ class NestedAppAuthAdapter {
|
|
|
17241
17202
|
const NestedAppAuthErrorMessage = {
|
|
17242
17203
|
unsupportedMethod: {
|
|
17243
17204
|
code: "unsupported_method",
|
|
17244
|
-
desc: "
|
|
17205
|
+
desc: "This method is not supported in nested app environment.",
|
|
17245
17206
|
},
|
|
17246
17207
|
};
|
|
17247
17208
|
class NestedAppAuthError extends AuthError {
|
|
@@ -17733,10 +17694,10 @@ class NestedAppAuthController {
|
|
|
17733
17694
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
17734
17695
|
* Licensed under the MIT License.
|
|
17735
17696
|
*/
|
|
17736
|
-
async function createV3Controller(config) {
|
|
17697
|
+
async function createV3Controller(config, request) {
|
|
17737
17698
|
const standard = new StandardOperatingContext(config);
|
|
17738
17699
|
await standard.initialize();
|
|
17739
|
-
return StandardController.createController(standard);
|
|
17700
|
+
return StandardController.createController(standard, request);
|
|
17740
17701
|
}
|
|
17741
17702
|
async function createController(config) {
|
|
17742
17703
|
const standard = new StandardOperatingContext(config);
|
|
@@ -17764,7 +17725,11 @@ async function createController(config) {
|
|
|
17764
17725
|
* to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.
|
|
17765
17726
|
*/
|
|
17766
17727
|
class PublicClientApplication {
|
|
17767
|
-
|
|
17728
|
+
/**
|
|
17729
|
+
* Creates StandardController and passes it to the PublicClientApplication
|
|
17730
|
+
*
|
|
17731
|
+
* @param configuration {Configuration}
|
|
17732
|
+
*/
|
|
17768
17733
|
static async createPublicClientApplication(configuration) {
|
|
17769
17734
|
const controller = await createV3Controller(configuration);
|
|
17770
17735
|
const pca = new PublicClientApplication(configuration, controller);
|
|
@@ -17799,9 +17764,10 @@ class PublicClientApplication {
|
|
|
17799
17764
|
}
|
|
17800
17765
|
/**
|
|
17801
17766
|
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
|
17767
|
+
* @param request {?InitializeApplicationRequest}
|
|
17802
17768
|
*/
|
|
17803
|
-
async initialize() {
|
|
17804
|
-
return this.controller.initialize();
|
|
17769
|
+
async initialize(request) {
|
|
17770
|
+
return this.controller.initialize(request);
|
|
17805
17771
|
}
|
|
17806
17772
|
/**
|
|
17807
17773
|
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|