@azure/msal-node 5.1.0 → 5.1.2
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/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/ClientApplication.mjs +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.mjs +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +1 -1
- package/dist/client/DeviceCodeClient.mjs +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.mjs +1 -1
- package/dist/client/PublicClientApplication.mjs +1 -1
- package/dist/client/UsernamePasswordClient.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/LoopbackClient.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
- package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
- package/dist/retry/ImdsRetryPolicy.mjs +1 -1
- package/dist/retry/LinearRetryStrategy.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/lib/msal-node.cjs +552 -531
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/package.json +2 -2
- package/src/packageMetadata.ts +1 -1
package/lib/msal-node.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v5.1.
|
|
1
|
+
/*! @azure/msal-node v5.1.2 2026-04-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -150,7 +150,7 @@ class Serializer {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
/*! @azure/msal-common v16.
|
|
153
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
154
154
|
/*
|
|
155
155
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
156
156
|
* Licensed under the MIT License.
|
|
@@ -398,7 +398,7 @@ const EncodingTypes = {
|
|
|
398
398
|
UTF8: "utf-8",
|
|
399
399
|
};
|
|
400
400
|
|
|
401
|
-
/*! @azure/msal-common v16.
|
|
401
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
402
402
|
/*
|
|
403
403
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
404
404
|
* Licensed under the MIT License.
|
|
@@ -448,9 +448,10 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
|
448
448
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
449
449
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
450
450
|
const INSTANCE_AWARE = "instance_aware";
|
|
451
|
-
const RESOURCE = "resource";
|
|
451
|
+
const RESOURCE = "resource";
|
|
452
|
+
const CLI_DATA = "clidata";
|
|
452
453
|
|
|
453
|
-
/*! @azure/msal-common v16.
|
|
454
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
454
455
|
/*
|
|
455
456
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
456
457
|
* Licensed under the MIT License.
|
|
@@ -481,7 +482,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
481
482
|
return new AuthError(code, additionalMessage || getDefaultErrorMessage(code));
|
|
482
483
|
}
|
|
483
484
|
|
|
484
|
-
/*! @azure/msal-common v16.
|
|
485
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
485
486
|
|
|
486
487
|
/*
|
|
487
488
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -501,7 +502,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
501
502
|
return new ClientConfigurationError(errorCode);
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
/*! @azure/msal-common v16.
|
|
505
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
505
506
|
/*
|
|
506
507
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
507
508
|
* Licensed under the MIT License.
|
|
@@ -581,7 +582,7 @@ class StringUtils {
|
|
|
581
582
|
}
|
|
582
583
|
}
|
|
583
584
|
|
|
584
|
-
/*! @azure/msal-common v16.
|
|
585
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
585
586
|
|
|
586
587
|
/*
|
|
587
588
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -604,7 +605,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
604
605
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
605
606
|
}
|
|
606
607
|
|
|
607
|
-
/*! @azure/msal-common v16.
|
|
608
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
608
609
|
/*
|
|
609
610
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
610
611
|
* Licensed under the MIT License.
|
|
@@ -658,7 +659,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
658
659
|
urlParseError: urlParseError
|
|
659
660
|
});
|
|
660
661
|
|
|
661
|
-
/*! @azure/msal-common v16.
|
|
662
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
662
663
|
/*
|
|
663
664
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
664
665
|
* Licensed under the MIT License.
|
|
@@ -746,7 +747,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
746
747
|
userCanceled: userCanceled
|
|
747
748
|
});
|
|
748
749
|
|
|
749
|
-
/*! @azure/msal-common v16.
|
|
750
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
750
751
|
|
|
751
752
|
/*
|
|
752
753
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -941,7 +942,7 @@ class ScopeSet {
|
|
|
941
942
|
}
|
|
942
943
|
}
|
|
943
944
|
|
|
944
|
-
/*! @azure/msal-common v16.
|
|
945
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
945
946
|
|
|
946
947
|
/*
|
|
947
948
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1222,6 +1223,12 @@ function addGrantType(parameters, grantType) {
|
|
|
1222
1223
|
function addClientInfo(parameters) {
|
|
1223
1224
|
parameters.set(CLIENT_INFO, "1");
|
|
1224
1225
|
}
|
|
1226
|
+
/**
|
|
1227
|
+
* add clidata=1 to request to indicate client data support
|
|
1228
|
+
*/
|
|
1229
|
+
function addCliData(parameters) {
|
|
1230
|
+
parameters.set(CLI_DATA, "1");
|
|
1231
|
+
}
|
|
1225
1232
|
function addInstanceAware(parameters) {
|
|
1226
1233
|
if (!parameters.has(INSTANCE_AWARE)) {
|
|
1227
1234
|
parameters.set(INSTANCE_AWARE, "true");
|
|
@@ -1331,7 +1338,7 @@ function addResource(parameters, resource) {
|
|
|
1331
1338
|
}
|
|
1332
1339
|
}
|
|
1333
1340
|
|
|
1334
|
-
/*! @azure/msal-common v16.
|
|
1341
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1335
1342
|
/**
|
|
1336
1343
|
* Parses hash string from given string. Returns empty string if no hash symbol is found.
|
|
1337
1344
|
* @param hashString
|
|
@@ -1384,7 +1391,7 @@ function mapToQueryString(parameters) {
|
|
|
1384
1391
|
return queryParameterArray.join("&");
|
|
1385
1392
|
}
|
|
1386
1393
|
|
|
1387
|
-
/*! @azure/msal-common v16.
|
|
1394
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1388
1395
|
|
|
1389
1396
|
/*
|
|
1390
1397
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1423,7 +1430,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
1423
1430
|
},
|
|
1424
1431
|
};
|
|
1425
1432
|
|
|
1426
|
-
/*! @azure/msal-common v16.
|
|
1433
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1427
1434
|
/*
|
|
1428
1435
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1429
1436
|
* Licensed under the MIT License.
|
|
@@ -1684,12 +1691,12 @@ class Logger {
|
|
|
1684
1691
|
}
|
|
1685
1692
|
}
|
|
1686
1693
|
|
|
1687
|
-
/*! @azure/msal-common v16.
|
|
1694
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1688
1695
|
/* eslint-disable header/header */
|
|
1689
1696
|
const name$1 = "@azure/msal-common";
|
|
1690
|
-
const version$1 = "16.
|
|
1697
|
+
const version$1 = "16.4.1";
|
|
1691
1698
|
|
|
1692
|
-
/*! @azure/msal-common v16.
|
|
1699
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1693
1700
|
/*
|
|
1694
1701
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1695
1702
|
* Licensed under the MIT License.
|
|
@@ -1709,7 +1716,7 @@ const AzureCloudInstance = {
|
|
|
1709
1716
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1710
1717
|
};
|
|
1711
1718
|
|
|
1712
|
-
/*! @azure/msal-common v16.
|
|
1719
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1713
1720
|
/*
|
|
1714
1721
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1715
1722
|
* Licensed under the MIT License.
|
|
@@ -1791,7 +1798,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
1791
1798
|
return updatedAccountInfo;
|
|
1792
1799
|
}
|
|
1793
1800
|
|
|
1794
|
-
/*! @azure/msal-common v16.
|
|
1801
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1795
1802
|
|
|
1796
1803
|
/*
|
|
1797
1804
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1871,7 +1878,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1871
1878
|
}
|
|
1872
1879
|
}
|
|
1873
1880
|
|
|
1874
|
-
/*! @azure/msal-common v16.
|
|
1881
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
1875
1882
|
|
|
1876
1883
|
/*
|
|
1877
1884
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2028,7 +2035,7 @@ class UrlString {
|
|
|
2028
2035
|
}
|
|
2029
2036
|
}
|
|
2030
2037
|
|
|
2031
|
-
/*! @azure/msal-common v16.
|
|
2038
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2032
2039
|
|
|
2033
2040
|
/*
|
|
2034
2041
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2185,7 +2192,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2185
2192
|
return null;
|
|
2186
2193
|
}
|
|
2187
2194
|
|
|
2188
|
-
/*! @azure/msal-common v16.
|
|
2195
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2189
2196
|
/*
|
|
2190
2197
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2191
2198
|
* Licensed under the MIT License.
|
|
@@ -2193,7 +2200,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2193
2200
|
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
2194
2201
|
const cacheErrorUnknown = "cache_error_unknown";
|
|
2195
2202
|
|
|
2196
|
-
/*! @azure/msal-common v16.
|
|
2203
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2197
2204
|
|
|
2198
2205
|
/*
|
|
2199
2206
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2231,7 +2238,7 @@ function createCacheError(e) {
|
|
|
2231
2238
|
}
|
|
2232
2239
|
}
|
|
2233
2240
|
|
|
2234
|
-
/*! @azure/msal-common v16.
|
|
2241
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2235
2242
|
|
|
2236
2243
|
/*
|
|
2237
2244
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2269,7 +2276,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
2269
2276
|
};
|
|
2270
2277
|
}
|
|
2271
2278
|
|
|
2272
|
-
/*! @azure/msal-common v16.
|
|
2279
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2273
2280
|
/*
|
|
2274
2281
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2275
2282
|
* Licensed under the MIT License.
|
|
@@ -2284,7 +2291,7 @@ const AuthorityType = {
|
|
|
2284
2291
|
Ciam: 3,
|
|
2285
2292
|
};
|
|
2286
2293
|
|
|
2287
|
-
/*! @azure/msal-common v16.
|
|
2294
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2288
2295
|
/*
|
|
2289
2296
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2290
2297
|
* Licensed under the MIT License.
|
|
@@ -2306,7 +2313,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2306
2313
|
return null;
|
|
2307
2314
|
}
|
|
2308
2315
|
|
|
2309
|
-
/*! @azure/msal-common v16.
|
|
2316
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2310
2317
|
/*
|
|
2311
2318
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2312
2319
|
* Licensed under the MIT License.
|
|
@@ -2330,7 +2337,7 @@ const ProtocolMode = {
|
|
|
2330
2337
|
EAR: "EAR",
|
|
2331
2338
|
};
|
|
2332
2339
|
|
|
2333
|
-
/*! @azure/msal-common v16.
|
|
2340
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2334
2341
|
/**
|
|
2335
2342
|
* Returns the AccountInfo interface for this account.
|
|
2336
2343
|
*/
|
|
@@ -2473,7 +2480,7 @@ function isAccountEntity(entity) {
|
|
|
2473
2480
|
entity.hasOwnProperty("authorityType"));
|
|
2474
2481
|
}
|
|
2475
2482
|
|
|
2476
|
-
/*! @azure/msal-common v16.
|
|
2483
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
2477
2484
|
|
|
2478
2485
|
/*
|
|
2479
2486
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2503,6 +2510,11 @@ class CacheManager {
|
|
|
2503
2510
|
* Gets first tenanted AccountInfo object found based on provided filters
|
|
2504
2511
|
*/
|
|
2505
2512
|
getAccountInfoFilteredBy(accountFilter, correlationId) {
|
|
2513
|
+
if (Object.keys(accountFilter).length === 0 ||
|
|
2514
|
+
Object.values(accountFilter).every((value) => value === null || value === undefined || value === "")) {
|
|
2515
|
+
this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null", correlationId);
|
|
2516
|
+
return null;
|
|
2517
|
+
}
|
|
2506
2518
|
const allAccounts = this.getAllAccounts(accountFilter, correlationId);
|
|
2507
2519
|
if (allAccounts.length > 1) {
|
|
2508
2520
|
// If one or more accounts are found, prioritize accounts that have an ID token
|
|
@@ -3569,7 +3581,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3569
3581
|
}
|
|
3570
3582
|
}
|
|
3571
3583
|
|
|
3572
|
-
/*! @azure/msal-common v16.
|
|
3584
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
3573
3585
|
/*
|
|
3574
3586
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3575
3587
|
* Licensed under the MIT License.
|
|
@@ -3583,7 +3595,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3583
3595
|
const PerformanceEventStatus = {
|
|
3584
3596
|
InProgress: 1};
|
|
3585
3597
|
|
|
3586
|
-
/*! @azure/msal-common v16.
|
|
3598
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
3587
3599
|
|
|
3588
3600
|
/*
|
|
3589
3601
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3638,7 +3650,7 @@ class StubPerformanceClient {
|
|
|
3638
3650
|
}
|
|
3639
3651
|
}
|
|
3640
3652
|
|
|
3641
|
-
/*! @azure/msal-common v16.
|
|
3653
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
3642
3654
|
|
|
3643
3655
|
/*
|
|
3644
3656
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3733,190 +3745,34 @@ function isOidcProtocolMode(config) {
|
|
|
3733
3745
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
3734
3746
|
}
|
|
3735
3747
|
|
|
3736
|
-
/*! @azure/msal-common v16.
|
|
3737
|
-
|
|
3738
|
-
/*
|
|
3739
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3740
|
-
* Licensed under the MIT License.
|
|
3741
|
-
*/
|
|
3742
|
-
/**
|
|
3743
|
-
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
3744
|
-
*/
|
|
3745
|
-
class ServerError extends AuthError {
|
|
3746
|
-
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
3747
|
-
super(errorCode, errorMessage, subError);
|
|
3748
|
-
this.name = "ServerError";
|
|
3749
|
-
this.errorNo = errorNo;
|
|
3750
|
-
this.status = status;
|
|
3751
|
-
Object.setPrototypeOf(this, ServerError.prototype);
|
|
3752
|
-
}
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
/*! @azure/msal-common v16.3.0 2026-03-13 */
|
|
3756
|
-
/*
|
|
3757
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3758
|
-
* Licensed under the MIT License.
|
|
3759
|
-
*/
|
|
3760
|
-
/**
|
|
3761
|
-
* MSAL-defined interaction required error code indicating no tokens are found in cache.
|
|
3762
|
-
* @public
|
|
3763
|
-
*/
|
|
3764
|
-
const noTokensFound = "no_tokens_found";
|
|
3765
|
-
/**
|
|
3766
|
-
* MSAL-defined error code indicating a native account is unavailable on the platform.
|
|
3767
|
-
* @public
|
|
3768
|
-
*/
|
|
3769
|
-
const nativeAccountUnavailable = "native_account_unavailable";
|
|
3770
|
-
/**
|
|
3771
|
-
* MSAL-defined error code indicating the refresh token has expired and user interaction is needed.
|
|
3772
|
-
* @public
|
|
3773
|
-
*/
|
|
3774
|
-
const refreshTokenExpired = "refresh_token_expired";
|
|
3775
|
-
/**
|
|
3776
|
-
* MSAL-defined error code indicating UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction.
|
|
3777
|
-
* @public
|
|
3778
|
-
*/
|
|
3779
|
-
const uxNotAllowed = "ux_not_allowed";
|
|
3780
|
-
/**
|
|
3781
|
-
* Server-originated error code indicating interaction is required to complete the request.
|
|
3782
|
-
* @public
|
|
3783
|
-
*/
|
|
3784
|
-
const interactionRequired = "interaction_required";
|
|
3785
|
-
/**
|
|
3786
|
-
* Server-originated error code indicating user consent is required.
|
|
3787
|
-
* @public
|
|
3788
|
-
*/
|
|
3789
|
-
const consentRequired = "consent_required";
|
|
3790
|
-
/**
|
|
3791
|
-
* Server-originated error code indicating user login is required.
|
|
3792
|
-
* @public
|
|
3793
|
-
*/
|
|
3794
|
-
const loginRequired = "login_required";
|
|
3795
|
-
/**
|
|
3796
|
-
* Server-originated error code indicating the token is invalid or corrupted.
|
|
3797
|
-
* @public
|
|
3798
|
-
*/
|
|
3799
|
-
const badToken = "bad_token";
|
|
3800
|
-
/**
|
|
3801
|
-
* Server-originated error code indicating the user is in an interrupted state and interaction is required.
|
|
3802
|
-
* @public
|
|
3803
|
-
*/
|
|
3804
|
-
const interruptedUser = "interrupted_user";
|
|
3805
|
-
|
|
3806
|
-
var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
3807
|
-
__proto__: null,
|
|
3808
|
-
badToken: badToken,
|
|
3809
|
-
consentRequired: consentRequired,
|
|
3810
|
-
interactionRequired: interactionRequired,
|
|
3811
|
-
interruptedUser: interruptedUser,
|
|
3812
|
-
loginRequired: loginRequired,
|
|
3813
|
-
nativeAccountUnavailable: nativeAccountUnavailable,
|
|
3814
|
-
noTokensFound: noTokensFound,
|
|
3815
|
-
refreshTokenExpired: refreshTokenExpired,
|
|
3816
|
-
uxNotAllowed: uxNotAllowed
|
|
3817
|
-
});
|
|
3818
|
-
|
|
3819
|
-
/*! @azure/msal-common v16.3.0 2026-03-13 */
|
|
3820
|
-
|
|
3748
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
3821
3749
|
/*
|
|
3822
3750
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3823
3751
|
* Licensed under the MIT License.
|
|
3824
3752
|
*/
|
|
3825
3753
|
/**
|
|
3826
|
-
*
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
badToken,
|
|
3833
|
-
uxNotAllowed,
|
|
3834
|
-
interruptedUser,
|
|
3835
|
-
];
|
|
3836
|
-
const InteractionRequiredAuthSubErrorMessage = [
|
|
3837
|
-
"message_only",
|
|
3838
|
-
"additional_action",
|
|
3839
|
-
"basic_action",
|
|
3840
|
-
"user_password_expired",
|
|
3841
|
-
"consent_required",
|
|
3842
|
-
"bad_token",
|
|
3843
|
-
"ux_not_allowed",
|
|
3844
|
-
"interrupted_user",
|
|
3845
|
-
];
|
|
3846
|
-
/**
|
|
3847
|
-
* Error thrown when user interaction is required.
|
|
3848
|
-
*/
|
|
3849
|
-
class InteractionRequiredAuthError extends AuthError {
|
|
3850
|
-
constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
|
|
3851
|
-
super(errorCode, errorMessage, subError);
|
|
3852
|
-
Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
|
|
3853
|
-
this.timestamp = timestamp || "";
|
|
3854
|
-
this.traceId = traceId || "";
|
|
3855
|
-
this.correlationId = correlationId || "";
|
|
3856
|
-
this.claims = claims || "";
|
|
3857
|
-
this.name = "InteractionRequiredAuthError";
|
|
3858
|
-
this.errorNo = errorNo;
|
|
3859
|
-
}
|
|
3860
|
-
}
|
|
3861
|
-
/**
|
|
3862
|
-
* Helper function used to determine if an error thrown by the server requires interaction to resolve
|
|
3863
|
-
* @param errorCode
|
|
3864
|
-
* @param errorString
|
|
3865
|
-
* @param subError
|
|
3866
|
-
*/
|
|
3867
|
-
function isInteractionRequiredError(errorCode, errorString, subError) {
|
|
3868
|
-
const isInteractionRequiredErrorCode = !!errorCode &&
|
|
3869
|
-
InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;
|
|
3870
|
-
const isInteractionRequiredSubError = !!subError &&
|
|
3871
|
-
InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;
|
|
3872
|
-
const isInteractionRequiredErrorDesc = !!errorString &&
|
|
3873
|
-
InteractionRequiredServerErrorMessage.some((irErrorCode) => {
|
|
3874
|
-
return errorString.indexOf(irErrorCode) > -1;
|
|
3875
|
-
});
|
|
3876
|
-
return (isInteractionRequiredErrorCode ||
|
|
3877
|
-
isInteractionRequiredErrorDesc ||
|
|
3878
|
-
isInteractionRequiredSubError);
|
|
3879
|
-
}
|
|
3880
|
-
/**
|
|
3881
|
-
* Creates an InteractionRequiredAuthError
|
|
3882
|
-
*/
|
|
3883
|
-
function createInteractionRequiredAuthError(errorCode, errorMessage) {
|
|
3884
|
-
return new InteractionRequiredAuthError(errorCode, errorMessage);
|
|
3885
|
-
}
|
|
3886
|
-
|
|
3887
|
-
/*! @azure/msal-common v16.3.0 2026-03-13 */
|
|
3888
|
-
/**
|
|
3889
|
-
* Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
|
|
3890
|
-
* @param base64Decode
|
|
3891
|
-
* @param state
|
|
3892
|
-
*/
|
|
3893
|
-
function parseRequestState(base64Decode, state) {
|
|
3894
|
-
if (!base64Decode) {
|
|
3895
|
-
throw createClientAuthError(noCryptoObject);
|
|
3896
|
-
}
|
|
3897
|
-
if (!state) {
|
|
3898
|
-
throw createClientAuthError(invalidState);
|
|
3754
|
+
* This class instance helps track the memory changes facilitating
|
|
3755
|
+
* decisions to read from and write to the persistent cache
|
|
3756
|
+
*/ class TokenCacheContext {
|
|
3757
|
+
constructor(tokenCache, hasChanged) {
|
|
3758
|
+
this.cache = tokenCache;
|
|
3759
|
+
this.hasChanged = hasChanged;
|
|
3899
3760
|
}
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
? splitState.slice(1).join(RESOURCE_DELIM)
|
|
3906
|
-
: "";
|
|
3907
|
-
const libraryStateString = base64Decode(libraryState);
|
|
3908
|
-
const libraryStateObj = JSON.parse(libraryStateString);
|
|
3909
|
-
return {
|
|
3910
|
-
userRequestState: userState || "",
|
|
3911
|
-
libraryState: libraryStateObj,
|
|
3912
|
-
};
|
|
3761
|
+
/**
|
|
3762
|
+
* boolean which indicates the changes in cache
|
|
3763
|
+
*/
|
|
3764
|
+
get cacheHasChanged() {
|
|
3765
|
+
return this.hasChanged;
|
|
3913
3766
|
}
|
|
3914
|
-
|
|
3915
|
-
|
|
3767
|
+
/**
|
|
3768
|
+
* function to retrieve the token cache
|
|
3769
|
+
*/
|
|
3770
|
+
get tokenCache() {
|
|
3771
|
+
return this.cache;
|
|
3916
3772
|
}
|
|
3917
3773
|
}
|
|
3918
3774
|
|
|
3919
|
-
/*! @azure/msal-common v16.
|
|
3775
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
3920
3776
|
/*
|
|
3921
3777
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3922
3778
|
* Licensed under the MIT License.
|
|
@@ -3971,54 +3827,313 @@ function delay(t, value) {
|
|
|
3971
3827
|
return new Promise((resolve) => setTimeout(() => resolve(value), t));
|
|
3972
3828
|
}
|
|
3973
3829
|
|
|
3974
|
-
/*! @azure/msal-common v16.
|
|
3830
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
3831
|
+
|
|
3975
3832
|
/*
|
|
3976
3833
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3977
3834
|
* Licensed under the MIT License.
|
|
3978
3835
|
*/
|
|
3979
3836
|
/**
|
|
3980
|
-
*
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
/**
|
|
3986
|
-
* Time spent on the network for refresh token acquisition
|
|
3987
|
-
*/
|
|
3988
|
-
const RefreshTokenClientExecuteTokenRequest = "refreshTokenClientExecuteTokenRequest";
|
|
3989
|
-
/**
|
|
3990
|
-
* Time taken for acquiring refresh token , records RT size
|
|
3991
|
-
*/
|
|
3992
|
-
const RefreshTokenClientAcquireToken = "refreshTokenClientAcquireToken";
|
|
3993
|
-
/**
|
|
3994
|
-
* Time taken for acquiring cached refresh token
|
|
3995
|
-
*/
|
|
3996
|
-
const RefreshTokenClientAcquireTokenWithCachedRefreshToken = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
|
|
3997
|
-
/**
|
|
3998
|
-
* Helper function to create token request body in RefreshTokenClient (msal-common).
|
|
3999
|
-
*/
|
|
4000
|
-
const RefreshTokenClientCreateTokenRequestBody = "refreshTokenClientCreateTokenRequestBody";
|
|
4001
|
-
const SilentFlowClientGenerateResultFromCacheRecord = "silentFlowClientGenerateResultFromCacheRecord";
|
|
4002
|
-
/**
|
|
4003
|
-
* APIs in Authorization Code Client (msal-common)
|
|
4004
|
-
*/
|
|
4005
|
-
const AuthClientExecuteTokenRequest = "authClientExecuteTokenRequest";
|
|
4006
|
-
const AuthClientCreateTokenRequestBody = "authClientCreateTokenRequestBody";
|
|
4007
|
-
const UpdateTokenEndpointAuthority = "updateTokenEndpointAuthority";
|
|
4008
|
-
/**
|
|
4009
|
-
* Generate functions in PopTokenGenerator (msal-common)
|
|
4010
|
-
*/
|
|
4011
|
-
const PopTokenGenerateCnf = "popTokenGenerateCnf";
|
|
4012
|
-
/**
|
|
4013
|
-
* handleServerTokenResponse API in ResponseHandler (msal-common)
|
|
3837
|
+
* Create IdTokenEntity
|
|
3838
|
+
* @param homeAccountId
|
|
3839
|
+
* @param authenticationResult
|
|
3840
|
+
* @param clientId
|
|
3841
|
+
* @param authority
|
|
4014
3842
|
*/
|
|
4015
|
-
|
|
3843
|
+
function createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {
|
|
3844
|
+
const idTokenEntity = {
|
|
3845
|
+
credentialType: CredentialType.ID_TOKEN,
|
|
3846
|
+
homeAccountId: homeAccountId,
|
|
3847
|
+
environment: environment,
|
|
3848
|
+
clientId: clientId,
|
|
3849
|
+
secret: idToken,
|
|
3850
|
+
realm: tenantId,
|
|
3851
|
+
lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
|
|
3852
|
+
};
|
|
3853
|
+
return idTokenEntity;
|
|
3854
|
+
}
|
|
4016
3855
|
/**
|
|
4017
|
-
*
|
|
3856
|
+
* Create AccessTokenEntity
|
|
3857
|
+
* @param homeAccountId
|
|
3858
|
+
* @param environment
|
|
3859
|
+
* @param accessToken
|
|
3860
|
+
* @param clientId
|
|
3861
|
+
* @param tenantId
|
|
3862
|
+
* @param scopes
|
|
3863
|
+
* @param expiresOn
|
|
3864
|
+
* @param extExpiresOn
|
|
4018
3865
|
*/
|
|
4019
|
-
|
|
4020
|
-
const
|
|
4021
|
-
|
|
3866
|
+
function createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, base64Decode, refreshOn, tokenType, userAssertionHash, keyId) {
|
|
3867
|
+
const atEntity = {
|
|
3868
|
+
homeAccountId: homeAccountId,
|
|
3869
|
+
credentialType: CredentialType.ACCESS_TOKEN,
|
|
3870
|
+
secret: accessToken,
|
|
3871
|
+
cachedAt: nowSeconds().toString(),
|
|
3872
|
+
expiresOn: expiresOn.toString(),
|
|
3873
|
+
extendedExpiresOn: extExpiresOn.toString(),
|
|
3874
|
+
environment: environment,
|
|
3875
|
+
clientId: clientId,
|
|
3876
|
+
realm: tenantId,
|
|
3877
|
+
target: scopes,
|
|
3878
|
+
tokenType: tokenType || AuthenticationScheme.BEARER,
|
|
3879
|
+
lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
|
|
3880
|
+
};
|
|
3881
|
+
if (userAssertionHash) {
|
|
3882
|
+
atEntity.userAssertionHash = userAssertionHash;
|
|
3883
|
+
}
|
|
3884
|
+
if (refreshOn) {
|
|
3885
|
+
atEntity.refreshOn = refreshOn.toString();
|
|
3886
|
+
}
|
|
3887
|
+
/*
|
|
3888
|
+
* Create Access Token With Auth Scheme instead of regular access token
|
|
3889
|
+
* Cast to lower to handle "bearer" from ADFS
|
|
3890
|
+
*/
|
|
3891
|
+
if (atEntity.tokenType?.toLowerCase() !==
|
|
3892
|
+
AuthenticationScheme.BEARER.toLowerCase()) {
|
|
3893
|
+
atEntity.credentialType =
|
|
3894
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
3895
|
+
switch (atEntity.tokenType) {
|
|
3896
|
+
case AuthenticationScheme.POP:
|
|
3897
|
+
// Make sure keyId is present and add it to credential
|
|
3898
|
+
const tokenClaims = extractTokenClaims(accessToken, base64Decode);
|
|
3899
|
+
if (!tokenClaims?.cnf?.kid) {
|
|
3900
|
+
throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
|
|
3901
|
+
}
|
|
3902
|
+
atEntity.keyId = tokenClaims.cnf.kid;
|
|
3903
|
+
break;
|
|
3904
|
+
case AuthenticationScheme.SSH:
|
|
3905
|
+
atEntity.keyId = keyId;
|
|
3906
|
+
}
|
|
3907
|
+
}
|
|
3908
|
+
return atEntity;
|
|
3909
|
+
}
|
|
3910
|
+
/**
|
|
3911
|
+
* Create RefreshTokenEntity
|
|
3912
|
+
* @param homeAccountId
|
|
3913
|
+
* @param authenticationResult
|
|
3914
|
+
* @param clientId
|
|
3915
|
+
* @param authority
|
|
3916
|
+
*/
|
|
3917
|
+
function createRefreshTokenEntity(homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash, expiresOn) {
|
|
3918
|
+
const rtEntity = {
|
|
3919
|
+
credentialType: CredentialType.REFRESH_TOKEN,
|
|
3920
|
+
homeAccountId: homeAccountId,
|
|
3921
|
+
environment: environment,
|
|
3922
|
+
clientId: clientId,
|
|
3923
|
+
secret: refreshToken,
|
|
3924
|
+
lastUpdatedAt: Date.now().toString(),
|
|
3925
|
+
};
|
|
3926
|
+
if (userAssertionHash) {
|
|
3927
|
+
rtEntity.userAssertionHash = userAssertionHash;
|
|
3928
|
+
}
|
|
3929
|
+
if (familyId) {
|
|
3930
|
+
rtEntity.familyId = familyId;
|
|
3931
|
+
}
|
|
3932
|
+
if (expiresOn) {
|
|
3933
|
+
rtEntity.expiresOn = expiresOn.toString();
|
|
3934
|
+
}
|
|
3935
|
+
return rtEntity;
|
|
3936
|
+
}
|
|
3937
|
+
function isCredentialEntity(entity) {
|
|
3938
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
3939
|
+
entity.hasOwnProperty("environment") &&
|
|
3940
|
+
entity.hasOwnProperty("credentialType") &&
|
|
3941
|
+
entity.hasOwnProperty("clientId") &&
|
|
3942
|
+
entity.hasOwnProperty("secret"));
|
|
3943
|
+
}
|
|
3944
|
+
/**
|
|
3945
|
+
* Validates an entity: checks for all expected params
|
|
3946
|
+
* @param entity
|
|
3947
|
+
*/
|
|
3948
|
+
function isAccessTokenEntity(entity) {
|
|
3949
|
+
if (!entity) {
|
|
3950
|
+
return false;
|
|
3951
|
+
}
|
|
3952
|
+
return (isCredentialEntity(entity) &&
|
|
3953
|
+
entity.hasOwnProperty("realm") &&
|
|
3954
|
+
entity.hasOwnProperty("target") &&
|
|
3955
|
+
(entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
|
|
3956
|
+
entity["credentialType"] ===
|
|
3957
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
|
|
3958
|
+
}
|
|
3959
|
+
/**
|
|
3960
|
+
* Validates an entity: checks for all expected params
|
|
3961
|
+
* @param entity
|
|
3962
|
+
*/
|
|
3963
|
+
function isIdTokenEntity(entity) {
|
|
3964
|
+
if (!entity) {
|
|
3965
|
+
return false;
|
|
3966
|
+
}
|
|
3967
|
+
return (isCredentialEntity(entity) &&
|
|
3968
|
+
entity.hasOwnProperty("realm") &&
|
|
3969
|
+
entity["credentialType"] === CredentialType.ID_TOKEN);
|
|
3970
|
+
}
|
|
3971
|
+
/**
|
|
3972
|
+
* Validates an entity: checks for all expected params
|
|
3973
|
+
* @param entity
|
|
3974
|
+
*/
|
|
3975
|
+
function isRefreshTokenEntity(entity) {
|
|
3976
|
+
if (!entity) {
|
|
3977
|
+
return false;
|
|
3978
|
+
}
|
|
3979
|
+
return (isCredentialEntity(entity) &&
|
|
3980
|
+
entity["credentialType"] === CredentialType.REFRESH_TOKEN);
|
|
3981
|
+
}
|
|
3982
|
+
/**
|
|
3983
|
+
* validates if a given cache entry is "Telemetry", parses <key,value>
|
|
3984
|
+
* @param key
|
|
3985
|
+
* @param entity
|
|
3986
|
+
*/
|
|
3987
|
+
function isServerTelemetryEntity(key, entity) {
|
|
3988
|
+
const validateKey = key.indexOf(SERVER_TELEM_CACHE_KEY) === 0;
|
|
3989
|
+
let validateEntity = true;
|
|
3990
|
+
if (entity) {
|
|
3991
|
+
validateEntity =
|
|
3992
|
+
entity.hasOwnProperty("failedRequests") &&
|
|
3993
|
+
entity.hasOwnProperty("errors") &&
|
|
3994
|
+
entity.hasOwnProperty("cacheHits");
|
|
3995
|
+
}
|
|
3996
|
+
return validateKey && validateEntity;
|
|
3997
|
+
}
|
|
3998
|
+
/**
|
|
3999
|
+
* validates if a given cache entry is "Throttling", parses <key,value>
|
|
4000
|
+
* @param key
|
|
4001
|
+
* @param entity
|
|
4002
|
+
*/
|
|
4003
|
+
function isThrottlingEntity(key, entity) {
|
|
4004
|
+
let validateKey = false;
|
|
4005
|
+
if (key) {
|
|
4006
|
+
validateKey = key.indexOf(THROTTLING_PREFIX) === 0;
|
|
4007
|
+
}
|
|
4008
|
+
let validateEntity = true;
|
|
4009
|
+
if (entity) {
|
|
4010
|
+
validateEntity = entity.hasOwnProperty("throttleTime");
|
|
4011
|
+
}
|
|
4012
|
+
return validateKey && validateEntity;
|
|
4013
|
+
}
|
|
4014
|
+
/**
|
|
4015
|
+
* Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>
|
|
4016
|
+
*/
|
|
4017
|
+
function generateAppMetadataKey({ environment, clientId, }) {
|
|
4018
|
+
const appMetaDataKeyArray = [
|
|
4019
|
+
APP_METADATA,
|
|
4020
|
+
environment,
|
|
4021
|
+
clientId,
|
|
4022
|
+
];
|
|
4023
|
+
return appMetaDataKeyArray
|
|
4024
|
+
.join(CACHE_KEY_SEPARATOR)
|
|
4025
|
+
.toLowerCase();
|
|
4026
|
+
}
|
|
4027
|
+
/*
|
|
4028
|
+
* Validates an entity: checks for all expected params
|
|
4029
|
+
* @param entity
|
|
4030
|
+
*/
|
|
4031
|
+
function isAppMetadataEntity(key, entity) {
|
|
4032
|
+
if (!entity) {
|
|
4033
|
+
return false;
|
|
4034
|
+
}
|
|
4035
|
+
return (key.indexOf(APP_METADATA) === 0 &&
|
|
4036
|
+
entity.hasOwnProperty("clientId") &&
|
|
4037
|
+
entity.hasOwnProperty("environment"));
|
|
4038
|
+
}
|
|
4039
|
+
/**
|
|
4040
|
+
* Validates an entity: checks for all expected params
|
|
4041
|
+
* @param entity
|
|
4042
|
+
*/
|
|
4043
|
+
function isAuthorityMetadataEntity(key, entity) {
|
|
4044
|
+
if (!entity) {
|
|
4045
|
+
return false;
|
|
4046
|
+
}
|
|
4047
|
+
return (key.indexOf(AUTHORITY_METADATA_CACHE_KEY) === 0 &&
|
|
4048
|
+
entity.hasOwnProperty("aliases") &&
|
|
4049
|
+
entity.hasOwnProperty("preferred_cache") &&
|
|
4050
|
+
entity.hasOwnProperty("preferred_network") &&
|
|
4051
|
+
entity.hasOwnProperty("canonical_authority") &&
|
|
4052
|
+
entity.hasOwnProperty("authorization_endpoint") &&
|
|
4053
|
+
entity.hasOwnProperty("token_endpoint") &&
|
|
4054
|
+
entity.hasOwnProperty("issuer") &&
|
|
4055
|
+
entity.hasOwnProperty("aliasesFromNetwork") &&
|
|
4056
|
+
entity.hasOwnProperty("endpointsFromNetwork") &&
|
|
4057
|
+
entity.hasOwnProperty("expiresAt") &&
|
|
4058
|
+
entity.hasOwnProperty("jwks_uri"));
|
|
4059
|
+
}
|
|
4060
|
+
/**
|
|
4061
|
+
* Reset the exiresAt value
|
|
4062
|
+
*/
|
|
4063
|
+
function generateAuthorityMetadataExpiresAt() {
|
|
4064
|
+
return (nowSeconds() +
|
|
4065
|
+
AUTHORITY_METADATA_REFRESH_TIME_SECONDS);
|
|
4066
|
+
}
|
|
4067
|
+
function updateAuthorityEndpointMetadata(authorityMetadata, updatedValues, fromNetwork) {
|
|
4068
|
+
authorityMetadata.authorization_endpoint =
|
|
4069
|
+
updatedValues.authorization_endpoint;
|
|
4070
|
+
authorityMetadata.token_endpoint = updatedValues.token_endpoint;
|
|
4071
|
+
authorityMetadata.end_session_endpoint = updatedValues.end_session_endpoint;
|
|
4072
|
+
authorityMetadata.issuer = updatedValues.issuer;
|
|
4073
|
+
authorityMetadata.endpointsFromNetwork = fromNetwork;
|
|
4074
|
+
authorityMetadata.jwks_uri = updatedValues.jwks_uri;
|
|
4075
|
+
}
|
|
4076
|
+
function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetwork) {
|
|
4077
|
+
authorityMetadata.aliases = updatedValues.aliases;
|
|
4078
|
+
authorityMetadata.preferred_cache = updatedValues.preferred_cache;
|
|
4079
|
+
authorityMetadata.preferred_network = updatedValues.preferred_network;
|
|
4080
|
+
authorityMetadata.aliasesFromNetwork = fromNetwork;
|
|
4081
|
+
}
|
|
4082
|
+
/**
|
|
4083
|
+
* Returns whether or not the data needs to be refreshed
|
|
4084
|
+
*/
|
|
4085
|
+
function isAuthorityMetadataExpired(metadata) {
|
|
4086
|
+
return metadata.expiresAt <= nowSeconds();
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4090
|
+
/*
|
|
4091
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4092
|
+
* Licensed under the MIT License.
|
|
4093
|
+
*/
|
|
4094
|
+
/**
|
|
4095
|
+
* Time spent sending/waiting for the response of a request to the token endpoint
|
|
4096
|
+
*/
|
|
4097
|
+
const NetworkClientSendPostRequestAsync = "networkClientSendPostRequestAsync";
|
|
4098
|
+
const RefreshTokenClientExecutePostToTokenEndpoint = "refreshTokenClientExecutePostToTokenEndpoint";
|
|
4099
|
+
const AuthorizationCodeClientExecutePostToTokenEndpoint = "authorizationCodeClientExecutePostToTokenEndpoint";
|
|
4100
|
+
/**
|
|
4101
|
+
* Time spent on the network for refresh token acquisition
|
|
4102
|
+
*/
|
|
4103
|
+
const RefreshTokenClientExecuteTokenRequest = "refreshTokenClientExecuteTokenRequest";
|
|
4104
|
+
/**
|
|
4105
|
+
* Time taken for acquiring refresh token , records RT size
|
|
4106
|
+
*/
|
|
4107
|
+
const RefreshTokenClientAcquireToken = "refreshTokenClientAcquireToken";
|
|
4108
|
+
/**
|
|
4109
|
+
* Time taken for acquiring cached refresh token
|
|
4110
|
+
*/
|
|
4111
|
+
const RefreshTokenClientAcquireTokenWithCachedRefreshToken = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
|
|
4112
|
+
/**
|
|
4113
|
+
* Helper function to create token request body in RefreshTokenClient (msal-common).
|
|
4114
|
+
*/
|
|
4115
|
+
const RefreshTokenClientCreateTokenRequestBody = "refreshTokenClientCreateTokenRequestBody";
|
|
4116
|
+
const SilentFlowClientGenerateResultFromCacheRecord = "silentFlowClientGenerateResultFromCacheRecord";
|
|
4117
|
+
/**
|
|
4118
|
+
* APIs in Authorization Code Client (msal-common)
|
|
4119
|
+
*/
|
|
4120
|
+
const AuthClientExecuteTokenRequest = "authClientExecuteTokenRequest";
|
|
4121
|
+
const AuthClientCreateTokenRequestBody = "authClientCreateTokenRequestBody";
|
|
4122
|
+
const UpdateTokenEndpointAuthority = "updateTokenEndpointAuthority";
|
|
4123
|
+
/**
|
|
4124
|
+
* Generate functions in PopTokenGenerator (msal-common)
|
|
4125
|
+
*/
|
|
4126
|
+
const PopTokenGenerateCnf = "popTokenGenerateCnf";
|
|
4127
|
+
/**
|
|
4128
|
+
* handleServerTokenResponse API in ResponseHandler (msal-common)
|
|
4129
|
+
*/
|
|
4130
|
+
const HandleServerTokenResponse = "handleServerTokenResponse";
|
|
4131
|
+
/**
|
|
4132
|
+
* Authority functions
|
|
4133
|
+
*/
|
|
4134
|
+
const AuthorityResolveEndpointsAsync = "authorityResolveEndpointsAsync";
|
|
4135
|
+
const AuthorityGetCloudDiscoveryMetadataFromNetwork = "authorityGetCloudDiscoveryMetadataFromNetwork";
|
|
4136
|
+
const AuthorityUpdateCloudDiscoveryMetadata = "authorityUpdateCloudDiscoveryMetadata";
|
|
4022
4137
|
const AuthorityGetEndpointMetadataFromNetwork = "authorityGetEndpointMetadataFromNetwork";
|
|
4023
4138
|
const AuthorityUpdateEndpointMetadata = "authorityUpdateEndpointMetadata";
|
|
4024
4139
|
const AuthorityUpdateMetadataWithRegionalInformation = "authorityUpdateMetadataWithRegionalInformation";
|
|
@@ -4033,7 +4148,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
|
|
|
4033
4148
|
*/
|
|
4034
4149
|
const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
|
|
4035
4150
|
|
|
4036
|
-
/*! @azure/msal-common v16.
|
|
4151
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4037
4152
|
/*
|
|
4038
4153
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4039
4154
|
* Licensed under the MIT License.
|
|
@@ -4126,7 +4241,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
4126
4241
|
};
|
|
4127
4242
|
};
|
|
4128
4243
|
|
|
4129
|
-
/*! @azure/msal-common v16.
|
|
4244
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4130
4245
|
|
|
4131
4246
|
/*
|
|
4132
4247
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4206,293 +4321,190 @@ class PopTokenGenerator {
|
|
|
4206
4321
|
}
|
|
4207
4322
|
}
|
|
4208
4323
|
|
|
4209
|
-
/*! @azure/msal-common v16.
|
|
4324
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4210
4325
|
/*
|
|
4211
4326
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4212
4327
|
* Licensed under the MIT License.
|
|
4213
4328
|
*/
|
|
4214
4329
|
/**
|
|
4215
|
-
*
|
|
4216
|
-
*
|
|
4217
|
-
*/ class TokenCacheContext {
|
|
4218
|
-
constructor(tokenCache, hasChanged) {
|
|
4219
|
-
this.cache = tokenCache;
|
|
4220
|
-
this.hasChanged = hasChanged;
|
|
4221
|
-
}
|
|
4222
|
-
/**
|
|
4223
|
-
* boolean which indicates the changes in cache
|
|
4224
|
-
*/
|
|
4225
|
-
get cacheHasChanged() {
|
|
4226
|
-
return this.hasChanged;
|
|
4227
|
-
}
|
|
4228
|
-
/**
|
|
4229
|
-
* function to retrieve the token cache
|
|
4230
|
-
*/
|
|
4231
|
-
get tokenCache() {
|
|
4232
|
-
return this.cache;
|
|
4233
|
-
}
|
|
4234
|
-
}
|
|
4235
|
-
|
|
4236
|
-
/*! @azure/msal-common v16.3.0 2026-03-13 */
|
|
4237
|
-
|
|
4238
|
-
/*
|
|
4239
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4240
|
-
* Licensed under the MIT License.
|
|
4241
|
-
*/
|
|
4242
|
-
/**
|
|
4243
|
-
* Create IdTokenEntity
|
|
4244
|
-
* @param homeAccountId
|
|
4245
|
-
* @param authenticationResult
|
|
4246
|
-
* @param clientId
|
|
4247
|
-
* @param authority
|
|
4330
|
+
* MSAL-defined interaction required error code indicating no tokens are found in cache.
|
|
4331
|
+
* @public
|
|
4248
4332
|
*/
|
|
4249
|
-
|
|
4250
|
-
const idTokenEntity = {
|
|
4251
|
-
credentialType: CredentialType.ID_TOKEN,
|
|
4252
|
-
homeAccountId: homeAccountId,
|
|
4253
|
-
environment: environment,
|
|
4254
|
-
clientId: clientId,
|
|
4255
|
-
secret: idToken,
|
|
4256
|
-
realm: tenantId,
|
|
4257
|
-
lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
|
|
4258
|
-
};
|
|
4259
|
-
return idTokenEntity;
|
|
4260
|
-
}
|
|
4333
|
+
const noTokensFound = "no_tokens_found";
|
|
4261
4334
|
/**
|
|
4262
|
-
*
|
|
4263
|
-
* @
|
|
4264
|
-
* @param environment
|
|
4265
|
-
* @param accessToken
|
|
4266
|
-
* @param clientId
|
|
4267
|
-
* @param tenantId
|
|
4268
|
-
* @param scopes
|
|
4269
|
-
* @param expiresOn
|
|
4270
|
-
* @param extExpiresOn
|
|
4335
|
+
* MSAL-defined error code indicating a native account is unavailable on the platform.
|
|
4336
|
+
* @public
|
|
4271
4337
|
*/
|
|
4272
|
-
|
|
4273
|
-
const atEntity = {
|
|
4274
|
-
homeAccountId: homeAccountId,
|
|
4275
|
-
credentialType: CredentialType.ACCESS_TOKEN,
|
|
4276
|
-
secret: accessToken,
|
|
4277
|
-
cachedAt: nowSeconds().toString(),
|
|
4278
|
-
expiresOn: expiresOn.toString(),
|
|
4279
|
-
extendedExpiresOn: extExpiresOn.toString(),
|
|
4280
|
-
environment: environment,
|
|
4281
|
-
clientId: clientId,
|
|
4282
|
-
realm: tenantId,
|
|
4283
|
-
target: scopes,
|
|
4284
|
-
tokenType: tokenType || AuthenticationScheme.BEARER,
|
|
4285
|
-
lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
|
|
4286
|
-
};
|
|
4287
|
-
if (userAssertionHash) {
|
|
4288
|
-
atEntity.userAssertionHash = userAssertionHash;
|
|
4289
|
-
}
|
|
4290
|
-
if (refreshOn) {
|
|
4291
|
-
atEntity.refreshOn = refreshOn.toString();
|
|
4292
|
-
}
|
|
4293
|
-
/*
|
|
4294
|
-
* Create Access Token With Auth Scheme instead of regular access token
|
|
4295
|
-
* Cast to lower to handle "bearer" from ADFS
|
|
4296
|
-
*/
|
|
4297
|
-
if (atEntity.tokenType?.toLowerCase() !==
|
|
4298
|
-
AuthenticationScheme.BEARER.toLowerCase()) {
|
|
4299
|
-
atEntity.credentialType =
|
|
4300
|
-
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
4301
|
-
switch (atEntity.tokenType) {
|
|
4302
|
-
case AuthenticationScheme.POP:
|
|
4303
|
-
// Make sure keyId is present and add it to credential
|
|
4304
|
-
const tokenClaims = extractTokenClaims(accessToken, base64Decode);
|
|
4305
|
-
if (!tokenClaims?.cnf?.kid) {
|
|
4306
|
-
throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
|
|
4307
|
-
}
|
|
4308
|
-
atEntity.keyId = tokenClaims.cnf.kid;
|
|
4309
|
-
break;
|
|
4310
|
-
case AuthenticationScheme.SSH:
|
|
4311
|
-
atEntity.keyId = keyId;
|
|
4312
|
-
}
|
|
4313
|
-
}
|
|
4314
|
-
return atEntity;
|
|
4315
|
-
}
|
|
4338
|
+
const nativeAccountUnavailable = "native_account_unavailable";
|
|
4316
4339
|
/**
|
|
4317
|
-
*
|
|
4318
|
-
* @
|
|
4319
|
-
* @param authenticationResult
|
|
4320
|
-
* @param clientId
|
|
4321
|
-
* @param authority
|
|
4340
|
+
* MSAL-defined error code indicating the refresh token has expired and user interaction is needed.
|
|
4341
|
+
* @public
|
|
4322
4342
|
*/
|
|
4323
|
-
|
|
4324
|
-
const rtEntity = {
|
|
4325
|
-
credentialType: CredentialType.REFRESH_TOKEN,
|
|
4326
|
-
homeAccountId: homeAccountId,
|
|
4327
|
-
environment: environment,
|
|
4328
|
-
clientId: clientId,
|
|
4329
|
-
secret: refreshToken,
|
|
4330
|
-
lastUpdatedAt: Date.now().toString(),
|
|
4331
|
-
};
|
|
4332
|
-
if (userAssertionHash) {
|
|
4333
|
-
rtEntity.userAssertionHash = userAssertionHash;
|
|
4334
|
-
}
|
|
4335
|
-
if (familyId) {
|
|
4336
|
-
rtEntity.familyId = familyId;
|
|
4337
|
-
}
|
|
4338
|
-
if (expiresOn) {
|
|
4339
|
-
rtEntity.expiresOn = expiresOn.toString();
|
|
4340
|
-
}
|
|
4341
|
-
return rtEntity;
|
|
4342
|
-
}
|
|
4343
|
-
function isCredentialEntity(entity) {
|
|
4344
|
-
return (entity.hasOwnProperty("homeAccountId") &&
|
|
4345
|
-
entity.hasOwnProperty("environment") &&
|
|
4346
|
-
entity.hasOwnProperty("credentialType") &&
|
|
4347
|
-
entity.hasOwnProperty("clientId") &&
|
|
4348
|
-
entity.hasOwnProperty("secret"));
|
|
4349
|
-
}
|
|
4343
|
+
const refreshTokenExpired = "refresh_token_expired";
|
|
4350
4344
|
/**
|
|
4351
|
-
*
|
|
4352
|
-
* @
|
|
4345
|
+
* MSAL-defined error code indicating UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction.
|
|
4346
|
+
* @public
|
|
4353
4347
|
*/
|
|
4354
|
-
|
|
4355
|
-
if (!entity) {
|
|
4356
|
-
return false;
|
|
4357
|
-
}
|
|
4358
|
-
return (isCredentialEntity(entity) &&
|
|
4359
|
-
entity.hasOwnProperty("realm") &&
|
|
4360
|
-
entity.hasOwnProperty("target") &&
|
|
4361
|
-
(entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
|
|
4362
|
-
entity["credentialType"] ===
|
|
4363
|
-
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
|
|
4364
|
-
}
|
|
4348
|
+
const uxNotAllowed = "ux_not_allowed";
|
|
4365
4349
|
/**
|
|
4366
|
-
*
|
|
4367
|
-
* @
|
|
4350
|
+
* Server-originated error code indicating interaction is required to complete the request.
|
|
4351
|
+
* @public
|
|
4368
4352
|
*/
|
|
4369
|
-
|
|
4370
|
-
if (!entity) {
|
|
4371
|
-
return false;
|
|
4372
|
-
}
|
|
4373
|
-
return (isCredentialEntity(entity) &&
|
|
4374
|
-
entity.hasOwnProperty("realm") &&
|
|
4375
|
-
entity["credentialType"] === CredentialType.ID_TOKEN);
|
|
4376
|
-
}
|
|
4353
|
+
const interactionRequired = "interaction_required";
|
|
4377
4354
|
/**
|
|
4378
|
-
*
|
|
4379
|
-
* @
|
|
4355
|
+
* Server-originated error code indicating user consent is required.
|
|
4356
|
+
* @public
|
|
4380
4357
|
*/
|
|
4381
|
-
|
|
4382
|
-
if (!entity) {
|
|
4383
|
-
return false;
|
|
4384
|
-
}
|
|
4385
|
-
return (isCredentialEntity(entity) &&
|
|
4386
|
-
entity["credentialType"] === CredentialType.REFRESH_TOKEN);
|
|
4387
|
-
}
|
|
4358
|
+
const consentRequired = "consent_required";
|
|
4388
4359
|
/**
|
|
4389
|
-
*
|
|
4390
|
-
* @
|
|
4391
|
-
* @param entity
|
|
4360
|
+
* Server-originated error code indicating user login is required.
|
|
4361
|
+
* @public
|
|
4392
4362
|
*/
|
|
4393
|
-
|
|
4394
|
-
const validateKey = key.indexOf(SERVER_TELEM_CACHE_KEY) === 0;
|
|
4395
|
-
let validateEntity = true;
|
|
4396
|
-
if (entity) {
|
|
4397
|
-
validateEntity =
|
|
4398
|
-
entity.hasOwnProperty("failedRequests") &&
|
|
4399
|
-
entity.hasOwnProperty("errors") &&
|
|
4400
|
-
entity.hasOwnProperty("cacheHits");
|
|
4401
|
-
}
|
|
4402
|
-
return validateKey && validateEntity;
|
|
4403
|
-
}
|
|
4363
|
+
const loginRequired = "login_required";
|
|
4404
4364
|
/**
|
|
4405
|
-
*
|
|
4406
|
-
* @
|
|
4407
|
-
* @param entity
|
|
4365
|
+
* Server-originated error code indicating the token is invalid or corrupted.
|
|
4366
|
+
* @public
|
|
4408
4367
|
*/
|
|
4409
|
-
|
|
4410
|
-
let validateKey = false;
|
|
4411
|
-
if (key) {
|
|
4412
|
-
validateKey = key.indexOf(THROTTLING_PREFIX) === 0;
|
|
4413
|
-
}
|
|
4414
|
-
let validateEntity = true;
|
|
4415
|
-
if (entity) {
|
|
4416
|
-
validateEntity = entity.hasOwnProperty("throttleTime");
|
|
4417
|
-
}
|
|
4418
|
-
return validateKey && validateEntity;
|
|
4419
|
-
}
|
|
4368
|
+
const badToken = "bad_token";
|
|
4420
4369
|
/**
|
|
4421
|
-
*
|
|
4370
|
+
* Server-originated error code indicating the user is in an interrupted state and interaction is required.
|
|
4371
|
+
* @public
|
|
4422
4372
|
*/
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4373
|
+
const interruptedUser = "interrupted_user";
|
|
4374
|
+
|
|
4375
|
+
var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
4376
|
+
__proto__: null,
|
|
4377
|
+
badToken: badToken,
|
|
4378
|
+
consentRequired: consentRequired,
|
|
4379
|
+
interactionRequired: interactionRequired,
|
|
4380
|
+
interruptedUser: interruptedUser,
|
|
4381
|
+
loginRequired: loginRequired,
|
|
4382
|
+
nativeAccountUnavailable: nativeAccountUnavailable,
|
|
4383
|
+
noTokensFound: noTokensFound,
|
|
4384
|
+
refreshTokenExpired: refreshTokenExpired,
|
|
4385
|
+
uxNotAllowed: uxNotAllowed
|
|
4386
|
+
});
|
|
4387
|
+
|
|
4388
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4389
|
+
|
|
4433
4390
|
/*
|
|
4434
|
-
*
|
|
4435
|
-
*
|
|
4391
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4392
|
+
* Licensed under the MIT License.
|
|
4436
4393
|
*/
|
|
4437
|
-
function isAppMetadataEntity(key, entity) {
|
|
4438
|
-
if (!entity) {
|
|
4439
|
-
return false;
|
|
4440
|
-
}
|
|
4441
|
-
return (key.indexOf(APP_METADATA) === 0 &&
|
|
4442
|
-
entity.hasOwnProperty("clientId") &&
|
|
4443
|
-
entity.hasOwnProperty("environment"));
|
|
4444
|
-
}
|
|
4445
4394
|
/**
|
|
4446
|
-
*
|
|
4447
|
-
* @param entity
|
|
4395
|
+
* InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required
|
|
4448
4396
|
*/
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4397
|
+
const InteractionRequiredServerErrorMessage = [
|
|
4398
|
+
interactionRequired,
|
|
4399
|
+
consentRequired,
|
|
4400
|
+
loginRequired,
|
|
4401
|
+
badToken,
|
|
4402
|
+
uxNotAllowed,
|
|
4403
|
+
interruptedUser,
|
|
4404
|
+
];
|
|
4405
|
+
const InteractionRequiredAuthSubErrorMessage = [
|
|
4406
|
+
"message_only",
|
|
4407
|
+
"additional_action",
|
|
4408
|
+
"basic_action",
|
|
4409
|
+
"user_password_expired",
|
|
4410
|
+
"consent_required",
|
|
4411
|
+
"bad_token",
|
|
4412
|
+
"ux_not_allowed",
|
|
4413
|
+
"interrupted_user",
|
|
4414
|
+
];
|
|
4415
|
+
/**
|
|
4416
|
+
* Error thrown when user interaction is required.
|
|
4417
|
+
*/
|
|
4418
|
+
class InteractionRequiredAuthError extends AuthError {
|
|
4419
|
+
constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
|
|
4420
|
+
super(errorCode, errorMessage, subError);
|
|
4421
|
+
Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
|
|
4422
|
+
this.timestamp = timestamp || "";
|
|
4423
|
+
this.traceId = traceId || "";
|
|
4424
|
+
this.correlationId = correlationId || "";
|
|
4425
|
+
this.claims = claims || "";
|
|
4426
|
+
this.name = "InteractionRequiredAuthError";
|
|
4427
|
+
this.errorNo = errorNo;
|
|
4452
4428
|
}
|
|
4453
|
-
return (key.indexOf(AUTHORITY_METADATA_CACHE_KEY) === 0 &&
|
|
4454
|
-
entity.hasOwnProperty("aliases") &&
|
|
4455
|
-
entity.hasOwnProperty("preferred_cache") &&
|
|
4456
|
-
entity.hasOwnProperty("preferred_network") &&
|
|
4457
|
-
entity.hasOwnProperty("canonical_authority") &&
|
|
4458
|
-
entity.hasOwnProperty("authorization_endpoint") &&
|
|
4459
|
-
entity.hasOwnProperty("token_endpoint") &&
|
|
4460
|
-
entity.hasOwnProperty("issuer") &&
|
|
4461
|
-
entity.hasOwnProperty("aliasesFromNetwork") &&
|
|
4462
|
-
entity.hasOwnProperty("endpointsFromNetwork") &&
|
|
4463
|
-
entity.hasOwnProperty("expiresAt") &&
|
|
4464
|
-
entity.hasOwnProperty("jwks_uri"));
|
|
4465
4429
|
}
|
|
4466
4430
|
/**
|
|
4467
|
-
*
|
|
4431
|
+
* Helper function used to determine if an error thrown by the server requires interaction to resolve
|
|
4432
|
+
* @param errorCode
|
|
4433
|
+
* @param errorString
|
|
4434
|
+
* @param subError
|
|
4468
4435
|
*/
|
|
4469
|
-
function
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
}
|
|
4482
|
-
function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetwork) {
|
|
4483
|
-
authorityMetadata.aliases = updatedValues.aliases;
|
|
4484
|
-
authorityMetadata.preferred_cache = updatedValues.preferred_cache;
|
|
4485
|
-
authorityMetadata.preferred_network = updatedValues.preferred_network;
|
|
4486
|
-
authorityMetadata.aliasesFromNetwork = fromNetwork;
|
|
4436
|
+
function isInteractionRequiredError(errorCode, errorString, subError) {
|
|
4437
|
+
const isInteractionRequiredErrorCode = !!errorCode &&
|
|
4438
|
+
InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;
|
|
4439
|
+
const isInteractionRequiredSubError = !!subError &&
|
|
4440
|
+
InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;
|
|
4441
|
+
const isInteractionRequiredErrorDesc = !!errorString &&
|
|
4442
|
+
InteractionRequiredServerErrorMessage.some((irErrorCode) => {
|
|
4443
|
+
return errorString.indexOf(irErrorCode) > -1;
|
|
4444
|
+
});
|
|
4445
|
+
return (isInteractionRequiredErrorCode ||
|
|
4446
|
+
isInteractionRequiredErrorDesc ||
|
|
4447
|
+
isInteractionRequiredSubError);
|
|
4487
4448
|
}
|
|
4488
4449
|
/**
|
|
4489
|
-
*
|
|
4450
|
+
* Creates an InteractionRequiredAuthError
|
|
4490
4451
|
*/
|
|
4491
|
-
function
|
|
4492
|
-
return
|
|
4452
|
+
function createInteractionRequiredAuthError(errorCode, errorMessage) {
|
|
4453
|
+
return new InteractionRequiredAuthError(errorCode, errorMessage);
|
|
4454
|
+
}
|
|
4455
|
+
|
|
4456
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4457
|
+
|
|
4458
|
+
/*
|
|
4459
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4460
|
+
* Licensed under the MIT License.
|
|
4461
|
+
*/
|
|
4462
|
+
/**
|
|
4463
|
+
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
4464
|
+
*/
|
|
4465
|
+
class ServerError extends AuthError {
|
|
4466
|
+
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
4467
|
+
super(errorCode, errorMessage, subError);
|
|
4468
|
+
this.name = "ServerError";
|
|
4469
|
+
this.errorNo = errorNo;
|
|
4470
|
+
this.status = status;
|
|
4471
|
+
Object.setPrototypeOf(this, ServerError.prototype);
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
|
|
4475
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4476
|
+
/**
|
|
4477
|
+
* Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
|
|
4478
|
+
* @param base64Decode
|
|
4479
|
+
* @param state
|
|
4480
|
+
*/
|
|
4481
|
+
function parseRequestState(base64Decode, state) {
|
|
4482
|
+
if (!base64Decode) {
|
|
4483
|
+
throw createClientAuthError(noCryptoObject);
|
|
4484
|
+
}
|
|
4485
|
+
if (!state) {
|
|
4486
|
+
throw createClientAuthError(invalidState);
|
|
4487
|
+
}
|
|
4488
|
+
try {
|
|
4489
|
+
// Split the state between library state and user passed state and decode them separately
|
|
4490
|
+
const splitState = state.split(RESOURCE_DELIM);
|
|
4491
|
+
const libraryState = splitState[0];
|
|
4492
|
+
const userState = splitState.length > 1
|
|
4493
|
+
? splitState.slice(1).join(RESOURCE_DELIM)
|
|
4494
|
+
: "";
|
|
4495
|
+
const libraryStateString = base64Decode(libraryState);
|
|
4496
|
+
const libraryStateObj = JSON.parse(libraryStateString);
|
|
4497
|
+
return {
|
|
4498
|
+
userRequestState: userState || "",
|
|
4499
|
+
libraryState: libraryStateObj,
|
|
4500
|
+
};
|
|
4501
|
+
}
|
|
4502
|
+
catch (e) {
|
|
4503
|
+
throw createClientAuthError(invalidState);
|
|
4504
|
+
}
|
|
4493
4505
|
}
|
|
4494
4506
|
|
|
4495
|
-
/*! @azure/msal-common v16.
|
|
4507
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4496
4508
|
|
|
4497
4509
|
/*
|
|
4498
4510
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4648,7 +4660,7 @@ class ResponseHandler {
|
|
|
4648
4660
|
if (serverTokenResponse.id_token && !!idTokenClaims) {
|
|
4649
4661
|
cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || "");
|
|
4650
4662
|
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, request.correlationId, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
|
|
4651
|
-
this.logger);
|
|
4663
|
+
this.logger, this.performanceClient);
|
|
4652
4664
|
}
|
|
4653
4665
|
// AccessToken
|
|
4654
4666
|
let cachedAccessToken = null;
|
|
@@ -4799,17 +4811,24 @@ class ResponseHandler {
|
|
|
4799
4811
|
};
|
|
4800
4812
|
}
|
|
4801
4813
|
}
|
|
4802
|
-
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
4814
|
+
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger, performanceClient) {
|
|
4803
4815
|
logger?.verbose("setCachedAccount called", correlationId);
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4816
|
+
/*
|
|
4817
|
+
* Check if base account is already cached. Filter by homeAccountId (identifies
|
|
4818
|
+
* the user's home identity) and environment (identifies the cloud) — the two
|
|
4819
|
+
* tenant-agnostic properties that uniquely locate a base AccountEntity.
|
|
4820
|
+
*/
|
|
4821
|
+
const accountEnvironment = environment || authority.getPreferredCache();
|
|
4822
|
+
const matchedAccounts = cacheStorage.getAccountsFilteredBy({ homeAccountId, environment: accountEnvironment }, correlationId);
|
|
4823
|
+
performanceClient?.addFields({ cacheMatchedAccounts: matchedAccounts.length }, correlationId);
|
|
4824
|
+
if (matchedAccounts.length > 1) {
|
|
4825
|
+
/*
|
|
4826
|
+
* Base accounts are expected to be unique for a given homeAccountId in normal cache usage.
|
|
4827
|
+
* If multiple matches exist, ignore the cache hit rather than arbitrarily choosing one.
|
|
4828
|
+
*/
|
|
4829
|
+
logger?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.", correlationId);
|
|
4812
4830
|
}
|
|
4831
|
+
const cachedAccount = matchedAccounts.length === 1 ? matchedAccounts[0] : null;
|
|
4813
4832
|
const baseAccount = cachedAccount ||
|
|
4814
4833
|
createAccountEntity({
|
|
4815
4834
|
homeAccountId,
|
|
@@ -4833,7 +4852,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
4833
4852
|
return baseAccount;
|
|
4834
4853
|
}
|
|
4835
4854
|
|
|
4836
|
-
/*! @azure/msal-common v16.
|
|
4855
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4837
4856
|
/*
|
|
4838
4857
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4839
4858
|
* Licensed under the MIT License.
|
|
@@ -4843,7 +4862,7 @@ const CcsCredentialType = {
|
|
|
4843
4862
|
UPN: "UPN",
|
|
4844
4863
|
};
|
|
4845
4864
|
|
|
4846
|
-
/*! @azure/msal-common v16.
|
|
4865
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4847
4866
|
/*
|
|
4848
4867
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4849
4868
|
* Licensed under the MIT License.
|
|
@@ -4861,7 +4880,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
4861
4880
|
}
|
|
4862
4881
|
}
|
|
4863
4882
|
|
|
4864
|
-
/*! @azure/msal-common v16.
|
|
4883
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4865
4884
|
/*
|
|
4866
4885
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4867
4886
|
* Licensed under the MIT License.
|
|
@@ -4882,7 +4901,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
4882
4901
|
};
|
|
4883
4902
|
}
|
|
4884
4903
|
|
|
4885
|
-
/*! @azure/msal-common v16.
|
|
4904
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4886
4905
|
|
|
4887
4906
|
/*
|
|
4888
4907
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4968,7 +4987,7 @@ class ThrottlingUtils {
|
|
|
4968
4987
|
}
|
|
4969
4988
|
}
|
|
4970
4989
|
|
|
4971
|
-
/*! @azure/msal-common v16.
|
|
4990
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
4972
4991
|
|
|
4973
4992
|
/*
|
|
4974
4993
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4999,7 +5018,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
|
|
|
4999
5018
|
return new NetworkError(error, httpStatus, responseHeaders);
|
|
5000
5019
|
}
|
|
5001
5020
|
|
|
5002
|
-
/*! @azure/msal-common v16.
|
|
5021
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
5003
5022
|
|
|
5004
5023
|
/*
|
|
5005
5024
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5113,7 +5132,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
5113
5132
|
return response;
|
|
5114
5133
|
}
|
|
5115
5134
|
|
|
5116
|
-
/*! @azure/msal-common v16.
|
|
5135
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
5117
5136
|
/*
|
|
5118
5137
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5119
5138
|
* Licensed under the MIT License.
|
|
@@ -5125,7 +5144,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
5125
5144
|
response.hasOwnProperty("jwks_uri"));
|
|
5126
5145
|
}
|
|
5127
5146
|
|
|
5128
|
-
/*! @azure/msal-common v16.
|
|
5147
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
5129
5148
|
/*
|
|
5130
5149
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5131
5150
|
* Licensed under the MIT License.
|
|
@@ -5135,7 +5154,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
5135
5154
|
response.hasOwnProperty("metadata"));
|
|
5136
5155
|
}
|
|
5137
5156
|
|
|
5138
|
-
/*! @azure/msal-common v16.
|
|
5157
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
5139
5158
|
/*
|
|
5140
5159
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5141
5160
|
* Licensed under the MIT License.
|
|
@@ -5145,7 +5164,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
5145
5164
|
response.hasOwnProperty("error_description"));
|
|
5146
5165
|
}
|
|
5147
5166
|
|
|
5148
|
-
/*! @azure/msal-common v16.
|
|
5167
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
5149
5168
|
|
|
5150
5169
|
/*
|
|
5151
5170
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5250,7 +5269,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5250
5269
|
},
|
|
5251
5270
|
};
|
|
5252
5271
|
|
|
5253
|
-
/*! @azure/msal-common v16.
|
|
5272
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
5254
5273
|
|
|
5255
5274
|
/*
|
|
5256
5275
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6073,7 +6092,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
6073
6092
|
};
|
|
6074
6093
|
}
|
|
6075
6094
|
|
|
6076
|
-
/*! @azure/msal-common v16.
|
|
6095
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6077
6096
|
|
|
6078
6097
|
/*
|
|
6079
6098
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6107,7 +6126,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6107
6126
|
}
|
|
6108
6127
|
}
|
|
6109
6128
|
|
|
6110
|
-
/*! @azure/msal-common v16.
|
|
6129
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6111
6130
|
|
|
6112
6131
|
/*
|
|
6113
6132
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6368,7 +6387,7 @@ class AuthorizationCodeClient {
|
|
|
6368
6387
|
}
|
|
6369
6388
|
}
|
|
6370
6389
|
|
|
6371
|
-
/*! @azure/msal-common v16.
|
|
6390
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6372
6391
|
|
|
6373
6392
|
/*
|
|
6374
6393
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6593,7 +6612,7 @@ class RefreshTokenClient {
|
|
|
6593
6612
|
}
|
|
6594
6613
|
}
|
|
6595
6614
|
|
|
6596
|
-
/*! @azure/msal-common v16.
|
|
6615
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6597
6616
|
|
|
6598
6617
|
/*
|
|
6599
6618
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6709,7 +6728,7 @@ class SilentFlowClient {
|
|
|
6709
6728
|
}
|
|
6710
6729
|
}
|
|
6711
6730
|
|
|
6712
|
-
/*! @azure/msal-common v16.
|
|
6731
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6713
6732
|
|
|
6714
6733
|
/*
|
|
6715
6734
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6742,6 +6761,8 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
|
|
|
6742
6761
|
addResponseMode(parameters, request.responseMode);
|
|
6743
6762
|
// add client_info=1
|
|
6744
6763
|
addClientInfo(parameters);
|
|
6764
|
+
// add clidata=1
|
|
6765
|
+
addCliData(parameters);
|
|
6745
6766
|
if (request.prompt) {
|
|
6746
6767
|
addPrompt(parameters, request.prompt);
|
|
6747
6768
|
}
|
|
@@ -6860,7 +6881,7 @@ function extractLoginHint(account) {
|
|
|
6860
6881
|
return account.loginHint || account.idTokenClaims?.login_hint || null;
|
|
6861
6882
|
}
|
|
6862
6883
|
|
|
6863
|
-
/*! @azure/msal-common v16.
|
|
6884
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6864
6885
|
|
|
6865
6886
|
/*
|
|
6866
6887
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6893,7 +6914,7 @@ function containsResourceParam(params) {
|
|
|
6893
6914
|
return Object.prototype.hasOwnProperty.call(params, "resource");
|
|
6894
6915
|
}
|
|
6895
6916
|
|
|
6896
|
-
/*! @azure/msal-common v16.
|
|
6917
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6897
6918
|
/*
|
|
6898
6919
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6899
6920
|
* Licensed under the MIT License.
|
|
@@ -6910,7 +6931,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6910
6931
|
unexpectedError: unexpectedError
|
|
6911
6932
|
});
|
|
6912
6933
|
|
|
6913
|
-
/*! @azure/msal-common v16.
|
|
6934
|
+
/*! @azure/msal-common v16.4.1 2026-04-01 */
|
|
6914
6935
|
|
|
6915
6936
|
/*
|
|
6916
6937
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9113,7 +9134,7 @@ class ClientAssertion {
|
|
|
9113
9134
|
|
|
9114
9135
|
/* eslint-disable header/header */
|
|
9115
9136
|
const name = "@azure/msal-node";
|
|
9116
|
-
const version = "5.1.
|
|
9137
|
+
const version = "5.1.2";
|
|
9117
9138
|
|
|
9118
9139
|
/*
|
|
9119
9140
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|