@azure/msal-common 14.2.0 → 14.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +4 -5
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +29 -172
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +79 -413
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +2 -2
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/cache/CacheManager.d.ts +24 -19
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +51 -33
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +12 -43
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/entities/AppMetadataEntity.mjs +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.mjs +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +15 -73
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/IdTokenEntity.d.ts +4 -30
- package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.d.ts +2 -33
- package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.d.ts +2 -9
- package/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -1
- package/dist/cache/entities/ThrottlingEntity.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.d.ts +65 -0
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -0
- package/dist/cache/utils/CacheHelpers.mjs +242 -0
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -0
- package/dist/client/AuthorizationCodeClient.d.ts +2 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +4 -10
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +1 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +8 -8
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +2 -2
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +5 -3
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/crypto/ICrypto.d.ts +3 -3
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.d.ts +3 -3
- package/dist/crypto/JoseHeader.d.ts.map +1 -1
- package/dist/crypto/JoseHeader.mjs +3 -3
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +3 -3
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +4 -0
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index.cjs +2768 -3303
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6 -7
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/NetworkManager.mjs +1 -1
- package/dist/network/RequestThumbprint.d.ts +2 -0
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/BaseAuthRequest.d.ts +3 -0
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestValidator.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.d.ts +2 -2
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +23 -29
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +8 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +6 -2
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +11 -8
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts +2 -37
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +7 -126
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +2 -3
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +3 -4
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.d.ts +11 -0
- package/dist/utils/UrlUtils.d.ts.map +1 -0
- package/dist/utils/UrlUtils.mjs +52 -0
- package/dist/utils/UrlUtils.mjs.map +1 -0
- package/package.json +1 -1
- package/src/authority/Authority.ts +5 -8
- package/src/authority/AuthorityMetadata.ts +109 -435
- package/src/authority/AuthorityOptions.ts +2 -2
- package/src/cache/CacheManager.ts +79 -42
- package/src/cache/entities/AccessTokenEntity.ts +13 -149
- package/src/cache/entities/CredentialEntity.ts +16 -200
- package/src/cache/entities/IdTokenEntity.ts +4 -64
- package/src/cache/entities/RefreshTokenEntity.ts +2 -69
- package/src/cache/entities/ServerTelemetryEntity.ts +2 -30
- package/src/cache/utils/CacheHelpers.ts +327 -0
- package/src/client/AuthorizationCodeClient.ts +4 -15
- package/src/client/BaseClient.ts +21 -10
- package/src/client/RefreshTokenClient.ts +7 -1
- package/src/client/SilentFlowClient.ts +8 -4
- package/src/crypto/ICrypto.ts +7 -2
- package/src/crypto/JoseHeader.ts +4 -4
- package/src/crypto/PopTokenGenerator.ts +2 -0
- package/src/crypto/SignedHttpRequest.ts +6 -0
- package/src/index.ts +4 -1
- package/src/network/RequestThumbprint.ts +2 -0
- package/src/packageMetadata.ts +1 -1
- package/src/request/BaseAuthRequest.ts +3 -0
- package/src/response/ResponseHandler.ts +36 -41
- package/src/telemetry/performance/PerformanceEvent.ts +12 -1
- package/src/telemetry/server/ServerTelemetryManager.ts +12 -6
- package/src/url/UrlString.ts +6 -153
- package/src/utils/Constants.ts +3 -3
- package/src/utils/UrlUtils.ts +60 -0
- package/dist/cache/entities/AccessTokenEntity.mjs +0 -121
- package/dist/cache/entities/AccessTokenEntity.mjs.map +0 -1
- package/dist/cache/entities/CredentialEntity.mjs +0 -145
- package/dist/cache/entities/CredentialEntity.mjs.map +0 -1
- package/dist/cache/entities/IdTokenEntity.mjs +0 -64
- package/dist/cache/entities/IdTokenEntity.mjs.map +0 -1
- package/dist/cache/entities/RefreshTokenEntity.mjs +0 -67
- package/dist/cache/entities/RefreshTokenEntity.mjs.map +0 -1
- package/dist/cache/entities/ServerTelemetryEntity.mjs +0 -34
- package/dist/cache/entities/ServerTelemetryEntity.mjs.map +0 -1
|
@@ -15,6 +15,7 @@ import { BaseAuthRequest } from "../request/BaseAuthRequest";
|
|
|
15
15
|
import { Logger } from "../logger/Logger";
|
|
16
16
|
import { StoreInCache } from "../request/StoreInCache";
|
|
17
17
|
import { StaticAuthorityOptions } from "../authority/AuthorityOptions";
|
|
18
|
+
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
|
|
18
19
|
/**
|
|
19
20
|
* Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.
|
|
20
21
|
* @internal
|
|
@@ -237,13 +238,13 @@ export declare abstract class CacheManager implements ICacheManager {
|
|
|
237
238
|
removeAppMetadata(): boolean;
|
|
238
239
|
/**
|
|
239
240
|
* Retrieve the cached credentials into a cacherecord
|
|
240
|
-
* @param account
|
|
241
|
-
* @param
|
|
242
|
-
* @param
|
|
243
|
-
* @param
|
|
244
|
-
* @param
|
|
241
|
+
* @param account {AccountInfo}
|
|
242
|
+
* @param request {BaseAuthRequest}
|
|
243
|
+
* @param environment {string}
|
|
244
|
+
* @param performanceClient {?IPerformanceClient}
|
|
245
|
+
* @param correlationId {?string}
|
|
245
246
|
*/
|
|
246
|
-
readCacheRecord(account: AccountInfo, request: BaseAuthRequest, environment: string): CacheRecord;
|
|
247
|
+
readCacheRecord(account: AccountInfo, request: BaseAuthRequest, environment: string, performanceClient?: IPerformanceClient, correlationId?: string): CacheRecord;
|
|
247
248
|
/**
|
|
248
249
|
* Retrieve AccountEntity from cache
|
|
249
250
|
* @param account
|
|
@@ -251,11 +252,12 @@ export declare abstract class CacheManager implements ICacheManager {
|
|
|
251
252
|
readAccountFromCache(account: AccountInfo): AccountEntity | null;
|
|
252
253
|
/**
|
|
253
254
|
* Retrieve IdTokenEntity from cache
|
|
254
|
-
* @param
|
|
255
|
-
* @param
|
|
256
|
-
* @param
|
|
255
|
+
* @param account {AccountInfo}
|
|
256
|
+
* @param tokenKeys {?TokenKeys}
|
|
257
|
+
* @param performanceClient {?IPerformanceClient}
|
|
258
|
+
* @param correlationId {?string}
|
|
257
259
|
*/
|
|
258
|
-
getIdToken(account: AccountInfo, tokenKeys?: TokenKeys): IdTokenEntity | null;
|
|
260
|
+
getIdToken(account: AccountInfo, tokenKeys?: TokenKeys, performanceClient?: IPerformanceClient, correlationId?: string): IdTokenEntity | null;
|
|
259
261
|
/**
|
|
260
262
|
* Gets all idTokens matching the given filter
|
|
261
263
|
* @param filter
|
|
@@ -281,12 +283,13 @@ export declare abstract class CacheManager implements ICacheManager {
|
|
|
281
283
|
removeRefreshToken(key: string): void;
|
|
282
284
|
/**
|
|
283
285
|
* Retrieve AccessTokenEntity from cache
|
|
284
|
-
* @param
|
|
285
|
-
* @param
|
|
286
|
-
* @param
|
|
287
|
-
* @param
|
|
286
|
+
* @param account {AccountInfo}
|
|
287
|
+
* @param request {BaseAuthRequest}
|
|
288
|
+
* @param tokenKeys {?TokenKeys}
|
|
289
|
+
* @param performanceClient {?IPerformanceClient}
|
|
290
|
+
* @param correlationId {?string}
|
|
288
291
|
*/
|
|
289
|
-
getAccessToken(account: AccountInfo, request: BaseAuthRequest, tokenKeys?: TokenKeys): AccessTokenEntity | null;
|
|
292
|
+
getAccessToken(account: AccountInfo, request: BaseAuthRequest, tokenKeys?: TokenKeys, performanceClient?: IPerformanceClient, correlationId?: string): AccessTokenEntity | null;
|
|
290
293
|
/**
|
|
291
294
|
* Validate the cache key against filter before retrieving and parsing cache value
|
|
292
295
|
* @param key
|
|
@@ -303,11 +306,13 @@ export declare abstract class CacheManager implements ICacheManager {
|
|
|
303
306
|
getAccessTokensByFilter(filter: CredentialFilter): AccessTokenEntity[];
|
|
304
307
|
/**
|
|
305
308
|
* Helper to retrieve the appropriate refresh token from cache
|
|
306
|
-
* @param
|
|
307
|
-
* @param
|
|
308
|
-
* @param
|
|
309
|
+
* @param account {AccountInfo}
|
|
310
|
+
* @param familyRT {boolean}
|
|
311
|
+
* @param tokenKeys {?TokenKeys}
|
|
312
|
+
* @param performanceClient {?IPerformanceClient}
|
|
313
|
+
* @param correlationId {?string}
|
|
309
314
|
*/
|
|
310
|
-
getRefreshToken(account: AccountInfo, familyRT: boolean, tokenKeys?: TokenKeys): RefreshTokenEntity | null;
|
|
315
|
+
getRefreshToken(account: AccountInfo, familyRT: boolean, tokenKeys?: TokenKeys, performanceClient?: IPerformanceClient, correlationId?: string): RefreshTokenEntity | null;
|
|
311
316
|
/**
|
|
312
317
|
* Validate the cache key against filter before retrieving and parsing cache value
|
|
313
318
|
* @param key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheManager.d.ts","sourceRoot":"","sources":["../../src/cache/CacheManager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iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAM9C;AAED,gBAAgB;AAChB,qBAAa,mBAAoB,SAAQ,YAAY;IACjD,UAAU,IAAI,IAAI;IAGlB,UAAU,IAAI,aAAa;IAG3B,oBAAoB,IAAI,IAAI;IAG5B,oBAAoB,IAAI,aAAa;IAGrC,wBAAwB,IAAI,IAAI;IAGhC,wBAAwB,IAAI,iBAAiB;IAG7C,yBAAyB,IAAI,IAAI;IAGjC,yBAAyB,IAAI,kBAAkB;IAG/C,cAAc,IAAI,IAAI;IAGtB,cAAc,IAAI,iBAAiB;IAGnC,kBAAkB,IAAI,IAAI;IAG1B,kBAAkB,IAAI,qBAAqB;IAG3C,oBAAoB,IAAI,IAAI;IAG5B,oBAAoB,IAAI,uBAAuB,GAAG,IAAI;IAGtD,wBAAwB,IAAI,KAAK,CAAC,MAAM,CAAC;IAGzC,kBAAkB,IAAI,IAAI;IAG1B,kBAAkB,IAAI,gBAAgB;IAGtC,UAAU,IAAI,OAAO;IAGrB,WAAW,IAAI,OAAO;IAGtB,OAAO,IAAI,MAAM,EAAE;IAGnB,cAAc,IAAI,MAAM,EAAE;IAG1B,YAAY,IAAI,SAAS;IAGnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAG5B,wBAAwB,IAAI,MAAM;CAGrC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.4.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { Separators, CredentialType, AuthenticationScheme, THE_FAMILY_ID, APP_METADATA, AUTHORITY_METADATA_CONSTANTS } from '../utils/Constants.mjs';
|
|
4
|
+
import { generateCredentialKey } from './utils/CacheHelpers.mjs';
|
|
4
5
|
import { ScopeSet } from '../request/ScopeSet.mjs';
|
|
5
6
|
import { AccountEntity } from './entities/AccountEntity.mjs';
|
|
6
7
|
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
|
7
8
|
import { extractTokenClaims } from '../account/AuthToken.mjs';
|
|
8
9
|
import { name, version } from '../packageMetadata.mjs';
|
|
9
|
-
import {
|
|
10
|
+
import { getAliasesFromStaticSources } from '../authority/AuthorityMetadata.mjs';
|
|
10
11
|
import { invalidCacheRecord, bindingKeyNotRemoved, multipleMatchingAppMetadata, methodNotImplemented } from '../error/ClientAuthErrorCodes.mjs';
|
|
11
12
|
|
|
12
13
|
/*
|
|
@@ -44,7 +45,14 @@ class CacheManager {
|
|
|
44
45
|
*/
|
|
45
46
|
getAccountInfoFilteredBy(accountFilter) {
|
|
46
47
|
const allAccounts = this.getAllAccounts(accountFilter);
|
|
47
|
-
if (allAccounts.length >
|
|
48
|
+
if (allAccounts.length > 1) {
|
|
49
|
+
// If one or more accounts are found, further filter to the first account that has an ID token
|
|
50
|
+
return allAccounts.filter((account) => {
|
|
51
|
+
return !!account.idTokenClaims;
|
|
52
|
+
})[0];
|
|
53
|
+
}
|
|
54
|
+
else if (allAccounts.length === 1) {
|
|
55
|
+
// If only one account is found, return it regardless of whether a matching ID token was found
|
|
48
56
|
return allAccounts[0];
|
|
49
57
|
}
|
|
50
58
|
else {
|
|
@@ -76,7 +84,7 @@ class CacheManager {
|
|
|
76
84
|
return accountInfo;
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
|
-
return
|
|
87
|
+
return accountInfo;
|
|
80
88
|
}
|
|
81
89
|
idTokenClaimsMatchAccountFilter(idTokenClaims, accountFilter) {
|
|
82
90
|
if (accountFilter) {
|
|
@@ -480,18 +488,18 @@ class CacheManager {
|
|
|
480
488
|
}
|
|
481
489
|
/**
|
|
482
490
|
* Retrieve the cached credentials into a cacherecord
|
|
483
|
-
* @param account
|
|
484
|
-
* @param
|
|
485
|
-
* @param
|
|
486
|
-
* @param
|
|
487
|
-
* @param
|
|
491
|
+
* @param account {AccountInfo}
|
|
492
|
+
* @param request {BaseAuthRequest}
|
|
493
|
+
* @param environment {string}
|
|
494
|
+
* @param performanceClient {?IPerformanceClient}
|
|
495
|
+
* @param correlationId {?string}
|
|
488
496
|
*/
|
|
489
|
-
readCacheRecord(account, request, environment) {
|
|
497
|
+
readCacheRecord(account, request, environment, performanceClient, correlationId) {
|
|
490
498
|
const tokenKeys = this.getTokenKeys();
|
|
491
499
|
const cachedAccount = this.readAccountFromCache(account);
|
|
492
|
-
const cachedIdToken = this.getIdToken(account, tokenKeys);
|
|
493
|
-
const cachedAccessToken = this.getAccessToken(account, request, tokenKeys);
|
|
494
|
-
const cachedRefreshToken = this.getRefreshToken(account, false, tokenKeys);
|
|
500
|
+
const cachedIdToken = this.getIdToken(account, tokenKeys, performanceClient, correlationId);
|
|
501
|
+
const cachedAccessToken = this.getAccessToken(account, request, tokenKeys, performanceClient, correlationId);
|
|
502
|
+
const cachedRefreshToken = this.getRefreshToken(account, false, tokenKeys, performanceClient, correlationId);
|
|
495
503
|
const cachedAppMetadata = this.readAppMetadataFromCache(environment);
|
|
496
504
|
if (cachedAccount && cachedIdToken) {
|
|
497
505
|
cachedAccount.idTokenClaims = extractTokenClaims(cachedIdToken.secret, this.cryptoImpl.base64Decode);
|
|
@@ -514,11 +522,12 @@ class CacheManager {
|
|
|
514
522
|
}
|
|
515
523
|
/**
|
|
516
524
|
* Retrieve IdTokenEntity from cache
|
|
517
|
-
* @param
|
|
518
|
-
* @param
|
|
519
|
-
* @param
|
|
525
|
+
* @param account {AccountInfo}
|
|
526
|
+
* @param tokenKeys {?TokenKeys}
|
|
527
|
+
* @param performanceClient {?IPerformanceClient}
|
|
528
|
+
* @param correlationId {?string}
|
|
520
529
|
*/
|
|
521
|
-
getIdToken(account, tokenKeys) {
|
|
530
|
+
getIdToken(account, tokenKeys, performanceClient, correlationId) {
|
|
522
531
|
this.commonLogger.trace("CacheManager - getIdToken called");
|
|
523
532
|
const idTokenFilter = {
|
|
524
533
|
homeAccountId: account.homeAccountId,
|
|
@@ -536,8 +545,11 @@ class CacheManager {
|
|
|
536
545
|
else if (numIdTokens > 1) {
|
|
537
546
|
this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them");
|
|
538
547
|
idTokens.forEach((idToken) => {
|
|
539
|
-
this.removeIdToken(
|
|
548
|
+
this.removeIdToken(generateCredentialKey(idToken));
|
|
540
549
|
});
|
|
550
|
+
if (performanceClient && correlationId) {
|
|
551
|
+
performanceClient.addFields({ multiMatchedID: idTokens.length }, correlationId);
|
|
552
|
+
}
|
|
541
553
|
return null;
|
|
542
554
|
}
|
|
543
555
|
this.commonLogger.info("CacheManager:getIdToken - Returning id token");
|
|
@@ -599,12 +611,13 @@ class CacheManager {
|
|
|
599
611
|
}
|
|
600
612
|
/**
|
|
601
613
|
* Retrieve AccessTokenEntity from cache
|
|
602
|
-
* @param
|
|
603
|
-
* @param
|
|
604
|
-
* @param
|
|
605
|
-
* @param
|
|
614
|
+
* @param account {AccountInfo}
|
|
615
|
+
* @param request {BaseAuthRequest}
|
|
616
|
+
* @param tokenKeys {?TokenKeys}
|
|
617
|
+
* @param performanceClient {?IPerformanceClient}
|
|
618
|
+
* @param correlationId {?string}
|
|
606
619
|
*/
|
|
607
|
-
getAccessToken(account, request, tokenKeys) {
|
|
620
|
+
getAccessToken(account, request, tokenKeys, performanceClient, correlationId) {
|
|
608
621
|
this.commonLogger.trace("CacheManager - getAccessToken called");
|
|
609
622
|
const scopes = ScopeSet.createSearchScopes(request.scopes);
|
|
610
623
|
const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;
|
|
@@ -650,8 +663,11 @@ class CacheManager {
|
|
|
650
663
|
else if (numAccessTokens > 1) {
|
|
651
664
|
this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them");
|
|
652
665
|
accessTokens.forEach((accessToken) => {
|
|
653
|
-
void this.removeAccessToken(
|
|
666
|
+
void this.removeAccessToken(generateCredentialKey(accessToken));
|
|
654
667
|
});
|
|
668
|
+
if (performanceClient && correlationId) {
|
|
669
|
+
performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
|
|
670
|
+
}
|
|
655
671
|
return null;
|
|
656
672
|
}
|
|
657
673
|
this.commonLogger.info("CacheManager:getAccessToken - Returning access token");
|
|
@@ -720,11 +736,13 @@ class CacheManager {
|
|
|
720
736
|
}
|
|
721
737
|
/**
|
|
722
738
|
* Helper to retrieve the appropriate refresh token from cache
|
|
723
|
-
* @param
|
|
724
|
-
* @param
|
|
725
|
-
* @param
|
|
739
|
+
* @param account {AccountInfo}
|
|
740
|
+
* @param familyRT {boolean}
|
|
741
|
+
* @param tokenKeys {?TokenKeys}
|
|
742
|
+
* @param performanceClient {?IPerformanceClient}
|
|
743
|
+
* @param correlationId {?string}
|
|
726
744
|
*/
|
|
727
|
-
getRefreshToken(account, familyRT, tokenKeys) {
|
|
745
|
+
getRefreshToken(account, familyRT, tokenKeys, performanceClient, correlationId) {
|
|
728
746
|
this.commonLogger.trace("CacheManager - getRefreshToken called");
|
|
729
747
|
const id = familyRT ? THE_FAMILY_ID : undefined;
|
|
730
748
|
const refreshTokenFilter = {
|
|
@@ -754,6 +772,9 @@ class CacheManager {
|
|
|
754
772
|
return null;
|
|
755
773
|
}
|
|
756
774
|
// address the else case after remove functions address environment aliases
|
|
775
|
+
if (numRefreshTokens > 1 && performanceClient && correlationId) {
|
|
776
|
+
performanceClient.addFields({ multiMatchedRT: numRefreshTokens }, correlationId);
|
|
777
|
+
}
|
|
757
778
|
this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token");
|
|
758
779
|
return refreshTokens[0];
|
|
759
780
|
}
|
|
@@ -863,11 +884,8 @@ class CacheManager {
|
|
|
863
884
|
matchEnvironment(entity, environment) {
|
|
864
885
|
// Check static authority options first for cases where authority metadata has not been resolved and cached yet
|
|
865
886
|
if (this.staticAuthorityOptions) {
|
|
866
|
-
const staticAliases =
|
|
867
|
-
|
|
868
|
-
this.staticAuthorityOptions.knownAuthorities;
|
|
869
|
-
if (staticAliases &&
|
|
870
|
-
staticAliases.includes(environment) &&
|
|
887
|
+
const staticAliases = getAliasesFromStaticSources(this.staticAuthorityOptions, this.commonLogger);
|
|
888
|
+
if (staticAliases.includes(environment) &&
|
|
871
889
|
staticAliases.includes(entity.environment)) {
|
|
872
890
|
return true;
|
|
873
891
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheManager.mjs","sources":["../../src/cache/CacheManager.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.invalidCacheRecord","ClientAuthErrorCodes.bindingKeyNotRemoved"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CacheManager.mjs","sources":["../../src/cache/CacheManager.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.invalidCacheRecord","ClientAuthErrorCodes.bindingKeyNotRemoved"],"mappings":";;;;;;;;;;;;AAKA;AAQA;AAYA;AACA;AAcA;AACA;AACA;AAEA;AAEO,MAAE,YAAA,CAAA;AAET,IAAA,WAAS,CAAA,QAAA,EAAA;AAET,QAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;;;AAGG,QAAA,IAAA,CAAA,sBAAA,GAAA,sBAAA,CAAA;AACH,KAAsB;AAClB;AACA;;;AAMI;AAWJ,IAAA,cAAA,CAAA,aAAA,EAAA;;;AAGG,YAAA,MAAA,WAAA,GAAA,IAAA,CAAA,wBAAA,CAAA,aAAA,EAAA,aAAA,CAAA,CAAA;YACK,eAAY,EAAA;AAEpB,gBAAA,aAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA;;;AAGG,QAAA,OAAA,aAAA,CAAA;AACH,KAAA;AAEA;;;AAGG,IAAA,wBAAA,CAAA,aAAA,EAAA;QACK,yBAAqB,cAAmB,CAAA,aAAgB,CAAA,CAAA;AAEhE,QAAA,IAAA,WAAA,CAAA,MAAA,GAAA,CAAA,EAAA;;;AAGG,gBAAA,OAAA,CAAA,CAAA,O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A,CAAA,QAAA,CAAA,EAAA;qBAGL,UAAE,CAAA,QAAA,CAAA,CAAA;aAGL;AAGd,SAAA,CAAA,CAAA;AAGM,QAAA,OAAS,IAAA,CAAO;AAGtB,KAAA;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,57 +1,26 @@
|
|
|
1
1
|
import { CredentialEntity } from "./CredentialEntity";
|
|
2
2
|
import { AuthenticationScheme } from "../../utils/Constants";
|
|
3
|
-
import { ICrypto } from "../../crypto/ICrypto";
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Key:Value Schema:
|
|
8
|
-
*
|
|
9
|
-
* Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
|
|
10
|
-
*
|
|
11
|
-
* Value Schema:
|
|
12
|
-
* {
|
|
13
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
14
|
-
* environment: entity that issued the token, represented as a full host
|
|
15
|
-
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
16
|
-
* clientId: client ID of the application
|
|
17
|
-
* secret: Actual credential as a string
|
|
18
|
-
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
19
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
20
|
-
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
21
|
-
* cachedAt: Absolute device time when entry was created in the cache.
|
|
22
|
-
* expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
|
|
23
|
-
* extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
|
|
24
|
-
* keyId: used for POP and SSH tokenTypes
|
|
25
|
-
* tokenType: Type of the token issued. Usually "Bearer"
|
|
26
|
-
* }
|
|
4
|
+
* Access token cache type
|
|
27
5
|
*/
|
|
28
|
-
export
|
|
6
|
+
export type AccessTokenEntity = CredentialEntity & {
|
|
7
|
+
/** Full tenant or organizational identifier that the account belongs to */
|
|
29
8
|
realm: string;
|
|
9
|
+
/** Permissions that are included in the token, or for refresh tokens, the resource identifier. */
|
|
30
10
|
target: string;
|
|
11
|
+
/** Absolute device time when entry was created in the cache. */
|
|
31
12
|
cachedAt: string;
|
|
13
|
+
/** Token expiry time, calculated based on current UTC time in seconds. Represented as a string. */
|
|
32
14
|
expiresOn: string;
|
|
15
|
+
/** Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds. */
|
|
33
16
|
extendedExpiresOn?: string;
|
|
17
|
+
/** Used for proactive refresh */
|
|
34
18
|
refreshOn?: string;
|
|
35
|
-
|
|
19
|
+
/** Matches the authentication scheme for which the token was issued (i.e. Bearer or pop) */
|
|
36
20
|
tokenType?: AuthenticationScheme;
|
|
21
|
+
/** Stringified claims object */
|
|
37
22
|
requestedClaims?: string;
|
|
23
|
+
/** Matches the SHA 256 hash of the claims object included in the token request */
|
|
38
24
|
requestedClaimsHash?: string;
|
|
39
|
-
|
|
40
|
-
* Create AccessTokenEntity
|
|
41
|
-
* @param homeAccountId
|
|
42
|
-
* @param environment
|
|
43
|
-
* @param accessToken
|
|
44
|
-
* @param clientId
|
|
45
|
-
* @param tenantId
|
|
46
|
-
* @param scopes
|
|
47
|
-
* @param expiresOn
|
|
48
|
-
* @param extExpiresOn
|
|
49
|
-
*/
|
|
50
|
-
static createAccessTokenEntity(homeAccountId: string, environment: string, accessToken: string, clientId: string, tenantId: string, scopes: string, expiresOn: number, extExpiresOn: number, cryptoUtils: ICrypto, refreshOn?: number, tokenType?: AuthenticationScheme, userAssertionHash?: string, keyId?: string, requestedClaims?: string, requestedClaimsHash?: string): AccessTokenEntity;
|
|
51
|
-
/**
|
|
52
|
-
* Validates an entity: checks for all expected params
|
|
53
|
-
* @param entity
|
|
54
|
-
*/
|
|
55
|
-
static isAccessTokenEntity(entity: object): boolean;
|
|
56
|
-
}
|
|
25
|
+
};
|
|
57
26
|
//# sourceMappingURL=AccessTokenEntity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessTokenEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/AccessTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"AccessTokenEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/AccessTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IAC/C,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;IAClB,qIAAqI;IACrI,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC"}
|
|
@@ -1,89 +1,31 @@
|
|
|
1
1
|
import { CredentialType, AuthenticationScheme } from "../../utils/Constants";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Key:Value Schema:
|
|
6
|
-
*
|
|
7
|
-
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>
|
|
8
|
-
*
|
|
9
|
-
* Value Schema:
|
|
10
|
-
* {
|
|
11
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
12
|
-
* environment: entity that issued the token, represented as a full host
|
|
13
|
-
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
14
|
-
* clientId: client ID of the application
|
|
15
|
-
* secret: Actual credential as a string
|
|
16
|
-
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
17
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
18
|
-
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
19
|
-
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
20
|
-
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
|
|
21
|
-
* userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow
|
|
22
|
-
* }
|
|
3
|
+
* Credential Cache Type
|
|
23
4
|
*/
|
|
24
|
-
export
|
|
5
|
+
export type CredentialEntity = {
|
|
6
|
+
/** Identifier for the user in their home tenant*/
|
|
25
7
|
homeAccountId: string;
|
|
8
|
+
/** Entity that issued the token, represented as a full host */
|
|
26
9
|
environment: string;
|
|
10
|
+
/** Type of credential */
|
|
27
11
|
credentialType: CredentialType;
|
|
12
|
+
/** Client ID of the application */
|
|
28
13
|
clientId: string;
|
|
14
|
+
/** Actual credential as a string */
|
|
29
15
|
secret: string;
|
|
16
|
+
/** Family ID identifier, usually only used for refresh tokens */
|
|
30
17
|
familyId?: string;
|
|
18
|
+
/** Full tenant or organizational identifier that the account belongs to */
|
|
31
19
|
realm?: string;
|
|
20
|
+
/** Permissions that are included in the token, or for refresh tokens, the resource identifier. */
|
|
32
21
|
target?: string;
|
|
22
|
+
/** Matches the SHA 256 hash of the obo_assertion for the OBO flow */
|
|
33
23
|
userAssertionHash?: string;
|
|
24
|
+
/** Matches the authentication scheme for which the token was issued (i.e. Bearer or pop) */
|
|
34
25
|
tokenType?: AuthenticationScheme;
|
|
26
|
+
/** KeyId for PoP and SSH tokens stored in the kid claim */
|
|
35
27
|
keyId?: string;
|
|
28
|
+
/** Matches the SHA 256 hash of the claims object included in the token request */
|
|
36
29
|
requestedClaimsHash?: string;
|
|
37
|
-
|
|
38
|
-
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
39
|
-
*/
|
|
40
|
-
generateAccountId(): string;
|
|
41
|
-
/**
|
|
42
|
-
* Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
|
|
43
|
-
*/
|
|
44
|
-
generateCredentialId(): string;
|
|
45
|
-
/**
|
|
46
|
-
* Generate target key component as per schema: <target>
|
|
47
|
-
*/
|
|
48
|
-
generateTarget(): string;
|
|
49
|
-
/**
|
|
50
|
-
* generates credential key
|
|
51
|
-
*/
|
|
52
|
-
generateCredentialKey(): string;
|
|
53
|
-
/**
|
|
54
|
-
* returns the type of the cache (in this case credential)
|
|
55
|
-
*/
|
|
56
|
-
generateType(): number;
|
|
57
|
-
/**
|
|
58
|
-
* generates credential key
|
|
59
|
-
* <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
|
|
60
|
-
*/
|
|
61
|
-
static generateCredentialCacheKey(homeAccountId: string, environment: string, credentialType: CredentialType, clientId: string, realm?: string, target?: string, familyId?: string, tokenType?: AuthenticationScheme, requestedClaimsHash?: string): string;
|
|
62
|
-
/**
|
|
63
|
-
* generates Account Id for keys
|
|
64
|
-
* @param homeAccountId
|
|
65
|
-
* @param environment
|
|
66
|
-
*/
|
|
67
|
-
private static generateAccountIdForCacheKey;
|
|
68
|
-
/**
|
|
69
|
-
* Generates Credential Id for keys
|
|
70
|
-
* @param credentialType
|
|
71
|
-
* @param realm
|
|
72
|
-
* @param clientId
|
|
73
|
-
* @param familyId
|
|
74
|
-
*/
|
|
75
|
-
private static generateCredentialIdForCacheKey;
|
|
76
|
-
/**
|
|
77
|
-
* Generate target key component as per schema: <target>
|
|
78
|
-
*/
|
|
79
|
-
private static generateTargetForCacheKey;
|
|
80
|
-
/**
|
|
81
|
-
* Generate requested claims key component as per schema: <requestedClaims>
|
|
82
|
-
*/
|
|
83
|
-
private static generateClaimsHashForCacheKey;
|
|
84
|
-
/**
|
|
85
|
-
* Generate scheme key componenet as per schema: <scheme>
|
|
86
|
-
*/
|
|
87
|
-
private static generateSchemeForCacheKey;
|
|
88
|
-
}
|
|
30
|
+
};
|
|
89
31
|
//# sourceMappingURL=CredentialEntity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,kDAAkD;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4FAA4F;IAC5F,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC"}
|
|
@@ -1,35 +1,9 @@
|
|
|
1
1
|
import { CredentialEntity } from "./CredentialEntity";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Key:Value Schema:
|
|
6
|
-
*
|
|
7
|
-
* Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-
|
|
8
|
-
*
|
|
9
|
-
* Value Schema:
|
|
10
|
-
* {
|
|
11
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
12
|
-
* environment: entity that issued the token, represented as a full host
|
|
13
|
-
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
14
|
-
* clientId: client ID of the application
|
|
15
|
-
* secret: Actual credential as a string
|
|
16
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
17
|
-
* }
|
|
3
|
+
* Id Token Cache Type
|
|
18
4
|
*/
|
|
19
|
-
export
|
|
5
|
+
export type IdTokenEntity = CredentialEntity & {
|
|
6
|
+
/** Full tenant or organizational identifier that the account belongs to */
|
|
20
7
|
realm: string;
|
|
21
|
-
|
|
22
|
-
* Create IdTokenEntity
|
|
23
|
-
* @param homeAccountId
|
|
24
|
-
* @param authenticationResult
|
|
25
|
-
* @param clientId
|
|
26
|
-
* @param authority
|
|
27
|
-
*/
|
|
28
|
-
static createIdTokenEntity(homeAccountId: string, environment: string, idToken: string, clientId: string, tenantId: string): IdTokenEntity;
|
|
29
|
-
/**
|
|
30
|
-
* Validates an entity: checks for all expected params
|
|
31
|
-
* @param entity
|
|
32
|
-
*/
|
|
33
|
-
static isIdTokenEntity(entity: object): boolean;
|
|
34
|
-
}
|
|
8
|
+
};
|
|
35
9
|
//# sourceMappingURL=IdTokenEntity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdTokenEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"IdTokenEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG;IAC3C,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC"}
|