@azure/msal-common 6.4.0 → 7.0.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.
Files changed (114) hide show
  1. package/dist/_virtual/_tslib.js +1 -1
  2. package/dist/account/AuthToken.js +1 -1
  3. package/dist/account/CcsCredential.js +1 -1
  4. package/dist/account/ClientCredentials.d.ts +15 -0
  5. package/dist/account/ClientCredentials.d.ts.map +1 -0
  6. package/dist/account/ClientInfo.js +1 -1
  7. package/dist/authority/Authority.js +1 -1
  8. package/dist/authority/AuthorityFactory.js +1 -1
  9. package/dist/authority/AuthorityOptions.js +1 -1
  10. package/dist/authority/AuthorityType.js +1 -1
  11. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  12. package/dist/authority/OpenIdConfigResponse.js +1 -1
  13. package/dist/authority/ProtocolMode.js +1 -1
  14. package/dist/authority/RegionDiscovery.js +1 -1
  15. package/dist/cache/CacheManager.d.ts +2 -2
  16. package/dist/cache/CacheManager.d.ts.map +1 -1
  17. package/dist/cache/CacheManager.js +9 -9
  18. package/dist/cache/CacheManager.js.map +1 -1
  19. package/dist/cache/entities/AccessTokenEntity.d.ts +1 -1
  20. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  21. package/dist/cache/entities/AccessTokenEntity.js +3 -3
  22. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  23. package/dist/cache/entities/AccountEntity.d.ts +2 -4
  24. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  25. package/dist/cache/entities/AccountEntity.js +3 -6
  26. package/dist/cache/entities/AccountEntity.js.map +1 -1
  27. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  28. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  29. package/dist/cache/entities/CacheRecord.js +1 -1
  30. package/dist/cache/entities/CredentialEntity.d.ts +2 -2
  31. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  32. package/dist/cache/entities/CredentialEntity.js +2 -2
  33. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  34. package/dist/cache/entities/IdTokenEntity.d.ts +1 -1
  35. package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
  36. package/dist/cache/entities/IdTokenEntity.js +2 -3
  37. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  38. package/dist/cache/entities/RefreshTokenEntity.d.ts +1 -1
  39. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  40. package/dist/cache/entities/RefreshTokenEntity.js +3 -3
  41. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  42. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  43. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  44. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  45. package/dist/cache/utils/CacheTypes.d.ts +1 -1
  46. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  47. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  48. package/dist/client/AuthorizationCodeClient.js +3 -3
  49. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  50. package/dist/client/BaseClient.js +1 -1
  51. package/dist/client/ClientCredentialClient.js +1 -1
  52. package/dist/client/DeviceCodeClient.js +1 -1
  53. package/dist/client/OnBehalfOfClient.d.ts +12 -9
  54. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  55. package/dist/client/OnBehalfOfClient.js +89 -62
  56. package/dist/client/OnBehalfOfClient.js.map +1 -1
  57. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  58. package/dist/client/RefreshTokenClient.js +3 -3
  59. package/dist/client/RefreshTokenClient.js.map +1 -1
  60. package/dist/client/SilentFlowClient.js +1 -1
  61. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  62. package/dist/client/UsernamePasswordClient.js +3 -4
  63. package/dist/client/UsernamePasswordClient.js.map +1 -1
  64. package/dist/config/ClientConfiguration.d.ts +1 -11
  65. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  66. package/dist/config/ClientConfiguration.js +1 -1
  67. package/dist/config/ClientConfiguration.js.map +1 -1
  68. package/dist/crypto/ICrypto.js +1 -1
  69. package/dist/crypto/JoseHeader.js +1 -1
  70. package/dist/crypto/PopTokenGenerator.js +1 -1
  71. package/dist/error/AuthError.js +1 -1
  72. package/dist/error/ClientAuthError.js +1 -1
  73. package/dist/error/ClientConfigurationError.js +1 -1
  74. package/dist/error/InteractionRequiredAuthError.js +1 -1
  75. package/dist/error/JoseHeaderError.js +1 -1
  76. package/dist/error/ServerError.js +1 -1
  77. package/dist/index.cjs.js +128 -102
  78. package/dist/index.cjs.js.map +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/logger/Logger.js +1 -1
  81. package/dist/network/INetworkModule.js +1 -1
  82. package/dist/network/NetworkManager.js +1 -1
  83. package/dist/network/ThrottlingUtils.js +1 -1
  84. package/dist/packageMetadata.d.ts +1 -1
  85. package/dist/packageMetadata.js +2 -2
  86. package/dist/packageMetadata.js.map +1 -1
  87. package/dist/request/AuthenticationHeaderParser.js +1 -1
  88. package/dist/request/BaseAuthRequest.d.ts +1 -3
  89. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  90. package/dist/request/CommonClientCredentialRequest.d.ts +2 -0
  91. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  92. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  93. package/dist/request/RequestParameterBuilder.js +7 -3
  94. package/dist/request/RequestParameterBuilder.js.map +1 -1
  95. package/dist/request/RequestValidator.js +1 -1
  96. package/dist/request/ScopeSet.js +1 -1
  97. package/dist/response/ResponseHandler.d.ts +1 -1
  98. package/dist/response/ResponseHandler.d.ts.map +1 -1
  99. package/dist/response/ResponseHandler.js +12 -12
  100. package/dist/response/ResponseHandler.js.map +1 -1
  101. package/dist/telemetry/performance/PerformanceClient.js +1 -1
  102. package/dist/telemetry/performance/PerformanceEvent.d.ts +12 -0
  103. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  104. package/dist/telemetry/performance/PerformanceEvent.js +1 -1
  105. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
  106. package/dist/telemetry/performance/StubPerformanceClient.js +1 -1
  107. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  108. package/dist/url/UrlString.js +1 -1
  109. package/dist/utils/Constants.js +1 -1
  110. package/dist/utils/Constants.js.map +1 -1
  111. package/dist/utils/ProtocolUtils.js +1 -1
  112. package/dist/utils/StringUtils.js +1 -1
  113. package/dist/utils/TimeUtils.js +1 -1
  114. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { ClientAuthError } from '../error/ClientAuthError.js';
4
4
  import { StringUtils } from '../utils/StringUtils.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Client Assertion credential for Confidential Clients
3
+ */
4
+ export declare type ClientAssertion = {
5
+ assertion: string;
6
+ assertionType: string;
7
+ };
8
+ /**
9
+ * Client Credentials set for Confidential Clients
10
+ */
11
+ export declare type ClientCredentials = {
12
+ clientSecret?: string;
13
+ clientAssertion?: ClientAssertion;
14
+ };
15
+ //# sourceMappingURL=ClientCredentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientCredentials.d.ts","sourceRoot":"","sources":["../../src/account/ClientCredentials.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,eAAe,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAA;CACxB,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,CAAA;CACpC,CAAC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { ClientAuthError } from '../error/ClientAuthError.js';
4
4
  import { StringUtils } from '../utils/StringUtils.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { AuthorityType } from './AuthorityType.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { Authority } from './Authority.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { RegionDiscoverySources, ResponseCodes, Constants } from '../utils/Constants.js';
@@ -177,7 +177,7 @@ export declare abstract class CacheManager implements ICacheManager {
177
177
  * @param clientId
178
178
  * @param realm
179
179
  * @param target
180
- * @param oboAssertion
180
+ * @param userAssertionHash
181
181
  * @param tokenType
182
182
  */
183
183
  private getCredentialsFilteredByInternal;
@@ -277,7 +277,7 @@ export declare abstract class CacheManager implements ICacheManager {
277
277
  * @param value
278
278
  * @param oboAssertion
279
279
  */
280
- private matchOboAssertion;
280
+ private matchUserAssertionHash;
281
281
  /**
282
282
  * helper to match environment
283
283
  * @param value
@@ -1 +1 @@
1
- {"version":3,"file":"CacheManager.d.ts","sourceRoot":"","sources":["../../src/cache/CacheManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC9J,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO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AIrB;;;OAGG;IACH,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInD;;OAEG;IACH,iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI5D;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAiB7B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAM9C;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IACjD,UAAU,IAAI,IAAI;IAIlB,UAAU,IAAI,aAAa;IAI3B,oBAAoB,IAAI,IAAI;IAI5B,oBAAoB,IAAI,aAAa;IAIrC,wBAAwB,IAAI,IAAI;IAIhC,wBAAwB,IAAI,iBAAiB;IAI7C,yBAAyB,IAAI,IAAI;IAIjC,yBAAyB,IAAI,kBAAkB;IAI/C,cAAc,IAAI,IAAI;IAItB,cAAc,IAAI,iBAAiB;IAInC,kBAAkB,IAAI,IAAI;IAI1B,kBAAkB,IAAI,qBAAqB;IAI3C,oBAAoB,IAAI,IAAI;IAI5B,oBAAoB,IAAI,uBAAuB,GAAG,IAAI;IAItD,wBAAwB,IAAI,KAAK,CAAC,MAAM,CAAC;IAIzC,kBAAkB,IAAI,IAAI;IAI1B,kBAAkB,IAAI,gBAAgB;IAItC,UAAU,IAAI,OAAO;IAIrB,WAAW,IAAI,OAAO;IAItB,OAAO,IAAI,MAAM,EAAE;IAIb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,wBAAwB,IAAI,MAAM;CAIrC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __extends } from '../_virtual/_tslib.js';
4
4
  import { Constants, CredentialType, AuthenticationScheme, CacheSchemaType, THE_FAMILY_ID, APP_METADATA, AUTHORITY_METADATA_CONSTANTS } from '../utils/Constants.js';
@@ -170,7 +170,7 @@ var CacheManager = /** @class */ (function () {
170
170
  * @param target
171
171
  */
172
172
  CacheManager.prototype.getCredentialsFilteredBy = function (filter) {
173
- 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);
173
+ return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.userAssertionHash, filter.tokenType, filter.keyId, filter.requestedClaimsHash);
174
174
  };
175
175
  /**
176
176
  * Support function to help match credentials
@@ -180,10 +180,10 @@ var CacheManager = /** @class */ (function () {
180
180
  * @param clientId
181
181
  * @param realm
182
182
  * @param target
183
- * @param oboAssertion
183
+ * @param userAssertionHash
184
184
  * @param tokenType
185
185
  */
186
- CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, oboAssertion, tokenType, keyId, requestedClaimsHash) {
186
+ CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, userAssertionHash, tokenType, keyId, requestedClaimsHash) {
187
187
  var _this = this;
188
188
  var allCacheKeys = this.getKeys();
189
189
  var matchingCredentials = {
@@ -202,7 +202,7 @@ var CacheManager = /** @class */ (function () {
202
202
  if (!entity) {
203
203
  return;
204
204
  }
205
- if (!!oboAssertion && !_this.matchOboAssertion(entity, oboAssertion)) {
205
+ if (!!userAssertionHash && !_this.matchUserAssertionHash(entity, userAssertionHash)) {
206
206
  return;
207
207
  }
208
208
  if (!!homeAccountId && !_this.matchHomeAccountId(entity, homeAccountId)) {
@@ -533,7 +533,7 @@ var CacheManager = /** @class */ (function () {
533
533
  target: scopes.printScopesLowerCase(),
534
534
  tokenType: authScheme,
535
535
  keyId: request.sshKid,
536
- requestedClaimsHash: request.requestedClaimsHash
536
+ requestedClaimsHash: request.requestedClaimsHash,
537
537
  };
538
538
  var credentialCache = this.getCredentialsFilteredBy(accessTokenFilter);
539
539
  var accessTokens = Object.keys(credentialCache.accessTokens).map(function (key) { return credentialCache.accessTokens[key]; });
@@ -559,7 +559,7 @@ var CacheManager = /** @class */ (function () {
559
559
  environment: account.environment,
560
560
  credentialType: CredentialType.REFRESH_TOKEN,
561
561
  clientId: clientId,
562
- familyId: id
562
+ familyId: id,
563
563
  };
564
564
  var credentialCache = this.getCredentialsFilteredBy(refreshTokenFilter);
565
565
  var refreshTokens = Object.keys(credentialCache.refreshTokens).map(function (key) { return credentialCache.refreshTokens[key]; });
@@ -611,8 +611,8 @@ var CacheManager = /** @class */ (function () {
611
611
  * @param value
612
612
  * @param oboAssertion
613
613
  */
614
- CacheManager.prototype.matchOboAssertion = function (entity, oboAssertion) {
615
- return !!(entity.oboAssertion && oboAssertion === entity.oboAssertion);
614
+ CacheManager.prototype.matchUserAssertionHash = function (entity, userAssertionHash) {
615
+ return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash);
616
616
  };
617
617
  /**
618
618
  * helper to match environment
@@ -1 +1 @@
1
- {"version":3,"file":"CacheManager.js","sources":["../../src/cache/CacheManager.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccountCache, AccountFilter, CredentialFilter, CredentialCache, ValidCredentialType, AppMetadataFilter, AppMetadataCache } from \"./utils/CacheTypes\";\nimport { CacheRecord } from \"./entities/CacheRecord\";\nimport { CacheSchemaType, CredentialType, Constants, APP_METADATA, THE_FAMILY_ID, AUTHORITY_METADATA_CONSTANTS, AuthenticationScheme } from \"../utils/Constants\";\nimport { CredentialEntity } from \"./entities/CredentialEntity\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AccountEntity } from \"./entities/AccountEntity\";\nimport { AccessTokenEntity } from \"./entities/AccessTokenEntity\";\nimport { IdTokenEntity } from \"./entities/IdTokenEntity\";\nimport { RefreshTokenEntity } from \"./entities/RefreshTokenEntity\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ICacheManager } from \"./interface/ICacheManager\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { AccountInfo } from \"../account/AccountInfo\";\nimport { AppMetadataEntity } from \"./entities/AppMetadataEntity\";\nimport { ServerTelemetryEntity } from \"./entities/ServerTelemetryEntity\";\nimport { ThrottlingEntity } from \"./entities/ThrottlingEntity\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { AuthorityMetadataEntity } from \"./entities/AuthorityMetadataEntity\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.\n */\nexport abstract class CacheManager implements ICacheManager {\n protected clientId: string;\n protected cryptoImpl: ICrypto;\n\n constructor(clientId: string, cryptoImpl: ICrypto) {\n this.clientId = clientId;\n this.cryptoImpl = cryptoImpl;\n }\n\n /**\n * fetch the account entity from the platform cache\n * @param accountKey\n */\n abstract getAccount(accountKey: string): AccountEntity | null;\n\n /**\n * set account entity in the platform cache\n * @param account\n */\n abstract setAccount(account: AccountEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param idTokenKey\n */\n abstract getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param idToken\n */\n abstract setIdTokenCredential(idToken: IdTokenEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param accessTokenKey\n */\n abstract getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param accessToken\n */\n abstract setAccessTokenCredential(accessToken: AccessTokenEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param refreshTokenKey\n */\n abstract getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param refreshToken\n */\n abstract setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;\n\n /**\n * fetch appMetadata entity from the platform cache\n * @param appMetadataKey\n */\n abstract getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;\n\n /**\n * set appMetadata entity to the platform cache\n * @param appMetadata\n */\n abstract setAppMetadata(appMetadata: AppMetadataEntity): void;\n\n /**\n * fetch server telemetry entity from the platform cache\n * @param serverTelemetryKey\n */\n abstract getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;\n\n /**\n * set server telemetry entity to the platform cache\n * @param serverTelemetryKey\n * @param serverTelemetry\n */\n abstract setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;\n\n /**\n * fetch cloud discovery metadata entity from the platform cache\n * @param key\n */\n abstract getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;\n\n /**\n * \n */\n abstract getAuthorityMetadataKeys(): Array<string>;\n\n /**\n * set cloud discovery metadata entity to the platform cache\n * @param key\n * @param value\n */\n abstract setAuthorityMetadata(key: string, value: AuthorityMetadataEntity): void;\n\n /**\n * fetch throttling entity from the platform cache\n * @param throttlingCacheKey\n */\n abstract getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;\n\n /**\n * set throttling entity to the platform cache\n * @param throttlingCacheKey\n * @param throttlingCache\n */\n abstract setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;;\n\n /**\n * Function to remove an item from cache given its key.\n * @param key\n */\n abstract removeItem(key: string, type?: string): boolean;\n\n /**\n * Function which returns boolean whether cache contains a specific key.\n * @param key\n */\n abstract containsKey(key: string, type?: string): boolean;\n\n /**\n * Function which retrieves all current keys from the cache.\n */\n abstract getKeys(): string[];\n\n /**\n * Function which clears cache.\n */\n abstract clear(): Promise<void>;\n\n /**\n * Function which updates an outdated credential cache key\n */\n abstract updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;\n\n /**\n * Returns all accounts in cache\n */\n getAllAccounts(): AccountInfo[] {\n const currentAccounts: AccountCache = this.getAccountsFilteredBy();\n const accountValues: AccountEntity[] = Object.keys(currentAccounts).map(accountKey => currentAccounts[accountKey]);\n const numAccounts = accountValues.length;\n if (numAccounts < 1) {\n return [];\n } else {\n const allAccounts = accountValues.map<AccountInfo>((value) => {\n const accountEntity = CacheManager.toObject<AccountEntity>(new AccountEntity(), value);\n const accountInfo = accountEntity.getAccountInfo();\n const idToken = this.readIdTokenFromCache(this.clientId, accountInfo);\n if (idToken && !accountInfo.idTokenClaims) {\n accountInfo.idTokenClaims = new AuthToken(idToken.secret, this.cryptoImpl).claims;\n }\n\n return accountInfo;\n \n });\n return allAccounts;\n }\n }\n\n /**\n * saves a cache record\n * @param cacheRecord\n */\n async saveCacheRecord(cacheRecord: CacheRecord): Promise<void> {\n if (!cacheRecord) {\n throw ClientAuthError.createNullOrUndefinedCacheRecord();\n }\n\n if (!!cacheRecord.account) {\n this.setAccount(cacheRecord.account);\n }\n\n if (!!cacheRecord.idToken) {\n this.setIdTokenCredential(cacheRecord.idToken);\n }\n\n if (!!cacheRecord.accessToken) {\n await this.saveAccessToken(cacheRecord.accessToken);\n }\n\n if (!!cacheRecord.refreshToken) {\n this.setRefreshTokenCredential(cacheRecord.refreshToken);\n }\n\n if (!!cacheRecord.appMetadata) {\n this.setAppMetadata(cacheRecord.appMetadata);\n }\n }\n\n /**\n * saves access token credential\n * @param credential\n */\n private async saveAccessToken(credential: AccessTokenEntity): Promise<void> {\n const currentTokenCache = this.getCredentialsFilteredBy({\n clientId: credential.clientId,\n credentialType: credential.credentialType,\n environment: credential.environment,\n homeAccountId: credential.homeAccountId,\n realm: credential.realm,\n tokenType: credential.tokenType,\n requestedClaimsHash: credential.requestedClaimsHash\n });\n\n const currentScopes = ScopeSet.fromString(credential.target);\n const currentAccessTokens: AccessTokenEntity[] = Object.keys(currentTokenCache.accessTokens).map(key => currentTokenCache.accessTokens[key]);\n\n if (currentAccessTokens) {\n const removedAccessTokens: Array<Promise<boolean>> = [];\n currentAccessTokens.forEach((tokenEntity) => {\n const tokenScopeSet = ScopeSet.fromString(tokenEntity.target);\n if (tokenScopeSet.intersectingScopeSets(currentScopes)) {\n removedAccessTokens.push(this.removeCredential(tokenEntity));\n }\n });\n await Promise.all(removedAccessTokens);\n }\n this.setAccessTokenCredential(credential);\n }\n\n /**\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\n * @param homeAccountId\n * @param environment\n * @param realm\n */\n getAccountsFilteredBy(accountFilter?: AccountFilter): AccountCache {\n return this.getAccountsFilteredByInternal(\n accountFilter ? accountFilter.homeAccountId : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.environment : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.realm : Constants.EMPTY_STRING\n );\n }\n\n /**\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\n * @param homeAccountId\n * @param environment\n * @param realm\n */\n private getAccountsFilteredByInternal(\n homeAccountId?: string,\n environment?: string,\n realm?: string\n ): AccountCache {\n const allCacheKeys = this.getKeys();\n const matchingAccounts: AccountCache = {};\n\n allCacheKeys.forEach((cacheKey) => {\n const entity: AccountEntity | null = this.getAccount(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (!!homeAccountId && !this.matchHomeAccountId(entity, homeAccountId)) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!realm && !this.matchRealm(entity, realm)) {\n return;\n }\n\n matchingAccounts[cacheKey] = entity;\n });\n\n return matchingAccounts;\n }\n\n /**\n * retrieve credentails matching all provided filters; if no filter is set, get all credentials\n * @param homeAccountId\n * @param environment\n * @param credentialType\n * @param clientId\n * @param realm\n * @param target\n */\n getCredentialsFilteredBy(filter: CredentialFilter): CredentialCache {\n return this.getCredentialsFilteredByInternal(\n filter.homeAccountId,\n filter.environment,\n filter.credentialType,\n filter.clientId,\n filter.familyId,\n filter.realm,\n filter.target,\n filter.oboAssertion,\n filter.tokenType,\n filter.keyId,\n filter.requestedClaimsHash\n );\n }\n\n /**\n * Support function to help match credentials\n * @param homeAccountId\n * @param environment\n * @param credentialType\n * @param clientId\n * @param realm\n * @param target\n * @param oboAssertion\n * @param tokenType\n */\n private getCredentialsFilteredByInternal(\n homeAccountId?: string,\n environment?: string,\n credentialType?: string,\n clientId?: string,\n familyId?: string,\n realm?: string,\n target?: string,\n oboAssertion?: string,\n tokenType?: AuthenticationScheme,\n keyId?: string,\n requestedClaimsHash?: string\n ): CredentialCache {\n const allCacheKeys = this.getKeys();\n const matchingCredentials: CredentialCache = {\n idTokens: {},\n accessTokens: {},\n refreshTokens: {},\n };\n \n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-credential type cache entities\n const credType = CredentialEntity.getCredentialType(cacheKey);\n\n if (credType === Constants.NOT_DEFINED) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getSpecificCredential(cacheKey, credType);\n\n if (!entity) {\n return;\n }\n\n if (!!oboAssertion && !this.matchOboAssertion(entity, oboAssertion)) {\n return;\n }\n\n if (!!homeAccountId && !this.matchHomeAccountId(entity, homeAccountId)) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!realm && !this.matchRealm(entity, realm)) {\n return;\n }\n\n if (!!credentialType && !this.matchCredentialType(entity, credentialType)) {\n return;\n }\n\n if (!!clientId && !this.matchClientId(entity, clientId)) {\n return;\n }\n\n if (!!familyId && !this.matchFamilyId(entity, familyId)) {\n return;\n }\n\n /*\n * idTokens do not have \"target\", target specific refreshTokens do exist for some types of authentication\n * Resource specific refresh tokens case will be added when the support is deemed necessary\n */\n if (!!target && !this.matchTarget(entity, target)) {\n return;\n }\n \n // If request OR cached entity has requested Claims Hash, check if they match\n if (requestedClaimsHash || entity.requestedClaimsHash) {\n // Don't match if either is undefined or they are different\n if (entity.requestedClaimsHash !== requestedClaimsHash) {\n return;\n }\n }\n\n // Access Token with Auth Scheme specific matching\n if (credentialType === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {\n if(!!tokenType && !this.matchTokenType(entity, tokenType)) {\n return;\n }\n\n // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key\n if (tokenType === AuthenticationScheme.SSH) {\n if(keyId && !this.matchKeyId(entity, keyId)) {\n return;\n }\n }\n }\n\n // At this point, the entity matches the request, update cache key if key schema has changed\n const updatedCacheKey = this.updateCredentialCacheKey(cacheKey, entity);\n\n switch (credType) {\n case CredentialType.ID_TOKEN:\n matchingCredentials.idTokens[updatedCacheKey] = entity as IdTokenEntity;\n break;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n matchingCredentials.accessTokens[updatedCacheKey] = entity as AccessTokenEntity;\n break;\n case CredentialType.REFRESH_TOKEN:\n matchingCredentials.refreshTokens[updatedCacheKey] = entity as RefreshTokenEntity;\n break;\n }\n });\n\n return matchingCredentials;\n }\n\n /**\n * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata\n * @param filter\n */\n getAppMetadataFilteredBy(filter: AppMetadataFilter): AppMetadataCache {\n return this.getAppMetadataFilteredByInternal(\n filter.environment,\n filter.clientId,\n );\n }\n\n /**\n * Support function to help match appMetadata\n * @param environment\n * @param clientId\n */\n private getAppMetadataFilteredByInternal(\n environment?: string,\n clientId?: string\n ): AppMetadataCache {\n\n const allCacheKeys = this.getKeys();\n const matchingAppMetadata: AppMetadataCache = {};\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-appMetadata type cache entities\n if (!this.isAppMetadata(cacheKey)) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getAppMetadata(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!clientId && !this.matchClientId(entity, clientId)) {\n return;\n }\n\n matchingAppMetadata[cacheKey] = entity;\n\n });\n\n return matchingAppMetadata;\n }\n\n /**\n * retrieve authorityMetadata that contains a matching alias\n * @param filter\n */\n getAuthorityMetadataByAlias(host: string): AuthorityMetadataEntity | null {\n const allCacheKeys = this.getAuthorityMetadataKeys();\n let matchedEntity = null;\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-authorityMetadata type cache entities\n if (!this.isAuthorityMetadata(cacheKey) || cacheKey.indexOf(this.clientId) === -1) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getAuthorityMetadata(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (entity.aliases.indexOf(host) === -1) {\n return;\n }\n\n matchedEntity = entity;\n\n });\n \n return matchedEntity;\n }\n\n /**\n * Removes all accounts and related tokens from cache.\n */\n async removeAllAccounts(): Promise<boolean> {\n const allCacheKeys = this.getKeys();\n const removedAccounts: Array<Promise<boolean>> = [];\n\n allCacheKeys.forEach((cacheKey) => {\n const entity = this.getAccount(cacheKey);\n if (!entity) {\n return;\n }\n removedAccounts.push(this.removeAccount(cacheKey));\n });\n \n await Promise.all(removedAccounts);\n return true;\n }\n\n /**\n * returns a boolean if the given account is removed\n * @param account\n */\n async removeAccount(accountKey: string): Promise<boolean> {\n const account = this.getAccount(accountKey);\n if (!account) {\n throw ClientAuthError.createNoAccountFoundError();\n }\n return (await this.removeAccountContext(account) && this.removeItem(accountKey, CacheSchemaType.ACCOUNT));\n }\n\n /**\n * Removes credentials associated with the provided account\n * @param account\n */\n async removeAccountContext(account: AccountEntity): Promise<boolean> {\n const allCacheKeys = this.getKeys();\n const accountId = account.generateAccountId();\n const removedCredentials: Array<Promise<boolean>> = [];\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-credential type cache entities\n const credType = CredentialEntity.getCredentialType(cacheKey);\n if (credType === Constants.NOT_DEFINED) {\n return;\n }\n\n const cacheEntity = this.getSpecificCredential(cacheKey, credType);\n if (!!cacheEntity && accountId === cacheEntity.generateAccountId()) {\n removedCredentials.push(this.removeCredential(cacheEntity));\n }\n });\n\n await Promise.all(removedCredentials);\n return true;\n }\n\n /**\n * returns a boolean if the given credential is removed\n * @param credential\n */\n async removeCredential(credential: CredentialEntity): Promise<boolean> {\n const key = credential.generateCredentialKey();\n\n // Remove Token Binding Key from key store for PoP Tokens Credentials\n if (credential.credentialType.toLowerCase() === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {\n if(credential.tokenType === AuthenticationScheme.POP) {\n const accessTokenWithAuthSchemeEntity = credential as AccessTokenEntity;\n const kid = accessTokenWithAuthSchemeEntity.keyId;\n \n if (kid) {\n try {\n await this.cryptoImpl.removeTokenBindingKey(kid);\n } catch (error) {\n throw ClientAuthError.createBindingKeyNotRemovedError();\n }\n }\n }\n }\n\n return this.removeItem(key, CacheSchemaType.CREDENTIAL);\n }\n\n /**\n * Removes all app metadata objects from cache.\n */\n removeAppMetadata(): boolean {\n const allCacheKeys = this.getKeys();\n allCacheKeys.forEach((cacheKey) => {\n if (this.isAppMetadata(cacheKey)) {\n this.removeItem(cacheKey, CacheSchemaType.APP_METADATA);\n }\n });\n\n return true;\n }\n\n /**\n * Retrieve the cached credentials into a cacherecord\n * @param account\n * @param clientId\n * @param scopes\n * @param environment\n * @param authScheme\n */\n readCacheRecord(account: AccountInfo, clientId: string, request: BaseAuthRequest, environment: string): CacheRecord {\n\n const cachedAccount = this.readAccountFromCache(account);\n const cachedIdToken = this.readIdTokenFromCache(clientId, account);\n const cachedAccessToken = this.readAccessTokenFromCache(clientId, account, request);\n const cachedRefreshToken = this.readRefreshTokenFromCache(clientId, account, false);\n const cachedAppMetadata = this.readAppMetadataFromCache(environment, clientId);\n\n if (cachedAccount && cachedIdToken) {\n cachedAccount.idTokenClaims = new AuthToken(cachedIdToken.secret, this.cryptoImpl).claims;\n }\n\n return {\n account: cachedAccount,\n idToken: cachedIdToken,\n accessToken: cachedAccessToken,\n refreshToken: cachedRefreshToken,\n appMetadata: cachedAppMetadata,\n };\n }\n\n /**\n * Retrieve AccountEntity from cache\n * @param account\n */\n readAccountFromCache(account: AccountInfo): AccountEntity | null {\n const accountKey: string = AccountEntity.generateAccountCacheKey(account);\n return this.getAccount(accountKey);\n }\n\n /**\n * Retrieve IdTokenEntity from cache\n * @param clientId\n * @param account\n * @param inputRealm\n */\n readIdTokenFromCache(clientId: string, account: AccountInfo): IdTokenEntity | null {\n const idTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: CredentialType.ID_TOKEN,\n clientId: clientId,\n realm: account.tenantId,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(idTokenFilter);\n const idTokens = Object.keys(credentialCache.idTokens).map((key) => credentialCache.idTokens[key]);\n const numIdTokens = idTokens.length;\n\n if (numIdTokens < 1) {\n return null;\n } else if (numIdTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return idTokens[0] as IdTokenEntity;\n }\n\n /**\n * Retrieve AccessTokenEntity from cache\n * @param clientId\n * @param account\n * @param scopes\n * @param authScheme\n */\n readAccessTokenFromCache(clientId: string, account: AccountInfo, request: BaseAuthRequest): AccessTokenEntity | null {\n const scopes = new ScopeSet(request.scopes || []);\n const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;\n /*\n * Distinguish between Bearer and PoP/SSH token cache types\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n const credentialType = (authScheme && authScheme.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;\n\n const accessTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: credentialType,\n clientId,\n realm: account.tenantId,\n target: scopes.printScopesLowerCase(),\n tokenType: authScheme,\n keyId: request.sshKid,\n requestedClaimsHash: request.requestedClaimsHash\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(accessTokenFilter);\n \n const accessTokens = Object.keys(credentialCache.accessTokens).map((key) => credentialCache.accessTokens[key]);\n \n const numAccessTokens = accessTokens.length;\n if (numAccessTokens < 1) {\n return null;\n } else if (numAccessTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return accessTokens[0] as AccessTokenEntity;\n }\n\n /**\n * Helper to retrieve the appropriate refresh token from cache\n * @param clientId\n * @param account\n * @param familyRT\n */\n readRefreshTokenFromCache(clientId: string, account: AccountInfo, familyRT: boolean): RefreshTokenEntity | null {\n const id = familyRT ? THE_FAMILY_ID : undefined;\n const refreshTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: CredentialType.REFRESH_TOKEN,\n clientId: clientId,\n familyId: id\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(refreshTokenFilter);\n const refreshTokens = Object.keys(credentialCache.refreshTokens).map((key) => credentialCache.refreshTokens[key]);\n\n const numRefreshTokens = refreshTokens.length;\n if (numRefreshTokens < 1) {\n return null;\n }\n // address the else case after remove functions address environment aliases\n\n return refreshTokens[0] as RefreshTokenEntity;\n }\n\n /**\n * Retrieve AppMetadataEntity from cache\n */\n readAppMetadataFromCache(environment: string, clientId: string): AppMetadataEntity | null {\n const appMetadataFilter: AppMetadataFilter = {\n environment,\n clientId,\n };\n\n const appMetadata: AppMetadataCache = this.getAppMetadataFilteredBy(appMetadataFilter);\n const appMetadataEntries: AppMetadataEntity[] = Object.keys(appMetadata).map((key) => appMetadata[key]);\n\n const numAppMetadata = appMetadataEntries.length;\n if (numAppMetadata < 1) {\n return null;\n } else if (numAppMetadata > 1) {\n throw ClientAuthError.createMultipleMatchingAppMetadataInCacheError();\n }\n\n return appMetadataEntries[0] as AppMetadataEntity;\n }\n\n /**\n * Return the family_id value associated with FOCI\n * @param environment\n * @param clientId\n */\n isAppMetadataFOCI(environment: string, clientId: string): boolean {\n const appMetadata = this.readAppMetadataFromCache(environment, clientId);\n return !!(appMetadata && appMetadata.familyId === THE_FAMILY_ID);\n }\n\n /**\n * helper to match account ids\n * @param value\n * @param homeAccountId\n */\n private matchHomeAccountId(entity: AccountEntity | CredentialEntity, homeAccountId: string): boolean {\n return !!(entity.homeAccountId && homeAccountId === entity.homeAccountId);\n }\n\n /**\n * helper to match assertion\n * @param value\n * @param oboAssertion\n */\n private matchOboAssertion(entity: AccountEntity | CredentialEntity, oboAssertion: string): boolean {\n return !!(entity.oboAssertion && oboAssertion === entity.oboAssertion);\n }\n\n /**\n * helper to match environment\n * @param value\n * @param environment\n */\n private matchEnvironment(entity: AccountEntity | CredentialEntity | AppMetadataEntity, environment: string): boolean {\n const cloudMetadata = this.getAuthorityMetadataByAlias(environment);\n if (cloudMetadata && cloudMetadata.aliases.indexOf(entity.environment) > -1) {\n return true;\n }\n\n return false;\n }\n\n /**\n * helper to match credential type\n * @param entity\n * @param credentialType\n */\n private matchCredentialType(entity: CredentialEntity, credentialType: string): boolean {\n return (entity.credentialType && credentialType.toLowerCase() === entity.credentialType.toLowerCase());\n }\n\n /**\n * helper to match client ids\n * @param entity\n * @param clientId\n */\n private matchClientId(entity: CredentialEntity | AppMetadataEntity, clientId: string): boolean {\n return !!(entity.clientId && clientId === entity.clientId);\n }\n\n /**\n * helper to match family ids\n * @param entity\n * @param familyId\n */\n private matchFamilyId(entity: CredentialEntity | AppMetadataEntity, familyId: string): boolean {\n return !!(entity.familyId && familyId === entity.familyId);\n }\n\n /**\n * helper to match realm\n * @param entity\n * @param realm\n */\n private matchRealm(entity: AccountEntity | CredentialEntity, realm: string): boolean {\n return !!(entity.realm && realm === entity.realm);\n }\n\n /**\n * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.\n * @param entity\n * @param target\n */\n private matchTarget(entity: CredentialEntity, target: string): boolean {\n const isNotAccessTokenCredential = (entity.credentialType !== CredentialType.ACCESS_TOKEN && entity.credentialType !== CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME);\n\n if ( isNotAccessTokenCredential || !entity.target) {\n return false;\n }\n\n const entityScopeSet: ScopeSet = ScopeSet.fromString(entity.target);\n const requestTargetScopeSet: ScopeSet = ScopeSet.fromString(target);\n\n if (!requestTargetScopeSet.containsOnlyOIDCScopes()) {\n requestTargetScopeSet.removeOIDCScopes(); // ignore OIDC scopes\n } else {\n requestTargetScopeSet.removeScope(Constants.OFFLINE_ACCESS_SCOPE);\n }\n return entityScopeSet.containsScopeSet(requestTargetScopeSet);\n }\n\n /**\n * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise\n * @param entity \n * @param tokenType \n */\n private matchTokenType(entity: CredentialEntity, tokenType: AuthenticationScheme): boolean {\n return !!(entity.tokenType && entity.tokenType === tokenType);\n }\n\n /**\n * Returns true if the credential's keyId matches the one in the request, false otherwise\n * @param entity \n * @param tokenType \n */\n private matchKeyId(entity: CredentialEntity, keyId: string): boolean {\n return !!(entity.keyId && entity.keyId === keyId);\n }\n\n /**\n * returns if a given cache entity is of the type appmetadata\n * @param key\n */\n private isAppMetadata(key: string): boolean {\n return key.indexOf(APP_METADATA) !== -1;\n }\n\n /**\n * returns if a given cache entity is of the type authoritymetadata\n * @param key\n */\n protected isAuthorityMetadata(key: string): boolean {\n return key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) !== -1;\n }\n\n /**\n * returns cache key used for cloud instance metadata\n */\n generateAuthorityMetadataCacheKey(authority: string): string {\n return `${AUTHORITY_METADATA_CONSTANTS.CACHE_KEY}-${this.clientId}-${authority}`;\n }\n\n /**\n * Returns the specific credential (IdToken/AccessToken/RefreshToken) from the cache\n * @param key\n * @param credType\n */\n private getSpecificCredential(key: string, credType: string): ValidCredentialType | null {\n switch (credType) {\n case CredentialType.ID_TOKEN: {\n return this.getIdTokenCredential(key);\n }\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME: {\n return this.getAccessTokenCredential(key);\n }\n case CredentialType.REFRESH_TOKEN: {\n return this.getRefreshTokenCredential(key);\n }\n default:\n return null;\n }\n }\n\n /**\n * Helper to convert serialized data to object\n * @param obj\n * @param json\n */\n static toObject<T>(obj: T, json: object): T {\n for (const propertyName in json) {\n obj[propertyName] = json[propertyName];\n }\n return obj;\n }\n}\n\nexport class DefaultStorageClass extends CacheManager {\n setAccount(): void {\n const notImplErr = \"Storage interface - setAccount() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAccount(): AccountEntity {\n const notImplErr = \"Storage interface - getAccount() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setIdTokenCredential(): void {\n const notImplErr = \"Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getIdTokenCredential(): IdTokenEntity {\n const notImplErr = \"Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAccessTokenCredential(): void {\n const notImplErr = \"Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAccessTokenCredential(): AccessTokenEntity {\n const notImplErr = \"Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setRefreshTokenCredential(): void {\n const notImplErr = \"Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getRefreshTokenCredential(): RefreshTokenEntity {\n const notImplErr = \"Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAppMetadata(): void {\n const notImplErr = \"Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAppMetadata(): AppMetadataEntity {\n const notImplErr = \"Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setServerTelemetry(): void {\n const notImplErr = \"Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getServerTelemetry(): ServerTelemetryEntity {\n const notImplErr = \"Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAuthorityMetadata(): void {\n const notImplErr = \"Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAuthorityMetadata(): AuthorityMetadataEntity | null {\n const notImplErr = \"Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAuthorityMetadataKeys(): Array<string> {\n const notImplErr = \"Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setThrottlingCache(): void {\n const notImplErr = \"Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getThrottlingCache(): ThrottlingEntity {\n const notImplErr = \"Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n removeItem(): boolean {\n const notImplErr = \"Storage interface - removeItem() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n containsKey(): boolean {\n const notImplErr = \"Storage interface - containsKey() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getKeys(): string[] {\n const notImplErr = \"Storage interface - getKeys() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n async clear(): Promise<void> {\n const notImplErr = \"Storage interface - clear() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n updateCredentialCacheKey(): string {\n const notImplErr = \"Storage interface - updateCredentialCacheKey() has not been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AU,CAAC,CAAC;KACrD;IACD,gDAAkB,GAAlB;QACI,IAAM,UAAU,GAAG,mGAAmG,CAAC;QACvH,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,wCAAU,GAAV;QACI,IAAM,UAAU,GAAG,2FAA2F,CAAC;QAC/G,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,yCAAW,GAAX;QACI,IAAM,UAAU,GAAG,4FAA4F,CAAC;QAChH,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,qCAAO,GAAP;QACI,IAAM,UAAU,GAAG,wFAAwF,CAAC;QAC5G,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACK,mCAAK,GAAX;;;;gBACU,UAAU,GAAG,sFAAsF,CAAC;gBAC1G,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACD,sDAAwB,GAAxB;QACI,IAAM,UAAU,GAAG,yGAAyG,CAAC;QAC7H,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACL,0BAAC;AAAD,CAzFA,CAAyC,YAAY;;;;"}
1
+ {"version":3,"file":"CacheManager.js","sources":["../../src/cache/CacheManager.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccountCache, AccountFilter, CredentialFilter, CredentialCache, ValidCredentialType, AppMetadataFilter, AppMetadataCache } from \"./utils/CacheTypes\";\nimport { CacheRecord } from \"./entities/CacheRecord\";\nimport { CacheSchemaType, CredentialType, Constants, APP_METADATA, THE_FAMILY_ID, AUTHORITY_METADATA_CONSTANTS, AuthenticationScheme } from \"../utils/Constants\";\nimport { CredentialEntity } from \"./entities/CredentialEntity\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AccountEntity } from \"./entities/AccountEntity\";\nimport { AccessTokenEntity } from \"./entities/AccessTokenEntity\";\nimport { IdTokenEntity } from \"./entities/IdTokenEntity\";\nimport { RefreshTokenEntity } from \"./entities/RefreshTokenEntity\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ICacheManager } from \"./interface/ICacheManager\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { AccountInfo } from \"../account/AccountInfo\";\nimport { AppMetadataEntity } from \"./entities/AppMetadataEntity\";\nimport { ServerTelemetryEntity } from \"./entities/ServerTelemetryEntity\";\nimport { ThrottlingEntity } from \"./entities/ThrottlingEntity\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { AuthorityMetadataEntity } from \"./entities/AuthorityMetadataEntity\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.\n */\nexport abstract class CacheManager implements ICacheManager {\n protected clientId: string;\n protected cryptoImpl: ICrypto;\n\n constructor(clientId: string, cryptoImpl: ICrypto) {\n this.clientId = clientId;\n this.cryptoImpl = cryptoImpl;\n }\n\n /**\n * fetch the account entity from the platform cache\n * @param accountKey\n */\n abstract getAccount(accountKey: string): AccountEntity | null;\n\n /**\n * set account entity in the platform cache\n * @param account\n */\n abstract setAccount(account: AccountEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param idTokenKey\n */\n abstract getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param idToken\n */\n abstract setIdTokenCredential(idToken: IdTokenEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param accessTokenKey\n */\n abstract getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param accessToken\n */\n abstract setAccessTokenCredential(accessToken: AccessTokenEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param refreshTokenKey\n */\n abstract getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param refreshToken\n */\n abstract setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;\n\n /**\n * fetch appMetadata entity from the platform cache\n * @param appMetadataKey\n */\n abstract getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;\n\n /**\n * set appMetadata entity to the platform cache\n * @param appMetadata\n */\n abstract setAppMetadata(appMetadata: AppMetadataEntity): void;\n\n /**\n * fetch server telemetry entity from the platform cache\n * @param serverTelemetryKey\n */\n abstract getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;\n\n /**\n * set server telemetry entity to the platform cache\n * @param serverTelemetryKey\n * @param serverTelemetry\n */\n abstract setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;\n\n /**\n * fetch cloud discovery metadata entity from the platform cache\n * @param key\n */\n abstract getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;\n\n /**\n *\n */\n abstract getAuthorityMetadataKeys(): Array<string>;\n\n /**\n * set cloud discovery metadata entity to the platform cache\n * @param key\n * @param value\n */\n abstract setAuthorityMetadata(key: string, value: AuthorityMetadataEntity): void;\n\n /**\n * fetch throttling entity from the platform cache\n * @param throttlingCacheKey\n */\n abstract getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;\n\n /**\n * set throttling entity to the platform cache\n * @param throttlingCacheKey\n * @param throttlingCache\n */\n abstract setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;;\n\n /**\n * Function to remove an item from cache given its key.\n * @param key\n */\n abstract removeItem(key: string, type?: string): boolean;\n\n /**\n * Function which returns boolean whether cache contains a specific key.\n * @param key\n */\n abstract containsKey(key: string, type?: string): boolean;\n\n /**\n * Function which retrieves all current keys from the cache.\n */\n abstract getKeys(): string[];\n\n /**\n * Function which clears cache.\n */\n abstract clear(): Promise<void>;\n\n /**\n * Function which updates an outdated credential cache key\n */\n abstract updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;\n\n /**\n * Returns all accounts in cache\n */\n getAllAccounts(): AccountInfo[] {\n const currentAccounts: AccountCache = this.getAccountsFilteredBy();\n const accountValues: AccountEntity[] = Object.keys(currentAccounts).map(accountKey => currentAccounts[accountKey]);\n const numAccounts = accountValues.length;\n if (numAccounts < 1) {\n return [];\n } else {\n const allAccounts = accountValues.map<AccountInfo>((value) => {\n const accountEntity = CacheManager.toObject<AccountEntity>(new AccountEntity(), value);\n const accountInfo = accountEntity.getAccountInfo();\n const idToken = this.readIdTokenFromCache(this.clientId, accountInfo);\n if (idToken && !accountInfo.idTokenClaims) {\n accountInfo.idTokenClaims = new AuthToken(idToken.secret, this.cryptoImpl).claims;\n }\n\n return accountInfo;\n\n });\n return allAccounts;\n }\n }\n\n /**\n * saves a cache record\n * @param cacheRecord\n */\n async saveCacheRecord(cacheRecord: CacheRecord): Promise<void> {\n if (!cacheRecord) {\n throw ClientAuthError.createNullOrUndefinedCacheRecord();\n }\n\n if (!!cacheRecord.account) {\n this.setAccount(cacheRecord.account);\n }\n\n if (!!cacheRecord.idToken) {\n this.setIdTokenCredential(cacheRecord.idToken);\n }\n\n if (!!cacheRecord.accessToken) {\n await this.saveAccessToken(cacheRecord.accessToken);\n }\n\n if (!!cacheRecord.refreshToken) {\n this.setRefreshTokenCredential(cacheRecord.refreshToken);\n }\n\n if (!!cacheRecord.appMetadata) {\n this.setAppMetadata(cacheRecord.appMetadata);\n }\n }\n\n /**\n * saves access token credential\n * @param credential\n */\n private async saveAccessToken(credential: AccessTokenEntity): Promise<void> {\n const currentTokenCache = this.getCredentialsFilteredBy({\n clientId: credential.clientId,\n credentialType: credential.credentialType,\n environment: credential.environment,\n homeAccountId: credential.homeAccountId,\n realm: credential.realm,\n tokenType: credential.tokenType,\n requestedClaimsHash: credential.requestedClaimsHash\n });\n\n const currentScopes = ScopeSet.fromString(credential.target);\n const currentAccessTokens: AccessTokenEntity[] = Object.keys(currentTokenCache.accessTokens).map(key => currentTokenCache.accessTokens[key]);\n\n if (currentAccessTokens) {\n const removedAccessTokens: Array<Promise<boolean>> = [];\n currentAccessTokens.forEach((tokenEntity) => {\n const tokenScopeSet = ScopeSet.fromString(tokenEntity.target);\n if (tokenScopeSet.intersectingScopeSets(currentScopes)) {\n removedAccessTokens.push(this.removeCredential(tokenEntity));\n }\n });\n await Promise.all(removedAccessTokens);\n }\n this.setAccessTokenCredential(credential);\n }\n\n /**\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\n * @param homeAccountId\n * @param environment\n * @param realm\n */\n getAccountsFilteredBy(accountFilter?: AccountFilter): AccountCache {\n return this.getAccountsFilteredByInternal(\n accountFilter ? accountFilter.homeAccountId : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.environment : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.realm : Constants.EMPTY_STRING\n );\n }\n\n /**\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\n * @param homeAccountId\n * @param environment\n * @param realm\n */\n private getAccountsFilteredByInternal(\n homeAccountId?: string,\n environment?: string,\n realm?: string\n ): AccountCache {\n const allCacheKeys = this.getKeys();\n const matchingAccounts: AccountCache = {};\n\n allCacheKeys.forEach((cacheKey) => {\n const entity: AccountEntity | null = this.getAccount(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (!!homeAccountId && !this.matchHomeAccountId(entity, homeAccountId)) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!realm && !this.matchRealm(entity, realm)) {\n return;\n }\n\n matchingAccounts[cacheKey] = entity;\n });\n\n return matchingAccounts;\n }\n\n /**\n * retrieve credentails matching all provided filters; if no filter is set, get all credentials\n * @param homeAccountId\n * @param environment\n * @param credentialType\n * @param clientId\n * @param realm\n * @param target\n */\n getCredentialsFilteredBy(filter: CredentialFilter): CredentialCache {\n return this.getCredentialsFilteredByInternal(\n filter.homeAccountId,\n filter.environment,\n filter.credentialType,\n filter.clientId,\n filter.familyId,\n filter.realm,\n filter.target,\n filter.userAssertionHash,\n filter.tokenType,\n filter.keyId,\n filter.requestedClaimsHash\n );\n }\n\n /**\n * Support function to help match credentials\n * @param homeAccountId\n * @param environment\n * @param credentialType\n * @param clientId\n * @param realm\n * @param target\n * @param userAssertionHash\n * @param tokenType\n */\n private getCredentialsFilteredByInternal(\n homeAccountId?: string,\n environment?: string,\n credentialType?: string,\n clientId?: string,\n familyId?: string,\n realm?: string,\n target?: string,\n userAssertionHash?: string,\n tokenType?: AuthenticationScheme,\n keyId?: string,\n requestedClaimsHash?: string\n ): CredentialCache {\n const allCacheKeys = this.getKeys();\n const matchingCredentials: CredentialCache = {\n idTokens: {},\n accessTokens: {},\n refreshTokens: {},\n };\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-credential type cache entities\n const credType = CredentialEntity.getCredentialType(cacheKey);\n\n if (credType === Constants.NOT_DEFINED) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getSpecificCredential(cacheKey, credType);\n\n if (!entity) {\n return;\n }\n\n if (!!userAssertionHash && !this.matchUserAssertionHash(entity, userAssertionHash)) {\n return;\n }\n\n if (!!homeAccountId && !this.matchHomeAccountId(entity, homeAccountId)) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!realm && !this.matchRealm(entity, realm)) {\n return;\n }\n\n if (!!credentialType && !this.matchCredentialType(entity, credentialType)) {\n return;\n }\n\n if (!!clientId && !this.matchClientId(entity, clientId)) {\n return;\n }\n\n if (!!familyId && !this.matchFamilyId(entity, familyId)) {\n return;\n }\n\n /*\n * idTokens do not have \"target\", target specific refreshTokens do exist for some types of authentication\n * Resource specific refresh tokens case will be added when the support is deemed necessary\n */\n if (!!target && !this.matchTarget(entity, target)) {\n return;\n }\n\n // If request OR cached entity has requested Claims Hash, check if they match\n if (requestedClaimsHash || entity.requestedClaimsHash) {\n // Don't match if either is undefined or they are different\n if (entity.requestedClaimsHash !== requestedClaimsHash) {\n return;\n }\n }\n\n // Access Token with Auth Scheme specific matching\n if (credentialType === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {\n if(!!tokenType && !this.matchTokenType(entity, tokenType)) {\n return;\n }\n\n // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key\n if (tokenType === AuthenticationScheme.SSH) {\n if(keyId && !this.matchKeyId(entity, keyId)) {\n return;\n }\n }\n }\n\n // At this point, the entity matches the request, update cache key if key schema has changed\n const updatedCacheKey = this.updateCredentialCacheKey(cacheKey, entity);\n\n switch (credType) {\n case CredentialType.ID_TOKEN:\n matchingCredentials.idTokens[updatedCacheKey] = entity as IdTokenEntity;\n break;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n matchingCredentials.accessTokens[updatedCacheKey] = entity as AccessTokenEntity;\n break;\n case CredentialType.REFRESH_TOKEN:\n matchingCredentials.refreshTokens[updatedCacheKey] = entity as RefreshTokenEntity;\n break;\n }\n });\n\n return matchingCredentials;\n }\n\n /**\n * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata\n * @param filter\n */\n getAppMetadataFilteredBy(filter: AppMetadataFilter): AppMetadataCache {\n return this.getAppMetadataFilteredByInternal(\n filter.environment,\n filter.clientId,\n );\n }\n\n /**\n * Support function to help match appMetadata\n * @param environment\n * @param clientId\n */\n private getAppMetadataFilteredByInternal(\n environment?: string,\n clientId?: string\n ): AppMetadataCache {\n\n const allCacheKeys = this.getKeys();\n const matchingAppMetadata: AppMetadataCache = {};\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-appMetadata type cache entities\n if (!this.isAppMetadata(cacheKey)) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getAppMetadata(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!clientId && !this.matchClientId(entity, clientId)) {\n return;\n }\n\n matchingAppMetadata[cacheKey] = entity;\n\n });\n\n return matchingAppMetadata;\n }\n\n /**\n * retrieve authorityMetadata that contains a matching alias\n * @param filter\n */\n getAuthorityMetadataByAlias(host: string): AuthorityMetadataEntity | null {\n const allCacheKeys = this.getAuthorityMetadataKeys();\n let matchedEntity = null;\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-authorityMetadata type cache entities\n if (!this.isAuthorityMetadata(cacheKey) || cacheKey.indexOf(this.clientId) === -1) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getAuthorityMetadata(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (entity.aliases.indexOf(host) === -1) {\n return;\n }\n\n matchedEntity = entity;\n\n });\n\n return matchedEntity;\n }\n\n /**\n * Removes all accounts and related tokens from cache.\n */\n async removeAllAccounts(): Promise<boolean> {\n const allCacheKeys = this.getKeys();\n const removedAccounts: Array<Promise<boolean>> = [];\n\n allCacheKeys.forEach((cacheKey) => {\n const entity = this.getAccount(cacheKey);\n if (!entity) {\n return;\n }\n removedAccounts.push(this.removeAccount(cacheKey));\n });\n\n await Promise.all(removedAccounts);\n return true;\n }\n\n /**\n * returns a boolean if the given account is removed\n * @param account\n */\n async removeAccount(accountKey: string): Promise<boolean> {\n const account = this.getAccount(accountKey);\n if (!account) {\n throw ClientAuthError.createNoAccountFoundError();\n }\n return (await this.removeAccountContext(account) && this.removeItem(accountKey, CacheSchemaType.ACCOUNT));\n }\n\n /**\n * Removes credentials associated with the provided account\n * @param account\n */\n async removeAccountContext(account: AccountEntity): Promise<boolean> {\n const allCacheKeys = this.getKeys();\n const accountId = account.generateAccountId();\n const removedCredentials: Array<Promise<boolean>> = [];\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-credential type cache entities\n const credType = CredentialEntity.getCredentialType(cacheKey);\n if (credType === Constants.NOT_DEFINED) {\n return;\n }\n\n const cacheEntity = this.getSpecificCredential(cacheKey, credType);\n if (!!cacheEntity && accountId === cacheEntity.generateAccountId()) {\n removedCredentials.push(this.removeCredential(cacheEntity));\n }\n });\n\n await Promise.all(removedCredentials);\n return true;\n }\n\n /**\n * returns a boolean if the given credential is removed\n * @param credential\n */\n async removeCredential(credential: CredentialEntity): Promise<boolean> {\n const key = credential.generateCredentialKey();\n\n // Remove Token Binding Key from key store for PoP Tokens Credentials\n if (credential.credentialType.toLowerCase() === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {\n if(credential.tokenType === AuthenticationScheme.POP) {\n const accessTokenWithAuthSchemeEntity = credential as AccessTokenEntity;\n const kid = accessTokenWithAuthSchemeEntity.keyId;\n\n if (kid) {\n try {\n await this.cryptoImpl.removeTokenBindingKey(kid);\n } catch (error) {\n throw ClientAuthError.createBindingKeyNotRemovedError();\n }\n }\n }\n }\n\n return this.removeItem(key, CacheSchemaType.CREDENTIAL);\n }\n\n /**\n * Removes all app metadata objects from cache.\n */\n removeAppMetadata(): boolean {\n const allCacheKeys = this.getKeys();\n allCacheKeys.forEach((cacheKey) => {\n if (this.isAppMetadata(cacheKey)) {\n this.removeItem(cacheKey, CacheSchemaType.APP_METADATA);\n }\n });\n\n return true;\n }\n\n /**\n * Retrieve the cached credentials into a cacherecord\n * @param account\n * @param clientId\n * @param scopes\n * @param environment\n * @param authScheme\n */\n readCacheRecord(account: AccountInfo, clientId: string, request: BaseAuthRequest, environment: string): CacheRecord {\n\n const cachedAccount = this.readAccountFromCache(account);\n const cachedIdToken = this.readIdTokenFromCache(clientId, account);\n const cachedAccessToken = this.readAccessTokenFromCache(clientId, account, request);\n const cachedRefreshToken = this.readRefreshTokenFromCache(clientId, account, false);\n const cachedAppMetadata = this.readAppMetadataFromCache(environment, clientId);\n\n if (cachedAccount && cachedIdToken) {\n cachedAccount.idTokenClaims = new AuthToken(cachedIdToken.secret, this.cryptoImpl).claims;\n }\n\n return {\n account: cachedAccount,\n idToken: cachedIdToken,\n accessToken: cachedAccessToken,\n refreshToken: cachedRefreshToken,\n appMetadata: cachedAppMetadata,\n };\n }\n\n /**\n * Retrieve AccountEntity from cache\n * @param account\n */\n readAccountFromCache(account: AccountInfo): AccountEntity | null {\n const accountKey: string = AccountEntity.generateAccountCacheKey(account);\n return this.getAccount(accountKey);\n }\n\n /**\n * Retrieve IdTokenEntity from cache\n * @param clientId\n * @param account\n * @param inputRealm\n */\n readIdTokenFromCache(clientId: string, account: AccountInfo): IdTokenEntity | null {\n const idTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: CredentialType.ID_TOKEN,\n clientId: clientId,\n realm: account.tenantId,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(idTokenFilter);\n const idTokens = Object.keys(credentialCache.idTokens).map((key) => credentialCache.idTokens[key]);\n const numIdTokens = idTokens.length;\n\n if (numIdTokens < 1) {\n return null;\n } else if (numIdTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return idTokens[0] as IdTokenEntity;\n }\n\n /**\n * Retrieve AccessTokenEntity from cache\n * @param clientId\n * @param account\n * @param scopes\n * @param authScheme\n */\n readAccessTokenFromCache(clientId: string, account: AccountInfo, request: BaseAuthRequest): AccessTokenEntity | null {\n const scopes = new ScopeSet(request.scopes || []);\n const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;\n /*\n * Distinguish between Bearer and PoP/SSH token cache types\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n const credentialType = (authScheme && authScheme.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;\n\n const accessTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: credentialType,\n clientId,\n realm: account.tenantId,\n target: scopes.printScopesLowerCase(),\n tokenType: authScheme,\n keyId: request.sshKid,\n requestedClaimsHash: request.requestedClaimsHash,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(accessTokenFilter);\n\n const accessTokens = Object.keys(credentialCache.accessTokens).map((key) => credentialCache.accessTokens[key]);\n\n const numAccessTokens = accessTokens.length;\n if (numAccessTokens < 1) {\n return null;\n } else if (numAccessTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return accessTokens[0] as AccessTokenEntity;\n }\n\n /**\n * Helper to retrieve the appropriate refresh token from cache\n * @param clientId\n * @param account\n * @param familyRT\n */\n readRefreshTokenFromCache(clientId: string, account: AccountInfo, familyRT: boolean): RefreshTokenEntity | null {\n const id = familyRT ? THE_FAMILY_ID : undefined;\n const refreshTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: CredentialType.REFRESH_TOKEN,\n clientId: clientId,\n familyId: id,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(refreshTokenFilter);\n const refreshTokens = Object.keys(credentialCache.refreshTokens).map((key) => credentialCache.refreshTokens[key]);\n\n const numRefreshTokens = refreshTokens.length;\n if (numRefreshTokens < 1) {\n return null;\n }\n // address the else case after remove functions address environment aliases\n\n return refreshTokens[0] as RefreshTokenEntity;\n }\n\n /**\n * Retrieve AppMetadataEntity from cache\n */\n readAppMetadataFromCache(environment: string, clientId: string): AppMetadataEntity | null {\n const appMetadataFilter: AppMetadataFilter = {\n environment,\n clientId,\n };\n\n const appMetadata: AppMetadataCache = this.getAppMetadataFilteredBy(appMetadataFilter);\n const appMetadataEntries: AppMetadataEntity[] = Object.keys(appMetadata).map((key) => appMetadata[key]);\n\n const numAppMetadata = appMetadataEntries.length;\n if (numAppMetadata < 1) {\n return null;\n } else if (numAppMetadata > 1) {\n throw ClientAuthError.createMultipleMatchingAppMetadataInCacheError();\n }\n\n return appMetadataEntries[0] as AppMetadataEntity;\n }\n\n /**\n * Return the family_id value associated with FOCI\n * @param environment\n * @param clientId\n */\n isAppMetadataFOCI(environment: string, clientId: string): boolean {\n const appMetadata = this.readAppMetadataFromCache(environment, clientId);\n return !!(appMetadata && appMetadata.familyId === THE_FAMILY_ID);\n }\n\n /**\n * helper to match account ids\n * @param value\n * @param homeAccountId\n */\n private matchHomeAccountId(entity: AccountEntity | CredentialEntity, homeAccountId: string): boolean {\n return !!(entity.homeAccountId && homeAccountId === entity.homeAccountId);\n }\n\n /**\n * helper to match assertion\n * @param value\n * @param oboAssertion\n */\n private matchUserAssertionHash(entity: CredentialEntity, userAssertionHash: string): boolean {\n return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash);\n }\n\n /**\n * helper to match environment\n * @param value\n * @param environment\n */\n private matchEnvironment(entity: AccountEntity | CredentialEntity | AppMetadataEntity, environment: string): boolean {\n const cloudMetadata = this.getAuthorityMetadataByAlias(environment);\n if (cloudMetadata && cloudMetadata.aliases.indexOf(entity.environment) > -1) {\n return true;\n }\n\n return false;\n }\n\n /**\n * helper to match credential type\n * @param entity\n * @param credentialType\n */\n private matchCredentialType(entity: CredentialEntity, credentialType: string): boolean {\n return (entity.credentialType && credentialType.toLowerCase() === entity.credentialType.toLowerCase());\n }\n\n /**\n * helper to match client ids\n * @param entity\n * @param clientId\n */\n private matchClientId(entity: CredentialEntity | AppMetadataEntity, clientId: string): boolean {\n return !!(entity.clientId && clientId === entity.clientId);\n }\n\n /**\n * helper to match family ids\n * @param entity\n * @param familyId\n */\n private matchFamilyId(entity: CredentialEntity | AppMetadataEntity, familyId: string): boolean {\n return !!(entity.familyId && familyId === entity.familyId);\n }\n\n /**\n * helper to match realm\n * @param entity\n * @param realm\n */\n private matchRealm(entity: AccountEntity | CredentialEntity, realm: string): boolean {\n return !!(entity.realm && realm === entity.realm);\n }\n\n /**\n * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.\n * @param entity\n * @param target\n */\n private matchTarget(entity: CredentialEntity, target: string): boolean {\n const isNotAccessTokenCredential = (entity.credentialType !== CredentialType.ACCESS_TOKEN && entity.credentialType !== CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME);\n\n if ( isNotAccessTokenCredential || !entity.target) {\n return false;\n }\n\n const entityScopeSet: ScopeSet = ScopeSet.fromString(entity.target);\n const requestTargetScopeSet: ScopeSet = ScopeSet.fromString(target);\n\n if (!requestTargetScopeSet.containsOnlyOIDCScopes()) {\n requestTargetScopeSet.removeOIDCScopes(); // ignore OIDC scopes\n } else {\n requestTargetScopeSet.removeScope(Constants.OFFLINE_ACCESS_SCOPE);\n }\n return entityScopeSet.containsScopeSet(requestTargetScopeSet);\n }\n\n /**\n * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise\n * @param entity\n * @param tokenType\n */\n private matchTokenType(entity: CredentialEntity, tokenType: AuthenticationScheme): boolean {\n return !!(entity.tokenType && entity.tokenType === tokenType);\n }\n\n /**\n * Returns true if the credential's keyId matches the one in the request, false otherwise\n * @param entity\n * @param tokenType\n */\n private matchKeyId(entity: CredentialEntity, keyId: string): boolean {\n return !!(entity.keyId && entity.keyId === keyId);\n }\n\n /**\n * returns if a given cache entity is of the type appmetadata\n * @param key\n */\n private isAppMetadata(key: string): boolean {\n return key.indexOf(APP_METADATA) !== -1;\n }\n\n /**\n * returns if a given cache entity is of the type authoritymetadata\n * @param key\n */\n protected isAuthorityMetadata(key: string): boolean {\n return key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) !== -1;\n }\n\n /**\n * returns cache key used for cloud instance metadata\n */\n generateAuthorityMetadataCacheKey(authority: string): string {\n return `${AUTHORITY_METADATA_CONSTANTS.CACHE_KEY}-${this.clientId}-${authority}`;\n }\n\n /**\n * Returns the specific credential (IdToken/AccessToken/RefreshToken) from the cache\n * @param key\n * @param credType\n */\n private getSpecificCredential(key: string, credType: string): ValidCredentialType | null {\n switch (credType) {\n case CredentialType.ID_TOKEN: {\n return this.getIdTokenCredential(key);\n }\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME: {\n return this.getAccessTokenCredential(key);\n }\n case CredentialType.REFRESH_TOKEN: {\n return this.getRefreshTokenCredential(key);\n }\n default:\n return null;\n }\n }\n\n /**\n * Helper to convert serialized data to object\n * @param obj\n * @param json\n */\n static toObject<T>(obj: T, json: object): T {\n for (const propertyName in json) {\n obj[propertyName] = json[propertyName];\n }\n return obj;\n }\n}\n\nexport class DefaultStorageClass extends CacheManager {\n setAccount(): void {\n const notImplErr = \"Storage interface - setAccount() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAccount(): AccountEntity {\n const notImplErr = \"Storage interface - getAccount() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setIdTokenCredential(): void {\n const notImplErr = \"Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getIdTokenCredential(): IdTokenEntity {\n const notImplErr = \"Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAccessTokenCredential(): void {\n const notImplErr = \"Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAccessTokenCredential(): AccessTokenEntity {\n const notImplErr = \"Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setRefreshTokenCredential(): void {\n const notImplErr = \"Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getRefreshTokenCredential(): RefreshTokenEntity {\n const notImplErr = \"Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAppMetadata(): void {\n const notImplErr = \"Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAppMetadata(): AppMetadataEntity {\n const notImplErr = \"Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setServerTelemetry(): void {\n const notImplErr = \"Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getServerTelemetry(): ServerTelemetryEntity {\n const notImplErr = \"Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAuthorityMetadata(): void {\n const notImplErr = \"Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAuthorityMetadata(): AuthorityMetadataEntity | null {\n const notImplErr = \"Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAuthorityMetadataKeys(): Array<string> {\n const notImplErr = \"Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setThrottlingCache(): void {\n const notImplErr = \"Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getThrottlingCache(): ThrottlingEntity {\n const notImplErr = \"Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n removeItem(): boolean {\n const notImplErr = \"Storage interface - removeItem() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n containsKey(): boolean {\n const notImplErr = \"Storage interface - containsKey() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getKeys(): string[] {\n const notImplErr = \"Storage interface - getKeys() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n async clear(): Promise<void> {\n const notImplErr = \"Storage interface - clear() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n updateCredentialCacheKey(): string {\n const notImplErr = \"Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AA0BA;;;;IAOI,sBAAY,QAAgB,EAAE,UAAmB;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;KAChC;;;;IAwID,qCAAc,GAAd;QAAA,iBAoBC;QAnBG,IAAM,eAAe,GAAiB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACnE,IAAM,aAAa,GAAoB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,UAAA,UAAU,IAAI,OAAA,eAAe,CAAC,UAAU,CAAC,GAAA,CAAC,CAAC;QACnH,IAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC;QACzC,IAAI,WAAW,GAAG,CAAC,EAAE;YACjB,OAAO,EAAE,CAAC;SACb;aAAM;YACH,IAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAc,UAAC,KAAK;gBACrD,IAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAgB,IAAI,aAAa,EAAE,EAAE,KAAK,CAAC,CAAC;gBACvF,IAAM,WAAW,GAAG,aAAa,CAAC,cAAc,EAAE,CAAC;gBACnD,IAAM,OAAO,GAAG,KAAI,CAAC,oBAAoB,CAAC,KAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBACtE,IAAI,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;oBACvC,WAAW,CAAC,aAAa,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,KAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;iBACrF;gBAED,OAAO,WAAW,CAAC;aAEtB,CAAC,CAAC;YACH,OAAO,WAAW,CAA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CAAC;KACrD;IACD,gDAAkB,GAAlB;QACI,IAAM,UAAU,GAAG,mGAAmG,CAAC;QACvH,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,gDAAkB,GAAlB;QACI,IAAM,UAAU,GAAG,mGAAmG,CAAC;QACvH,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,wCAAU,GAAV;QACI,IAAM,UAAU,GAAG,2FAA2F,CAAC;QAC/G,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,yCAAW,GAAX;QACI,IAAM,UAAU,GAAG,4FAA4F,CAAC;QAChH,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,qCAAO,GAAP;QACI,IAAM,UAAU,GAAG,wFAAwF,CAAC;QAC5G,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACK,mCAAK,GAAX;;;;gBACU,UAAU,GAAG,sFAAsF,CAAC;gBAC1G,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACD,sDAAwB,GAAxB;QACI,IAAM,UAAU,GAAG,yGAAyG,CAAC;QAC7H,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACL,0BAAC;AAAD,CAzFA,CAAyC,YAAY;;;;"}
@@ -47,7 +47,7 @@ export declare class AccessTokenEntity extends CredentialEntity {
47
47
  * @param expiresOn
48
48
  * @param extExpiresOn
49
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, oboAssertion?: string, keyId?: string, requestedClaims?: string, requestedClaimsHash?: string): AccessTokenEntity;
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
51
  /**
52
52
  * Validates an entity: checks for all expected params
53
53
  * @param entity
@@ -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,EAAkB,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,uBAAuB,CAC1B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,OAAO,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,oBAAoB,EAChC,YAAY,CA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AC,EAAC,MAAM,EACzB,KAAK,CAAC,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,EACxB,mBAAmB,CAAC,EAAE,MAAM,GAC7B,iBAAiB;IAwDpB;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAiBtD"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __extends } from '../../_virtual/_tslib.js';
4
4
  import { CredentialEntity } from './CredentialEntity.js';
@@ -52,7 +52,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
52
52
  * @param expiresOn
53
53
  * @param extExpiresOn
54
54
  */
55
- AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, oboAssertion, keyId, requestedClaims, requestedClaimsHash) {
55
+ AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
56
56
  var _a, _b;
57
57
  var atEntity = new AccessTokenEntity();
58
58
  atEntity.homeAccountId = homeAccountId;
@@ -73,7 +73,7 @@ var AccessTokenEntity = /** @class */ (function (_super) {
73
73
  atEntity.clientId = clientId;
74
74
  atEntity.realm = tenantId;
75
75
  atEntity.target = scopes;
76
- atEntity.oboAssertion = oboAssertion;
76
+ atEntity.userAssertionHash = userAssertionHash;
77
77
  atEntity.tokenType = StringUtils.isEmpty(tokenType) ? AuthenticationScheme.BEARER : tokenType;
78
78
  if (requestedClaims) {
79
79
  atEntity.requestedClaims = requestedClaims;
@@ -1 +1 @@
1
- {"version":3,"file":"AccessTokenEntity.js","sources":["../../../src/cache/entities/AccessTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType, AuthenticationScheme } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * ACCESS_TOKEN Credential Type\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * cachedAt: Absolute device time when entry was created in the cache.\n * expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.\n * extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.\n * keyId: used for POP and SSH tokenTypes\n * tokenType: Type of the token issued. Usually \"Bearer\"\n * }\n */\nexport class AccessTokenEntity extends CredentialEntity {\n realm: string;\n target: string;\n cachedAt: string;\n expiresOn: string;\n extendedExpiresOn?: string;\n refreshOn?: string;\n keyId?: string; // for POP and SSH tokenTypes\n tokenType?: AuthenticationScheme;\n requestedClaims?: string;\n requestedClaimsHash?: string;\n\n /**\n * Create AccessTokenEntity\n * @param homeAccountId\n * @param environment\n * @param accessToken\n * @param clientId\n * @param tenantId\n * @param scopes\n * @param expiresOn\n * @param extExpiresOn\n */\n static createAccessTokenEntity(\n homeAccountId: string,\n environment: string,\n accessToken: string,\n clientId: string,\n tenantId: string,\n scopes: string,\n expiresOn: number,\n extExpiresOn: number,\n cryptoUtils: ICrypto,\n refreshOn?: number,\n tokenType?: AuthenticationScheme,\n oboAssertion?: string,\n keyId?: string,\n requestedClaims?: string,\n requestedClaimsHash?: string \n ): AccessTokenEntity {\n const atEntity: AccessTokenEntity = new AccessTokenEntity();\n\n atEntity.homeAccountId = homeAccountId;\n atEntity.credentialType = CredentialType.ACCESS_TOKEN;\n atEntity.secret = accessToken;\n\n const currentTime = TimeUtils.nowSeconds();\n atEntity.cachedAt = currentTime.toString();\n\n /*\n * Token expiry time.\n * This value should be  calculated based on the current UTC time measured locally and the value  expires_in Represented as a string in JSON.\n */\n atEntity.expiresOn = expiresOn.toString();\n atEntity.extendedExpiresOn = extExpiresOn.toString();\n if (refreshOn) {\n atEntity.refreshOn = refreshOn.toString();\n }\n\n atEntity.environment = environment;\n atEntity.clientId = clientId;\n atEntity.realm = tenantId;\n atEntity.target = scopes;\n atEntity.oboAssertion = oboAssertion;\n\n atEntity.tokenType = StringUtils.isEmpty(tokenType) ? AuthenticationScheme.BEARER : tokenType;\n\n if (requestedClaims) {\n atEntity.requestedClaims = requestedClaims;\n atEntity.requestedClaimsHash = requestedClaimsHash;\n }\n\n /*\n * Create Access Token With Auth Scheme instead of regular access token\n * Cast to lower to handle \"bearer\" from ADFS\n */\n if (atEntity.tokenType?.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) {\n atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n switch (atEntity.tokenType) {\n case AuthenticationScheme.POP:\n // Make sure keyId is present and add it to credential\n const tokenClaims: TokenClaims | null = AuthToken.extractTokenClaims(accessToken, cryptoUtils);\n if (!tokenClaims?.cnf?.kid) {\n throw ClientAuthError.createTokenClaimsRequiredError();\n }\n atEntity.keyId = tokenClaims.cnf.kid;\n break;\n case AuthenticationScheme.SSH:\n atEntity.keyId = keyId;\n }\n }\n\n return atEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccessTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity.hasOwnProperty(\"target\") &&\n (entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN || entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME)\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;IAwBuC,qCAAgB;IAAvD;;KAoHC;;;;;;;;;;;;IA7FU,yCAAuB,GAA9B,UACI,aAAqB,EACrB,WAAmB,EACnB,WAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,MAAc,EACd,SAAiB,EACjB,YAAoB,EACpB,WAAoB,EACpB,SAAkB,EAClB,SAAgC,EAChC,YAAqB,EACrB,KAAc,EACd,eAAwB,EACxB,mBAA4B;;QAE5B,IAAM,QAAQ,GAAsB,IAAI,iBAAiB,EAAE,CAAC;QAE5D,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;QACvC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC,YAAY,CAAC;QACtD,QAAQ,CAAC,MAAM,GAAG,WAAW,CAAC;QAE9B,IAAM,WAAW,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;QAC3C,QAAQ,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;;;;;QAM3C,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC1C,QAAQ,CAAC,iBAAiB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACrD,IAAI,SAAS,EAAE;YACX,QAAQ,CAAC,SAAS,GA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,OAAO,KAAK,CAAC;SAChB;QAED,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;YACtC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;YACpC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACvC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;YAC9B,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;YACjC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;aAC9B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,YAAY,IAAI,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,6BAA6B,CAAC,EACzI;KACL;IACL,wBAAC;AAAD,CApHA,CAAuC,gBAAgB;;;;"}
1
+ {"version":3,"file":"AccessTokenEntity.js","sources":["../../../src/cache/entities/AccessTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType, AuthenticationScheme } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * ACCESS_TOKEN Credential Type\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * cachedAt: Absolute device time when entry was created in the cache.\n * expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.\n * extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.\n * keyId: used for POP and SSH tokenTypes\n * tokenType: Type of the token issued. Usually \"Bearer\"\n * }\n */\nexport class AccessTokenEntity extends CredentialEntity {\n realm: string;\n target: string;\n cachedAt: string;\n expiresOn: string;\n extendedExpiresOn?: string;\n refreshOn?: string;\n keyId?: string; // for POP and SSH tokenTypes\n tokenType?: AuthenticationScheme;\n requestedClaims?: string;\n requestedClaimsHash?: string;\n\n /**\n * Create AccessTokenEntity\n * @param homeAccountId\n * @param environment\n * @param accessToken\n * @param clientId\n * @param tenantId\n * @param scopes\n * @param expiresOn\n * @param extExpiresOn\n */\n static createAccessTokenEntity(\n homeAccountId: string,\n environment: string,\n accessToken: string,\n clientId: string,\n tenantId: string,\n scopes: string,\n expiresOn: number,\n extExpiresOn: number,\n cryptoUtils: ICrypto,\n refreshOn?: number,\n tokenType?: AuthenticationScheme,\n userAssertionHash?:string,\n keyId?: string,\n requestedClaims?: string,\n requestedClaimsHash?: string\n ): AccessTokenEntity {\n const atEntity: AccessTokenEntity = new AccessTokenEntity();\n\n atEntity.homeAccountId = homeAccountId;\n atEntity.credentialType = CredentialType.ACCESS_TOKEN;\n atEntity.secret = accessToken;\n\n const currentTime = TimeUtils.nowSeconds();\n atEntity.cachedAt = currentTime.toString();\n\n /*\n * Token expiry time.\n * This value should be  calculated based on the current UTC time measured locally and the value  expires_in Represented as a string in JSON.\n */\n atEntity.expiresOn = expiresOn.toString();\n atEntity.extendedExpiresOn = extExpiresOn.toString();\n if (refreshOn) {\n atEntity.refreshOn = refreshOn.toString();\n }\n\n atEntity.environment = environment;\n atEntity.clientId = clientId;\n atEntity.realm = tenantId;\n atEntity.target = scopes;\n atEntity.userAssertionHash = userAssertionHash;\n\n atEntity.tokenType = StringUtils.isEmpty(tokenType) ? AuthenticationScheme.BEARER : tokenType;\n\n if (requestedClaims) {\n atEntity.requestedClaims = requestedClaims;\n atEntity.requestedClaimsHash = requestedClaimsHash;\n }\n\n /*\n * Create Access Token With Auth Scheme instead of regular access token\n * Cast to lower to handle \"bearer\" from ADFS\n */\n if (atEntity.tokenType?.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) {\n atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n switch (atEntity.tokenType) {\n case AuthenticationScheme.POP:\n // Make sure keyId is present and add it to credential\n const tokenClaims: TokenClaims | null = AuthToken.extractTokenClaims(accessToken, cryptoUtils);\n if (!tokenClaims?.cnf?.kid) {\n throw ClientAuthError.createTokenClaimsRequiredError();\n }\n atEntity.keyId = tokenClaims.cnf.kid;\n break;\n case AuthenticationScheme.SSH:\n atEntity.keyId = keyId;\n }\n }\n\n return atEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccessTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity.hasOwnProperty(\"target\") &&\n (entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN || entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME)\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;IAwBuC,qCAAgB;IAAvD;;KAoHC;;;;;;;;;;;;IA7FU,yCAAuB,GAA9B,UACI,aAAqB,EACrB,WAAmB,EACnB,WAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,MAAc,EACd,SAAiB,E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