@azure/msal-browser 3.9.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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.10.0 2024-02-17 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
|
|
7
7
|
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
|
-
/*! @azure/msal-common v14.7.
|
|
9
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
10
10
|
/*
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
12
|
* Licensed under the MIT License.
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
Pop: "pop",
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
-
/*! @azure/msal-common v14.7.
|
|
304
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
305
305
|
/*
|
|
306
306
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
307
307
|
* Licensed under the MIT License.
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
unexpectedError: unexpectedError
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
-
/*! @azure/msal-common v14.7.
|
|
321
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
322
322
|
|
|
323
323
|
/*
|
|
324
324
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
: AuthErrorMessages[code]);
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
/*! @azure/msal-common v14.7.
|
|
370
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
371
371
|
/*
|
|
372
372
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
373
373
|
* Licensed under the MIT License.
|
|
@@ -465,7 +465,7 @@
|
|
|
465
465
|
userTimeoutReached: userTimeoutReached
|
|
466
466
|
});
|
|
467
467
|
|
|
468
|
-
/*! @azure/msal-common v14.7.
|
|
468
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
469
469
|
|
|
470
470
|
/*
|
|
471
471
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -717,7 +717,7 @@
|
|
|
717
717
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
-
/*! @azure/msal-common v14.7.
|
|
720
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
721
721
|
|
|
722
722
|
/*
|
|
723
723
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -750,7 +750,7 @@
|
|
|
750
750
|
},
|
|
751
751
|
};
|
|
752
752
|
|
|
753
|
-
/*! @azure/msal-common v14.7.
|
|
753
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
754
754
|
|
|
755
755
|
/*
|
|
756
756
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -941,12 +941,12 @@
|
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
943
|
|
|
944
|
-
/*! @azure/msal-common v14.7.
|
|
944
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
945
945
|
/* eslint-disable header/header */
|
|
946
946
|
const name$1 = "@azure/msal-common";
|
|
947
|
-
const version$1 = "14.7.
|
|
947
|
+
const version$1 = "14.7.1";
|
|
948
948
|
|
|
949
|
-
/*! @azure/msal-common v14.7.
|
|
949
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
950
950
|
/*
|
|
951
951
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
952
952
|
* Licensed under the MIT License.
|
|
@@ -966,7 +966,7 @@
|
|
|
966
966
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
967
967
|
};
|
|
968
968
|
|
|
969
|
-
/*! @azure/msal-common v14.7.
|
|
969
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
970
970
|
|
|
971
971
|
/*
|
|
972
972
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
/*! @azure/msal-common v14.7.
|
|
1030
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1031
1031
|
/*
|
|
1032
1032
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1033
1033
|
* Licensed under the MIT License.
|
|
@@ -1064,7 +1064,7 @@
|
|
|
1064
1064
|
return cachedAtSec > nowSeconds();
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
|
-
/*! @azure/msal-common v14.7.
|
|
1067
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1068
1068
|
|
|
1069
1069
|
/*
|
|
1070
1070
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1391,7 +1391,7 @@
|
|
|
1391
1391
|
return metadata.expiresAt <= nowSeconds();
|
|
1392
1392
|
}
|
|
1393
1393
|
|
|
1394
|
-
/*! @azure/msal-common v14.7.
|
|
1394
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1395
1395
|
/*
|
|
1396
1396
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1397
1397
|
* Licensed under the MIT License.
|
|
@@ -1445,7 +1445,7 @@
|
|
|
1445
1445
|
urlParseError: urlParseError
|
|
1446
1446
|
});
|
|
1447
1447
|
|
|
1448
|
-
/*! @azure/msal-common v14.7.
|
|
1448
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1449
1449
|
|
|
1450
1450
|
/*
|
|
1451
1451
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1583,7 +1583,7 @@
|
|
|
1583
1583
|
return new ClientConfigurationError(errorCode);
|
|
1584
1584
|
}
|
|
1585
1585
|
|
|
1586
|
-
/*! @azure/msal-common v14.7.
|
|
1586
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1587
1587
|
/*
|
|
1588
1588
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1589
1589
|
* Licensed under the MIT License.
|
|
@@ -1680,7 +1680,7 @@
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
|
|
1683
|
-
/*! @azure/msal-common v14.7.
|
|
1683
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1684
1684
|
|
|
1685
1685
|
/*
|
|
1686
1686
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1880,7 +1880,7 @@
|
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
|
-
/*! @azure/msal-common v14.7.
|
|
1883
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1884
1884
|
|
|
1885
1885
|
/*
|
|
1886
1886
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1920,7 +1920,7 @@
|
|
|
1920
1920
|
};
|
|
1921
1921
|
}
|
|
1922
1922
|
|
|
1923
|
-
/*! @azure/msal-common v14.7.
|
|
1923
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1924
1924
|
/*
|
|
1925
1925
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1926
1926
|
* Licensed under the MIT License.
|
|
@@ -1958,7 +1958,7 @@
|
|
|
1958
1958
|
* @param idTokenClaims
|
|
1959
1959
|
* @returns
|
|
1960
1960
|
*/
|
|
1961
|
-
function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenClaims) {
|
|
1961
|
+
function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenClaims, idTokenSecret) {
|
|
1962
1962
|
let updatedAccountInfo = baseAccountInfo;
|
|
1963
1963
|
// Tenant Profile overrides passed in account info
|
|
1964
1964
|
if (tenantProfile) {
|
|
@@ -1975,13 +1975,14 @@
|
|
|
1975
1975
|
...updatedAccountInfo,
|
|
1976
1976
|
...claimsSourcedTenantProfile,
|
|
1977
1977
|
idTokenClaims: idTokenClaims,
|
|
1978
|
+
idToken: idTokenSecret,
|
|
1978
1979
|
};
|
|
1979
1980
|
return updatedAccountInfo;
|
|
1980
1981
|
}
|
|
1981
1982
|
return updatedAccountInfo;
|
|
1982
1983
|
}
|
|
1983
1984
|
|
|
1984
|
-
/*! @azure/msal-common v14.7.
|
|
1985
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
1985
1986
|
/*
|
|
1986
1987
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1987
1988
|
* Licensed under the MIT License.
|
|
@@ -1996,7 +1997,7 @@
|
|
|
1996
1997
|
Ciam: 3,
|
|
1997
1998
|
};
|
|
1998
1999
|
|
|
1999
|
-
/*! @azure/msal-common v14.7.
|
|
2000
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2000
2001
|
/*
|
|
2001
2002
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2002
2003
|
* Licensed under the MIT License.
|
|
@@ -2018,7 +2019,7 @@
|
|
|
2018
2019
|
return null;
|
|
2019
2020
|
}
|
|
2020
2021
|
|
|
2021
|
-
/*! @azure/msal-common v14.7.
|
|
2022
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2022
2023
|
/*
|
|
2023
2024
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2024
2025
|
* Licensed under the MIT License.
|
|
@@ -2031,7 +2032,7 @@
|
|
|
2031
2032
|
OIDC: "OIDC",
|
|
2032
2033
|
};
|
|
2033
2034
|
|
|
2034
|
-
/*! @azure/msal-common v14.7.
|
|
2035
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2035
2036
|
|
|
2036
2037
|
/*
|
|
2037
2038
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2278,7 +2279,7 @@
|
|
|
2278
2279
|
}
|
|
2279
2280
|
}
|
|
2280
2281
|
|
|
2281
|
-
/*! @azure/msal-common v14.7.
|
|
2282
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2282
2283
|
|
|
2283
2284
|
/*
|
|
2284
2285
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2325,7 +2326,7 @@
|
|
|
2325
2326
|
return null;
|
|
2326
2327
|
}
|
|
2327
2328
|
|
|
2328
|
-
/*! @azure/msal-common v14.7.
|
|
2329
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2329
2330
|
|
|
2330
2331
|
/*
|
|
2331
2332
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2489,7 +2490,7 @@
|
|
|
2489
2490
|
}
|
|
2490
2491
|
}
|
|
2491
2492
|
|
|
2492
|
-
/*! @azure/msal-common v14.7.
|
|
2493
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2493
2494
|
|
|
2494
2495
|
/*
|
|
2495
2496
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2629,7 +2630,7 @@
|
|
|
2629
2630
|
return null;
|
|
2630
2631
|
}
|
|
2631
2632
|
|
|
2632
|
-
/*! @azure/msal-common v14.7.
|
|
2633
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
2633
2634
|
|
|
2634
2635
|
/*
|
|
2635
2636
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2720,7 +2721,7 @@
|
|
|
2720
2721
|
}
|
|
2721
2722
|
}
|
|
2722
2723
|
// Expand tenant profile into account info based on matching tenant profile and if available matching ID token claims
|
|
2723
|
-
tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims);
|
|
2724
|
+
tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims, idToken?.secret);
|
|
2724
2725
|
return tenantedAccountInfo;
|
|
2725
2726
|
}
|
|
2726
2727
|
getTenantProfilesFromAccountEntity(accountEntity, targetTenantId, tenantProfileFilter) {
|
|
@@ -3869,7 +3870,7 @@
|
|
|
3869
3870
|
}
|
|
3870
3871
|
}
|
|
3871
3872
|
|
|
3872
|
-
/*! @azure/msal-common v14.7.
|
|
3873
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
3873
3874
|
|
|
3874
3875
|
/*
|
|
3875
3876
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3969,7 +3970,7 @@
|
|
|
3969
3970
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3970
3971
|
}
|
|
3971
3972
|
|
|
3972
|
-
/*! @azure/msal-common v14.7.
|
|
3973
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
3973
3974
|
|
|
3974
3975
|
/*
|
|
3975
3976
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3986,7 +3987,7 @@
|
|
|
3986
3987
|
}
|
|
3987
3988
|
}
|
|
3988
3989
|
|
|
3989
|
-
/*! @azure/msal-common v14.7.
|
|
3990
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
3990
3991
|
|
|
3991
3992
|
/*
|
|
3992
3993
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4084,7 +4085,7 @@
|
|
|
4084
4085
|
}
|
|
4085
4086
|
}
|
|
4086
4087
|
|
|
4087
|
-
/*! @azure/msal-common v14.7.
|
|
4088
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4088
4089
|
|
|
4089
4090
|
/*
|
|
4090
4091
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4121,7 +4122,7 @@
|
|
|
4121
4122
|
}
|
|
4122
4123
|
}
|
|
4123
4124
|
|
|
4124
|
-
/*! @azure/msal-common v14.7.
|
|
4125
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4125
4126
|
/*
|
|
4126
4127
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4127
4128
|
* Licensed under the MIT License.
|
|
@@ -4131,7 +4132,7 @@
|
|
|
4131
4132
|
UPN: "UPN",
|
|
4132
4133
|
};
|
|
4133
4134
|
|
|
4134
|
-
/*! @azure/msal-common v14.7.
|
|
4135
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4135
4136
|
/*
|
|
4136
4137
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4137
4138
|
* Licensed under the MIT License.
|
|
@@ -4178,7 +4179,7 @@
|
|
|
4178
4179
|
const LOGIN_HINT = "login_hint";
|
|
4179
4180
|
const DOMAIN_HINT = "domain_hint";
|
|
4180
4181
|
|
|
4181
|
-
/*! @azure/msal-common v14.7.
|
|
4182
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4182
4183
|
|
|
4183
4184
|
/*
|
|
4184
4185
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4262,7 +4263,7 @@
|
|
|
4262
4263
|
}
|
|
4263
4264
|
}
|
|
4264
4265
|
|
|
4265
|
-
/*! @azure/msal-common v14.7.
|
|
4266
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4266
4267
|
|
|
4267
4268
|
/*
|
|
4268
4269
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4646,7 +4647,7 @@
|
|
|
4646
4647
|
}
|
|
4647
4648
|
}
|
|
4648
4649
|
|
|
4649
|
-
/*! @azure/msal-common v14.7.
|
|
4650
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4650
4651
|
/*
|
|
4651
4652
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4652
4653
|
* Licensed under the MIT License.
|
|
@@ -4658,7 +4659,7 @@
|
|
|
4658
4659
|
response.hasOwnProperty("jwks_uri"));
|
|
4659
4660
|
}
|
|
4660
4661
|
|
|
4661
|
-
/*! @azure/msal-common v14.7.
|
|
4662
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4662
4663
|
/*
|
|
4663
4664
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4664
4665
|
* Licensed under the MIT License.
|
|
@@ -4668,7 +4669,7 @@
|
|
|
4668
4669
|
response.hasOwnProperty("metadata"));
|
|
4669
4670
|
}
|
|
4670
4671
|
|
|
4671
|
-
/*! @azure/msal-common v14.7.
|
|
4672
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4672
4673
|
/*
|
|
4673
4674
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4674
4675
|
* Licensed under the MIT License.
|
|
@@ -4678,7 +4679,7 @@
|
|
|
4678
4679
|
response.hasOwnProperty("error_description"));
|
|
4679
4680
|
}
|
|
4680
4681
|
|
|
4681
|
-
/*! @azure/msal-common v14.7.
|
|
4682
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4682
4683
|
/*
|
|
4683
4684
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4684
4685
|
* Licensed under the MIT License.
|
|
@@ -4939,7 +4940,7 @@
|
|
|
4939
4940
|
"multiMatchedRT",
|
|
4940
4941
|
]);
|
|
4941
4942
|
|
|
4942
|
-
/*! @azure/msal-common v14.7.
|
|
4943
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
4943
4944
|
/*
|
|
4944
4945
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4945
4946
|
* Licensed under the MIT License.
|
|
@@ -5035,7 +5036,7 @@
|
|
|
5035
5036
|
};
|
|
5036
5037
|
};
|
|
5037
5038
|
|
|
5038
|
-
/*! @azure/msal-common v14.7.
|
|
5039
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
5039
5040
|
|
|
5040
5041
|
/*
|
|
5041
5042
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5144,7 +5145,7 @@
|
|
|
5144
5145
|
},
|
|
5145
5146
|
};
|
|
5146
5147
|
|
|
5147
|
-
/*! @azure/msal-common v14.7.
|
|
5148
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
5148
5149
|
|
|
5149
5150
|
/*
|
|
5150
5151
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5941,8 +5942,10 @@
|
|
|
5941
5942
|
* AAD Authority - domain/tenantId -> Credentials are cached with realm = tenantId
|
|
5942
5943
|
* B2C Authority - domain/{tenantId}?/.../policy -> Credentials are cached with realm = policy
|
|
5943
5944
|
* tenantId is downcased because B2C policies can have mixed case but tfp claim is downcased
|
|
5945
|
+
*
|
|
5946
|
+
* Note that we may not have any path segments in certain OIDC scenarios.
|
|
5944
5947
|
*/
|
|
5945
|
-
const tenantId = authorityUrlComponents.PathSegments.slice(-1)[0]
|
|
5948
|
+
const tenantId = authorityUrlComponents.PathSegments.slice(-1)[0]?.toLowerCase();
|
|
5946
5949
|
switch (tenantId) {
|
|
5947
5950
|
case AADAuthorityConstants.COMMON:
|
|
5948
5951
|
case AADAuthorityConstants.ORGANIZATIONS:
|
|
@@ -5977,7 +5980,7 @@
|
|
|
5977
5980
|
};
|
|
5978
5981
|
}
|
|
5979
5982
|
|
|
5980
|
-
/*! @azure/msal-common v14.7.
|
|
5983
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
5981
5984
|
|
|
5982
5985
|
/*
|
|
5983
5986
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6008,7 +6011,7 @@
|
|
|
6008
6011
|
}
|
|
6009
6012
|
}
|
|
6010
6013
|
|
|
6011
|
-
/*! @azure/msal-common v14.7.
|
|
6014
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6012
6015
|
|
|
6013
6016
|
/*
|
|
6014
6017
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6111,7 +6114,7 @@
|
|
|
6111
6114
|
}
|
|
6112
6115
|
}
|
|
6113
6116
|
|
|
6114
|
-
/*! @azure/msal-common v14.7.
|
|
6117
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6115
6118
|
/*
|
|
6116
6119
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6117
6120
|
* Licensed under the MIT License.
|
|
@@ -6137,7 +6140,7 @@
|
|
|
6137
6140
|
refreshTokenExpired: refreshTokenExpired
|
|
6138
6141
|
});
|
|
6139
6142
|
|
|
6140
|
-
/*! @azure/msal-common v14.7.
|
|
6143
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6141
6144
|
|
|
6142
6145
|
/*
|
|
6143
6146
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6224,7 +6227,7 @@
|
|
|
6224
6227
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6225
6228
|
}
|
|
6226
6229
|
|
|
6227
|
-
/*! @azure/msal-common v14.7.
|
|
6230
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6228
6231
|
/*
|
|
6229
6232
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6230
6233
|
* Licensed under the MIT License.
|
|
@@ -6240,7 +6243,7 @@
|
|
|
6240
6243
|
}
|
|
6241
6244
|
}
|
|
6242
6245
|
|
|
6243
|
-
/*! @azure/msal-common v14.7.
|
|
6246
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6244
6247
|
|
|
6245
6248
|
/*
|
|
6246
6249
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6312,7 +6315,7 @@
|
|
|
6312
6315
|
}
|
|
6313
6316
|
}
|
|
6314
6317
|
|
|
6315
|
-
/*! @azure/msal-common v14.7.
|
|
6318
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6316
6319
|
|
|
6317
6320
|
/*
|
|
6318
6321
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6397,7 +6400,7 @@
|
|
|
6397
6400
|
}
|
|
6398
6401
|
}
|
|
6399
6402
|
|
|
6400
|
-
/*! @azure/msal-common v14.7.
|
|
6403
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6401
6404
|
/*
|
|
6402
6405
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6403
6406
|
* Licensed under the MIT License.
|
|
@@ -6424,7 +6427,7 @@
|
|
|
6424
6427
|
}
|
|
6425
6428
|
}
|
|
6426
6429
|
|
|
6427
|
-
/*! @azure/msal-common v14.7.
|
|
6430
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6428
6431
|
|
|
6429
6432
|
/*
|
|
6430
6433
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6714,7 +6717,7 @@
|
|
|
6714
6717
|
}
|
|
6715
6718
|
const accountInfo = cacheRecord.account
|
|
6716
6719
|
? updateAccountTenantProfileData(cacheRecord.account.getAccountInfo(), undefined, // tenantProfile optional
|
|
6717
|
-
idTokenClaims)
|
|
6720
|
+
idTokenClaims, cacheRecord.idToken?.secret)
|
|
6718
6721
|
: null;
|
|
6719
6722
|
return {
|
|
6720
6723
|
authority: authority.canonicalAuthority,
|
|
@@ -6777,7 +6780,7 @@
|
|
|
6777
6780
|
return baseAccount;
|
|
6778
6781
|
}
|
|
6779
6782
|
|
|
6780
|
-
/*! @azure/msal-common v14.7.
|
|
6783
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
6781
6784
|
|
|
6782
6785
|
/*
|
|
6783
6786
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7182,7 +7185,7 @@
|
|
|
7182
7185
|
}
|
|
7183
7186
|
}
|
|
7184
7187
|
|
|
7185
|
-
/*! @azure/msal-common v14.7.
|
|
7188
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7186
7189
|
|
|
7187
7190
|
/*
|
|
7188
7191
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7389,7 +7392,7 @@
|
|
|
7389
7392
|
}
|
|
7390
7393
|
}
|
|
7391
7394
|
|
|
7392
|
-
/*! @azure/msal-common v14.7.
|
|
7395
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7393
7396
|
|
|
7394
7397
|
/*
|
|
7395
7398
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7520,7 +7523,7 @@
|
|
|
7520
7523
|
}
|
|
7521
7524
|
}
|
|
7522
7525
|
|
|
7523
|
-
/*! @azure/msal-common v14.7.
|
|
7526
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7524
7527
|
|
|
7525
7528
|
/*
|
|
7526
7529
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7535,7 +7538,7 @@
|
|
|
7535
7538
|
},
|
|
7536
7539
|
};
|
|
7537
7540
|
|
|
7538
|
-
/*! @azure/msal-common v14.7.
|
|
7541
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7539
7542
|
/*
|
|
7540
7543
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7541
7544
|
* Licensed under the MIT License.
|
|
@@ -7543,7 +7546,7 @@
|
|
|
7543
7546
|
const missingKidError = "missing_kid_error";
|
|
7544
7547
|
const missingAlgError = "missing_alg_error";
|
|
7545
7548
|
|
|
7546
|
-
/*! @azure/msal-common v14.7.
|
|
7549
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7547
7550
|
|
|
7548
7551
|
/*
|
|
7549
7552
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7568,7 +7571,7 @@
|
|
|
7568
7571
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
7569
7572
|
}
|
|
7570
7573
|
|
|
7571
|
-
/*! @azure/msal-common v14.7.
|
|
7574
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7572
7575
|
|
|
7573
7576
|
/*
|
|
7574
7577
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7608,7 +7611,7 @@
|
|
|
7608
7611
|
}
|
|
7609
7612
|
}
|
|
7610
7613
|
|
|
7611
|
-
/*! @azure/msal-common v14.7.
|
|
7614
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7612
7615
|
|
|
7613
7616
|
/*
|
|
7614
7617
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7666,7 +7669,7 @@
|
|
|
7666
7669
|
}
|
|
7667
7670
|
}
|
|
7668
7671
|
|
|
7669
|
-
/*! @azure/msal-common v14.7.
|
|
7672
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7670
7673
|
|
|
7671
7674
|
/*
|
|
7672
7675
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7870,7 +7873,7 @@
|
|
|
7870
7873
|
}
|
|
7871
7874
|
}
|
|
7872
7875
|
|
|
7873
|
-
/*! @azure/msal-common v14.7.
|
|
7876
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7874
7877
|
|
|
7875
7878
|
/*
|
|
7876
7879
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7949,7 +7952,7 @@
|
|
|
7949
7952
|
}
|
|
7950
7953
|
}
|
|
7951
7954
|
|
|
7952
|
-
/*! @azure/msal-common v14.7.
|
|
7955
|
+
/*! @azure/msal-common v14.7.1 2024-02-17 */
|
|
7953
7956
|
|
|
7954
7957
|
/*
|
|
7955
7958
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8935,6 +8938,149 @@
|
|
|
8935
8938
|
const LOG_PII_CACHE_KEY = "msal.browser.log.pii";
|
|
8936
8939
|
const BROWSER_PERF_ENABLED_KEY = "msal.browser.performance.enabled";
|
|
8937
8940
|
|
|
8941
|
+
/*
|
|
8942
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8943
|
+
* Licensed under the MIT License.
|
|
8944
|
+
*/
|
|
8945
|
+
/**
|
|
8946
|
+
* This file defines functions used by the browser library to perform cryptography operations such as
|
|
8947
|
+
* hashing and encoding. It also has helper functions to validate the availability of specific APIs.
|
|
8948
|
+
*/
|
|
8949
|
+
/**
|
|
8950
|
+
* See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
|
|
8951
|
+
*/
|
|
8952
|
+
// RSA KeyGen Algorithm
|
|
8953
|
+
const PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
|
|
8954
|
+
// SHA-256 hashing algorithm
|
|
8955
|
+
const S256_HASH_ALG = "SHA-256";
|
|
8956
|
+
// MOD length for PoP tokens
|
|
8957
|
+
const MODULUS_LENGTH = 2048;
|
|
8958
|
+
// Public Exponent
|
|
8959
|
+
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
|
8960
|
+
// UUID hex digits
|
|
8961
|
+
const UUID_CHARS = "0123456789abcdef";
|
|
8962
|
+
// Array to store UINT32 random value
|
|
8963
|
+
const UINT32_ARR = new Uint32Array(1);
|
|
8964
|
+
const keygenAlgorithmOptions = {
|
|
8965
|
+
name: PKCS1_V15_KEYGEN_ALG,
|
|
8966
|
+
hash: S256_HASH_ALG,
|
|
8967
|
+
modulusLength: MODULUS_LENGTH,
|
|
8968
|
+
publicExponent: PUBLIC_EXPONENT,
|
|
8969
|
+
};
|
|
8970
|
+
/**
|
|
8971
|
+
* Check whether browser crypto is available.
|
|
8972
|
+
*/
|
|
8973
|
+
function validateCryptoAvailable(logger) {
|
|
8974
|
+
if ("crypto" in window) {
|
|
8975
|
+
logger.verbose("BrowserCrypto: modern crypto interface available");
|
|
8976
|
+
}
|
|
8977
|
+
else {
|
|
8978
|
+
logger.error("BrowserCrypto: crypto interface is unavailable");
|
|
8979
|
+
throw createBrowserAuthError(cryptoNonExistent);
|
|
8980
|
+
}
|
|
8981
|
+
}
|
|
8982
|
+
/**
|
|
8983
|
+
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
8984
|
+
* @param dataString {string} data string
|
|
8985
|
+
* @param performanceClient {?IPerformanceClient}
|
|
8986
|
+
* @param correlationId {?string} correlation id
|
|
8987
|
+
*/
|
|
8988
|
+
async function sha256Digest(dataString, performanceClient, correlationId) {
|
|
8989
|
+
performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);
|
|
8990
|
+
const encoder = new TextEncoder();
|
|
8991
|
+
const data = encoder.encode(dataString);
|
|
8992
|
+
return window.crypto.subtle.digest(S256_HASH_ALG, data);
|
|
8993
|
+
}
|
|
8994
|
+
/**
|
|
8995
|
+
* Populates buffer with cryptographically random values.
|
|
8996
|
+
* @param dataBuffer
|
|
8997
|
+
*/
|
|
8998
|
+
function getRandomValues(dataBuffer) {
|
|
8999
|
+
return window.crypto.getRandomValues(dataBuffer);
|
|
9000
|
+
}
|
|
9001
|
+
/**
|
|
9002
|
+
* Returns random Uint32 value.
|
|
9003
|
+
* @returns {number}
|
|
9004
|
+
*/
|
|
9005
|
+
function getRandomUint32() {
|
|
9006
|
+
window.crypto.getRandomValues(UINT32_ARR);
|
|
9007
|
+
return UINT32_ARR[0];
|
|
9008
|
+
}
|
|
9009
|
+
/**
|
|
9010
|
+
* Creates a UUID v7 from the current timestamp.
|
|
9011
|
+
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
|
9012
|
+
* @returns {number}
|
|
9013
|
+
*/
|
|
9014
|
+
function createNewGuid() {
|
|
9015
|
+
const currentTimestamp = Date.now();
|
|
9016
|
+
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
|
|
9017
|
+
// Result byte array
|
|
9018
|
+
const bytes = new Uint8Array(16);
|
|
9019
|
+
// A 12-bit `rand_a` field value
|
|
9020
|
+
const randA = Math.trunc(baseRand / 2 ** 30);
|
|
9021
|
+
// The higher 30 bits of 62-bit `rand_b` field value
|
|
9022
|
+
const randBHi = baseRand & (2 ** 30 - 1);
|
|
9023
|
+
// The lower 32 bits of 62-bit `rand_b` field value
|
|
9024
|
+
const randBLo = getRandomUint32();
|
|
9025
|
+
bytes[0] = currentTimestamp / 2 ** 40;
|
|
9026
|
+
bytes[1] = currentTimestamp / 2 ** 32;
|
|
9027
|
+
bytes[2] = currentTimestamp / 2 ** 24;
|
|
9028
|
+
bytes[3] = currentTimestamp / 2 ** 16;
|
|
9029
|
+
bytes[4] = currentTimestamp / 2 ** 8;
|
|
9030
|
+
bytes[5] = currentTimestamp;
|
|
9031
|
+
bytes[6] = 0x70 | (randA >>> 8);
|
|
9032
|
+
bytes[7] = randA;
|
|
9033
|
+
bytes[8] = 0x80 | (randBHi >>> 24);
|
|
9034
|
+
bytes[9] = randBHi >>> 16;
|
|
9035
|
+
bytes[10] = randBHi >>> 8;
|
|
9036
|
+
bytes[11] = randBHi;
|
|
9037
|
+
bytes[12] = randBLo >>> 24;
|
|
9038
|
+
bytes[13] = randBLo >>> 16;
|
|
9039
|
+
bytes[14] = randBLo >>> 8;
|
|
9040
|
+
bytes[15] = randBLo;
|
|
9041
|
+
let text = "";
|
|
9042
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
9043
|
+
text += UUID_CHARS.charAt(bytes[i] >>> 4);
|
|
9044
|
+
text += UUID_CHARS.charAt(bytes[i] & 0xf);
|
|
9045
|
+
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
|
9046
|
+
text += "-";
|
|
9047
|
+
}
|
|
9048
|
+
}
|
|
9049
|
+
return text;
|
|
9050
|
+
}
|
|
9051
|
+
/**
|
|
9052
|
+
* Generates a keypair based on current keygen algorithm config.
|
|
9053
|
+
* @param extractable
|
|
9054
|
+
* @param usages
|
|
9055
|
+
*/
|
|
9056
|
+
async function generateKeyPair(extractable, usages) {
|
|
9057
|
+
return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);
|
|
9058
|
+
}
|
|
9059
|
+
/**
|
|
9060
|
+
* Export key as Json Web Key (JWK)
|
|
9061
|
+
* @param key
|
|
9062
|
+
*/
|
|
9063
|
+
async function exportJwk(key) {
|
|
9064
|
+
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
|
9065
|
+
}
|
|
9066
|
+
/**
|
|
9067
|
+
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
|
9068
|
+
* @param key
|
|
9069
|
+
* @param extractable
|
|
9070
|
+
* @param usages
|
|
9071
|
+
*/
|
|
9072
|
+
async function importJwk(key, extractable, usages) {
|
|
9073
|
+
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);
|
|
9074
|
+
}
|
|
9075
|
+
/**
|
|
9076
|
+
* Signs given data with given key
|
|
9077
|
+
* @param key
|
|
9078
|
+
* @param data
|
|
9079
|
+
*/
|
|
9080
|
+
async function sign(key, data) {
|
|
9081
|
+
return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
|
|
9082
|
+
}
|
|
9083
|
+
|
|
8938
9084
|
/*
|
|
8939
9085
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8940
9086
|
* Licensed under the MIT License.
|
|
@@ -9060,6 +9206,13 @@
|
|
|
9060
9206
|
catch { }
|
|
9061
9207
|
}, 10000); // 10s Timeout
|
|
9062
9208
|
}
|
|
9209
|
+
/**
|
|
9210
|
+
* Wrapper function that creates a UUID v7 from the current timestamp.
|
|
9211
|
+
* @returns {string}
|
|
9212
|
+
*/
|
|
9213
|
+
function createGuid() {
|
|
9214
|
+
return createNewGuid();
|
|
9215
|
+
}
|
|
9063
9216
|
|
|
9064
9217
|
var BrowserUtils = /*#__PURE__*/Object.freeze({
|
|
9065
9218
|
__proto__: null,
|
|
@@ -9069,6 +9222,7 @@
|
|
|
9069
9222
|
blockRedirectInIframe: blockRedirectInIframe,
|
|
9070
9223
|
blockReloadInHiddenIframes: blockReloadInHiddenIframes,
|
|
9071
9224
|
clearHash: clearHash,
|
|
9225
|
+
createGuid: createGuid,
|
|
9072
9226
|
getCurrentUri: getCurrentUri,
|
|
9073
9227
|
getHomepage: getHomepage,
|
|
9074
9228
|
isInIframe: isInIframe,
|
|
@@ -9349,7 +9503,7 @@
|
|
|
9349
9503
|
|
|
9350
9504
|
/* eslint-disable header/header */
|
|
9351
9505
|
const name = "@azure/msal-browser";
|
|
9352
|
-
const version = "3.
|
|
9506
|
+
const version = "3.10.0";
|
|
9353
9507
|
|
|
9354
9508
|
/*
|
|
9355
9509
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9856,149 +10010,6 @@
|
|
|
9856
10010
|
return Uint8Array.from(binString, (m) => m.codePointAt(0) || 0);
|
|
9857
10011
|
}
|
|
9858
10012
|
|
|
9859
|
-
/*
|
|
9860
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9861
|
-
* Licensed under the MIT License.
|
|
9862
|
-
*/
|
|
9863
|
-
/**
|
|
9864
|
-
* This file defines functions used by the browser library to perform cryptography operations such as
|
|
9865
|
-
* hashing and encoding. It also has helper functions to validate the availability of specific APIs.
|
|
9866
|
-
*/
|
|
9867
|
-
/**
|
|
9868
|
-
* See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
|
|
9869
|
-
*/
|
|
9870
|
-
// RSA KeyGen Algorithm
|
|
9871
|
-
const PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
|
|
9872
|
-
// SHA-256 hashing algorithm
|
|
9873
|
-
const S256_HASH_ALG = "SHA-256";
|
|
9874
|
-
// MOD length for PoP tokens
|
|
9875
|
-
const MODULUS_LENGTH = 2048;
|
|
9876
|
-
// Public Exponent
|
|
9877
|
-
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
|
9878
|
-
// UUID hex digits
|
|
9879
|
-
const UUID_CHARS = "0123456789abcdef";
|
|
9880
|
-
// Array to store UINT32 random value
|
|
9881
|
-
const UINT32_ARR = new Uint32Array(1);
|
|
9882
|
-
const keygenAlgorithmOptions = {
|
|
9883
|
-
name: PKCS1_V15_KEYGEN_ALG,
|
|
9884
|
-
hash: S256_HASH_ALG,
|
|
9885
|
-
modulusLength: MODULUS_LENGTH,
|
|
9886
|
-
publicExponent: PUBLIC_EXPONENT,
|
|
9887
|
-
};
|
|
9888
|
-
/**
|
|
9889
|
-
* Check whether browser crypto is available.
|
|
9890
|
-
*/
|
|
9891
|
-
function validateCryptoAvailable(logger) {
|
|
9892
|
-
if ("crypto" in window) {
|
|
9893
|
-
logger.verbose("BrowserCrypto: modern crypto interface available");
|
|
9894
|
-
}
|
|
9895
|
-
else {
|
|
9896
|
-
logger.error("BrowserCrypto: crypto interface is unavailable");
|
|
9897
|
-
throw createBrowserAuthError(cryptoNonExistent);
|
|
9898
|
-
}
|
|
9899
|
-
}
|
|
9900
|
-
/**
|
|
9901
|
-
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
|
9902
|
-
* @param dataString {string} data string
|
|
9903
|
-
* @param performanceClient {?IPerformanceClient}
|
|
9904
|
-
* @param correlationId {?string} correlation id
|
|
9905
|
-
*/
|
|
9906
|
-
async function sha256Digest(dataString, performanceClient, correlationId) {
|
|
9907
|
-
performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);
|
|
9908
|
-
const encoder = new TextEncoder();
|
|
9909
|
-
const data = encoder.encode(dataString);
|
|
9910
|
-
return window.crypto.subtle.digest(S256_HASH_ALG, data);
|
|
9911
|
-
}
|
|
9912
|
-
/**
|
|
9913
|
-
* Populates buffer with cryptographically random values.
|
|
9914
|
-
* @param dataBuffer
|
|
9915
|
-
*/
|
|
9916
|
-
function getRandomValues(dataBuffer) {
|
|
9917
|
-
return window.crypto.getRandomValues(dataBuffer);
|
|
9918
|
-
}
|
|
9919
|
-
/**
|
|
9920
|
-
* Returns random Uint32 value.
|
|
9921
|
-
* @returns {number}
|
|
9922
|
-
*/
|
|
9923
|
-
function getRandomUint32() {
|
|
9924
|
-
window.crypto.getRandomValues(UINT32_ARR);
|
|
9925
|
-
return UINT32_ARR[0];
|
|
9926
|
-
}
|
|
9927
|
-
/**
|
|
9928
|
-
* Creates a UUID v7 from the current timestamp.
|
|
9929
|
-
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
|
9930
|
-
* @returns {number}
|
|
9931
|
-
*/
|
|
9932
|
-
function createNewGuid() {
|
|
9933
|
-
const currentTimestamp = Date.now();
|
|
9934
|
-
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
|
|
9935
|
-
// Result byte array
|
|
9936
|
-
const bytes = new Uint8Array(16);
|
|
9937
|
-
// A 12-bit `rand_a` field value
|
|
9938
|
-
const randA = Math.trunc(baseRand / 2 ** 30);
|
|
9939
|
-
// The higher 30 bits of 62-bit `rand_b` field value
|
|
9940
|
-
const randBHi = baseRand & (2 ** 30 - 1);
|
|
9941
|
-
// The lower 32 bits of 62-bit `rand_b` field value
|
|
9942
|
-
const randBLo = getRandomUint32();
|
|
9943
|
-
bytes[0] = currentTimestamp / 2 ** 40;
|
|
9944
|
-
bytes[1] = currentTimestamp / 2 ** 32;
|
|
9945
|
-
bytes[2] = currentTimestamp / 2 ** 24;
|
|
9946
|
-
bytes[3] = currentTimestamp / 2 ** 16;
|
|
9947
|
-
bytes[4] = currentTimestamp / 2 ** 8;
|
|
9948
|
-
bytes[5] = currentTimestamp;
|
|
9949
|
-
bytes[6] = 0x70 | (randA >>> 8);
|
|
9950
|
-
bytes[7] = randA;
|
|
9951
|
-
bytes[8] = 0x80 | (randBHi >>> 24);
|
|
9952
|
-
bytes[9] = randBHi >>> 16;
|
|
9953
|
-
bytes[10] = randBHi >>> 8;
|
|
9954
|
-
bytes[11] = randBHi;
|
|
9955
|
-
bytes[12] = randBLo >>> 24;
|
|
9956
|
-
bytes[13] = randBLo >>> 16;
|
|
9957
|
-
bytes[14] = randBLo >>> 8;
|
|
9958
|
-
bytes[15] = randBLo;
|
|
9959
|
-
let text = "";
|
|
9960
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
9961
|
-
text += UUID_CHARS.charAt(bytes[i] >>> 4);
|
|
9962
|
-
text += UUID_CHARS.charAt(bytes[i] & 0xf);
|
|
9963
|
-
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
|
9964
|
-
text += "-";
|
|
9965
|
-
}
|
|
9966
|
-
}
|
|
9967
|
-
return text;
|
|
9968
|
-
}
|
|
9969
|
-
/**
|
|
9970
|
-
* Generates a keypair based on current keygen algorithm config.
|
|
9971
|
-
* @param extractable
|
|
9972
|
-
* @param usages
|
|
9973
|
-
*/
|
|
9974
|
-
async function generateKeyPair(extractable, usages) {
|
|
9975
|
-
return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);
|
|
9976
|
-
}
|
|
9977
|
-
/**
|
|
9978
|
-
* Export key as Json Web Key (JWK)
|
|
9979
|
-
* @param key
|
|
9980
|
-
*/
|
|
9981
|
-
async function exportJwk(key) {
|
|
9982
|
-
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
|
9983
|
-
}
|
|
9984
|
-
/**
|
|
9985
|
-
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
|
9986
|
-
* @param key
|
|
9987
|
-
* @param extractable
|
|
9988
|
-
* @param usages
|
|
9989
|
-
*/
|
|
9990
|
-
async function importJwk(key, extractable, usages) {
|
|
9991
|
-
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);
|
|
9992
|
-
}
|
|
9993
|
-
/**
|
|
9994
|
-
* Signs given data with given key
|
|
9995
|
-
* @param key
|
|
9996
|
-
* @param data
|
|
9997
|
-
*/
|
|
9998
|
-
async function sign(key, data) {
|
|
9999
|
-
return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
|
|
10000
|
-
}
|
|
10001
|
-
|
|
10002
10013
|
/*
|
|
10003
10014
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10004
10015
|
* Licensed under the MIT License.
|
|
@@ -12750,6 +12761,7 @@
|
|
|
12750
12761
|
const fullAccount = {
|
|
12751
12762
|
...account,
|
|
12752
12763
|
idTokenClaims: result?.idTokenClaims,
|
|
12764
|
+
idToken: result?.idToken,
|
|
12753
12765
|
};
|
|
12754
12766
|
return {
|
|
12755
12767
|
...result,
|
|
@@ -12851,15 +12863,19 @@
|
|
|
12851
12863
|
*/
|
|
12852
12864
|
async handleNativeResponse(response, request, reqTimestamp) {
|
|
12853
12865
|
this.logger.trace("NativeInteractionClient - handleNativeResponse called.");
|
|
12854
|
-
|
|
12866
|
+
// generate identifiers
|
|
12867
|
+
const idTokenClaims = extractTokenClaims(response.id_token, base64Decode);
|
|
12868
|
+
const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);
|
|
12869
|
+
const cachedhomeAccountId = this.browserStorage.getAccountInfoFilteredBy({
|
|
12870
|
+
nativeAccountId: request.accountId,
|
|
12871
|
+
})?.homeAccountId;
|
|
12872
|
+
if (homeAccountIdentifier !== cachedhomeAccountId &&
|
|
12873
|
+
response.account.id !== request.accountId) {
|
|
12855
12874
|
// 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
|
|
12856
12875
|
throw createNativeAuthError(userSwitch);
|
|
12857
12876
|
}
|
|
12858
12877
|
// Get the preferred_cache domain for the given authority
|
|
12859
12878
|
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
12860
|
-
// generate identifiers
|
|
12861
|
-
const idTokenClaims = extractTokenClaims(response.id_token, base64Decode);
|
|
12862
|
-
const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);
|
|
12863
12879
|
const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier, idTokenClaims, base64Decode, response.client_info, undefined, // environment
|
|
12864
12880
|
idTokenClaims.tid, undefined, // auth code payload
|
|
12865
12881
|
response.account.id, this.logger);
|
|
@@ -12955,7 +12971,14 @@
|
|
|
12955
12971
|
idTokenClaims.tid ||
|
|
12956
12972
|
Constants.EMPTY_STRING;
|
|
12957
12973
|
const accountInfo = updateAccountTenantProfileData(accountEntity.getAccountInfo(), undefined, // tenantProfile optional
|
|
12958
|
-
idTokenClaims);
|
|
12974
|
+
idTokenClaims, response.id_token);
|
|
12975
|
+
/**
|
|
12976
|
+
* In pairwise broker flows, this check prevents the broker's native account id
|
|
12977
|
+
* from being returned over the embedded app's account id.
|
|
12978
|
+
*/
|
|
12979
|
+
if (accountInfo.nativeAccountId !== response.account.id) {
|
|
12980
|
+
accountInfo.nativeAccountId = response.account.id;
|
|
12981
|
+
}
|
|
12959
12982
|
// generate PoP token as needed
|
|
12960
12983
|
const responseAccessToken = await this.generatePopAccessToken(response, request);
|
|
12961
12984
|
const tokenType = request.tokenType === AuthenticationScheme.POP
|
|
@@ -14617,17 +14640,20 @@
|
|
|
14617
14640
|
(!request.account || !request.account.username)) {
|
|
14618
14641
|
this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");
|
|
14619
14642
|
}
|
|
14620
|
-
// Check
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14643
|
+
// Check the prompt value
|
|
14644
|
+
const inputRequest = { ...request };
|
|
14645
|
+
if (inputRequest.prompt) {
|
|
14646
|
+
if (inputRequest.prompt !== PromptValue.NONE &&
|
|
14647
|
+
inputRequest.prompt !== PromptValue.NO_SESSION) {
|
|
14648
|
+
this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${inputRequest.prompt} with ${PromptValue.NONE}`);
|
|
14649
|
+
inputRequest.prompt = PromptValue.NONE;
|
|
14650
|
+
}
|
|
14651
|
+
}
|
|
14652
|
+
else {
|
|
14653
|
+
inputRequest.prompt = PromptValue.NONE;
|
|
14625
14654
|
}
|
|
14626
14655
|
// Create silent request
|
|
14627
|
-
const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(
|
|
14628
|
-
...request,
|
|
14629
|
-
prompt: request.prompt || PromptValue.NONE,
|
|
14630
|
-
}, exports.InteractionType.Silent);
|
|
14656
|
+
const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(inputRequest, exports.InteractionType.Silent);
|
|
14631
14657
|
preconnect(silentRequest.authority);
|
|
14632
14658
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
14633
14659
|
try {
|
|
@@ -17621,7 +17647,7 @@
|
|
|
17621
17647
|
}, intFields);
|
|
17622
17648
|
}
|
|
17623
17649
|
generateId() {
|
|
17624
|
-
return
|
|
17650
|
+
return createNewGuid();
|
|
17625
17651
|
}
|
|
17626
17652
|
getPageVisibility() {
|
|
17627
17653
|
return document.visibilityState?.toString() || null;
|