@azure/msal-browser 3.7.1 → 3.7.2-alpha.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.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/CryptoKeyStore.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +6 -3
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +54 -5
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.d.ts.map +1 -1
- package/dist/event/EventHandler.mjs +8 -2
- package/dist/event/EventHandler.mjs.map +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.d.ts +1 -0
- package/dist/event/EventType.d.ts.map +1 -1
- package/dist/event/EventType.mjs +2 -1
- package/dist/event/EventType.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +5 -4
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +19 -21
- package/dist/interaction_client/BaseInteractionClient.mjs.map +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 +3 -2
- 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 -3
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +4 -3
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +2 -2
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +5 -5
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +2 -2
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts +2 -2
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +5 -5
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +3 -9
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +6 -29
- package/dist/interaction_client/StandardInteractionClient.mjs.map +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/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.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/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 +216 -187
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +216 -187
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +66 -65
- package/package.json +4 -4
- package/src/crypto/BrowserCrypto.ts +57 -4
- package/src/event/EventHandler.ts +8 -0
- package/src/event/EventType.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +40 -31
- package/src/interaction_client/NativeInteractionClient.ts +6 -1
- package/src/interaction_client/PopupClient.ts +8 -2
- package/src/interaction_client/RedirectClient.ts +8 -2
- package/src/interaction_client/SilentAuthCodeClient.ts +6 -1
- package/src/interaction_client/SilentCacheClient.ts +6 -4
- package/src/interaction_client/SilentIframeClient.ts +2 -1
- package/src/interaction_client/SilentRefreshClient.ts +7 -4
- package/src/interaction_client/StandardInteractionClient.ts +11 -57
- package/src/packageMetadata.ts +1 -1
package/lib/msal-browser.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.7.1 2024-01-
|
|
1
|
+
/*! @azure/msal-browser v3.7.2-alpha.1 2024-01-30 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
5
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6
6
|
/*
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
@@ -297,7 +297,7 @@ const JsonWebTokenTypes = {
|
|
|
297
297
|
Pop: "pop",
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
300
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
301
301
|
/*
|
|
302
302
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
303
303
|
* Licensed under the MIT License.
|
|
@@ -314,7 +314,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
314
314
|
unexpectedError: unexpectedError
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
317
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
318
318
|
|
|
319
319
|
/*
|
|
320
320
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -363,7 +363,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
363
363
|
: AuthErrorMessages[code]);
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
366
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
367
367
|
/*
|
|
368
368
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
369
369
|
* Licensed under the MIT License.
|
|
@@ -461,7 +461,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
461
461
|
userTimeoutReached: userTimeoutReached
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
464
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
465
465
|
|
|
466
466
|
/*
|
|
467
467
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -713,7 +713,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
713
713
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
714
714
|
}
|
|
715
715
|
|
|
716
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
716
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
717
717
|
|
|
718
718
|
/*
|
|
719
719
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -746,7 +746,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
746
746
|
},
|
|
747
747
|
};
|
|
748
748
|
|
|
749
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
749
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
750
750
|
|
|
751
751
|
/*
|
|
752
752
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -937,12 +937,12 @@ class Logger {
|
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
|
|
940
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
940
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
941
941
|
/* eslint-disable header/header */
|
|
942
942
|
const name$1 = "@azure/msal-common";
|
|
943
|
-
const version$1 = "14.6.1";
|
|
943
|
+
const version$1 = "14.6.2-alpha.1";
|
|
944
944
|
|
|
945
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
945
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
946
946
|
/*
|
|
947
947
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
948
948
|
* Licensed under the MIT License.
|
|
@@ -962,7 +962,7 @@ const AzureCloudInstance = {
|
|
|
962
962
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
963
963
|
};
|
|
964
964
|
|
|
965
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
965
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
966
966
|
|
|
967
967
|
/*
|
|
968
968
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1023,54 +1023,44 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1026
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1027
1027
|
/*
|
|
1028
1028
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1029
1029
|
* Licensed under the MIT License.
|
|
1030
1030
|
*/
|
|
1031
1031
|
/**
|
|
1032
|
-
* Utility
|
|
1032
|
+
* Utility functions for managing date and time operations.
|
|
1033
1033
|
*/
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
return cachedAtSec > TimeUtils.nowSeconds();
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Waits for t number of milliseconds
|
|
1065
|
-
* @param t number
|
|
1066
|
-
* @param value T
|
|
1067
|
-
*/
|
|
1068
|
-
static delay(t, value) {
|
|
1069
|
-
return new Promise((resolve) => setTimeout(() => resolve(value), t));
|
|
1070
|
-
}
|
|
1034
|
+
/**
|
|
1035
|
+
* return the current time in Unix time (seconds).
|
|
1036
|
+
*/
|
|
1037
|
+
function nowSeconds() {
|
|
1038
|
+
// Date.getTime() returns in milliseconds.
|
|
1039
|
+
return Math.round(new Date().getTime() / 1000.0);
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* check if a token is expired based on given UTC time in seconds.
|
|
1043
|
+
* @param expiresOn
|
|
1044
|
+
*/
|
|
1045
|
+
function isTokenExpired(expiresOn, offset) {
|
|
1046
|
+
// check for access token expiry
|
|
1047
|
+
const expirationSec = Number(expiresOn) || 0;
|
|
1048
|
+
const offsetCurrentTimeSec = nowSeconds() + offset;
|
|
1049
|
+
// If current time + offset is greater than token expiration time, then token is expired.
|
|
1050
|
+
return offsetCurrentTimeSec > expirationSec;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* If the current time is earlier than the time that a token was cached at, we must discard the token
|
|
1054
|
+
* i.e. The system clock was turned back after acquiring the cached token
|
|
1055
|
+
* @param cachedAt
|
|
1056
|
+
* @param offset
|
|
1057
|
+
*/
|
|
1058
|
+
function wasClockTurnedBack(cachedAt) {
|
|
1059
|
+
const cachedAtSec = Number(cachedAt);
|
|
1060
|
+
return cachedAtSec > nowSeconds();
|
|
1071
1061
|
}
|
|
1072
1062
|
|
|
1073
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1063
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1074
1064
|
|
|
1075
1065
|
/*
|
|
1076
1066
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1128,7 +1118,7 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1128
1118
|
homeAccountId: homeAccountId,
|
|
1129
1119
|
credentialType: CredentialType.ACCESS_TOKEN,
|
|
1130
1120
|
secret: accessToken,
|
|
1131
|
-
cachedAt:
|
|
1121
|
+
cachedAt: nowSeconds().toString(),
|
|
1132
1122
|
expiresOn: expiresOn.toString(),
|
|
1133
1123
|
extendedExpiresOn: extExpiresOn.toString(),
|
|
1134
1124
|
environment: environment,
|
|
@@ -1372,7 +1362,7 @@ function isAuthorityMetadataEntity(key, entity) {
|
|
|
1372
1362
|
* Reset the exiresAt value
|
|
1373
1363
|
*/
|
|
1374
1364
|
function generateAuthorityMetadataExpiresAt() {
|
|
1375
|
-
return (
|
|
1365
|
+
return (nowSeconds() +
|
|
1376
1366
|
AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS);
|
|
1377
1367
|
}
|
|
1378
1368
|
function updateAuthorityEndpointMetadata(authorityMetadata, updatedValues, fromNetwork) {
|
|
@@ -1394,10 +1384,10 @@ function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetw
|
|
|
1394
1384
|
* Returns whether or not the data needs to be refreshed
|
|
1395
1385
|
*/
|
|
1396
1386
|
function isAuthorityMetadataExpired(metadata) {
|
|
1397
|
-
return metadata.expiresAt <=
|
|
1387
|
+
return metadata.expiresAt <= nowSeconds();
|
|
1398
1388
|
}
|
|
1399
1389
|
|
|
1400
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1390
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1401
1391
|
/*
|
|
1402
1392
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1403
1393
|
* Licensed under the MIT License.
|
|
@@ -1451,7 +1441,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1451
1441
|
urlParseError: urlParseError
|
|
1452
1442
|
});
|
|
1453
1443
|
|
|
1454
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1444
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1455
1445
|
|
|
1456
1446
|
/*
|
|
1457
1447
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1589,7 +1579,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1589
1579
|
return new ClientConfigurationError(errorCode);
|
|
1590
1580
|
}
|
|
1591
1581
|
|
|
1592
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1582
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1593
1583
|
/*
|
|
1594
1584
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1595
1585
|
* Licensed under the MIT License.
|
|
@@ -1686,7 +1676,7 @@ class StringUtils {
|
|
|
1686
1676
|
}
|
|
1687
1677
|
}
|
|
1688
1678
|
|
|
1689
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1679
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1690
1680
|
|
|
1691
1681
|
/*
|
|
1692
1682
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1886,7 +1876,7 @@ class ScopeSet {
|
|
|
1886
1876
|
}
|
|
1887
1877
|
}
|
|
1888
1878
|
|
|
1889
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1879
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1890
1880
|
|
|
1891
1881
|
/*
|
|
1892
1882
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1926,7 +1916,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
1926
1916
|
};
|
|
1927
1917
|
}
|
|
1928
1918
|
|
|
1929
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1919
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1930
1920
|
/*
|
|
1931
1921
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1932
1922
|
* Licensed under the MIT License.
|
|
@@ -1987,7 +1977,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
1987
1977
|
return updatedAccountInfo;
|
|
1988
1978
|
}
|
|
1989
1979
|
|
|
1990
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1980
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
1991
1981
|
/*
|
|
1992
1982
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1993
1983
|
* Licensed under the MIT License.
|
|
@@ -2002,7 +1992,7 @@ const AuthorityType = {
|
|
|
2002
1992
|
Ciam: 3,
|
|
2003
1993
|
};
|
|
2004
1994
|
|
|
2005
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
1995
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2006
1996
|
/*
|
|
2007
1997
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2008
1998
|
* Licensed under the MIT License.
|
|
@@ -2024,7 +2014,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2024
2014
|
return null;
|
|
2025
2015
|
}
|
|
2026
2016
|
|
|
2027
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
2017
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2028
2018
|
/*
|
|
2029
2019
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2030
2020
|
* Licensed under the MIT License.
|
|
@@ -2037,7 +2027,7 @@ const ProtocolMode = {
|
|
|
2037
2027
|
OIDC: "OIDC",
|
|
2038
2028
|
};
|
|
2039
2029
|
|
|
2040
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
2030
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2041
2031
|
|
|
2042
2032
|
/*
|
|
2043
2033
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2284,7 +2274,7 @@ class AccountEntity {
|
|
|
2284
2274
|
}
|
|
2285
2275
|
}
|
|
2286
2276
|
|
|
2287
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
2277
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2288
2278
|
|
|
2289
2279
|
/*
|
|
2290
2280
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2331,7 +2321,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2331
2321
|
return null;
|
|
2332
2322
|
}
|
|
2333
2323
|
|
|
2334
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
2324
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2335
2325
|
|
|
2336
2326
|
/*
|
|
2337
2327
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2495,7 +2485,7 @@ class UrlString {
|
|
|
2495
2485
|
}
|
|
2496
2486
|
}
|
|
2497
2487
|
|
|
2498
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
2488
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2499
2489
|
|
|
2500
2490
|
/*
|
|
2501
2491
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2635,7 +2625,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2635
2625
|
return null;
|
|
2636
2626
|
}
|
|
2637
2627
|
|
|
2638
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
2628
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
2639
2629
|
|
|
2640
2630
|
/*
|
|
2641
2631
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3875,7 +3865,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3875
3865
|
}
|
|
3876
3866
|
}
|
|
3877
3867
|
|
|
3878
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
3868
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
3879
3869
|
|
|
3880
3870
|
/*
|
|
3881
3871
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3975,7 +3965,7 @@ function isOidcProtocolMode(config) {
|
|
|
3975
3965
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3976
3966
|
}
|
|
3977
3967
|
|
|
3978
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
3968
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
3979
3969
|
|
|
3980
3970
|
/*
|
|
3981
3971
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3992,7 +3982,7 @@ class ServerError extends AuthError {
|
|
|
3992
3982
|
}
|
|
3993
3983
|
}
|
|
3994
3984
|
|
|
3995
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
3985
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
3996
3986
|
|
|
3997
3987
|
/*
|
|
3998
3988
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4090,7 +4080,7 @@ class ThrottlingUtils {
|
|
|
4090
4080
|
}
|
|
4091
4081
|
}
|
|
4092
4082
|
|
|
4093
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4083
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4094
4084
|
|
|
4095
4085
|
/*
|
|
4096
4086
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4127,7 +4117,7 @@ class NetworkManager {
|
|
|
4127
4117
|
}
|
|
4128
4118
|
}
|
|
4129
4119
|
|
|
4130
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4120
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4131
4121
|
/*
|
|
4132
4122
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4133
4123
|
* Licensed under the MIT License.
|
|
@@ -4137,7 +4127,7 @@ const CcsCredentialType = {
|
|
|
4137
4127
|
UPN: "UPN",
|
|
4138
4128
|
};
|
|
4139
4129
|
|
|
4140
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4130
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4141
4131
|
/*
|
|
4142
4132
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4143
4133
|
* Licensed under the MIT License.
|
|
@@ -4184,7 +4174,7 @@ const SID = "sid";
|
|
|
4184
4174
|
const LOGIN_HINT = "login_hint";
|
|
4185
4175
|
const DOMAIN_HINT = "domain_hint";
|
|
4186
4176
|
|
|
4187
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4177
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4188
4178
|
|
|
4189
4179
|
/*
|
|
4190
4180
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4268,7 +4258,7 @@ class RequestValidator {
|
|
|
4268
4258
|
}
|
|
4269
4259
|
}
|
|
4270
4260
|
|
|
4271
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4261
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4272
4262
|
|
|
4273
4263
|
/*
|
|
4274
4264
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4652,7 +4642,7 @@ class RequestParameterBuilder {
|
|
|
4652
4642
|
}
|
|
4653
4643
|
}
|
|
4654
4644
|
|
|
4655
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4645
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4656
4646
|
/*
|
|
4657
4647
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4658
4648
|
* Licensed under the MIT License.
|
|
@@ -4664,7 +4654,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4664
4654
|
response.hasOwnProperty("jwks_uri"));
|
|
4665
4655
|
}
|
|
4666
4656
|
|
|
4667
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4657
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4668
4658
|
/*
|
|
4669
4659
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4670
4660
|
* Licensed under the MIT License.
|
|
@@ -4674,7 +4664,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4674
4664
|
response.hasOwnProperty("metadata"));
|
|
4675
4665
|
}
|
|
4676
4666
|
|
|
4677
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4667
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4678
4668
|
/*
|
|
4679
4669
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4680
4670
|
* Licensed under the MIT License.
|
|
@@ -4684,7 +4674,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4684
4674
|
response.hasOwnProperty("error_description"));
|
|
4685
4675
|
}
|
|
4686
4676
|
|
|
4687
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4677
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4688
4678
|
/*
|
|
4689
4679
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4690
4680
|
* Licensed under the MIT License.
|
|
@@ -4939,7 +4929,7 @@ const IntFields = new Set([
|
|
|
4939
4929
|
"multiMatchedRT",
|
|
4940
4930
|
]);
|
|
4941
4931
|
|
|
4942
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
4932
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
4943
4933
|
/*
|
|
4944
4934
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4945
4935
|
* Licensed under the MIT License.
|
|
@@ -4960,6 +4950,11 @@ const invoke = (callback, eventName, logger, telemetryClient, correlationId) =>
|
|
|
4960
4950
|
return (...args) => {
|
|
4961
4951
|
logger.trace(`Executing function ${eventName}`);
|
|
4962
4952
|
const inProgressEvent = telemetryClient?.startMeasurement(eventName, correlationId);
|
|
4953
|
+
if (correlationId) {
|
|
4954
|
+
// Track number of times this API is called in a single request
|
|
4955
|
+
const eventCount = eventName + "CallCount";
|
|
4956
|
+
telemetryClient?.incrementFields({ [eventCount]: 1 }, correlationId);
|
|
4957
|
+
}
|
|
4963
4958
|
try {
|
|
4964
4959
|
const result = callback(...args);
|
|
4965
4960
|
inProgressEvent?.end({
|
|
@@ -5000,6 +4995,11 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5000
4995
|
return (...args) => {
|
|
5001
4996
|
logger.trace(`Executing function ${eventName}`);
|
|
5002
4997
|
const inProgressEvent = telemetryClient?.startMeasurement(eventName, correlationId);
|
|
4998
|
+
if (correlationId) {
|
|
4999
|
+
// Track number of times this API is called in a single request
|
|
5000
|
+
const eventCount = eventName + "CallCount";
|
|
5001
|
+
telemetryClient?.incrementFields({ [eventCount]: 1 }, correlationId);
|
|
5002
|
+
}
|
|
5003
5003
|
telemetryClient?.setPreQueueTime(eventName, correlationId);
|
|
5004
5004
|
return callback(...args)
|
|
5005
5005
|
.then((response) => {
|
|
@@ -5025,7 +5025,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5025
5025
|
};
|
|
5026
5026
|
};
|
|
5027
5027
|
|
|
5028
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
5028
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
5029
5029
|
|
|
5030
5030
|
/*
|
|
5031
5031
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5134,7 +5134,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5134
5134
|
},
|
|
5135
5135
|
};
|
|
5136
5136
|
|
|
5137
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
5137
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
5138
5138
|
|
|
5139
5139
|
/*
|
|
5140
5140
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5967,7 +5967,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
5967
5967
|
};
|
|
5968
5968
|
}
|
|
5969
5969
|
|
|
5970
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
5970
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
5971
5971
|
|
|
5972
5972
|
/*
|
|
5973
5973
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5998,12 +5998,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
5998
5998
|
}
|
|
5999
5999
|
}
|
|
6000
6000
|
|
|
6001
|
-
|
|
6002
|
-
__proto__: null,
|
|
6003
|
-
createDiscoveredInstance: createDiscoveredInstance
|
|
6004
|
-
});
|
|
6005
|
-
|
|
6006
|
-
/*! @azure/msal-common v14.6.1 2024-01-23 */
|
|
6001
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6007
6002
|
|
|
6008
6003
|
/*
|
|
6009
6004
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6106,7 +6101,7 @@ class BaseClient {
|
|
|
6106
6101
|
}
|
|
6107
6102
|
}
|
|
6108
6103
|
|
|
6109
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6104
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6110
6105
|
/*
|
|
6111
6106
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6112
6107
|
* Licensed under the MIT License.
|
|
@@ -6132,7 +6127,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6132
6127
|
refreshTokenExpired: refreshTokenExpired
|
|
6133
6128
|
});
|
|
6134
6129
|
|
|
6135
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6130
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6136
6131
|
|
|
6137
6132
|
/*
|
|
6138
6133
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6219,7 +6214,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6219
6214
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6220
6215
|
}
|
|
6221
6216
|
|
|
6222
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6217
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6223
6218
|
/*
|
|
6224
6219
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6225
6220
|
* Licensed under the MIT License.
|
|
@@ -6235,7 +6230,7 @@ class CacheRecord {
|
|
|
6235
6230
|
}
|
|
6236
6231
|
}
|
|
6237
6232
|
|
|
6238
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6233
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6239
6234
|
|
|
6240
6235
|
/*
|
|
6241
6236
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6307,7 +6302,7 @@ class ProtocolUtils {
|
|
|
6307
6302
|
}
|
|
6308
6303
|
}
|
|
6309
6304
|
|
|
6310
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6305
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6311
6306
|
|
|
6312
6307
|
/*
|
|
6313
6308
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6378,7 +6373,7 @@ class PopTokenGenerator {
|
|
|
6378
6373
|
const resourceUrlComponents = resourceUrlString?.getUrlComponents();
|
|
6379
6374
|
return this.cryptoUtils.signJwt({
|
|
6380
6375
|
at: payload,
|
|
6381
|
-
ts:
|
|
6376
|
+
ts: nowSeconds(),
|
|
6382
6377
|
m: resourceRequestMethod?.toUpperCase(),
|
|
6383
6378
|
u: resourceUrlComponents?.HostNameAndPort,
|
|
6384
6379
|
nonce: shrNonce || this.cryptoUtils.createNewGuid(),
|
|
@@ -6392,7 +6387,7 @@ class PopTokenGenerator {
|
|
|
6392
6387
|
}
|
|
6393
6388
|
}
|
|
6394
6389
|
|
|
6395
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6390
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6396
6391
|
/*
|
|
6397
6392
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6398
6393
|
* Licensed under the MIT License.
|
|
@@ -6419,7 +6414,7 @@ class PopTokenGenerator {
|
|
|
6419
6414
|
}
|
|
6420
6415
|
}
|
|
6421
6416
|
|
|
6422
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6417
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6423
6418
|
|
|
6424
6419
|
/*
|
|
6425
6420
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6632,7 +6627,7 @@ class ResponseHandler {
|
|
|
6632
6627
|
? reqTimestamp + refreshIn
|
|
6633
6628
|
: undefined;
|
|
6634
6629
|
// non AAD scenarios can have empty realm
|
|
6635
|
-
cachedAccessToken = createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token, this.clientId, claimsTenantId || authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj.base64Decode, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
|
|
6630
|
+
cachedAccessToken = createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token, this.clientId, claimsTenantId || authority.tenant || "", responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj.base64Decode, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
|
|
6636
6631
|
}
|
|
6637
6632
|
// refreshToken
|
|
6638
6633
|
let cachedRefreshToken = null;
|
|
@@ -6772,7 +6767,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, idTokenClai
|
|
|
6772
6767
|
return baseAccount;
|
|
6773
6768
|
}
|
|
6774
6769
|
|
|
6775
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
6770
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
6776
6771
|
|
|
6777
6772
|
/*
|
|
6778
6773
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6815,7 +6810,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
6815
6810
|
if (!request.code) {
|
|
6816
6811
|
throw createClientAuthError(requestCannotBeMade);
|
|
6817
6812
|
}
|
|
6818
|
-
const reqTimestamp =
|
|
6813
|
+
const reqTimestamp = nowSeconds();
|
|
6819
6814
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request);
|
|
6820
6815
|
// Retrieve requestId from response headers
|
|
6821
6816
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
@@ -7177,7 +7172,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7177
7172
|
}
|
|
7178
7173
|
}
|
|
7179
7174
|
|
|
7180
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7175
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7181
7176
|
|
|
7182
7177
|
/*
|
|
7183
7178
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7194,7 +7189,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7194
7189
|
}
|
|
7195
7190
|
async acquireToken(request) {
|
|
7196
7191
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
7197
|
-
const reqTimestamp =
|
|
7192
|
+
const reqTimestamp = nowSeconds();
|
|
7198
7193
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
|
|
7199
7194
|
// Retrieve requestId from response headers
|
|
7200
7195
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
@@ -7255,7 +7250,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7255
7250
|
throw createInteractionRequiredAuthError(noTokensFound);
|
|
7256
7251
|
}
|
|
7257
7252
|
if (refreshToken.expiresOn &&
|
|
7258
|
-
|
|
7253
|
+
isTokenExpired(refreshToken.expiresOn, request.refreshTokenExpirationOffsetSeconds ||
|
|
7259
7254
|
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS)) {
|
|
7260
7255
|
throw createInteractionRequiredAuthError(refreshTokenExpired);
|
|
7261
7256
|
}
|
|
@@ -7384,7 +7379,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7384
7379
|
}
|
|
7385
7380
|
}
|
|
7386
7381
|
|
|
7387
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7382
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7388
7383
|
|
|
7389
7384
|
/*
|
|
7390
7385
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7455,14 +7450,14 @@ class SilentFlowClient extends BaseClient {
|
|
|
7455
7450
|
this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
|
|
7456
7451
|
throw createClientAuthError(tokenRefreshRequired);
|
|
7457
7452
|
}
|
|
7458
|
-
else if (
|
|
7459
|
-
|
|
7453
|
+
else if (wasClockTurnedBack(cachedAccessToken.cachedAt) ||
|
|
7454
|
+
isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {
|
|
7460
7455
|
// must refresh due to the expires_in value
|
|
7461
7456
|
this.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED, request.correlationId);
|
|
7462
7457
|
throw createClientAuthError(tokenRefreshRequired);
|
|
7463
7458
|
}
|
|
7464
7459
|
else if (cachedAccessToken.refreshOn &&
|
|
7465
|
-
|
|
7460
|
+
isTokenExpired(cachedAccessToken.refreshOn, 0)) {
|
|
7466
7461
|
// must refresh (in the background) due to the refresh_in value
|
|
7467
7462
|
lastCacheOutcome = CacheOutcome.PROACTIVELY_REFRESHED;
|
|
7468
7463
|
// don't throw ClientAuthError.createRefreshRequiredError(), return cached token instead
|
|
@@ -7515,7 +7510,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7515
7510
|
}
|
|
7516
7511
|
}
|
|
7517
7512
|
|
|
7518
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7513
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7519
7514
|
|
|
7520
7515
|
/*
|
|
7521
7516
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7530,7 +7525,7 @@ const StubbedNetworkModule = {
|
|
|
7530
7525
|
},
|
|
7531
7526
|
};
|
|
7532
7527
|
|
|
7533
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7528
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7534
7529
|
/*
|
|
7535
7530
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7536
7531
|
* Licensed under the MIT License.
|
|
@@ -7538,7 +7533,7 @@ const StubbedNetworkModule = {
|
|
|
7538
7533
|
const missingKidError = "missing_kid_error";
|
|
7539
7534
|
const missingAlgError = "missing_alg_error";
|
|
7540
7535
|
|
|
7541
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7536
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7542
7537
|
|
|
7543
7538
|
/*
|
|
7544
7539
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7563,7 +7558,7 @@ function createJoseHeaderError(code) {
|
|
|
7563
7558
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
7564
7559
|
}
|
|
7565
7560
|
|
|
7566
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7561
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7567
7562
|
|
|
7568
7563
|
/*
|
|
7569
7564
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7603,7 +7598,7 @@ class JoseHeader {
|
|
|
7603
7598
|
}
|
|
7604
7599
|
}
|
|
7605
7600
|
|
|
7606
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7601
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7607
7602
|
|
|
7608
7603
|
/*
|
|
7609
7604
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7661,7 +7656,7 @@ class AuthenticationHeaderParser {
|
|
|
7661
7656
|
}
|
|
7662
7657
|
}
|
|
7663
7658
|
|
|
7664
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7659
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7665
7660
|
|
|
7666
7661
|
/*
|
|
7667
7662
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7865,7 +7860,7 @@ class ServerTelemetryManager {
|
|
|
7865
7860
|
}
|
|
7866
7861
|
}
|
|
7867
7862
|
|
|
7868
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7863
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7869
7864
|
|
|
7870
7865
|
/*
|
|
7871
7866
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7944,7 +7939,7 @@ class StubPerformanceClient {
|
|
|
7944
7939
|
}
|
|
7945
7940
|
}
|
|
7946
7941
|
|
|
7947
|
-
/*! @azure/msal-common v14.6.1 2024-01-
|
|
7942
|
+
/*! @azure/msal-common v14.6.2-alpha.1 2024-01-30 */
|
|
7948
7943
|
|
|
7949
7944
|
/*
|
|
7950
7945
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9344,7 +9339,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
9344
9339
|
|
|
9345
9340
|
/* eslint-disable header/header */
|
|
9346
9341
|
const name = "@azure/msal-browser";
|
|
9347
|
-
const version = "3.7.1";
|
|
9342
|
+
const version = "3.7.2-alpha.1";
|
|
9348
9343
|
|
|
9349
9344
|
/*
|
|
9350
9345
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9870,6 +9865,10 @@ const S256_HASH_ALG = "SHA-256";
|
|
|
9870
9865
|
const MODULUS_LENGTH = 2048;
|
|
9871
9866
|
// Public Exponent
|
|
9872
9867
|
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
|
9868
|
+
// UUID hex digits
|
|
9869
|
+
const UUID_CHARS = "0123456789abcdef";
|
|
9870
|
+
// Array to store UINT32 random value
|
|
9871
|
+
const UINT32_ARR = new Uint32Array(1);
|
|
9873
9872
|
const keygenAlgorithmOptions = {
|
|
9874
9873
|
name: PKCS1_V15_KEYGEN_ALG,
|
|
9875
9874
|
hash: S256_HASH_ALG,
|
|
@@ -9890,7 +9889,9 @@ function validateCryptoAvailable(logger) {
|
|
|
9890
9889
|
}
|
|
9891
9890
|
/**
|
|
9892
9891
|
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
9893
|
-
* @param dataString
|
|
9892
|
+
* @param dataString {string} data string
|
|
9893
|
+
* @param performanceClient {?IPerformanceClient}
|
|
9894
|
+
* @param correlationId {?string} correlation id
|
|
9894
9895
|
*/
|
|
9895
9896
|
async function sha256Digest(dataString, performanceClient, correlationId) {
|
|
9896
9897
|
performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);
|
|
@@ -9906,11 +9907,54 @@ function getRandomValues(dataBuffer) {
|
|
|
9906
9907
|
return window.crypto.getRandomValues(dataBuffer);
|
|
9907
9908
|
}
|
|
9908
9909
|
/**
|
|
9909
|
-
*
|
|
9910
|
-
* @returns
|
|
9910
|
+
* Returns random Uint32 value.
|
|
9911
|
+
* @returns {number}
|
|
9912
|
+
*/
|
|
9913
|
+
function getRandomUint32() {
|
|
9914
|
+
window.crypto.getRandomValues(UINT32_ARR);
|
|
9915
|
+
return UINT32_ARR[0];
|
|
9916
|
+
}
|
|
9917
|
+
/**
|
|
9918
|
+
* Creates a UUID v7 from the current timestamp.
|
|
9919
|
+
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
|
9920
|
+
* @returns {number}
|
|
9911
9921
|
*/
|
|
9912
9922
|
function createNewGuid() {
|
|
9913
|
-
|
|
9923
|
+
const currentTimestamp = Date.now();
|
|
9924
|
+
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
|
|
9925
|
+
// Result byte array
|
|
9926
|
+
const bytes = new Uint8Array(16);
|
|
9927
|
+
// A 12-bit `rand_a` field value
|
|
9928
|
+
const randA = Math.trunc(baseRand / 2 ** 30);
|
|
9929
|
+
// The higher 30 bits of 62-bit `rand_b` field value
|
|
9930
|
+
const randBHi = baseRand & (2 ** 30 - 1);
|
|
9931
|
+
// The lower 32 bits of 62-bit `rand_b` field value
|
|
9932
|
+
const randBLo = getRandomUint32();
|
|
9933
|
+
bytes[0] = currentTimestamp / 2 ** 40;
|
|
9934
|
+
bytes[1] = currentTimestamp / 2 ** 32;
|
|
9935
|
+
bytes[2] = currentTimestamp / 2 ** 24;
|
|
9936
|
+
bytes[3] = currentTimestamp / 2 ** 16;
|
|
9937
|
+
bytes[4] = currentTimestamp / 2 ** 8;
|
|
9938
|
+
bytes[5] = currentTimestamp;
|
|
9939
|
+
bytes[6] = 0x70 | (randA >>> 8);
|
|
9940
|
+
bytes[7] = randA;
|
|
9941
|
+
bytes[8] = 0x80 | (randBHi >>> 24);
|
|
9942
|
+
bytes[9] = randBHi >>> 16;
|
|
9943
|
+
bytes[10] = randBHi >>> 8;
|
|
9944
|
+
bytes[11] = randBHi;
|
|
9945
|
+
bytes[12] = randBLo >>> 24;
|
|
9946
|
+
bytes[13] = randBLo >>> 16;
|
|
9947
|
+
bytes[14] = randBLo >>> 8;
|
|
9948
|
+
bytes[15] = randBLo;
|
|
9949
|
+
let text = "";
|
|
9950
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
9951
|
+
text += UUID_CHARS.charAt(bytes[i] >>> 4);
|
|
9952
|
+
text += UUID_CHARS.charAt(bytes[i] & 0xf);
|
|
9953
|
+
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
|
9954
|
+
text += "-";
|
|
9955
|
+
}
|
|
9956
|
+
}
|
|
9957
|
+
return text;
|
|
9914
9958
|
}
|
|
9915
9959
|
/**
|
|
9916
9960
|
* Generates a keypair based on current keygen algorithm config.
|
|
@@ -11892,6 +11936,7 @@ const EventType = {
|
|
|
11892
11936
|
INITIALIZE_END: "msal:initializeEnd",
|
|
11893
11937
|
ACCOUNT_ADDED: "msal:accountAdded",
|
|
11894
11938
|
ACCOUNT_REMOVED: "msal:accountRemoved",
|
|
11939
|
+
ACTIVE_ACCOUNT_CHANGED: "msal:activeAccountChanged",
|
|
11895
11940
|
LOGIN_START: "msal:loginStart",
|
|
11896
11941
|
LOGIN_SUCCESS: "msal:loginSuccess",
|
|
11897
11942
|
LOGIN_FAILURE: "msal:loginFailure",
|
|
@@ -12009,6 +12054,12 @@ class EventHandler {
|
|
|
12009
12054
|
*/
|
|
12010
12055
|
handleAccountCacheChange(e) {
|
|
12011
12056
|
try {
|
|
12057
|
+
// Handle active account filter change
|
|
12058
|
+
if (e.key?.includes(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS)) {
|
|
12059
|
+
// This event has no payload, it only signals cross-tab app instances that the results of calling getActiveAccount() will have changed
|
|
12060
|
+
this.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
|
|
12061
|
+
}
|
|
12062
|
+
// Handle account object change
|
|
12012
12063
|
const cacheValue = e.newValue || e.oldValue;
|
|
12013
12064
|
if (!cacheValue) {
|
|
12014
12065
|
return;
|
|
@@ -12084,12 +12135,9 @@ class BaseInteractionClient {
|
|
|
12084
12135
|
* Initializer function for all request APIs
|
|
12085
12136
|
* @param request
|
|
12086
12137
|
*/
|
|
12087
|
-
async initializeBaseRequest(request
|
|
12138
|
+
async initializeBaseRequest(request) {
|
|
12088
12139
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, this.correlationId);
|
|
12089
12140
|
const authority = request.authority || this.config.auth.authority;
|
|
12090
|
-
if (account) {
|
|
12091
|
-
await this.validateRequestAuthority(authority, account);
|
|
12092
|
-
}
|
|
12093
12141
|
const scopes = [...((request && request.scopes) || [])];
|
|
12094
12142
|
const validatedRequest = {
|
|
12095
12143
|
...request,
|
|
@@ -12138,16 +12186,6 @@ class BaseInteractionClient {
|
|
|
12138
12186
|
getCurrentUri();
|
|
12139
12187
|
return UrlString.getAbsoluteUrl(redirectUri, getCurrentUri());
|
|
12140
12188
|
}
|
|
12141
|
-
/*
|
|
12142
|
-
* If authority provided in the request does not match environment/authority specified
|
|
12143
|
-
* in the account or MSAL config, we throw an error.
|
|
12144
|
-
*/
|
|
12145
|
-
async validateRequestAuthority(authority, account) {
|
|
12146
|
-
const discoveredAuthority = await this.getDiscoveredAuthority(authority);
|
|
12147
|
-
if (!discoveredAuthority.isAlias(account.environment)) {
|
|
12148
|
-
throw createClientConfigurationError(authorityMismatch);
|
|
12149
|
-
}
|
|
12150
|
-
}
|
|
12151
12189
|
/**
|
|
12152
12190
|
*
|
|
12153
12191
|
* @param apiId
|
|
@@ -12169,19 +12207,30 @@ class BaseInteractionClient {
|
|
|
12169
12207
|
/**
|
|
12170
12208
|
* Used to get a discovered version of the default authority.
|
|
12171
12209
|
* @param requestAuthority
|
|
12210
|
+
* @param requestAzureCloudOptions
|
|
12211
|
+
* @param account
|
|
12172
12212
|
*/
|
|
12173
|
-
async getDiscoveredAuthority(requestAuthority) {
|
|
12174
|
-
this.
|
|
12213
|
+
async getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions, account) {
|
|
12214
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
|
|
12175
12215
|
const authorityOptions = {
|
|
12176
12216
|
protocolMode: this.config.auth.protocolMode,
|
|
12177
12217
|
OIDCOptions: this.config.auth.OIDCOptions,
|
|
12178
12218
|
knownAuthorities: this.config.auth.knownAuthorities,
|
|
12179
12219
|
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
12180
12220
|
authorityMetadata: this.config.auth.authorityMetadata,
|
|
12221
|
+
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
12181
12222
|
};
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12223
|
+
// build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority
|
|
12224
|
+
const userAuthority = requestAuthority
|
|
12225
|
+
? requestAuthority
|
|
12226
|
+
: this.config.auth.authority;
|
|
12227
|
+
// fall back to the authority from config
|
|
12228
|
+
const builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
|
|
12229
|
+
const discoveredAuthority = await invokeAsync(createDiscoveredInstance, PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.logger, this.performanceClient, this.correlationId)(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.correlationId, this.performanceClient);
|
|
12230
|
+
if (account && !discoveredAuthority.isAlias(account.environment)) {
|
|
12231
|
+
throw createClientConfigurationError(authorityMismatch);
|
|
12232
|
+
}
|
|
12233
|
+
return discoveredAuthority;
|
|
12185
12234
|
}
|
|
12186
12235
|
}
|
|
12187
12236
|
|
|
@@ -12354,10 +12403,10 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
12354
12403
|
* @param serverTelemetryManager
|
|
12355
12404
|
* @param authorityUrl
|
|
12356
12405
|
*/
|
|
12357
|
-
async createAuthCodeClient(serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
|
|
12406
|
+
async createAuthCodeClient(serverTelemetryManager, authorityUrl, requestAzureCloudOptions, account) {
|
|
12358
12407
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
|
|
12359
12408
|
// Create auth module.
|
|
12360
|
-
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);
|
|
12409
|
+
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, requestAzureCloudOptions, account);
|
|
12361
12410
|
return new AuthorizationCodeClient(clientConfig, this.performanceClient);
|
|
12362
12411
|
}
|
|
12363
12412
|
/**
|
|
@@ -12366,9 +12415,9 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
12366
12415
|
* @param requestAuthority
|
|
12367
12416
|
* @param requestCorrelationId
|
|
12368
12417
|
*/
|
|
12369
|
-
async getClientConfiguration(serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
|
|
12418
|
+
async getClientConfiguration(serverTelemetryManager, requestAuthority, requestAzureCloudOptions, account) {
|
|
12370
12419
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
|
|
12371
|
-
const discoveredAuthority = await invokeAsync(this.getDiscoveredAuthority.bind(this), PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, this.correlationId)(requestAuthority, requestAzureCloudOptions);
|
|
12420
|
+
const discoveredAuthority = await invokeAsync(this.getDiscoveredAuthority.bind(this), PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, this.correlationId)(requestAuthority, requestAzureCloudOptions, account);
|
|
12372
12421
|
const logger = this.config.system.loggerOptions;
|
|
12373
12422
|
return {
|
|
12374
12423
|
authOptions: {
|
|
@@ -12402,29 +12451,6 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
12402
12451
|
telemetry: this.config.telemetry,
|
|
12403
12452
|
};
|
|
12404
12453
|
}
|
|
12405
|
-
/**
|
|
12406
|
-
* Used to get a discovered version of the default authority.
|
|
12407
|
-
* @param requestAuthority
|
|
12408
|
-
* @param requestCorrelationId
|
|
12409
|
-
*/
|
|
12410
|
-
async getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions) {
|
|
12411
|
-
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
|
|
12412
|
-
const authorityOptions = {
|
|
12413
|
-
protocolMode: this.config.auth.protocolMode,
|
|
12414
|
-
OIDCOptions: this.config.auth.OIDCOptions,
|
|
12415
|
-
knownAuthorities: this.config.auth.knownAuthorities,
|
|
12416
|
-
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
12417
|
-
authorityMetadata: this.config.auth.authorityMetadata,
|
|
12418
|
-
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
12419
|
-
};
|
|
12420
|
-
// build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority
|
|
12421
|
-
const userAuthority = requestAuthority
|
|
12422
|
-
? requestAuthority
|
|
12423
|
-
: this.config.auth.authority;
|
|
12424
|
-
// fall back to the authority from config
|
|
12425
|
-
const builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
|
|
12426
|
-
return invokeAsync(createDiscoveredInstance.bind(AuthorityFactory), PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.logger, this.performanceClient, this.correlationId)(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.correlationId, this.performanceClient);
|
|
12427
|
-
}
|
|
12428
12454
|
/**
|
|
12429
12455
|
* Helper to initialize required request parameters for interactive APIs and ssoSilent()
|
|
12430
12456
|
* @param request
|
|
@@ -12556,7 +12582,7 @@ class SilentCacheClient extends StandardInteractionClient {
|
|
|
12556
12582
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
|
|
12557
12583
|
// Telemetry manager only used to increment cacheHits here
|
|
12558
12584
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
|
|
12559
|
-
const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
|
|
12585
|
+
const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);
|
|
12560
12586
|
this.logger.verbose("Silent auth client created");
|
|
12561
12587
|
try {
|
|
12562
12588
|
const response = await invokeAsync(silentAuthClient.acquireCachedToken.bind(silentAuthClient), PerformanceEvents.SilentFlowClientAcquireCachedToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);
|
|
@@ -12588,14 +12614,14 @@ class SilentCacheClient extends StandardInteractionClient {
|
|
|
12588
12614
|
* @param serverTelemetryManager
|
|
12589
12615
|
* @param authorityUrl
|
|
12590
12616
|
*/
|
|
12591
|
-
async createSilentFlowClient(serverTelemetryManager, authorityUrl, azureCloudOptions) {
|
|
12617
|
+
async createSilentFlowClient(serverTelemetryManager, authorityUrl, azureCloudOptions, account) {
|
|
12592
12618
|
// Create auth module.
|
|
12593
|
-
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions);
|
|
12619
|
+
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions, account);
|
|
12594
12620
|
return new SilentFlowClient(clientConfig, this.performanceClient);
|
|
12595
12621
|
}
|
|
12596
12622
|
async initializeSilentRequest(request, account) {
|
|
12597
12623
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);
|
|
12598
|
-
const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)(request
|
|
12624
|
+
const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)(request);
|
|
12599
12625
|
return {
|
|
12600
12626
|
...request,
|
|
12601
12627
|
...baseRequest,
|
|
@@ -12631,7 +12657,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
12631
12657
|
this.logger.trace("NativeInteractionClient - acquireToken called.");
|
|
12632
12658
|
// start the perf measurement
|
|
12633
12659
|
const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
|
|
12634
|
-
const reqTimestamp =
|
|
12660
|
+
const reqTimestamp = nowSeconds();
|
|
12635
12661
|
// initialize native request
|
|
12636
12662
|
const nativeRequest = await this.initializeNativeRequest(request);
|
|
12637
12663
|
// check if the tokens can be retrieved from internal cache
|
|
@@ -12780,7 +12806,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
12780
12806
|
method: NativeExtensionMethod.GetToken,
|
|
12781
12807
|
request: request,
|
|
12782
12808
|
};
|
|
12783
|
-
const reqTimestamp =
|
|
12809
|
+
const reqTimestamp = nowSeconds();
|
|
12784
12810
|
try {
|
|
12785
12811
|
this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");
|
|
12786
12812
|
const response = await this.nativeMessageHandler.sendMessage(messageBody);
|
|
@@ -13051,7 +13077,8 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
13051
13077
|
this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
|
|
13052
13078
|
const authority = request.authority || this.config.auth.authority;
|
|
13053
13079
|
if (request.account) {
|
|
13054
|
-
|
|
13080
|
+
// validate authority
|
|
13081
|
+
await this.getDiscoveredAuthority(authority, request.azureCloudOptions, request.account);
|
|
13055
13082
|
}
|
|
13056
13083
|
const canonicalAuthority = new UrlString(authority);
|
|
13057
13084
|
canonicalAuthority.validateAsUri();
|
|
@@ -13616,7 +13643,7 @@ class PopupClient extends StandardInteractionClient {
|
|
|
13616
13643
|
// Create auth code request and generate PKCE params
|
|
13617
13644
|
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);
|
|
13618
13645
|
// Initialize the client
|
|
13619
|
-
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
|
|
13646
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions, validRequest.account);
|
|
13620
13647
|
const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
|
|
13621
13648
|
// Start measurement for server calls with native brokering enabled
|
|
13622
13649
|
let fetchNativeAccountIdMeasurement;
|
|
@@ -13697,7 +13724,8 @@ class PopupClient extends StandardInteractionClient {
|
|
|
13697
13724
|
// Clear cache on logout
|
|
13698
13725
|
await this.clearCacheOnLogout(validRequest.account);
|
|
13699
13726
|
// Initialize the client
|
|
13700
|
-
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, requestAuthority
|
|
13727
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, requestAuthority, undefined, // AzureCloudOptions
|
|
13728
|
+
validRequest.account || undefined);
|
|
13701
13729
|
try {
|
|
13702
13730
|
authClient.authority.endSessionEndpoint;
|
|
13703
13731
|
}
|
|
@@ -14129,7 +14157,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
14129
14157
|
// Create auth code request and generate PKCE params
|
|
14130
14158
|
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);
|
|
14131
14159
|
// Initialize the client
|
|
14132
|
-
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
|
|
14160
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions, validRequest.account);
|
|
14133
14161
|
// Create redirect interaction handler.
|
|
14134
14162
|
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
14135
14163
|
// Create acquire token url.
|
|
@@ -14347,7 +14375,8 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
14347
14375
|
timeout: this.config.system.redirectNavigationTimeout,
|
|
14348
14376
|
noHistory: false,
|
|
14349
14377
|
};
|
|
14350
|
-
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, logoutRequest && logoutRequest.authority
|
|
14378
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, logoutRequest && logoutRequest.authority, undefined, // AzureCloudOptions
|
|
14379
|
+
(logoutRequest && logoutRequest.account) || undefined);
|
|
14351
14380
|
if (authClient.authority.protocolMode === ProtocolMode.OIDC) {
|
|
14352
14381
|
try {
|
|
14353
14382
|
authClient.authority.endSessionEndpoint;
|
|
@@ -14583,7 +14612,7 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
14583
14612
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
14584
14613
|
try {
|
|
14585
14614
|
// Initialize the client
|
|
14586
|
-
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
|
|
14615
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);
|
|
14587
14616
|
return await invokeAsync(this.silentTokenHelper.bind(this), PerformanceEvents.SilentIframeClientTokenHelper, this.logger, this.performanceClient, request.correlationId)(authClient, silentRequest);
|
|
14588
14617
|
}
|
|
14589
14618
|
catch (e) {
|
|
@@ -14654,7 +14683,7 @@ class SilentRefreshClient extends StandardInteractionClient {
|
|
|
14654
14683
|
*/
|
|
14655
14684
|
async acquireToken(request) {
|
|
14656
14685
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
|
|
14657
|
-
const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request
|
|
14686
|
+
const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request);
|
|
14658
14687
|
const silentRequest = {
|
|
14659
14688
|
...request,
|
|
14660
14689
|
...baseRequest,
|
|
@@ -14664,7 +14693,7 @@ class SilentRefreshClient extends StandardInteractionClient {
|
|
|
14664
14693
|
silentRequest.redirectUri = this.getRedirectUri(request.redirectUri);
|
|
14665
14694
|
}
|
|
14666
14695
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
|
|
14667
|
-
const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
|
|
14696
|
+
const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);
|
|
14668
14697
|
// Send request to renew token. Auth module will throw errors if token cannot be renewed.
|
|
14669
14698
|
return invokeAsync(refreshTokenClient.acquireTokenByRefreshToken.bind(refreshTokenClient), PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, this.logger, this.performanceClient, request.correlationId)(silentRequest).catch((e) => {
|
|
14670
14699
|
e.setCorrelationId(this.correlationId);
|
|
@@ -14684,9 +14713,9 @@ class SilentRefreshClient extends StandardInteractionClient {
|
|
|
14684
14713
|
* @param serverTelemetryManager
|
|
14685
14714
|
* @param authorityUrl
|
|
14686
14715
|
*/
|
|
14687
|
-
async createRefreshTokenClient(serverTelemetryManager, authorityUrl, azureCloudOptions) {
|
|
14716
|
+
async createRefreshTokenClient(serverTelemetryManager, authorityUrl, azureCloudOptions, account) {
|
|
14688
14717
|
// Create auth module.
|
|
14689
|
-
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions);
|
|
14718
|
+
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions, account);
|
|
14690
14719
|
return new RefreshTokenClient(clientConfig, this.performanceClient);
|
|
14691
14720
|
}
|
|
14692
14721
|
}
|
|
@@ -14953,7 +14982,7 @@ class SilentAuthCodeClient extends StandardInteractionClient {
|
|
|
14953
14982
|
code: request.code,
|
|
14954
14983
|
};
|
|
14955
14984
|
// Initialize the client
|
|
14956
|
-
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority);
|
|
14985
|
+
const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);
|
|
14957
14986
|
const authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
|
|
14958
14987
|
this.logger.verbose("Auth code client created");
|
|
14959
14988
|
// Create silent handler
|
|
@@ -17989,7 +18018,7 @@ class NestedAppAuthController {
|
|
|
17989
18018
|
atPopupMeasurement?.add({ nestedAppAuthRequest: true });
|
|
17990
18019
|
try {
|
|
17991
18020
|
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(request);
|
|
17992
|
-
const reqTimestamp =
|
|
18021
|
+
const reqTimestamp = nowSeconds();
|
|
17993
18022
|
const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
|
|
17994
18023
|
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
|
|
17995
18024
|
this.operatingContext.setActiveAccount(result.account);
|
|
@@ -18026,7 +18055,7 @@ class NestedAppAuthController {
|
|
|
18026
18055
|
});
|
|
18027
18056
|
try {
|
|
18028
18057
|
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(request);
|
|
18029
|
-
const reqTimestamp =
|
|
18058
|
+
const reqTimestamp = nowSeconds();
|
|
18030
18059
|
const response = await this.bridgeProxy.getTokenSilent(naaRequest);
|
|
18031
18060
|
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
|
|
18032
18061
|
this.operatingContext.setActiveAccount(result.account);
|