@azure/msal-browser 2.20.0 → 2.21.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/CHANGELOG.json +29 -0
- package/CHANGELOG.md +14 -1
- package/README.md +3 -3
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.js +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.js +29 -24
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +5 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +21 -1
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.d.ts +5 -0
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +22 -5
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +396 -258
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +39 -24
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +46 -36
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +14 -13
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +10 -8
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +12 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +13 -11
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +10 -7
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +2 -2
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +51 -32
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/PopupHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +1 -1
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/SilentRequest.d.ts +1 -1
- package/dist/request/SilentRequest.d.ts.map +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/PopupUtils.js +1 -1
- package/lib/msal-browser.js +396 -258
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +30 -30
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.21.0 2022-01-04 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -105,7 +105,7 @@ function __spread() {
|
|
|
105
105
|
return ar;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/*! @azure/msal-common
|
|
108
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
109
109
|
/*! *****************************************************************************
|
|
110
110
|
Copyright (c) Microsoft Corporation.
|
|
111
111
|
|
|
@@ -192,7 +192,7 @@ function __spreadArrays() {
|
|
|
192
192
|
return r;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
/*! @azure/msal-common
|
|
195
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
196
196
|
|
|
197
197
|
/*
|
|
198
198
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -554,7 +554,7 @@ var CacheOutcome;
|
|
|
554
554
|
CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
|
|
555
555
|
})(CacheOutcome || (CacheOutcome = {}));
|
|
556
556
|
|
|
557
|
-
/*! @azure/msal-common
|
|
557
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
558
558
|
|
|
559
559
|
/*
|
|
560
560
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -598,7 +598,7 @@ var AuthError = /** @class */ (function (_super) {
|
|
|
598
598
|
return AuthError;
|
|
599
599
|
}(Error));
|
|
600
600
|
|
|
601
|
-
/*! @azure/msal-common
|
|
601
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
602
602
|
|
|
603
603
|
/*
|
|
604
604
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -661,10 +661,19 @@ var DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
661
661
|
throw AuthError.createUnexpectedError(notImplErr);
|
|
662
662
|
});
|
|
663
663
|
});
|
|
664
|
+
},
|
|
665
|
+
hashString: function () {
|
|
666
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
667
|
+
var notImplErr;
|
|
668
|
+
return __generator(this, function (_a) {
|
|
669
|
+
notImplErr = "Crypto interface - hashString() has not been implemented";
|
|
670
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
671
|
+
});
|
|
672
|
+
});
|
|
664
673
|
}
|
|
665
674
|
};
|
|
666
675
|
|
|
667
|
-
/*! @azure/msal-common
|
|
676
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
668
677
|
|
|
669
678
|
/*
|
|
670
679
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1126,7 +1135,7 @@ var ClientAuthError = /** @class */ (function (_super) {
|
|
|
1126
1135
|
return ClientAuthError;
|
|
1127
1136
|
}(AuthError));
|
|
1128
1137
|
|
|
1129
|
-
/*! @azure/msal-common
|
|
1138
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
1130
1139
|
|
|
1131
1140
|
/*
|
|
1132
1141
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1251,7 +1260,7 @@ var StringUtils = /** @class */ (function () {
|
|
|
1251
1260
|
return StringUtils;
|
|
1252
1261
|
}());
|
|
1253
1262
|
|
|
1254
|
-
/*! @azure/msal-common
|
|
1263
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
1255
1264
|
|
|
1256
1265
|
/*
|
|
1257
1266
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1431,12 +1440,12 @@ var Logger = /** @class */ (function () {
|
|
|
1431
1440
|
return Logger;
|
|
1432
1441
|
}());
|
|
1433
1442
|
|
|
1434
|
-
/*! @azure/msal-common
|
|
1443
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
1435
1444
|
/* eslint-disable header/header */
|
|
1436
1445
|
var name$1 = "@azure/msal-common";
|
|
1437
|
-
var version$1 = "
|
|
1446
|
+
var version$1 = "6.0.0";
|
|
1438
1447
|
|
|
1439
|
-
/*! @azure/msal-common
|
|
1448
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
1440
1449
|
|
|
1441
1450
|
/*
|
|
1442
1451
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1447,7 +1456,7 @@ var version$1 = "5.2.0";
|
|
|
1447
1456
|
*
|
|
1448
1457
|
* Key:Value Schema:
|
|
1449
1458
|
*
|
|
1450
|
-
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme
|
|
1459
|
+
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>
|
|
1451
1460
|
*
|
|
1452
1461
|
* Value Schema:
|
|
1453
1462
|
* {
|
|
@@ -1461,6 +1470,7 @@ var version$1 = "5.2.0";
|
|
|
1461
1470
|
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
1462
1471
|
* oboAssertion: access token passed in as part of OBO request
|
|
1463
1472
|
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
1473
|
+
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
|
|
1464
1474
|
* }
|
|
1465
1475
|
*/
|
|
1466
1476
|
var CredentialEntity = /** @class */ (function () {
|
|
@@ -1488,7 +1498,7 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
1488
1498
|
* generates credential key
|
|
1489
1499
|
*/
|
|
1490
1500
|
CredentialEntity.prototype.generateCredentialKey = function () {
|
|
1491
|
-
return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType);
|
|
1501
|
+
return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType, this.requestedClaimsHash);
|
|
1492
1502
|
};
|
|
1493
1503
|
/**
|
|
1494
1504
|
* returns the type of the cache (in this case credential)
|
|
@@ -1532,16 +1542,14 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
1532
1542
|
* generates credential key
|
|
1533
1543
|
* <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
|
|
1534
1544
|
*/
|
|
1535
|
-
CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType) {
|
|
1545
|
+
CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType, requestedClaimsHash) {
|
|
1536
1546
|
var credentialKey = [
|
|
1537
1547
|
this.generateAccountIdForCacheKey(homeAccountId, environment),
|
|
1538
1548
|
this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
|
|
1539
|
-
this.generateTargetForCacheKey(target)
|
|
1549
|
+
this.generateTargetForCacheKey(target),
|
|
1550
|
+
this.generateClaimsHashForCacheKey(requestedClaimsHash),
|
|
1551
|
+
this.generateSchemeForCacheKey(tokenType)
|
|
1540
1552
|
];
|
|
1541
|
-
// PoP Tokens and SSH certs include scheme in cache key
|
|
1542
|
-
if (tokenType && tokenType !== exports.AuthenticationScheme.BEARER) {
|
|
1543
|
-
credentialKey.push(tokenType.toLowerCase());
|
|
1544
|
-
}
|
|
1545
1553
|
return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
1546
1554
|
};
|
|
1547
1555
|
/**
|
|
@@ -1577,10 +1585,26 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
1577
1585
|
CredentialEntity.generateTargetForCacheKey = function (scopes) {
|
|
1578
1586
|
return (scopes || "").toLowerCase();
|
|
1579
1587
|
};
|
|
1588
|
+
/**
|
|
1589
|
+
* Generate requested claims key component as per schema: <requestedClaims>
|
|
1590
|
+
*/
|
|
1591
|
+
CredentialEntity.generateClaimsHashForCacheKey = function (requestedClaimsHash) {
|
|
1592
|
+
return (requestedClaimsHash || "").toLowerCase();
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* Generate scheme key componenet as per schema: <scheme>
|
|
1596
|
+
*/
|
|
1597
|
+
CredentialEntity.generateSchemeForCacheKey = function (tokenType) {
|
|
1598
|
+
/*
|
|
1599
|
+
* PoP Tokens and SSH certs include scheme in cache key
|
|
1600
|
+
* Cast to lowercase to handle "bearer" from ADFS
|
|
1601
|
+
*/
|
|
1602
|
+
return (tokenType && tokenType.toLowerCase() !== exports.AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : "";
|
|
1603
|
+
};
|
|
1580
1604
|
return CredentialEntity;
|
|
1581
1605
|
}());
|
|
1582
1606
|
|
|
1583
|
-
/*! @azure/msal-common
|
|
1607
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
1584
1608
|
|
|
1585
1609
|
/*
|
|
1586
1610
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1825,7 +1849,7 @@ var ClientConfigurationError = /** @class */ (function (_super) {
|
|
|
1825
1849
|
return ClientConfigurationError;
|
|
1826
1850
|
}(ClientAuthError));
|
|
1827
1851
|
|
|
1828
|
-
/*! @azure/msal-common
|
|
1852
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
1829
1853
|
|
|
1830
1854
|
/*
|
|
1831
1855
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2009,7 +2033,7 @@ var ScopeSet = /** @class */ (function () {
|
|
|
2009
2033
|
return ScopeSet;
|
|
2010
2034
|
}());
|
|
2011
2035
|
|
|
2012
|
-
/*! @azure/msal-common
|
|
2036
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
2013
2037
|
|
|
2014
2038
|
/*
|
|
2015
2039
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2047,7 +2071,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
2047
2071
|
};
|
|
2048
2072
|
}
|
|
2049
2073
|
|
|
2050
|
-
/*! @azure/msal-common
|
|
2074
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
2051
2075
|
/*
|
|
2052
2076
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2053
2077
|
* Licensed under the MIT License.
|
|
@@ -2061,7 +2085,7 @@ var AuthorityType;
|
|
|
2061
2085
|
AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
|
|
2062
2086
|
})(AuthorityType || (AuthorityType = {}));
|
|
2063
2087
|
|
|
2064
|
-
/*! @azure/msal-common
|
|
2088
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
2065
2089
|
|
|
2066
2090
|
/*
|
|
2067
2091
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2295,7 +2319,7 @@ var AccountEntity = /** @class */ (function () {
|
|
|
2295
2319
|
return AccountEntity;
|
|
2296
2320
|
}());
|
|
2297
2321
|
|
|
2298
|
-
/*! @azure/msal-common
|
|
2322
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
2299
2323
|
|
|
2300
2324
|
/*
|
|
2301
2325
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2333,7 +2357,7 @@ var AuthToken = /** @class */ (function () {
|
|
|
2333
2357
|
return AuthToken;
|
|
2334
2358
|
}());
|
|
2335
2359
|
|
|
2336
|
-
/*! @azure/msal-common
|
|
2360
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
2337
2361
|
|
|
2338
2362
|
/*
|
|
2339
2363
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2423,7 +2447,8 @@ var CacheManager = /** @class */ (function () {
|
|
|
2423
2447
|
environment: credential.environment,
|
|
2424
2448
|
homeAccountId: credential.homeAccountId,
|
|
2425
2449
|
realm: credential.realm,
|
|
2426
|
-
tokenType: credential.tokenType
|
|
2450
|
+
tokenType: credential.tokenType,
|
|
2451
|
+
requestedClaimsHash: credential.requestedClaimsHash
|
|
2427
2452
|
});
|
|
2428
2453
|
currentScopes = ScopeSet.fromString(credential.target);
|
|
2429
2454
|
currentAccessTokens = Object.keys(currentTokenCache.accessTokens).map(function (key) { return currentTokenCache.accessTokens[key]; });
|
|
@@ -2495,7 +2520,7 @@ var CacheManager = /** @class */ (function () {
|
|
|
2495
2520
|
* @param target
|
|
2496
2521
|
*/
|
|
2497
2522
|
CacheManager.prototype.getCredentialsFilteredBy = function (filter) {
|
|
2498
|
-
return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.oboAssertion, filter.tokenType, filter.keyId);
|
|
2523
|
+
return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.oboAssertion, filter.tokenType, filter.keyId, filter.requestedClaimsHash);
|
|
2499
2524
|
};
|
|
2500
2525
|
/**
|
|
2501
2526
|
* Support function to help match credentials
|
|
@@ -2508,7 +2533,7 @@ var CacheManager = /** @class */ (function () {
|
|
|
2508
2533
|
* @param oboAssertion
|
|
2509
2534
|
* @param tokenType
|
|
2510
2535
|
*/
|
|
2511
|
-
CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, oboAssertion, tokenType, keyId) {
|
|
2536
|
+
CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, oboAssertion, tokenType, keyId, requestedClaimsHash) {
|
|
2512
2537
|
var _this = this;
|
|
2513
2538
|
var allCacheKeys = this.getKeys();
|
|
2514
2539
|
var matchingCredentials = {
|
|
@@ -2555,38 +2580,37 @@ var CacheManager = /** @class */ (function () {
|
|
|
2555
2580
|
if (!!target && !_this.matchTarget(entity, target)) {
|
|
2556
2581
|
return;
|
|
2557
2582
|
}
|
|
2583
|
+
// If request OR cached entity has requested Claims Hash, check if they match
|
|
2584
|
+
if (requestedClaimsHash || entity.requestedClaimsHash) {
|
|
2585
|
+
// Don't match if either is undefined or they are different
|
|
2586
|
+
if (entity.requestedClaimsHash !== requestedClaimsHash) {
|
|
2587
|
+
return;
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2558
2590
|
// Access Token with Auth Scheme specific matching
|
|
2559
2591
|
if (credentialType === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {
|
|
2560
2592
|
if (!!tokenType && !_this.matchTokenType(entity, tokenType)) {
|
|
2561
2593
|
return;
|
|
2562
2594
|
}
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
_this.removeItem(cacheKey, CacheSchemaType.CREDENTIAL);
|
|
2569
|
-
return;
|
|
2570
|
-
}
|
|
2571
|
-
break;
|
|
2572
|
-
case exports.AuthenticationScheme.SSH:
|
|
2573
|
-
// KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
|
|
2574
|
-
if (keyId && !_this.matchKeyId(entity, keyId)) {
|
|
2575
|
-
return;
|
|
2576
|
-
}
|
|
2577
|
-
break;
|
|
2595
|
+
// KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
|
|
2596
|
+
if (tokenType === exports.AuthenticationScheme.SSH) {
|
|
2597
|
+
if (keyId && !_this.matchKeyId(entity, keyId)) {
|
|
2598
|
+
return;
|
|
2599
|
+
}
|
|
2578
2600
|
}
|
|
2579
2601
|
}
|
|
2602
|
+
// At this point, the entity matches the request, update cache key if key schema has changed
|
|
2603
|
+
var updatedCacheKey = _this.updateCredentialCacheKey(cacheKey, entity);
|
|
2580
2604
|
switch (credType) {
|
|
2581
2605
|
case CredentialType.ID_TOKEN:
|
|
2582
|
-
matchingCredentials.idTokens[
|
|
2606
|
+
matchingCredentials.idTokens[updatedCacheKey] = entity;
|
|
2583
2607
|
break;
|
|
2584
2608
|
case CredentialType.ACCESS_TOKEN:
|
|
2585
2609
|
case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
|
|
2586
|
-
matchingCredentials.accessTokens[
|
|
2610
|
+
matchingCredentials.accessTokens[updatedCacheKey] = entity;
|
|
2587
2611
|
break;
|
|
2588
2612
|
case CredentialType.REFRESH_TOKEN:
|
|
2589
|
-
matchingCredentials.refreshTokens[
|
|
2613
|
+
matchingCredentials.refreshTokens[updatedCacheKey] = entity;
|
|
2590
2614
|
break;
|
|
2591
2615
|
}
|
|
2592
2616
|
});
|
|
@@ -2785,10 +2809,10 @@ var CacheManager = /** @class */ (function () {
|
|
|
2785
2809
|
* @param environment
|
|
2786
2810
|
* @param authScheme
|
|
2787
2811
|
*/
|
|
2788
|
-
CacheManager.prototype.readCacheRecord = function (account, clientId,
|
|
2812
|
+
CacheManager.prototype.readCacheRecord = function (account, clientId, request, environment) {
|
|
2789
2813
|
var cachedAccount = this.readAccountFromCache(account);
|
|
2790
2814
|
var cachedIdToken = this.readIdTokenFromCache(clientId, account);
|
|
2791
|
-
var cachedAccessToken = this.readAccessTokenFromCache(clientId, account,
|
|
2815
|
+
var cachedAccessToken = this.readAccessTokenFromCache(clientId, account, request);
|
|
2792
2816
|
var cachedRefreshToken = this.readRefreshTokenFromCache(clientId, account, false);
|
|
2793
2817
|
var cachedAppMetadata = this.readAppMetadataFromCache(environment, clientId);
|
|
2794
2818
|
if (cachedAccount && cachedIdToken) {
|
|
@@ -2842,9 +2866,14 @@ var CacheManager = /** @class */ (function () {
|
|
|
2842
2866
|
* @param scopes
|
|
2843
2867
|
* @param authScheme
|
|
2844
2868
|
*/
|
|
2845
|
-
CacheManager.prototype.readAccessTokenFromCache = function (clientId, account,
|
|
2846
|
-
|
|
2847
|
-
var
|
|
2869
|
+
CacheManager.prototype.readAccessTokenFromCache = function (clientId, account, request) {
|
|
2870
|
+
var scopes = new ScopeSet(request.scopes || []);
|
|
2871
|
+
var authScheme = request.authenticationScheme || exports.AuthenticationScheme.BEARER;
|
|
2872
|
+
/*
|
|
2873
|
+
* Distinguish between Bearer and PoP/SSH token cache types
|
|
2874
|
+
* Cast to lowercase to handle "bearer" from ADFS
|
|
2875
|
+
*/
|
|
2876
|
+
var credentialType = (authScheme && authScheme.toLowerCase() !== exports.AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;
|
|
2848
2877
|
var accessTokenFilter = {
|
|
2849
2878
|
homeAccountId: account.homeAccountId,
|
|
2850
2879
|
environment: account.environment,
|
|
@@ -2853,7 +2882,8 @@ var CacheManager = /** @class */ (function () {
|
|
|
2853
2882
|
realm: account.tenantId,
|
|
2854
2883
|
target: scopes.printScopesLowerCase(),
|
|
2855
2884
|
tokenType: authScheme,
|
|
2856
|
-
keyId:
|
|
2885
|
+
keyId: request.sshKid,
|
|
2886
|
+
requestedClaimsHash: request.requestedClaimsHash
|
|
2857
2887
|
};
|
|
2858
2888
|
var credentialCache = this.getCredentialsFilteredBy(accessTokenFilter);
|
|
2859
2889
|
var accessTokens = Object.keys(credentialCache.accessTokens).map(function (key) { return credentialCache.accessTokens[key]; });
|
|
@@ -3162,10 +3192,14 @@ var DefaultStorageClass = /** @class */ (function (_super) {
|
|
|
3162
3192
|
});
|
|
3163
3193
|
});
|
|
3164
3194
|
};
|
|
3195
|
+
DefaultStorageClass.prototype.updateCredentialCacheKey = function () {
|
|
3196
|
+
var notImplErr = "Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";
|
|
3197
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
3198
|
+
};
|
|
3165
3199
|
return DefaultStorageClass;
|
|
3166
3200
|
}(CacheManager));
|
|
3167
3201
|
|
|
3168
|
-
/*! @azure/msal-common
|
|
3202
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3169
3203
|
|
|
3170
3204
|
/*
|
|
3171
3205
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3247,7 +3281,7 @@ function buildAuthOptions(authOptions) {
|
|
|
3247
3281
|
return __assign({ clientCapabilities: [] }, authOptions);
|
|
3248
3282
|
}
|
|
3249
3283
|
|
|
3250
|
-
/*! @azure/msal-common
|
|
3284
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3251
3285
|
|
|
3252
3286
|
/*
|
|
3253
3287
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3267,7 +3301,7 @@ var ServerError = /** @class */ (function (_super) {
|
|
|
3267
3301
|
return ServerError;
|
|
3268
3302
|
}(AuthError));
|
|
3269
3303
|
|
|
3270
|
-
/*! @azure/msal-common
|
|
3304
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3271
3305
|
|
|
3272
3306
|
/*
|
|
3273
3307
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3350,11 +3384,11 @@ var ThrottlingUtils = /** @class */ (function () {
|
|
|
3350
3384
|
authority: request.authority,
|
|
3351
3385
|
scopes: request.scopes,
|
|
3352
3386
|
homeAccountIdentifier: homeAccountIdentifier,
|
|
3387
|
+
claims: request.claims,
|
|
3353
3388
|
authenticationScheme: request.authenticationScheme,
|
|
3354
3389
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
3355
3390
|
resourceRequestUri: request.resourceRequestUri,
|
|
3356
3391
|
shrClaims: request.shrClaims,
|
|
3357
|
-
sshJwk: request.sshJwk,
|
|
3358
3392
|
sshKid: request.sshKid
|
|
3359
3393
|
};
|
|
3360
3394
|
var key = this.generateThrottlingStorageKey(thumbprint);
|
|
@@ -3363,7 +3397,7 @@ var ThrottlingUtils = /** @class */ (function () {
|
|
|
3363
3397
|
return ThrottlingUtils;
|
|
3364
3398
|
}());
|
|
3365
3399
|
|
|
3366
|
-
/*! @azure/msal-common
|
|
3400
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3367
3401
|
|
|
3368
3402
|
/*
|
|
3369
3403
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3412,7 +3446,7 @@ var NetworkManager = /** @class */ (function () {
|
|
|
3412
3446
|
return NetworkManager;
|
|
3413
3447
|
}());
|
|
3414
3448
|
|
|
3415
|
-
/*! @azure/msal-common
|
|
3449
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3416
3450
|
/*
|
|
3417
3451
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3418
3452
|
* Licensed under the MIT License.
|
|
@@ -3423,7 +3457,7 @@ var CcsCredentialType;
|
|
|
3423
3457
|
CcsCredentialType["UPN"] = "UPN";
|
|
3424
3458
|
})(CcsCredentialType || (CcsCredentialType = {}));
|
|
3425
3459
|
|
|
3426
|
-
/*! @azure/msal-common
|
|
3460
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3427
3461
|
|
|
3428
3462
|
/*
|
|
3429
3463
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3512,7 +3546,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
3512
3546
|
return BaseClient;
|
|
3513
3547
|
}());
|
|
3514
3548
|
|
|
3515
|
-
/*! @azure/msal-common
|
|
3549
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3516
3550
|
|
|
3517
3551
|
/*
|
|
3518
3552
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3598,7 +3632,7 @@ var RequestValidator = /** @class */ (function () {
|
|
|
3598
3632
|
return RequestValidator;
|
|
3599
3633
|
}());
|
|
3600
3634
|
|
|
3601
|
-
/*! @azure/msal-common
|
|
3635
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3602
3636
|
|
|
3603
3637
|
/*
|
|
3604
3638
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3938,7 +3972,7 @@ var RequestParameterBuilder = /** @class */ (function () {
|
|
|
3938
3972
|
return RequestParameterBuilder;
|
|
3939
3973
|
}());
|
|
3940
3974
|
|
|
3941
|
-
/*! @azure/msal-common
|
|
3975
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
3942
3976
|
|
|
3943
3977
|
/*
|
|
3944
3978
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4003,7 +4037,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
|
|
|
4003
4037
|
return IdTokenEntity;
|
|
4004
4038
|
}(CredentialEntity));
|
|
4005
4039
|
|
|
4006
|
-
/*! @azure/msal-common
|
|
4040
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4007
4041
|
/*
|
|
4008
4042
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4009
4043
|
* Licensed under the MIT License.
|
|
@@ -4053,7 +4087,7 @@ var TimeUtils = /** @class */ (function () {
|
|
|
4053
4087
|
return TimeUtils;
|
|
4054
4088
|
}());
|
|
4055
4089
|
|
|
4056
|
-
/*! @azure/msal-common
|
|
4090
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4057
4091
|
|
|
4058
4092
|
/*
|
|
4059
4093
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4099,8 +4133,8 @@ var AccessTokenEntity = /** @class */ (function (_super) {
|
|
|
4099
4133
|
* @param expiresOn
|
|
4100
4134
|
* @param extExpiresOn
|
|
4101
4135
|
*/
|
|
4102
|
-
AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, oboAssertion, keyId) {
|
|
4103
|
-
var _a;
|
|
4136
|
+
AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, oboAssertion, keyId, requestedClaims, requestedClaimsHash) {
|
|
4137
|
+
var _a, _b;
|
|
4104
4138
|
var atEntity = new AccessTokenEntity();
|
|
4105
4139
|
atEntity.homeAccountId = homeAccountId;
|
|
4106
4140
|
atEntity.credentialType = CredentialType.ACCESS_TOKEN;
|
|
@@ -4122,14 +4156,21 @@ var AccessTokenEntity = /** @class */ (function (_super) {
|
|
|
4122
4156
|
atEntity.target = scopes;
|
|
4123
4157
|
atEntity.oboAssertion = oboAssertion;
|
|
4124
4158
|
atEntity.tokenType = StringUtils.isEmpty(tokenType) ? exports.AuthenticationScheme.BEARER : tokenType;
|
|
4125
|
-
|
|
4126
|
-
|
|
4159
|
+
if (requestedClaims) {
|
|
4160
|
+
atEntity.requestedClaims = requestedClaims;
|
|
4161
|
+
atEntity.requestedClaimsHash = requestedClaimsHash;
|
|
4162
|
+
}
|
|
4163
|
+
/*
|
|
4164
|
+
* Create Access Token With Auth Scheme instead of regular access token
|
|
4165
|
+
* Cast to lower to handle "bearer" from ADFS
|
|
4166
|
+
*/
|
|
4167
|
+
if (((_a = atEntity.tokenType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== exports.AuthenticationScheme.BEARER.toLowerCase()) {
|
|
4127
4168
|
atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
4128
4169
|
switch (atEntity.tokenType) {
|
|
4129
4170
|
case exports.AuthenticationScheme.POP:
|
|
4130
4171
|
// Make sure keyId is present and add it to credential
|
|
4131
4172
|
var tokenClaims = AuthToken.extractTokenClaims(accessToken, cryptoUtils);
|
|
4132
|
-
if (!((
|
|
4173
|
+
if (!((_b = tokenClaims === null || tokenClaims === void 0 ? void 0 : tokenClaims.cnf) === null || _b === void 0 ? void 0 : _b.kid)) {
|
|
4133
4174
|
throw ClientAuthError.createTokenClaimsRequiredError();
|
|
4134
4175
|
}
|
|
4135
4176
|
atEntity.keyId = tokenClaims.cnf.kid;
|
|
@@ -4160,7 +4201,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
|
|
|
4160
4201
|
return AccessTokenEntity;
|
|
4161
4202
|
}(CredentialEntity));
|
|
4162
4203
|
|
|
4163
|
-
/*! @azure/msal-common
|
|
4204
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4164
4205
|
|
|
4165
4206
|
/*
|
|
4166
4207
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4227,7 +4268,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
|
|
|
4227
4268
|
return RefreshTokenEntity;
|
|
4228
4269
|
}(CredentialEntity));
|
|
4229
4270
|
|
|
4230
|
-
/*! @azure/msal-common
|
|
4271
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4231
4272
|
|
|
4232
4273
|
/*
|
|
4233
4274
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4291,7 +4332,7 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
|
|
|
4291
4332
|
return InteractionRequiredAuthError;
|
|
4292
4333
|
}(AuthError));
|
|
4293
4334
|
|
|
4294
|
-
/*! @azure/msal-common
|
|
4335
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4295
4336
|
/*
|
|
4296
4337
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4297
4338
|
* Licensed under the MIT License.
|
|
@@ -4307,7 +4348,7 @@ var CacheRecord = /** @class */ (function () {
|
|
|
4307
4348
|
return CacheRecord;
|
|
4308
4349
|
}());
|
|
4309
4350
|
|
|
4310
|
-
/*! @azure/msal-common
|
|
4351
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4311
4352
|
|
|
4312
4353
|
/*
|
|
4313
4354
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4378,7 +4419,7 @@ var ProtocolUtils = /** @class */ (function () {
|
|
|
4378
4419
|
return ProtocolUtils;
|
|
4379
4420
|
}());
|
|
4380
4421
|
|
|
4381
|
-
/*! @azure/msal-common
|
|
4422
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4382
4423
|
|
|
4383
4424
|
/*
|
|
4384
4425
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4579,7 +4620,7 @@ var UrlString = /** @class */ (function () {
|
|
|
4579
4620
|
return UrlString;
|
|
4580
4621
|
}());
|
|
4581
4622
|
|
|
4582
|
-
/*! @azure/msal-common
|
|
4623
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4583
4624
|
|
|
4584
4625
|
/*
|
|
4585
4626
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4654,7 +4695,7 @@ var PopTokenGenerator = /** @class */ (function () {
|
|
|
4654
4695
|
return PopTokenGenerator;
|
|
4655
4696
|
}());
|
|
4656
4697
|
|
|
4657
|
-
/*! @azure/msal-common
|
|
4698
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4658
4699
|
|
|
4659
4700
|
/*
|
|
4660
4701
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4724,7 +4765,7 @@ var AppMetadataEntity = /** @class */ (function () {
|
|
|
4724
4765
|
return AppMetadataEntity;
|
|
4725
4766
|
}());
|
|
4726
4767
|
|
|
4727
|
-
/*! @azure/msal-common
|
|
4768
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4728
4769
|
/*
|
|
4729
4770
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4730
4771
|
* Licensed under the MIT License.
|
|
@@ -4760,7 +4801,7 @@ var AppMetadataEntity = /** @class */ (function () {
|
|
|
4760
4801
|
return TokenCacheContext;
|
|
4761
4802
|
}());
|
|
4762
4803
|
|
|
4763
|
-
/*! @azure/msal-common
|
|
4804
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
4764
4805
|
|
|
4765
4806
|
/*
|
|
4766
4807
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4843,7 +4884,7 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
4843
4884
|
}
|
|
4844
4885
|
// Add keyId from request to serverTokenResponse if defined
|
|
4845
4886
|
serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;
|
|
4846
|
-
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp,
|
|
4887
|
+
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload);
|
|
4847
4888
|
_a.label = 1;
|
|
4848
4889
|
case 1:
|
|
4849
4890
|
_a.trys.push([1, , 5, 8]);
|
|
@@ -4891,7 +4932,7 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
4891
4932
|
* @param idTokenObj
|
|
4892
4933
|
* @param authority
|
|
4893
4934
|
*/
|
|
4894
|
-
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp,
|
|
4935
|
+
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload) {
|
|
4895
4936
|
var env = authority.getPreferredCache();
|
|
4896
4937
|
if (StringUtils.isEmpty(env)) {
|
|
4897
4938
|
throw ClientAuthError.createInvalidCacheEnvironmentError();
|
|
@@ -4907,7 +4948,7 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
4907
4948
|
var cachedAccessToken = null;
|
|
4908
4949
|
if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {
|
|
4909
4950
|
// If scopes not returned in server response, use request scopes
|
|
4910
|
-
var responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(
|
|
4951
|
+
var responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);
|
|
4911
4952
|
/*
|
|
4912
4953
|
* Use timestamp calculated before request
|
|
4913
4954
|
* Server may return timestamps as strings, parse to numbers if so.
|
|
@@ -4919,7 +4960,7 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
4919
4960
|
var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;
|
|
4920
4961
|
var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;
|
|
4921
4962
|
// non AAD scenarios can have empty realm
|
|
4922
|
-
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, oboAssertion, serverTokenResponse.key_id);
|
|
4963
|
+
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, oboAssertion, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
|
|
4923
4964
|
}
|
|
4924
4965
|
// refreshToken
|
|
4925
4966
|
var cachedRefreshToken = null;
|
|
@@ -5025,7 +5066,7 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
5025
5066
|
return ResponseHandler;
|
|
5026
5067
|
}());
|
|
5027
5068
|
|
|
5028
|
-
/*! @azure/msal-common
|
|
5069
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5029
5070
|
|
|
5030
5071
|
/*
|
|
5031
5072
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5140,11 +5181,11 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
5140
5181
|
clientId: this.config.authOptions.clientId,
|
|
5141
5182
|
authority: authority.canonicalAuthority,
|
|
5142
5183
|
scopes: request.scopes,
|
|
5184
|
+
claims: request.claims,
|
|
5143
5185
|
authenticationScheme: request.authenticationScheme,
|
|
5144
5186
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
5145
5187
|
resourceRequestUri: request.resourceRequestUri,
|
|
5146
5188
|
shrClaims: request.shrClaims,
|
|
5147
|
-
sshJwk: request.sshJwk,
|
|
5148
5189
|
sshKid: request.sshKid
|
|
5149
5190
|
};
|
|
5150
5191
|
return [4 /*yield*/, this.createTokenRequestBody(request)];
|
|
@@ -5433,7 +5474,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
5433
5474
|
return AuthorizationCodeClient;
|
|
5434
5475
|
}(BaseClient));
|
|
5435
5476
|
|
|
5436
|
-
/*! @azure/msal-common
|
|
5477
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5437
5478
|
|
|
5438
5479
|
/*
|
|
5439
5480
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5544,11 +5585,11 @@ var RefreshTokenClient = /** @class */ (function (_super) {
|
|
|
5544
5585
|
clientId: this.config.authOptions.clientId,
|
|
5545
5586
|
authority: authority.canonicalAuthority,
|
|
5546
5587
|
scopes: request.scopes,
|
|
5588
|
+
claims: request.claims,
|
|
5547
5589
|
authenticationScheme: request.authenticationScheme,
|
|
5548
5590
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
5549
5591
|
resourceRequestUri: request.resourceRequestUri,
|
|
5550
5592
|
shrClaims: request.shrClaims,
|
|
5551
|
-
sshJwk: request.sshJwk,
|
|
5552
5593
|
sshKid: request.sshKid
|
|
5553
5594
|
};
|
|
5554
5595
|
endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParameters);
|
|
@@ -5644,7 +5685,7 @@ var RefreshTokenClient = /** @class */ (function (_super) {
|
|
|
5644
5685
|
return RefreshTokenClient;
|
|
5645
5686
|
}(BaseClient));
|
|
5646
5687
|
|
|
5647
|
-
/*! @azure/msal-common
|
|
5688
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5648
5689
|
|
|
5649
5690
|
/*
|
|
5650
5691
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5690,7 +5731,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
|
|
|
5690
5731
|
SilentFlowClient.prototype.acquireCachedToken = function (request) {
|
|
5691
5732
|
var _a, _b, _c, _d;
|
|
5692
5733
|
return __awaiter(this, void 0, void 0, function () {
|
|
5693
|
-
var
|
|
5734
|
+
var environment, cacheRecord;
|
|
5694
5735
|
return __generator(this, function (_e) {
|
|
5695
5736
|
switch (_e.label) {
|
|
5696
5737
|
case 0:
|
|
@@ -5704,19 +5745,12 @@ var SilentFlowClient = /** @class */ (function (_super) {
|
|
|
5704
5745
|
this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.");
|
|
5705
5746
|
throw ClientAuthError.createRefreshRequiredError();
|
|
5706
5747
|
}
|
|
5707
|
-
else if (!StringUtils.isEmptyObj(request.claims)) {
|
|
5708
|
-
// Must refresh due to request parameters.
|
|
5709
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims are requested.");
|
|
5710
|
-
throw ClientAuthError.createRefreshRequiredError();
|
|
5711
|
-
}
|
|
5712
5748
|
// We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
|
|
5713
5749
|
if (!request.account) {
|
|
5714
5750
|
throw ClientAuthError.createNoAccountInSilentRequestError();
|
|
5715
5751
|
}
|
|
5716
|
-
requestScopes = new ScopeSet(request.scopes || []);
|
|
5717
5752
|
environment = request.authority || this.authority.getPreferredCache();
|
|
5718
|
-
|
|
5719
|
-
cacheRecord = this.cacheManager.readCacheRecord(request.account, this.config.authOptions.clientId, requestScopes, environment, authScheme, request.sshKid);
|
|
5753
|
+
cacheRecord = this.cacheManager.readCacheRecord(request.account, this.config.authOptions.clientId, request, environment);
|
|
5720
5754
|
if (!cacheRecord.accessToken) {
|
|
5721
5755
|
// Must refresh due to non-existent access_token.
|
|
5722
5756
|
(_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);
|
|
@@ -5767,7 +5801,7 @@ var SilentFlowClient = /** @class */ (function (_super) {
|
|
|
5767
5801
|
return SilentFlowClient;
|
|
5768
5802
|
}(BaseClient));
|
|
5769
5803
|
|
|
5770
|
-
/*! @azure/msal-common
|
|
5804
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5771
5805
|
/*
|
|
5772
5806
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5773
5807
|
* Licensed under the MIT License.
|
|
@@ -5778,7 +5812,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
5778
5812
|
response.hasOwnProperty("issuer"));
|
|
5779
5813
|
}
|
|
5780
5814
|
|
|
5781
|
-
/*! @azure/msal-common
|
|
5815
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5782
5816
|
/*
|
|
5783
5817
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5784
5818
|
* Licensed under the MIT License.
|
|
@@ -5792,7 +5826,7 @@ exports.ProtocolMode = void 0;
|
|
|
5792
5826
|
ProtocolMode["OIDC"] = "OIDC";
|
|
5793
5827
|
})(exports.ProtocolMode || (exports.ProtocolMode = {}));
|
|
5794
5828
|
|
|
5795
|
-
/*! @azure/msal-common
|
|
5829
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5796
5830
|
|
|
5797
5831
|
/*
|
|
5798
5832
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5867,7 +5901,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
|
|
|
5867
5901
|
return AuthorityMetadataEntity;
|
|
5868
5902
|
}());
|
|
5869
5903
|
|
|
5870
|
-
/*! @azure/msal-common
|
|
5904
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5871
5905
|
/*
|
|
5872
5906
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5873
5907
|
* Licensed under the MIT License.
|
|
@@ -5877,7 +5911,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
5877
5911
|
response.hasOwnProperty("metadata"));
|
|
5878
5912
|
}
|
|
5879
5913
|
|
|
5880
|
-
/*! @azure/msal-common
|
|
5914
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5881
5915
|
|
|
5882
5916
|
/*
|
|
5883
5917
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5991,7 +6025,7 @@ var RegionDiscovery = /** @class */ (function () {
|
|
|
5991
6025
|
return RegionDiscovery;
|
|
5992
6026
|
}());
|
|
5993
6027
|
|
|
5994
|
-
/*! @azure/msal-common
|
|
6028
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
5995
6029
|
|
|
5996
6030
|
/*
|
|
5997
6031
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6557,7 +6591,7 @@ var Authority = /** @class */ (function () {
|
|
|
6557
6591
|
return Authority;
|
|
6558
6592
|
}());
|
|
6559
6593
|
|
|
6560
|
-
/*! @azure/msal-common
|
|
6594
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
6561
6595
|
|
|
6562
6596
|
/*
|
|
6563
6597
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6618,7 +6652,7 @@ var AuthorityFactory = /** @class */ (function () {
|
|
|
6618
6652
|
return AuthorityFactory;
|
|
6619
6653
|
}());
|
|
6620
6654
|
|
|
6621
|
-
/*! @azure/msal-common
|
|
6655
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
6622
6656
|
|
|
6623
6657
|
/*
|
|
6624
6658
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6649,7 +6683,7 @@ var ServerTelemetryEntity = /** @class */ (function () {
|
|
|
6649
6683
|
return ServerTelemetryEntity;
|
|
6650
6684
|
}());
|
|
6651
6685
|
|
|
6652
|
-
/*! @azure/msal-common
|
|
6686
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
6653
6687
|
|
|
6654
6688
|
/*
|
|
6655
6689
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6677,7 +6711,7 @@ var ThrottlingEntity = /** @class */ (function () {
|
|
|
6677
6711
|
return ThrottlingEntity;
|
|
6678
6712
|
}());
|
|
6679
6713
|
|
|
6680
|
-
/*! @azure/msal-common
|
|
6714
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
6681
6715
|
|
|
6682
6716
|
/*
|
|
6683
6717
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6694,7 +6728,7 @@ var StubbedNetworkModule = {
|
|
|
6694
6728
|
}
|
|
6695
6729
|
};
|
|
6696
6730
|
|
|
6697
|
-
/*! @azure/msal-common
|
|
6731
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
6698
6732
|
|
|
6699
6733
|
/*
|
|
6700
6734
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6753,7 +6787,7 @@ var AuthenticationHeaderParser = /** @class */ (function () {
|
|
|
6753
6787
|
return AuthenticationHeaderParser;
|
|
6754
6788
|
}());
|
|
6755
6789
|
|
|
6756
|
-
/*! @azure/msal-common
|
|
6790
|
+
/*! @azure/msal-common v6.0.0 2022-01-04 */
|
|
6757
6791
|
|
|
6758
6792
|
/*
|
|
6759
6793
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8695,7 +8729,7 @@ var CryptoOps = /** @class */ (function () {
|
|
|
8695
8729
|
*/
|
|
8696
8730
|
CryptoOps.prototype.getPublicKeyThumbprint = function (request) {
|
|
8697
8731
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
8698
|
-
var keyPair, publicKeyJwk, pubKeyThumprintObj, publicJwkString,
|
|
8732
|
+
var keyPair, publicKeyJwk, pubKeyThumprintObj, publicJwkString, publicJwkHash, privateKeyJwk, unextractablePrivateKey;
|
|
8699
8733
|
return __generator$1(this, function (_a) {
|
|
8700
8734
|
switch (_a.label) {
|
|
8701
8735
|
case 0: return [4 /*yield*/, this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES)];
|
|
@@ -8710,10 +8744,9 @@ var CryptoOps = /** @class */ (function () {
|
|
|
8710
8744
|
n: publicKeyJwk.n
|
|
8711
8745
|
};
|
|
8712
8746
|
publicJwkString = BrowserCrypto.getJwkString(pubKeyThumprintObj);
|
|
8713
|
-
return [4 /*yield*/, this.
|
|
8747
|
+
return [4 /*yield*/, this.hashString(publicJwkString)];
|
|
8714
8748
|
case 3:
|
|
8715
|
-
|
|
8716
|
-
publicJwkHash = this.b64Encode.urlEncodeArr(new Uint8Array(publicJwkBuffer));
|
|
8749
|
+
publicJwkHash = _a.sent();
|
|
8717
8750
|
return [4 /*yield*/, this.browserCrypto.exportJwk(keyPair.privateKey)];
|
|
8718
8751
|
case 4:
|
|
8719
8752
|
privateKeyJwk = _a.sent();
|
|
@@ -8820,6 +8853,24 @@ var CryptoOps = /** @class */ (function () {
|
|
|
8820
8853
|
});
|
|
8821
8854
|
});
|
|
8822
8855
|
};
|
|
8856
|
+
/**
|
|
8857
|
+
* Returns the SHA-256 hash of an input string
|
|
8858
|
+
* @param plainText
|
|
8859
|
+
*/
|
|
8860
|
+
CryptoOps.prototype.hashString = function (plainText) {
|
|
8861
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
8862
|
+
var hashBuffer, hashBytes;
|
|
8863
|
+
return __generator$1(this, function (_a) {
|
|
8864
|
+
switch (_a.label) {
|
|
8865
|
+
case 0: return [4 /*yield*/, this.browserCrypto.sha256Digest(plainText)];
|
|
8866
|
+
case 1:
|
|
8867
|
+
hashBuffer = _a.sent();
|
|
8868
|
+
hashBytes = new Uint8Array(hashBuffer);
|
|
8869
|
+
return [2 /*return*/, this.b64Encode.urlEncodeArr(hashBytes)];
|
|
8870
|
+
}
|
|
8871
|
+
});
|
|
8872
|
+
});
|
|
8873
|
+
};
|
|
8823
8874
|
CryptoOps.POP_KEY_USAGES = ["sign", "verify"];
|
|
8824
8875
|
CryptoOps.EXTRACTABLE = true;
|
|
8825
8876
|
return CryptoOps;
|
|
@@ -9741,6 +9792,7 @@ var BrowserCacheManager = /** @class */ (function (_super) {
|
|
|
9741
9792
|
}
|
|
9742
9793
|
});
|
|
9743
9794
|
this.clearMsalCookies();
|
|
9795
|
+
this.setInteractionInProgress(false);
|
|
9744
9796
|
};
|
|
9745
9797
|
BrowserCacheManager.prototype.cacheCodeRequest = function (authCodeRequest, browserCrypto) {
|
|
9746
9798
|
this.logger.trace("BrowserCacheManager.cacheCodeRequest called");
|
|
@@ -9831,6 +9883,25 @@ var BrowserCacheManager = /** @class */ (function (_super) {
|
|
|
9831
9883
|
}
|
|
9832
9884
|
return null;
|
|
9833
9885
|
};
|
|
9886
|
+
/**
|
|
9887
|
+
* Updates a credential's cache key if the current cache key is outdated
|
|
9888
|
+
*/
|
|
9889
|
+
BrowserCacheManager.prototype.updateCredentialCacheKey = function (currentCacheKey, credential) {
|
|
9890
|
+
var updatedCacheKey = credential.generateCredentialKey();
|
|
9891
|
+
if (currentCacheKey !== updatedCacheKey) {
|
|
9892
|
+
var cacheItem = this.getItem(currentCacheKey);
|
|
9893
|
+
if (cacheItem) {
|
|
9894
|
+
this.removeItem(currentCacheKey);
|
|
9895
|
+
this.setItem(updatedCacheKey, cacheItem);
|
|
9896
|
+
this.logger.verbose("Updated an outdated " + credential.credentialType + " cache key");
|
|
9897
|
+
return updatedCacheKey;
|
|
9898
|
+
}
|
|
9899
|
+
else {
|
|
9900
|
+
this.logger.error("Attempted to update an outdated " + credential.credentialType + " cache key but no item matching the outdated key was found in storage");
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9903
|
+
return currentCacheKey;
|
|
9904
|
+
};
|
|
9834
9905
|
return BrowserCacheManager;
|
|
9835
9906
|
}(CacheManager));
|
|
9836
9907
|
var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
|
|
@@ -10331,7 +10402,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
|
|
|
10331
10402
|
|
|
10332
10403
|
/* eslint-disable header/header */
|
|
10333
10404
|
var name = "@azure/msal-browser";
|
|
10334
|
-
var version = "2.
|
|
10405
|
+
var version = "2.21.0";
|
|
10335
10406
|
|
|
10336
10407
|
/*
|
|
10337
10408
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10548,28 +10619,43 @@ var BaseInteractionClient = /** @class */ (function () {
|
|
|
10548
10619
|
* @param request
|
|
10549
10620
|
*/
|
|
10550
10621
|
BaseInteractionClient.prototype.initializeBaseRequest = function (request) {
|
|
10551
|
-
this
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10622
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
10623
|
+
var authority, scopes, _a, validatedRequest;
|
|
10624
|
+
return __generator$1(this, function (_b) {
|
|
10625
|
+
switch (_b.label) {
|
|
10626
|
+
case 0:
|
|
10627
|
+
this.logger.verbose("Initializing BaseAuthRequest");
|
|
10628
|
+
authority = request.authority || this.config.auth.authority;
|
|
10629
|
+
scopes = __spread(((request && request.scopes) || []));
|
|
10630
|
+
// Set authenticationScheme to BEARER if not explicitly set in the request
|
|
10631
|
+
if (!request.authenticationScheme) {
|
|
10632
|
+
request.authenticationScheme = exports.AuthenticationScheme.BEARER;
|
|
10633
|
+
this.logger.verbose("Authentication Scheme wasn't explicitly set in request, defaulting to \"Bearer\" request");
|
|
10634
|
+
}
|
|
10635
|
+
else {
|
|
10636
|
+
if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
|
|
10637
|
+
if (!request.sshJwk) {
|
|
10638
|
+
throw ClientConfigurationError.createMissingSshJwkError();
|
|
10639
|
+
}
|
|
10640
|
+
if (!request.sshKid) {
|
|
10641
|
+
throw ClientConfigurationError.createMissingSshKidError();
|
|
10642
|
+
}
|
|
10643
|
+
}
|
|
10644
|
+
this.logger.verbose("Authentication Scheme set to \"" + request.authenticationScheme + "\" as configured in Auth request");
|
|
10645
|
+
}
|
|
10646
|
+
if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 2];
|
|
10647
|
+
_a = request;
|
|
10648
|
+
return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];
|
|
10649
|
+
case 1:
|
|
10650
|
+
_a.requestedClaimsHash = _b.sent();
|
|
10651
|
+
_b.label = 2;
|
|
10652
|
+
case 2:
|
|
10653
|
+
validatedRequest = __assign$1(__assign$1({}, request), { correlationId: this.correlationId, authority: authority,
|
|
10654
|
+
scopes: scopes });
|
|
10655
|
+
return [2 /*return*/, validatedRequest];
|
|
10566
10656
|
}
|
|
10567
|
-
}
|
|
10568
|
-
|
|
10569
|
-
}
|
|
10570
|
-
var validatedRequest = __assign$1(__assign$1({}, request), { correlationId: this.correlationId, authority: authority,
|
|
10571
|
-
scopes: scopes });
|
|
10572
|
-
return validatedRequest;
|
|
10657
|
+
});
|
|
10658
|
+
});
|
|
10573
10659
|
};
|
|
10574
10660
|
/**
|
|
10575
10661
|
*
|
|
@@ -10799,14 +10885,22 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
10799
10885
|
* @param interactionType
|
|
10800
10886
|
*/
|
|
10801
10887
|
StandardInteractionClient.prototype.preflightInteractiveRequest = function (request, interactionType) {
|
|
10802
|
-
this
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10888
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
10889
|
+
return __generator$1(this, function (_a) {
|
|
10890
|
+
switch (_a.label) {
|
|
10891
|
+
case 0:
|
|
10892
|
+
this.logger.verbose("preflightInteractiveRequest called, validating app environment", request === null || request === void 0 ? void 0 : request.correlationId);
|
|
10893
|
+
// block the reload if it occurred inside a hidden iframe
|
|
10894
|
+
BrowserUtils.blockReloadInHiddenIframes();
|
|
10895
|
+
// Check if interaction is in progress. Throw error if true.
|
|
10896
|
+
if (this.browserStorage.isInteractionInProgress(false)) {
|
|
10897
|
+
throw BrowserAuthError.createInteractionInProgressError();
|
|
10898
|
+
}
|
|
10899
|
+
return [4 /*yield*/, this.initializeAuthorizationRequest(request, interactionType)];
|
|
10900
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
10901
|
+
}
|
|
10902
|
+
});
|
|
10903
|
+
});
|
|
10810
10904
|
};
|
|
10811
10905
|
/**
|
|
10812
10906
|
* Helper to initialize required request parameters for interactive APIs and ssoSilent()
|
|
@@ -10814,28 +10908,39 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
10814
10908
|
* @param interactionType
|
|
10815
10909
|
*/
|
|
10816
10910
|
StandardInteractionClient.prototype.initializeAuthorizationRequest = function (request, interactionType) {
|
|
10817
|
-
this
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10911
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
10912
|
+
var redirectUri, browserState, state, validatedRequest, _a, account, legacyLoginHint;
|
|
10913
|
+
return __generator$1(this, function (_b) {
|
|
10914
|
+
switch (_b.label) {
|
|
10915
|
+
case 0:
|
|
10916
|
+
this.logger.verbose("initializeAuthorizationRequest called");
|
|
10917
|
+
redirectUri = this.getRedirectUri(request.redirectUri);
|
|
10918
|
+
browserState = {
|
|
10919
|
+
interactionType: interactionType
|
|
10920
|
+
};
|
|
10921
|
+
state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || "", browserState);
|
|
10922
|
+
_a = [{}];
|
|
10923
|
+
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
10924
|
+
case 1:
|
|
10925
|
+
validatedRequest = __assign$1.apply(void 0, [__assign$1.apply(void 0, _a.concat([_b.sent()])), { redirectUri: redirectUri, state: state, nonce: request.nonce || this.browserCrypto.createNewGuid(), responseMode: ResponseMode.FRAGMENT }]);
|
|
10926
|
+
account = request.account || this.browserStorage.getActiveAccount();
|
|
10927
|
+
if (account) {
|
|
10928
|
+
this.logger.verbose("Setting validated request account");
|
|
10929
|
+
this.logger.verbosePii("Setting validated request account: " + account);
|
|
10930
|
+
validatedRequest.account = account;
|
|
10931
|
+
}
|
|
10932
|
+
// Check for ADAL/MSAL v1 SSO
|
|
10933
|
+
if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {
|
|
10934
|
+
legacyLoginHint = this.browserStorage.getLegacyLoginHint();
|
|
10935
|
+
if (legacyLoginHint) {
|
|
10936
|
+
validatedRequest.loginHint = legacyLoginHint;
|
|
10937
|
+
}
|
|
10938
|
+
}
|
|
10939
|
+
this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || "", validatedRequest.account || null);
|
|
10940
|
+
return [2 /*return*/, validatedRequest];
|
|
10941
|
+
}
|
|
10942
|
+
});
|
|
10943
|
+
});
|
|
10839
10944
|
};
|
|
10840
10945
|
return StandardInteractionClient;
|
|
10841
10946
|
}(BaseInteractionClient));
|
|
@@ -11225,26 +11330,36 @@ var PopupClient = /** @class */ (function (_super) {
|
|
|
11225
11330
|
* @param request
|
|
11226
11331
|
*/
|
|
11227
11332
|
PopupClient.prototype.acquireToken = function (request) {
|
|
11228
|
-
|
|
11229
|
-
var validRequest
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11333
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
11334
|
+
var validRequest, popupName, popupWindowAttributes, popup, e_1;
|
|
11335
|
+
return __generator$1(this, function (_a) {
|
|
11336
|
+
switch (_a.label) {
|
|
11337
|
+
case 0:
|
|
11338
|
+
_a.trys.push([0, 2, , 3]);
|
|
11339
|
+
return [4 /*yield*/, this.preflightInteractiveRequest(request, exports.InteractionType.Popup)];
|
|
11340
|
+
case 1:
|
|
11341
|
+
validRequest = _a.sent();
|
|
11342
|
+
popupName = PopupUtils.generatePopupName(this.config.auth.clientId, validRequest);
|
|
11343
|
+
popupWindowAttributes = request.popupWindowAttributes || {};
|
|
11344
|
+
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
|
|
11345
|
+
if (this.config.system.asyncPopups) {
|
|
11346
|
+
this.logger.verbose("asyncPopups set to true, acquiring token");
|
|
11347
|
+
// Passes on popup position and dimensions if in request
|
|
11348
|
+
return [2 /*return*/, this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes)];
|
|
11349
|
+
}
|
|
11350
|
+
else {
|
|
11351
|
+
// asyncPopups flag is set to false. Opens popup before acquiring token.
|
|
11352
|
+
this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
|
|
11353
|
+
popup = PopupUtils.openSizedPopup("about:blank", popupName, popupWindowAttributes, this.logger);
|
|
11354
|
+
return [2 /*return*/, this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes, popup)];
|
|
11355
|
+
}
|
|
11356
|
+
case 2:
|
|
11357
|
+
e_1 = _a.sent();
|
|
11358
|
+
return [2 /*return*/, Promise.reject(e_1)];
|
|
11359
|
+
case 3: return [2 /*return*/];
|
|
11360
|
+
}
|
|
11361
|
+
});
|
|
11362
|
+
});
|
|
11248
11363
|
};
|
|
11249
11364
|
/**
|
|
11250
11365
|
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
|
@@ -11287,7 +11402,7 @@ var PopupClient = /** @class */ (function (_super) {
|
|
|
11287
11402
|
*/
|
|
11288
11403
|
PopupClient.prototype.acquireTokenPopupAsync = function (validRequest, popupName, popupWindowAttributes, popup) {
|
|
11289
11404
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
11290
|
-
var serverTelemetryManager, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result,
|
|
11405
|
+
var serverTelemetryManager, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_2;
|
|
11291
11406
|
return __generator$1(this, function (_a) {
|
|
11292
11407
|
switch (_a.label) {
|
|
11293
11408
|
case 0:
|
|
@@ -11325,17 +11440,17 @@ var PopupClient = /** @class */ (function (_super) {
|
|
|
11325
11440
|
result = _a.sent();
|
|
11326
11441
|
return [2 /*return*/, result];
|
|
11327
11442
|
case 7:
|
|
11328
|
-
|
|
11443
|
+
e_2 = _a.sent();
|
|
11329
11444
|
if (popup) {
|
|
11330
11445
|
// Close the synchronous popup if an error is thrown before the window unload event is registered
|
|
11331
11446
|
popup.close();
|
|
11332
11447
|
}
|
|
11333
|
-
if (
|
|
11334
|
-
|
|
11448
|
+
if (e_2 instanceof AuthError) {
|
|
11449
|
+
e_2.setCorrelationId(this.correlationId);
|
|
11335
11450
|
}
|
|
11336
|
-
serverTelemetryManager.cacheFailedRequest(
|
|
11451
|
+
serverTelemetryManager.cacheFailedRequest(e_2);
|
|
11337
11452
|
this.browserStorage.cleanRequestByState(validRequest.state);
|
|
11338
|
-
throw
|
|
11453
|
+
throw e_2;
|
|
11339
11454
|
case 8: return [2 /*return*/];
|
|
11340
11455
|
}
|
|
11341
11456
|
});
|
|
@@ -11352,7 +11467,7 @@ var PopupClient = /** @class */ (function (_super) {
|
|
|
11352
11467
|
*/
|
|
11353
11468
|
PopupClient.prototype.logoutPopupAsync = function (validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {
|
|
11354
11469
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
11355
|
-
var serverTelemetryManager, authClient, logoutUri, popupUtils, popupWindow,
|
|
11470
|
+
var serverTelemetryManager, authClient, logoutUri, popupUtils, popupWindow, e_3, navigationOptions, absoluteUrl, e_4;
|
|
11356
11471
|
return __generator$1(this, function (_a) {
|
|
11357
11472
|
switch (_a.label) {
|
|
11358
11473
|
case 0:
|
|
@@ -11388,8 +11503,8 @@ var PopupClient = /** @class */ (function (_super) {
|
|
|
11388
11503
|
this.logger.verbose("Popup successfully redirected to postLogoutRedirectUri");
|
|
11389
11504
|
return [3 /*break*/, 7];
|
|
11390
11505
|
case 6:
|
|
11391
|
-
|
|
11392
|
-
this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: " +
|
|
11506
|
+
e_3 = _a.sent();
|
|
11507
|
+
this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: " + e_3);
|
|
11393
11508
|
return [3 /*break*/, 7];
|
|
11394
11509
|
case 7:
|
|
11395
11510
|
popupUtils.cleanPopup(popupWindow);
|
|
@@ -11409,19 +11524,19 @@ var PopupClient = /** @class */ (function (_super) {
|
|
|
11409
11524
|
}
|
|
11410
11525
|
return [3 /*break*/, 9];
|
|
11411
11526
|
case 8:
|
|
11412
|
-
|
|
11527
|
+
e_4 = _a.sent();
|
|
11413
11528
|
if (popup) {
|
|
11414
11529
|
// Close the synchronous popup if an error is thrown before the window unload event is registered
|
|
11415
11530
|
popup.close();
|
|
11416
11531
|
}
|
|
11417
|
-
if (
|
|
11418
|
-
|
|
11532
|
+
if (e_4 instanceof AuthError) {
|
|
11533
|
+
e_4.setCorrelationId(this.correlationId);
|
|
11419
11534
|
}
|
|
11420
11535
|
this.browserStorage.setInteractionInProgress(false);
|
|
11421
|
-
this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null,
|
|
11536
|
+
this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e_4);
|
|
11422
11537
|
this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
|
|
11423
|
-
serverTelemetryManager.cacheFailedRequest(
|
|
11424
|
-
throw
|
|
11538
|
+
serverTelemetryManager.cacheFailedRequest(e_4);
|
|
11539
|
+
throw e_4;
|
|
11425
11540
|
case 9:
|
|
11426
11541
|
this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
|
|
11427
11542
|
return [2 /*return*/];
|
|
@@ -11579,22 +11694,23 @@ var RedirectClient = /** @class */ (function (_super) {
|
|
|
11579
11694
|
var validRequest, serverTelemetryManager, authCodeRequest, authClient, interactionHandler, navigateUrl, redirectStartPage, e_1;
|
|
11580
11695
|
return __generator$1(this, function (_a) {
|
|
11581
11696
|
switch (_a.label) {
|
|
11582
|
-
case 0:
|
|
11583
|
-
validRequest = this.preflightInteractiveRequest(request, exports.InteractionType.Redirect);
|
|
11584
|
-
serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenRedirect);
|
|
11585
|
-
_a.label = 1;
|
|
11697
|
+
case 0: return [4 /*yield*/, this.preflightInteractiveRequest(request, exports.InteractionType.Redirect)];
|
|
11586
11698
|
case 1:
|
|
11587
|
-
_a.
|
|
11588
|
-
|
|
11699
|
+
validRequest = _a.sent();
|
|
11700
|
+
serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenRedirect);
|
|
11701
|
+
_a.label = 2;
|
|
11589
11702
|
case 2:
|
|
11703
|
+
_a.trys.push([2, 7, , 8]);
|
|
11704
|
+
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
|
|
11705
|
+
case 3:
|
|
11590
11706
|
authCodeRequest = _a.sent();
|
|
11591
11707
|
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
|
|
11592
|
-
case
|
|
11708
|
+
case 4:
|
|
11593
11709
|
authClient = _a.sent();
|
|
11594
11710
|
this.logger.verbose("Auth code client created");
|
|
11595
11711
|
interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto);
|
|
11596
11712
|
return [4 /*yield*/, authClient.getAuthCodeUrl(validRequest)];
|
|
11597
|
-
case
|
|
11713
|
+
case 5:
|
|
11598
11714
|
navigateUrl = _a.sent();
|
|
11599
11715
|
redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);
|
|
11600
11716
|
this.logger.verbosePii("Redirect start page: " + redirectStartPage);
|
|
@@ -11604,10 +11720,10 @@ var RedirectClient = /** @class */ (function (_super) {
|
|
|
11604
11720
|
redirectStartPage: redirectStartPage,
|
|
11605
11721
|
onRedirectNavigate: request.onRedirectNavigate
|
|
11606
11722
|
})];
|
|
11607
|
-
case
|
|
11723
|
+
case 6:
|
|
11608
11724
|
// Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.
|
|
11609
11725
|
return [2 /*return*/, _a.sent()];
|
|
11610
|
-
case
|
|
11726
|
+
case 7:
|
|
11611
11727
|
e_1 = _a.sent();
|
|
11612
11728
|
if (e_1 instanceof AuthError) {
|
|
11613
11729
|
e_1.setCorrelationId(this.correlationId);
|
|
@@ -11615,7 +11731,7 @@ var RedirectClient = /** @class */ (function (_super) {
|
|
|
11615
11731
|
serverTelemetryManager.cacheFailedRequest(e_1);
|
|
11616
11732
|
this.browserStorage.cleanRequestByState(validRequest.state);
|
|
11617
11733
|
throw e_1;
|
|
11618
|
-
case
|
|
11734
|
+
case 8: return [2 /*return*/];
|
|
11619
11735
|
}
|
|
11620
11736
|
});
|
|
11621
11737
|
});
|
|
@@ -12031,24 +12147,26 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
12031
12147
|
if (request.prompt && request.prompt !== PromptValue.NONE) {
|
|
12032
12148
|
throw BrowserAuthError.createSilentPromptValueError(request.prompt);
|
|
12033
12149
|
}
|
|
12034
|
-
|
|
12035
|
-
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
12036
|
-
_a.label = 1;
|
|
12150
|
+
return [4 /*yield*/, this.initializeAuthorizationRequest(__assign$1(__assign$1({}, request), { prompt: PromptValue.NONE }), exports.InteractionType.Silent)];
|
|
12037
12151
|
case 1:
|
|
12038
|
-
_a.
|
|
12039
|
-
|
|
12152
|
+
silentRequest = _a.sent();
|
|
12153
|
+
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
12154
|
+
_a.label = 2;
|
|
12040
12155
|
case 2:
|
|
12156
|
+
_a.trys.push([2, 7, , 8]);
|
|
12157
|
+
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
|
|
12158
|
+
case 3:
|
|
12041
12159
|
authCodeRequest = _a.sent();
|
|
12042
12160
|
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority)];
|
|
12043
|
-
case
|
|
12161
|
+
case 4:
|
|
12044
12162
|
authClient = _a.sent();
|
|
12045
12163
|
this.logger.verbose("Auth code client created");
|
|
12046
12164
|
return [4 /*yield*/, authClient.getAuthCodeUrl(silentRequest)];
|
|
12047
|
-
case
|
|
12165
|
+
case 5:
|
|
12048
12166
|
navigateUrl = _a.sent();
|
|
12049
12167
|
return [4 /*yield*/, this.silentTokenHelper(navigateUrl, authCodeRequest, authClient, this.logger)];
|
|
12050
|
-
case
|
|
12051
|
-
case
|
|
12168
|
+
case 6: return [2 /*return*/, _a.sent()];
|
|
12169
|
+
case 7:
|
|
12052
12170
|
e_1 = _a.sent();
|
|
12053
12171
|
if (e_1 instanceof AuthError) {
|
|
12054
12172
|
e_1.setCorrelationId(this.correlationId);
|
|
@@ -12056,7 +12174,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
12056
12174
|
serverTelemetryManager.cacheFailedRequest(e_1);
|
|
12057
12175
|
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
12058
12176
|
throw e_1;
|
|
12059
|
-
case
|
|
12177
|
+
case 8: return [2 /*return*/];
|
|
12060
12178
|
}
|
|
12061
12179
|
});
|
|
12062
12180
|
});
|
|
@@ -12112,16 +12230,19 @@ var SilentRefreshClient = /** @class */ (function (_super) {
|
|
|
12112
12230
|
*/
|
|
12113
12231
|
SilentRefreshClient.prototype.acquireToken = function (request) {
|
|
12114
12232
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
12115
|
-
var silentRequest, serverTelemetryManager, refreshTokenClient;
|
|
12233
|
+
var silentRequest, _a, serverTelemetryManager, refreshTokenClient;
|
|
12116
12234
|
var _this = this;
|
|
12117
|
-
return __generator$1(this, function (
|
|
12118
|
-
switch (
|
|
12235
|
+
return __generator$1(this, function (_b) {
|
|
12236
|
+
switch (_b.label) {
|
|
12119
12237
|
case 0:
|
|
12120
|
-
|
|
12238
|
+
_a = [__assign$1({}, request)];
|
|
12239
|
+
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
12240
|
+
case 1:
|
|
12241
|
+
silentRequest = __assign$1.apply(void 0, _a.concat([_b.sent()]));
|
|
12121
12242
|
serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
|
|
12122
12243
|
return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority)];
|
|
12123
|
-
case
|
|
12124
|
-
refreshTokenClient =
|
|
12244
|
+
case 2:
|
|
12245
|
+
refreshTokenClient = _b.sent();
|
|
12125
12246
|
this.logger.verbose("Refresh token client created");
|
|
12126
12247
|
// Send request to renew token. Auth module will throw errors if token cannot be renewed.
|
|
12127
12248
|
return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(silentRequest).catch(function (e) {
|
|
@@ -12320,14 +12441,16 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
|
|
|
12320
12441
|
if (!request.code) {
|
|
12321
12442
|
throw BrowserAuthError.createAuthCodeRequiredError();
|
|
12322
12443
|
}
|
|
12323
|
-
|
|
12324
|
-
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
12325
|
-
_a.label = 1;
|
|
12444
|
+
return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Silent)];
|
|
12326
12445
|
case 1:
|
|
12327
|
-
_a.
|
|
12446
|
+
silentRequest = _a.sent();
|
|
12447
|
+
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
12448
|
+
_a.label = 2;
|
|
12449
|
+
case 2:
|
|
12450
|
+
_a.trys.push([2, 4, , 5]);
|
|
12328
12451
|
authCodeRequest = __assign$1(__assign$1({}, silentRequest), { code: request.code });
|
|
12329
12452
|
return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, silentRequest.authority)];
|
|
12330
|
-
case
|
|
12453
|
+
case 3:
|
|
12331
12454
|
clientConfig = _a.sent();
|
|
12332
12455
|
authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
|
|
12333
12456
|
this.logger.verbose("Auth code client created");
|
|
@@ -12339,7 +12462,7 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
|
|
|
12339
12462
|
cloud_graph_host_name: request.cloudGraphHostName,
|
|
12340
12463
|
cloud_instance_host_name: request.cloudInstanceHostName
|
|
12341
12464
|
}, silentRequest.state, authClient.authority, this.networkClient, false)];
|
|
12342
|
-
case
|
|
12465
|
+
case 4:
|
|
12343
12466
|
e_1 = _a.sent();
|
|
12344
12467
|
if (e_1 instanceof AuthError) {
|
|
12345
12468
|
e_1.setCorrelationId(this.correlationId);
|
|
@@ -12347,7 +12470,7 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
|
|
|
12347
12470
|
serverTelemetryManager.cacheFailedRequest(e_1);
|
|
12348
12471
|
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
12349
12472
|
throw e_1;
|
|
12350
|
-
case
|
|
12473
|
+
case 5: return [2 /*return*/];
|
|
12351
12474
|
}
|
|
12352
12475
|
});
|
|
12353
12476
|
});
|
|
@@ -13006,7 +13129,17 @@ var SilentCacheClient = /** @class */ (function (_super) {
|
|
|
13006
13129
|
});
|
|
13007
13130
|
};
|
|
13008
13131
|
SilentCacheClient.prototype.initializeSilentRequest = function (request, account) {
|
|
13009
|
-
return
|
|
13132
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
13133
|
+
var _a;
|
|
13134
|
+
return __generator$1(this, function (_b) {
|
|
13135
|
+
switch (_b.label) {
|
|
13136
|
+
case 0:
|
|
13137
|
+
_a = [__assign$1({}, request)];
|
|
13138
|
+
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
13139
|
+
case 1: return [2 /*return*/, __assign$1.apply(void 0, [__assign$1.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
|
|
13140
|
+
}
|
|
13141
|
+
});
|
|
13142
|
+
});
|
|
13010
13143
|
};
|
|
13011
13144
|
return SilentCacheClient;
|
|
13012
13145
|
}(StandardInteractionClient));
|
|
@@ -13097,11 +13230,11 @@ var PublicClientApplication = /** @class */ (function (_super) {
|
|
|
13097
13230
|
authority: request.authority || "",
|
|
13098
13231
|
scopes: request.scopes,
|
|
13099
13232
|
homeAccountIdentifier: account.homeAccountId,
|
|
13233
|
+
claims: request.claims,
|
|
13100
13234
|
authenticationScheme: request.authenticationScheme,
|
|
13101
13235
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
13102
13236
|
resourceRequestUri: request.resourceRequestUri,
|
|
13103
13237
|
shrClaims: request.shrClaims,
|
|
13104
|
-
sshJwk: request.sshJwk,
|
|
13105
13238
|
sshKid: request.sshKid
|
|
13106
13239
|
};
|
|
13107
13240
|
silentRequestKey = JSON.stringify(thumbprint);
|
|
@@ -13138,28 +13271,33 @@ var PublicClientApplication = /** @class */ (function (_super) {
|
|
|
13138
13271
|
var silentCacheClient, silentRequest;
|
|
13139
13272
|
var _this = this;
|
|
13140
13273
|
return __generator$1(this, function (_a) {
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13274
|
+
switch (_a.label) {
|
|
13275
|
+
case 0:
|
|
13276
|
+
silentCacheClient = new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);
|
|
13277
|
+
return [4 /*yield*/, silentCacheClient.initializeSilentRequest(request, account)];
|
|
13278
|
+
case 1:
|
|
13279
|
+
silentRequest = _a.sent();
|
|
13280
|
+
this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
|
|
13281
|
+
return [2 /*return*/, silentCacheClient.acquireToken(silentRequest).catch(function () { return __awaiter$1(_this, void 0, void 0, function () {
|
|
13282
|
+
var tokenRenewalResult, tokenRenewalError_1;
|
|
13283
|
+
return __generator$1(this, function (_a) {
|
|
13284
|
+
switch (_a.label) {
|
|
13285
|
+
case 0:
|
|
13286
|
+
_a.trys.push([0, 2, , 3]);
|
|
13287
|
+
return [4 /*yield*/, this.acquireTokenByRefreshToken(silentRequest)];
|
|
13288
|
+
case 1:
|
|
13289
|
+
tokenRenewalResult = _a.sent();
|
|
13290
|
+
this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, tokenRenewalResult);
|
|
13291
|
+
return [2 /*return*/, tokenRenewalResult];
|
|
13292
|
+
case 2:
|
|
13293
|
+
tokenRenewalError_1 = _a.sent();
|
|
13294
|
+
this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError_1);
|
|
13295
|
+
throw tokenRenewalError_1;
|
|
13296
|
+
case 3: return [2 /*return*/];
|
|
13297
|
+
}
|
|
13298
|
+
});
|
|
13299
|
+
}); })];
|
|
13300
|
+
}
|
|
13163
13301
|
});
|
|
13164
13302
|
});
|
|
13165
13303
|
};
|