@azure/msal-browser 3.8.1-beta.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/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.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +18 -6
- 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.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +14 -11
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/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.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +3 -2
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.d.ts +5 -0
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +10 -2
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +252 -226
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +252 -226
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +58 -58
- package/package.json +2 -2
- package/src/interaction_client/NativeInteractionClient.ts +28 -9
- package/src/interaction_client/SilentIframeClient.ts +15 -16
- package/src/packageMetadata.ts +1 -1
- package/src/telemetry/BrowserPerformanceClient.ts +2 -1
- package/src/utils/BrowserUtils.ts +9 -0
package/lib/msal-browser.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.10.0 2024-02-17 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
/*! @azure/msal-common v14.
|
|
5
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
300
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
317
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
366
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
464
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
716
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
749
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
940
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
941
941
|
/* eslint-disable header/header */
|
|
942
942
|
const name$1 = "@azure/msal-common";
|
|
943
|
-
const version$1 = "14.
|
|
943
|
+
const version$1 = "14.7.1";
|
|
944
944
|
|
|
945
|
-
/*! @azure/msal-common v14.
|
|
945
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
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.
|
|
965
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
966
966
|
|
|
967
967
|
/*
|
|
968
968
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1023,7 +1023,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
|
-
/*! @azure/msal-common v14.
|
|
1026
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1027
1027
|
/*
|
|
1028
1028
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1029
1029
|
* Licensed under the MIT License.
|
|
@@ -1060,7 +1060,7 @@ function wasClockTurnedBack(cachedAt) {
|
|
|
1060
1060
|
return cachedAtSec > nowSeconds();
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
|
-
/*! @azure/msal-common v14.
|
|
1063
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1064
1064
|
|
|
1065
1065
|
/*
|
|
1066
1066
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1387,7 +1387,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
1387
1387
|
return metadata.expiresAt <= nowSeconds();
|
|
1388
1388
|
}
|
|
1389
1389
|
|
|
1390
|
-
/*! @azure/msal-common v14.
|
|
1390
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1391
1391
|
/*
|
|
1392
1392
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1393
1393
|
* Licensed under the MIT License.
|
|
@@ -1441,7 +1441,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1441
1441
|
urlParseError: urlParseError
|
|
1442
1442
|
});
|
|
1443
1443
|
|
|
1444
|
-
/*! @azure/msal-common v14.
|
|
1444
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1445
1445
|
|
|
1446
1446
|
/*
|
|
1447
1447
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1579,7 +1579,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1579
1579
|
return new ClientConfigurationError(errorCode);
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
-
/*! @azure/msal-common v14.
|
|
1582
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1583
1583
|
/*
|
|
1584
1584
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1585
1585
|
* Licensed under the MIT License.
|
|
@@ -1676,7 +1676,7 @@ class StringUtils {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
1678
|
|
|
1679
|
-
/*! @azure/msal-common v14.
|
|
1679
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1680
1680
|
|
|
1681
1681
|
/*
|
|
1682
1682
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1876,7 +1876,7 @@ class ScopeSet {
|
|
|
1876
1876
|
}
|
|
1877
1877
|
}
|
|
1878
1878
|
|
|
1879
|
-
/*! @azure/msal-common v14.
|
|
1879
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1880
1880
|
|
|
1881
1881
|
/*
|
|
1882
1882
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1916,7 +1916,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
1916
1916
|
};
|
|
1917
1917
|
}
|
|
1918
1918
|
|
|
1919
|
-
/*! @azure/msal-common v14.
|
|
1919
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1920
1920
|
/*
|
|
1921
1921
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1922
1922
|
* Licensed under the MIT License.
|
|
@@ -1954,7 +1954,7 @@ function buildTenantProfileFromIdTokenClaims(homeAccountId, idTokenClaims) {
|
|
|
1954
1954
|
* @param idTokenClaims
|
|
1955
1955
|
* @returns
|
|
1956
1956
|
*/
|
|
1957
|
-
function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenClaims) {
|
|
1957
|
+
function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenClaims, idTokenSecret) {
|
|
1958
1958
|
let updatedAccountInfo = baseAccountInfo;
|
|
1959
1959
|
// Tenant Profile overrides passed in account info
|
|
1960
1960
|
if (tenantProfile) {
|
|
@@ -1971,13 +1971,14 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
1971
1971
|
...updatedAccountInfo,
|
|
1972
1972
|
...claimsSourcedTenantProfile,
|
|
1973
1973
|
idTokenClaims: idTokenClaims,
|
|
1974
|
+
idToken: idTokenSecret,
|
|
1974
1975
|
};
|
|
1975
1976
|
return updatedAccountInfo;
|
|
1976
1977
|
}
|
|
1977
1978
|
return updatedAccountInfo;
|
|
1978
1979
|
}
|
|
1979
1980
|
|
|
1980
|
-
/*! @azure/msal-common v14.
|
|
1981
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1981
1982
|
/*
|
|
1982
1983
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1983
1984
|
* Licensed under the MIT License.
|
|
@@ -1992,7 +1993,7 @@ const AuthorityType = {
|
|
|
1992
1993
|
Ciam: 3,
|
|
1993
1994
|
};
|
|
1994
1995
|
|
|
1995
|
-
/*! @azure/msal-common v14.
|
|
1996
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1996
1997
|
/*
|
|
1997
1998
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1998
1999
|
* Licensed under the MIT License.
|
|
@@ -2014,7 +2015,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2014
2015
|
return null;
|
|
2015
2016
|
}
|
|
2016
2017
|
|
|
2017
|
-
/*! @azure/msal-common v14.
|
|
2018
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2018
2019
|
/*
|
|
2019
2020
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2020
2021
|
* Licensed under the MIT License.
|
|
@@ -2027,7 +2028,7 @@ const ProtocolMode = {
|
|
|
2027
2028
|
OIDC: "OIDC",
|
|
2028
2029
|
};
|
|
2029
2030
|
|
|
2030
|
-
/*! @azure/msal-common v14.
|
|
2031
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2031
2032
|
|
|
2032
2033
|
/*
|
|
2033
2034
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2274,7 +2275,7 @@ class AccountEntity {
|
|
|
2274
2275
|
}
|
|
2275
2276
|
}
|
|
2276
2277
|
|
|
2277
|
-
/*! @azure/msal-common v14.
|
|
2278
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2278
2279
|
|
|
2279
2280
|
/*
|
|
2280
2281
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2321,7 +2322,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2321
2322
|
return null;
|
|
2322
2323
|
}
|
|
2323
2324
|
|
|
2324
|
-
/*! @azure/msal-common v14.
|
|
2325
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2325
2326
|
|
|
2326
2327
|
/*
|
|
2327
2328
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2485,7 +2486,7 @@ class UrlString {
|
|
|
2485
2486
|
}
|
|
2486
2487
|
}
|
|
2487
2488
|
|
|
2488
|
-
/*! @azure/msal-common v14.
|
|
2489
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2489
2490
|
|
|
2490
2491
|
/*
|
|
2491
2492
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2625,7 +2626,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2625
2626
|
return null;
|
|
2626
2627
|
}
|
|
2627
2628
|
|
|
2628
|
-
/*! @azure/msal-common v14.
|
|
2629
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2629
2630
|
|
|
2630
2631
|
/*
|
|
2631
2632
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2716,7 +2717,7 @@ class CacheManager {
|
|
|
2716
2717
|
}
|
|
2717
2718
|
}
|
|
2718
2719
|
// Expand tenant profile into account info based on matching tenant profile and if available matching ID token claims
|
|
2719
|
-
tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims);
|
|
2720
|
+
tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims, idToken?.secret);
|
|
2720
2721
|
return tenantedAccountInfo;
|
|
2721
2722
|
}
|
|
2722
2723
|
getTenantProfilesFromAccountEntity(accountEntity, targetTenantId, tenantProfileFilter) {
|
|
@@ -3865,7 +3866,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3865
3866
|
}
|
|
3866
3867
|
}
|
|
3867
3868
|
|
|
3868
|
-
/*! @azure/msal-common v14.
|
|
3869
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
3869
3870
|
|
|
3870
3871
|
/*
|
|
3871
3872
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3965,7 +3966,7 @@ function isOidcProtocolMode(config) {
|
|
|
3965
3966
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3966
3967
|
}
|
|
3967
3968
|
|
|
3968
|
-
/*! @azure/msal-common v14.
|
|
3969
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
3969
3970
|
|
|
3970
3971
|
/*
|
|
3971
3972
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3982,7 +3983,7 @@ class ServerError extends AuthError {
|
|
|
3982
3983
|
}
|
|
3983
3984
|
}
|
|
3984
3985
|
|
|
3985
|
-
/*! @azure/msal-common v14.
|
|
3986
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
3986
3987
|
|
|
3987
3988
|
/*
|
|
3988
3989
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4080,7 +4081,7 @@ class ThrottlingUtils {
|
|
|
4080
4081
|
}
|
|
4081
4082
|
}
|
|
4082
4083
|
|
|
4083
|
-
/*! @azure/msal-common v14.
|
|
4084
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4084
4085
|
|
|
4085
4086
|
/*
|
|
4086
4087
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4117,7 +4118,7 @@ class NetworkManager {
|
|
|
4117
4118
|
}
|
|
4118
4119
|
}
|
|
4119
4120
|
|
|
4120
|
-
/*! @azure/msal-common v14.
|
|
4121
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4121
4122
|
/*
|
|
4122
4123
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4123
4124
|
* Licensed under the MIT License.
|
|
@@ -4127,7 +4128,7 @@ const CcsCredentialType = {
|
|
|
4127
4128
|
UPN: "UPN",
|
|
4128
4129
|
};
|
|
4129
4130
|
|
|
4130
|
-
/*! @azure/msal-common v14.
|
|
4131
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4131
4132
|
/*
|
|
4132
4133
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4133
4134
|
* Licensed under the MIT License.
|
|
@@ -4174,7 +4175,7 @@ const SID = "sid";
|
|
|
4174
4175
|
const LOGIN_HINT = "login_hint";
|
|
4175
4176
|
const DOMAIN_HINT = "domain_hint";
|
|
4176
4177
|
|
|
4177
|
-
/*! @azure/msal-common v14.
|
|
4178
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4178
4179
|
|
|
4179
4180
|
/*
|
|
4180
4181
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4258,7 +4259,7 @@ class RequestValidator {
|
|
|
4258
4259
|
}
|
|
4259
4260
|
}
|
|
4260
4261
|
|
|
4261
|
-
/*! @azure/msal-common v14.
|
|
4262
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4262
4263
|
|
|
4263
4264
|
/*
|
|
4264
4265
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4642,7 +4643,7 @@ class RequestParameterBuilder {
|
|
|
4642
4643
|
}
|
|
4643
4644
|
}
|
|
4644
4645
|
|
|
4645
|
-
/*! @azure/msal-common v14.
|
|
4646
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4646
4647
|
/*
|
|
4647
4648
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4648
4649
|
* Licensed under the MIT License.
|
|
@@ -4654,7 +4655,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4654
4655
|
response.hasOwnProperty("jwks_uri"));
|
|
4655
4656
|
}
|
|
4656
4657
|
|
|
4657
|
-
/*! @azure/msal-common v14.
|
|
4658
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4658
4659
|
/*
|
|
4659
4660
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4660
4661
|
* Licensed under the MIT License.
|
|
@@ -4664,7 +4665,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4664
4665
|
response.hasOwnProperty("metadata"));
|
|
4665
4666
|
}
|
|
4666
4667
|
|
|
4667
|
-
/*! @azure/msal-common v14.
|
|
4668
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4668
4669
|
/*
|
|
4669
4670
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4670
4671
|
* Licensed under the MIT License.
|
|
@@ -4674,7 +4675,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4674
4675
|
response.hasOwnProperty("error_description"));
|
|
4675
4676
|
}
|
|
4676
4677
|
|
|
4677
|
-
/*! @azure/msal-common v14.
|
|
4678
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4678
4679
|
/*
|
|
4679
4680
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4680
4681
|
* Licensed under the MIT License.
|
|
@@ -4935,7 +4936,7 @@ const IntFields = new Set([
|
|
|
4935
4936
|
"multiMatchedRT",
|
|
4936
4937
|
]);
|
|
4937
4938
|
|
|
4938
|
-
/*! @azure/msal-common v14.
|
|
4939
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4939
4940
|
/*
|
|
4940
4941
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4941
4942
|
* Licensed under the MIT License.
|
|
@@ -5031,7 +5032,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5031
5032
|
};
|
|
5032
5033
|
};
|
|
5033
5034
|
|
|
5034
|
-
/*! @azure/msal-common v14.
|
|
5035
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
5035
5036
|
|
|
5036
5037
|
/*
|
|
5037
5038
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5140,7 +5141,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5140
5141
|
},
|
|
5141
5142
|
};
|
|
5142
5143
|
|
|
5143
|
-
/*! @azure/msal-common v14.
|
|
5144
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
5144
5145
|
|
|
5145
5146
|
/*
|
|
5146
5147
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5937,8 +5938,10 @@ function getTenantFromAuthorityString(authority) {
|
|
|
5937
5938
|
* AAD Authority - domain/tenantId -> Credentials are cached with realm = tenantId
|
|
5938
5939
|
* B2C Authority - domain/{tenantId}?/.../policy -> Credentials are cached with realm = policy
|
|
5939
5940
|
* tenantId is downcased because B2C policies can have mixed case but tfp claim is downcased
|
|
5941
|
+
*
|
|
5942
|
+
* Note that we may not have any path segments in certain OIDC scenarios.
|
|
5940
5943
|
*/
|
|
5941
|
-
const tenantId = authorityUrlComponents.PathSegments.slice(-1)[0]
|
|
5944
|
+
const tenantId = authorityUrlComponents.PathSegments.slice(-1)[0]?.toLowerCase();
|
|
5942
5945
|
switch (tenantId) {
|
|
5943
5946
|
case AADAuthorityConstants.COMMON:
|
|
5944
5947
|
case AADAuthorityConstants.ORGANIZATIONS:
|
|
@@ -5973,7 +5976,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
5973
5976
|
};
|
|
5974
5977
|
}
|
|
5975
5978
|
|
|
5976
|
-
/*! @azure/msal-common v14.
|
|
5979
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
5977
5980
|
|
|
5978
5981
|
/*
|
|
5979
5982
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6004,7 +6007,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6004
6007
|
}
|
|
6005
6008
|
}
|
|
6006
6009
|
|
|
6007
|
-
/*! @azure/msal-common v14.
|
|
6010
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6008
6011
|
|
|
6009
6012
|
/*
|
|
6010
6013
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6107,7 +6110,7 @@ class BaseClient {
|
|
|
6107
6110
|
}
|
|
6108
6111
|
}
|
|
6109
6112
|
|
|
6110
|
-
/*! @azure/msal-common v14.
|
|
6113
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6111
6114
|
/*
|
|
6112
6115
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6113
6116
|
* Licensed under the MIT License.
|
|
@@ -6133,7 +6136,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6133
6136
|
refreshTokenExpired: refreshTokenExpired
|
|
6134
6137
|
});
|
|
6135
6138
|
|
|
6136
|
-
/*! @azure/msal-common v14.
|
|
6139
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6137
6140
|
|
|
6138
6141
|
/*
|
|
6139
6142
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6220,7 +6223,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6220
6223
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6221
6224
|
}
|
|
6222
6225
|
|
|
6223
|
-
/*! @azure/msal-common v14.
|
|
6226
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6224
6227
|
/*
|
|
6225
6228
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6226
6229
|
* Licensed under the MIT License.
|
|
@@ -6236,7 +6239,7 @@ class CacheRecord {
|
|
|
6236
6239
|
}
|
|
6237
6240
|
}
|
|
6238
6241
|
|
|
6239
|
-
/*! @azure/msal-common v14.
|
|
6242
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6240
6243
|
|
|
6241
6244
|
/*
|
|
6242
6245
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6308,7 +6311,7 @@ class ProtocolUtils {
|
|
|
6308
6311
|
}
|
|
6309
6312
|
}
|
|
6310
6313
|
|
|
6311
|
-
/*! @azure/msal-common v14.
|
|
6314
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6312
6315
|
|
|
6313
6316
|
/*
|
|
6314
6317
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6393,7 +6396,7 @@ class PopTokenGenerator {
|
|
|
6393
6396
|
}
|
|
6394
6397
|
}
|
|
6395
6398
|
|
|
6396
|
-
/*! @azure/msal-common v14.
|
|
6399
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6397
6400
|
/*
|
|
6398
6401
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6399
6402
|
* Licensed under the MIT License.
|
|
@@ -6420,7 +6423,7 @@ class PopTokenGenerator {
|
|
|
6420
6423
|
}
|
|
6421
6424
|
}
|
|
6422
6425
|
|
|
6423
|
-
/*! @azure/msal-common v14.
|
|
6426
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6424
6427
|
|
|
6425
6428
|
/*
|
|
6426
6429
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6710,7 +6713,7 @@ class ResponseHandler {
|
|
|
6710
6713
|
}
|
|
6711
6714
|
const accountInfo = cacheRecord.account
|
|
6712
6715
|
? updateAccountTenantProfileData(cacheRecord.account.getAccountInfo(), undefined, // tenantProfile optional
|
|
6713
|
-
idTokenClaims)
|
|
6716
|
+
idTokenClaims, cacheRecord.idToken?.secret)
|
|
6714
6717
|
: null;
|
|
6715
6718
|
return {
|
|
6716
6719
|
authority: authority.canonicalAuthority,
|
|
@@ -6773,7 +6776,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, idTokenClai
|
|
|
6773
6776
|
return baseAccount;
|
|
6774
6777
|
}
|
|
6775
6778
|
|
|
6776
|
-
/*! @azure/msal-common v14.
|
|
6779
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6777
6780
|
|
|
6778
6781
|
/*
|
|
6779
6782
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7178,7 +7181,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7178
7181
|
}
|
|
7179
7182
|
}
|
|
7180
7183
|
|
|
7181
|
-
/*! @azure/msal-common v14.
|
|
7184
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7182
7185
|
|
|
7183
7186
|
/*
|
|
7184
7187
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7385,7 +7388,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7385
7388
|
}
|
|
7386
7389
|
}
|
|
7387
7390
|
|
|
7388
|
-
/*! @azure/msal-common v14.
|
|
7391
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7389
7392
|
|
|
7390
7393
|
/*
|
|
7391
7394
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7516,7 +7519,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7516
7519
|
}
|
|
7517
7520
|
}
|
|
7518
7521
|
|
|
7519
|
-
/*! @azure/msal-common v14.
|
|
7522
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7520
7523
|
|
|
7521
7524
|
/*
|
|
7522
7525
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7531,7 +7534,7 @@ const StubbedNetworkModule = {
|
|
|
7531
7534
|
},
|
|
7532
7535
|
};
|
|
7533
7536
|
|
|
7534
|
-
/*! @azure/msal-common v14.
|
|
7537
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7535
7538
|
/*
|
|
7536
7539
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7537
7540
|
* Licensed under the MIT License.
|
|
@@ -7539,7 +7542,7 @@ const StubbedNetworkModule = {
|
|
|
7539
7542
|
const missingKidError = "missing_kid_error";
|
|
7540
7543
|
const missingAlgError = "missing_alg_error";
|
|
7541
7544
|
|
|
7542
|
-
/*! @azure/msal-common v14.
|
|
7545
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7543
7546
|
|
|
7544
7547
|
/*
|
|
7545
7548
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7564,7 +7567,7 @@ function createJoseHeaderError(code) {
|
|
|
7564
7567
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
7565
7568
|
}
|
|
7566
7569
|
|
|
7567
|
-
/*! @azure/msal-common v14.
|
|
7570
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7568
7571
|
|
|
7569
7572
|
/*
|
|
7570
7573
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7604,7 +7607,7 @@ class JoseHeader {
|
|
|
7604
7607
|
}
|
|
7605
7608
|
}
|
|
7606
7609
|
|
|
7607
|
-
/*! @azure/msal-common v14.
|
|
7610
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7608
7611
|
|
|
7609
7612
|
/*
|
|
7610
7613
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7662,7 +7665,7 @@ class AuthenticationHeaderParser {
|
|
|
7662
7665
|
}
|
|
7663
7666
|
}
|
|
7664
7667
|
|
|
7665
|
-
/*! @azure/msal-common v14.
|
|
7668
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7666
7669
|
|
|
7667
7670
|
/*
|
|
7668
7671
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7866,7 +7869,7 @@ class ServerTelemetryManager {
|
|
|
7866
7869
|
}
|
|
7867
7870
|
}
|
|
7868
7871
|
|
|
7869
|
-
/*! @azure/msal-common v14.
|
|
7872
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7870
7873
|
|
|
7871
7874
|
/*
|
|
7872
7875
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7945,7 +7948,7 @@ class StubPerformanceClient {
|
|
|
7945
7948
|
}
|
|
7946
7949
|
}
|
|
7947
7950
|
|
|
7948
|
-
/*! @azure/msal-common v14.
|
|
7951
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7949
7952
|
|
|
7950
7953
|
/*
|
|
7951
7954
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8931,6 +8934,149 @@ const LOG_LEVEL_CACHE_KEY = "msal.browser.log.level";
|
|
|
8931
8934
|
const LOG_PII_CACHE_KEY = "msal.browser.log.pii";
|
|
8932
8935
|
const BROWSER_PERF_ENABLED_KEY = "msal.browser.performance.enabled";
|
|
8933
8936
|
|
|
8937
|
+
/*
|
|
8938
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8939
|
+
* Licensed under the MIT License.
|
|
8940
|
+
*/
|
|
8941
|
+
/**
|
|
8942
|
+
* This file defines functions used by the browser library to perform cryptography operations such as
|
|
8943
|
+
* hashing and encoding. It also has helper functions to validate the availability of specific APIs.
|
|
8944
|
+
*/
|
|
8945
|
+
/**
|
|
8946
|
+
* See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
|
|
8947
|
+
*/
|
|
8948
|
+
// RSA KeyGen Algorithm
|
|
8949
|
+
const PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
|
|
8950
|
+
// SHA-256 hashing algorithm
|
|
8951
|
+
const S256_HASH_ALG = "SHA-256";
|
|
8952
|
+
// MOD length for PoP tokens
|
|
8953
|
+
const MODULUS_LENGTH = 2048;
|
|
8954
|
+
// Public Exponent
|
|
8955
|
+
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
|
8956
|
+
// UUID hex digits
|
|
8957
|
+
const UUID_CHARS = "0123456789abcdef";
|
|
8958
|
+
// Array to store UINT32 random value
|
|
8959
|
+
const UINT32_ARR = new Uint32Array(1);
|
|
8960
|
+
const keygenAlgorithmOptions = {
|
|
8961
|
+
name: PKCS1_V15_KEYGEN_ALG,
|
|
8962
|
+
hash: S256_HASH_ALG,
|
|
8963
|
+
modulusLength: MODULUS_LENGTH,
|
|
8964
|
+
publicExponent: PUBLIC_EXPONENT,
|
|
8965
|
+
};
|
|
8966
|
+
/**
|
|
8967
|
+
* Check whether browser crypto is available.
|
|
8968
|
+
*/
|
|
8969
|
+
function validateCryptoAvailable(logger) {
|
|
8970
|
+
if ("crypto" in window) {
|
|
8971
|
+
logger.verbose("BrowserCrypto: modern crypto interface available");
|
|
8972
|
+
}
|
|
8973
|
+
else {
|
|
8974
|
+
logger.error("BrowserCrypto: crypto interface is unavailable");
|
|
8975
|
+
throw createBrowserAuthError(cryptoNonExistent);
|
|
8976
|
+
}
|
|
8977
|
+
}
|
|
8978
|
+
/**
|
|
8979
|
+
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
8980
|
+
* @param dataString {string} data string
|
|
8981
|
+
* @param performanceClient {?IPerformanceClient}
|
|
8982
|
+
* @param correlationId {?string} correlation id
|
|
8983
|
+
*/
|
|
8984
|
+
async function sha256Digest(dataString, performanceClient, correlationId) {
|
|
8985
|
+
performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);
|
|
8986
|
+
const encoder = new TextEncoder();
|
|
8987
|
+
const data = encoder.encode(dataString);
|
|
8988
|
+
return window.crypto.subtle.digest(S256_HASH_ALG, data);
|
|
8989
|
+
}
|
|
8990
|
+
/**
|
|
8991
|
+
* Populates buffer with cryptographically random values.
|
|
8992
|
+
* @param dataBuffer
|
|
8993
|
+
*/
|
|
8994
|
+
function getRandomValues(dataBuffer) {
|
|
8995
|
+
return window.crypto.getRandomValues(dataBuffer);
|
|
8996
|
+
}
|
|
8997
|
+
/**
|
|
8998
|
+
* Returns random Uint32 value.
|
|
8999
|
+
* @returns {number}
|
|
9000
|
+
*/
|
|
9001
|
+
function getRandomUint32() {
|
|
9002
|
+
window.crypto.getRandomValues(UINT32_ARR);
|
|
9003
|
+
return UINT32_ARR[0];
|
|
9004
|
+
}
|
|
9005
|
+
/**
|
|
9006
|
+
* Creates a UUID v7 from the current timestamp.
|
|
9007
|
+
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
|
9008
|
+
* @returns {number}
|
|
9009
|
+
*/
|
|
9010
|
+
function createNewGuid() {
|
|
9011
|
+
const currentTimestamp = Date.now();
|
|
9012
|
+
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
|
|
9013
|
+
// Result byte array
|
|
9014
|
+
const bytes = new Uint8Array(16);
|
|
9015
|
+
// A 12-bit `rand_a` field value
|
|
9016
|
+
const randA = Math.trunc(baseRand / 2 ** 30);
|
|
9017
|
+
// The higher 30 bits of 62-bit `rand_b` field value
|
|
9018
|
+
const randBHi = baseRand & (2 ** 30 - 1);
|
|
9019
|
+
// The lower 32 bits of 62-bit `rand_b` field value
|
|
9020
|
+
const randBLo = getRandomUint32();
|
|
9021
|
+
bytes[0] = currentTimestamp / 2 ** 40;
|
|
9022
|
+
bytes[1] = currentTimestamp / 2 ** 32;
|
|
9023
|
+
bytes[2] = currentTimestamp / 2 ** 24;
|
|
9024
|
+
bytes[3] = currentTimestamp / 2 ** 16;
|
|
9025
|
+
bytes[4] = currentTimestamp / 2 ** 8;
|
|
9026
|
+
bytes[5] = currentTimestamp;
|
|
9027
|
+
bytes[6] = 0x70 | (randA >>> 8);
|
|
9028
|
+
bytes[7] = randA;
|
|
9029
|
+
bytes[8] = 0x80 | (randBHi >>> 24);
|
|
9030
|
+
bytes[9] = randBHi >>> 16;
|
|
9031
|
+
bytes[10] = randBHi >>> 8;
|
|
9032
|
+
bytes[11] = randBHi;
|
|
9033
|
+
bytes[12] = randBLo >>> 24;
|
|
9034
|
+
bytes[13] = randBLo >>> 16;
|
|
9035
|
+
bytes[14] = randBLo >>> 8;
|
|
9036
|
+
bytes[15] = randBLo;
|
|
9037
|
+
let text = "";
|
|
9038
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
9039
|
+
text += UUID_CHARS.charAt(bytes[i] >>> 4);
|
|
9040
|
+
text += UUID_CHARS.charAt(bytes[i] & 0xf);
|
|
9041
|
+
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
|
9042
|
+
text += "-";
|
|
9043
|
+
}
|
|
9044
|
+
}
|
|
9045
|
+
return text;
|
|
9046
|
+
}
|
|
9047
|
+
/**
|
|
9048
|
+
* Generates a keypair based on current keygen algorithm config.
|
|
9049
|
+
* @param extractable
|
|
9050
|
+
* @param usages
|
|
9051
|
+
*/
|
|
9052
|
+
async function generateKeyPair(extractable, usages) {
|
|
9053
|
+
return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);
|
|
9054
|
+
}
|
|
9055
|
+
/**
|
|
9056
|
+
* Export key as Json Web Key (JWK)
|
|
9057
|
+
* @param key
|
|
9058
|
+
*/
|
|
9059
|
+
async function exportJwk(key) {
|
|
9060
|
+
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
|
9061
|
+
}
|
|
9062
|
+
/**
|
|
9063
|
+
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
|
9064
|
+
* @param key
|
|
9065
|
+
* @param extractable
|
|
9066
|
+
* @param usages
|
|
9067
|
+
*/
|
|
9068
|
+
async function importJwk(key, extractable, usages) {
|
|
9069
|
+
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);
|
|
9070
|
+
}
|
|
9071
|
+
/**
|
|
9072
|
+
* Signs given data with given key
|
|
9073
|
+
* @param key
|
|
9074
|
+
* @param data
|
|
9075
|
+
*/
|
|
9076
|
+
async function sign(key, data) {
|
|
9077
|
+
return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
|
|
9078
|
+
}
|
|
9079
|
+
|
|
8934
9080
|
/*
|
|
8935
9081
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8936
9082
|
* Licensed under the MIT License.
|
|
@@ -9056,6 +9202,13 @@ function preconnect(authority) {
|
|
|
9056
9202
|
catch { }
|
|
9057
9203
|
}, 10000); // 10s Timeout
|
|
9058
9204
|
}
|
|
9205
|
+
/**
|
|
9206
|
+
* Wrapper function that creates a UUID v7 from the current timestamp.
|
|
9207
|
+
* @returns {string}
|
|
9208
|
+
*/
|
|
9209
|
+
function createGuid() {
|
|
9210
|
+
return createNewGuid();
|
|
9211
|
+
}
|
|
9059
9212
|
|
|
9060
9213
|
var BrowserUtils = /*#__PURE__*/Object.freeze({
|
|
9061
9214
|
__proto__: null,
|
|
@@ -9065,6 +9218,7 @@ var BrowserUtils = /*#__PURE__*/Object.freeze({
|
|
|
9065
9218
|
blockRedirectInIframe: blockRedirectInIframe,
|
|
9066
9219
|
blockReloadInHiddenIframes: blockReloadInHiddenIframes,
|
|
9067
9220
|
clearHash: clearHash,
|
|
9221
|
+
createGuid: createGuid,
|
|
9068
9222
|
getCurrentUri: getCurrentUri,
|
|
9069
9223
|
getHomepage: getHomepage,
|
|
9070
9224
|
isInIframe: isInIframe,
|
|
@@ -9345,7 +9499,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
9345
9499
|
|
|
9346
9500
|
/* eslint-disable header/header */
|
|
9347
9501
|
const name = "@azure/msal-browser";
|
|
9348
|
-
const version = "3.
|
|
9502
|
+
const version = "3.10.0";
|
|
9349
9503
|
|
|
9350
9504
|
/*
|
|
9351
9505
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9852,149 +10006,6 @@ function base64DecToArr(base64String) {
|
|
|
9852
10006
|
return Uint8Array.from(binString, (m) => m.codePointAt(0) || 0);
|
|
9853
10007
|
}
|
|
9854
10008
|
|
|
9855
|
-
/*
|
|
9856
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9857
|
-
* Licensed under the MIT License.
|
|
9858
|
-
*/
|
|
9859
|
-
/**
|
|
9860
|
-
* This file defines functions used by the browser library to perform cryptography operations such as
|
|
9861
|
-
* hashing and encoding. It also has helper functions to validate the availability of specific APIs.
|
|
9862
|
-
*/
|
|
9863
|
-
/**
|
|
9864
|
-
* See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
|
|
9865
|
-
*/
|
|
9866
|
-
// RSA KeyGen Algorithm
|
|
9867
|
-
const PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
|
|
9868
|
-
// SHA-256 hashing algorithm
|
|
9869
|
-
const S256_HASH_ALG = "SHA-256";
|
|
9870
|
-
// MOD length for PoP tokens
|
|
9871
|
-
const MODULUS_LENGTH = 2048;
|
|
9872
|
-
// Public Exponent
|
|
9873
|
-
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
|
9874
|
-
// UUID hex digits
|
|
9875
|
-
const UUID_CHARS = "0123456789abcdef";
|
|
9876
|
-
// Array to store UINT32 random value
|
|
9877
|
-
const UINT32_ARR = new Uint32Array(1);
|
|
9878
|
-
const keygenAlgorithmOptions = {
|
|
9879
|
-
name: PKCS1_V15_KEYGEN_ALG,
|
|
9880
|
-
hash: S256_HASH_ALG,
|
|
9881
|
-
modulusLength: MODULUS_LENGTH,
|
|
9882
|
-
publicExponent: PUBLIC_EXPONENT,
|
|
9883
|
-
};
|
|
9884
|
-
/**
|
|
9885
|
-
* Check whether browser crypto is available.
|
|
9886
|
-
*/
|
|
9887
|
-
function validateCryptoAvailable(logger) {
|
|
9888
|
-
if ("crypto" in window) {
|
|
9889
|
-
logger.verbose("BrowserCrypto: modern crypto interface available");
|
|
9890
|
-
}
|
|
9891
|
-
else {
|
|
9892
|
-
logger.error("BrowserCrypto: crypto interface is unavailable");
|
|
9893
|
-
throw createBrowserAuthError(cryptoNonExistent);
|
|
9894
|
-
}
|
|
9895
|
-
}
|
|
9896
|
-
/**
|
|
9897
|
-
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
9898
|
-
* @param dataString {string} data string
|
|
9899
|
-
* @param performanceClient {?IPerformanceClient}
|
|
9900
|
-
* @param correlationId {?string} correlation id
|
|
9901
|
-
*/
|
|
9902
|
-
async function sha256Digest(dataString, performanceClient, correlationId) {
|
|
9903
|
-
performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);
|
|
9904
|
-
const encoder = new TextEncoder();
|
|
9905
|
-
const data = encoder.encode(dataString);
|
|
9906
|
-
return window.crypto.subtle.digest(S256_HASH_ALG, data);
|
|
9907
|
-
}
|
|
9908
|
-
/**
|
|
9909
|
-
* Populates buffer with cryptographically random values.
|
|
9910
|
-
* @param dataBuffer
|
|
9911
|
-
*/
|
|
9912
|
-
function getRandomValues(dataBuffer) {
|
|
9913
|
-
return window.crypto.getRandomValues(dataBuffer);
|
|
9914
|
-
}
|
|
9915
|
-
/**
|
|
9916
|
-
* Returns random Uint32 value.
|
|
9917
|
-
* @returns {number}
|
|
9918
|
-
*/
|
|
9919
|
-
function getRandomUint32() {
|
|
9920
|
-
window.crypto.getRandomValues(UINT32_ARR);
|
|
9921
|
-
return UINT32_ARR[0];
|
|
9922
|
-
}
|
|
9923
|
-
/**
|
|
9924
|
-
* Creates a UUID v7 from the current timestamp.
|
|
9925
|
-
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
|
9926
|
-
* @returns {number}
|
|
9927
|
-
*/
|
|
9928
|
-
function createNewGuid() {
|
|
9929
|
-
const currentTimestamp = Date.now();
|
|
9930
|
-
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
|
|
9931
|
-
// Result byte array
|
|
9932
|
-
const bytes = new Uint8Array(16);
|
|
9933
|
-
// A 12-bit `rand_a` field value
|
|
9934
|
-
const randA = Math.trunc(baseRand / 2 ** 30);
|
|
9935
|
-
// The higher 30 bits of 62-bit `rand_b` field value
|
|
9936
|
-
const randBHi = baseRand & (2 ** 30 - 1);
|
|
9937
|
-
// The lower 32 bits of 62-bit `rand_b` field value
|
|
9938
|
-
const randBLo = getRandomUint32();
|
|
9939
|
-
bytes[0] = currentTimestamp / 2 ** 40;
|
|
9940
|
-
bytes[1] = currentTimestamp / 2 ** 32;
|
|
9941
|
-
bytes[2] = currentTimestamp / 2 ** 24;
|
|
9942
|
-
bytes[3] = currentTimestamp / 2 ** 16;
|
|
9943
|
-
bytes[4] = currentTimestamp / 2 ** 8;
|
|
9944
|
-
bytes[5] = currentTimestamp;
|
|
9945
|
-
bytes[6] = 0x70 | (randA >>> 8);
|
|
9946
|
-
bytes[7] = randA;
|
|
9947
|
-
bytes[8] = 0x80 | (randBHi >>> 24);
|
|
9948
|
-
bytes[9] = randBHi >>> 16;
|
|
9949
|
-
bytes[10] = randBHi >>> 8;
|
|
9950
|
-
bytes[11] = randBHi;
|
|
9951
|
-
bytes[12] = randBLo >>> 24;
|
|
9952
|
-
bytes[13] = randBLo >>> 16;
|
|
9953
|
-
bytes[14] = randBLo >>> 8;
|
|
9954
|
-
bytes[15] = randBLo;
|
|
9955
|
-
let text = "";
|
|
9956
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
9957
|
-
text += UUID_CHARS.charAt(bytes[i] >>> 4);
|
|
9958
|
-
text += UUID_CHARS.charAt(bytes[i] & 0xf);
|
|
9959
|
-
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
|
9960
|
-
text += "-";
|
|
9961
|
-
}
|
|
9962
|
-
}
|
|
9963
|
-
return text;
|
|
9964
|
-
}
|
|
9965
|
-
/**
|
|
9966
|
-
* Generates a keypair based on current keygen algorithm config.
|
|
9967
|
-
* @param extractable
|
|
9968
|
-
* @param usages
|
|
9969
|
-
*/
|
|
9970
|
-
async function generateKeyPair(extractable, usages) {
|
|
9971
|
-
return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);
|
|
9972
|
-
}
|
|
9973
|
-
/**
|
|
9974
|
-
* Export key as Json Web Key (JWK)
|
|
9975
|
-
* @param key
|
|
9976
|
-
*/
|
|
9977
|
-
async function exportJwk(key) {
|
|
9978
|
-
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
|
9979
|
-
}
|
|
9980
|
-
/**
|
|
9981
|
-
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
|
9982
|
-
* @param key
|
|
9983
|
-
* @param extractable
|
|
9984
|
-
* @param usages
|
|
9985
|
-
*/
|
|
9986
|
-
async function importJwk(key, extractable, usages) {
|
|
9987
|
-
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);
|
|
9988
|
-
}
|
|
9989
|
-
/**
|
|
9990
|
-
* Signs given data with given key
|
|
9991
|
-
* @param key
|
|
9992
|
-
* @param data
|
|
9993
|
-
*/
|
|
9994
|
-
async function sign(key, data) {
|
|
9995
|
-
return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
|
|
9996
|
-
}
|
|
9997
|
-
|
|
9998
10009
|
/*
|
|
9999
10010
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10000
10011
|
* Licensed under the MIT License.
|
|
@@ -12746,6 +12757,7 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
12746
12757
|
const fullAccount = {
|
|
12747
12758
|
...account,
|
|
12748
12759
|
idTokenClaims: result?.idTokenClaims,
|
|
12760
|
+
idToken: result?.idToken,
|
|
12749
12761
|
};
|
|
12750
12762
|
return {
|
|
12751
12763
|
...result,
|
|
@@ -12847,15 +12859,19 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
12847
12859
|
*/
|
|
12848
12860
|
async handleNativeResponse(response, request, reqTimestamp) {
|
|
12849
12861
|
this.logger.trace("NativeInteractionClient - handleNativeResponse called.");
|
|
12850
|
-
|
|
12862
|
+
// generate identifiers
|
|
12863
|
+
const idTokenClaims = extractTokenClaims(response.id_token, base64Decode);
|
|
12864
|
+
const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);
|
|
12865
|
+
const cachedhomeAccountId = this.browserStorage.getAccountInfoFilteredBy({
|
|
12866
|
+
nativeAccountId: request.accountId,
|
|
12867
|
+
})?.homeAccountId;
|
|
12868
|
+
if (homeAccountIdentifier !== cachedhomeAccountId &&
|
|
12869
|
+
response.account.id !== request.accountId) {
|
|
12851
12870
|
// User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
|
|
12852
12871
|
throw createNativeAuthError(userSwitch);
|
|
12853
12872
|
}
|
|
12854
12873
|
// Get the preferred_cache domain for the given authority
|
|
12855
12874
|
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
12856
|
-
// generate identifiers
|
|
12857
|
-
const idTokenClaims = extractTokenClaims(response.id_token, base64Decode);
|
|
12858
|
-
const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);
|
|
12859
12875
|
const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier, idTokenClaims, base64Decode, response.client_info, undefined, // environment
|
|
12860
12876
|
idTokenClaims.tid, undefined, // auth code payload
|
|
12861
12877
|
response.account.id, this.logger);
|
|
@@ -12951,7 +12967,14 @@ class NativeInteractionClient extends BaseInteractionClient {
|
|
|
12951
12967
|
idTokenClaims.tid ||
|
|
12952
12968
|
Constants.EMPTY_STRING;
|
|
12953
12969
|
const accountInfo = updateAccountTenantProfileData(accountEntity.getAccountInfo(), undefined, // tenantProfile optional
|
|
12954
|
-
idTokenClaims);
|
|
12970
|
+
idTokenClaims, response.id_token);
|
|
12971
|
+
/**
|
|
12972
|
+
* In pairwise broker flows, this check prevents the broker's native account id
|
|
12973
|
+
* from being returned over the embedded app's account id.
|
|
12974
|
+
*/
|
|
12975
|
+
if (accountInfo.nativeAccountId !== response.account.id) {
|
|
12976
|
+
accountInfo.nativeAccountId = response.account.id;
|
|
12977
|
+
}
|
|
12955
12978
|
// generate PoP token as needed
|
|
12956
12979
|
const responseAccessToken = await this.generatePopAccessToken(response, request);
|
|
12957
12980
|
const tokenType = request.tokenType === AuthenticationScheme.POP
|
|
@@ -14613,17 +14636,20 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
14613
14636
|
(!request.account || !request.account.username)) {
|
|
14614
14637
|
this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");
|
|
14615
14638
|
}
|
|
14616
|
-
// Check
|
|
14617
|
-
|
|
14618
|
-
|
|
14619
|
-
|
|
14620
|
-
|
|
14639
|
+
// Check the prompt value
|
|
14640
|
+
const inputRequest = { ...request };
|
|
14641
|
+
if (inputRequest.prompt) {
|
|
14642
|
+
if (inputRequest.prompt !== PromptValue.NONE &&
|
|
14643
|
+
inputRequest.prompt !== PromptValue.NO_SESSION) {
|
|
14644
|
+
this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${inputRequest.prompt} with ${PromptValue.NONE}`);
|
|
14645
|
+
inputRequest.prompt = PromptValue.NONE;
|
|
14646
|
+
}
|
|
14647
|
+
}
|
|
14648
|
+
else {
|
|
14649
|
+
inputRequest.prompt = PromptValue.NONE;
|
|
14621
14650
|
}
|
|
14622
14651
|
// Create silent request
|
|
14623
|
-
const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(
|
|
14624
|
-
...request,
|
|
14625
|
-
prompt: request.prompt || PromptValue.NONE,
|
|
14626
|
-
}, exports.InteractionType.Silent);
|
|
14652
|
+
const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(inputRequest, exports.InteractionType.Silent);
|
|
14627
14653
|
preconnect(silentRequest.authority);
|
|
14628
14654
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
14629
14655
|
try {
|
|
@@ -17617,7 +17643,7 @@ class BrowserPerformanceClient extends PerformanceClient {
|
|
|
17617
17643
|
}, intFields);
|
|
17618
17644
|
}
|
|
17619
17645
|
generateId() {
|
|
17620
|
-
return
|
|
17646
|
+
return createNewGuid();
|
|
17621
17647
|
}
|
|
17622
17648
|
getPageVisibility() {
|
|
17623
17649
|
return document.visibilityState?.toString() || null;
|