@azure/msal-common 6.1.0 → 6.2.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 (121) 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/ClientInfo.js +1 -1
  5. package/dist/authority/Authority.js +1 -1
  6. package/dist/authority/AuthorityFactory.js +1 -1
  7. package/dist/authority/AuthorityOptions.d.ts +1 -0
  8. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  9. package/dist/authority/AuthorityOptions.js +3 -1
  10. package/dist/authority/AuthorityOptions.js.map +1 -1
  11. package/dist/authority/AuthorityType.js +1 -1
  12. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  13. package/dist/authority/OpenIdConfigResponse.js +1 -1
  14. package/dist/authority/ProtocolMode.js +1 -1
  15. package/dist/authority/RegionDiscovery.js +1 -1
  16. package/dist/cache/CacheManager.js +2 -2
  17. package/dist/cache/CacheManager.js.map +1 -1
  18. package/dist/cache/entities/AccessTokenEntity.js +1 -1
  19. package/dist/cache/entities/AccountEntity.js +10 -10
  20. package/dist/cache/entities/AccountEntity.js.map +1 -1
  21. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  22. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  23. package/dist/cache/entities/CacheRecord.js +1 -1
  24. package/dist/cache/entities/CredentialEntity.js +5 -5
  25. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  26. package/dist/cache/entities/IdTokenEntity.js +1 -1
  27. package/dist/cache/entities/RefreshTokenEntity.js +1 -1
  28. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  29. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  30. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  31. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  32. package/dist/client/AuthorizationCodeClient.js +3 -1
  33. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  34. package/dist/client/BaseClient.js +1 -1
  35. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  36. package/dist/client/ClientCredentialClient.js +4 -3
  37. package/dist/client/ClientCredentialClient.js.map +1 -1
  38. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  39. package/dist/client/DeviceCodeClient.js +2 -1
  40. package/dist/client/DeviceCodeClient.js.map +1 -1
  41. package/dist/client/OnBehalfOfClient.js +3 -2
  42. package/dist/client/OnBehalfOfClient.js.map +1 -1
  43. package/dist/client/RefreshTokenClient.js +2 -1
  44. package/dist/client/RefreshTokenClient.js.map +1 -1
  45. package/dist/client/SilentFlowClient.js +1 -1
  46. package/dist/client/UsernamePasswordClient.js +2 -1
  47. package/dist/client/UsernamePasswordClient.js.map +1 -1
  48. package/dist/config/ClientConfiguration.d.ts +16 -1
  49. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  50. package/dist/config/ClientConfiguration.js +14 -7
  51. package/dist/config/ClientConfiguration.js.map +1 -1
  52. package/dist/crypto/ICrypto.d.ts +4 -2
  53. package/dist/crypto/ICrypto.d.ts.map +1 -1
  54. package/dist/crypto/ICrypto.js +1 -1
  55. package/dist/crypto/ICrypto.js.map +1 -1
  56. package/dist/crypto/IGuidGenerator.d.ts +5 -0
  57. package/dist/crypto/IGuidGenerator.d.ts.map +1 -0
  58. package/dist/crypto/PopTokenGenerator.js +2 -2
  59. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  60. package/dist/error/AuthError.js +3 -3
  61. package/dist/error/AuthError.js.map +1 -1
  62. package/dist/error/ClientAuthError.js +1 -1
  63. package/dist/error/ClientConfigurationError.js +1 -1
  64. package/dist/error/InteractionRequiredAuthError.js +1 -1
  65. package/dist/error/ServerError.js +1 -1
  66. package/dist/index.cjs.js +468 -53
  67. package/dist/index.cjs.js.map +1 -1
  68. package/dist/index.d.ts +7 -1
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +4 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/logger/Logger.js +13 -13
  73. package/dist/logger/Logger.js.map +1 -1
  74. package/dist/network/INetworkModule.js +1 -1
  75. package/dist/network/NetworkManager.js +1 -1
  76. package/dist/network/ThrottlingUtils.js +1 -1
  77. package/dist/packageMetadata.d.ts +1 -1
  78. package/dist/packageMetadata.js +2 -2
  79. package/dist/packageMetadata.js.map +1 -1
  80. package/dist/request/AuthenticationHeaderParser.js +3 -3
  81. package/dist/request/AuthenticationHeaderParser.js.map +1 -1
  82. package/dist/request/RequestParameterBuilder.d.ts +6 -1
  83. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  84. package/dist/request/RequestParameterBuilder.js +19 -3
  85. package/dist/request/RequestParameterBuilder.js.map +1 -1
  86. package/dist/request/RequestValidator.js +1 -1
  87. package/dist/request/ScopeSet.js +4 -4
  88. package/dist/request/ScopeSet.js.map +1 -1
  89. package/dist/response/ResponseHandler.js +4 -4
  90. package/dist/response/ResponseHandler.js.map +1 -1
  91. package/dist/telemetry/performance/IPerformanceClient.d.ts +22 -0
  92. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
  93. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
  94. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
  95. package/dist/telemetry/performance/PerformanceClient.d.ts +125 -0
  96. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -0
  97. package/dist/telemetry/performance/PerformanceClient.js +275 -0
  98. package/dist/telemetry/performance/PerformanceClient.js.map +1 -0
  99. package/dist/telemetry/performance/PerformanceEvent.d.ts +182 -0
  100. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
  101. package/dist/telemetry/performance/PerformanceEvent.js +85 -0
  102. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -0
  103. package/dist/telemetry/performance/StubPerformanceClient.d.ts +13 -0
  104. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
  105. package/dist/telemetry/performance/StubPerformanceClient.js +37 -0
  106. package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -0
  107. package/dist/telemetry/server/ServerTelemetryManager.js +4 -4
  108. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  109. package/dist/url/UrlString.js +2 -2
  110. package/dist/url/UrlString.js.map +1 -1
  111. package/dist/utils/Constants.d.ts +2 -0
  112. package/dist/utils/Constants.d.ts.map +1 -1
  113. package/dist/utils/Constants.js +3 -1
  114. package/dist/utils/Constants.js.map +1 -1
  115. package/dist/utils/ProtocolUtils.js +3 -3
  116. package/dist/utils/ProtocolUtils.js.map +1 -1
  117. package/dist/utils/StringUtils.js +1 -1
  118. package/dist/utils/TimeUtils.js +1 -1
  119. package/package.json +2 -4
  120. package/CHANGELOG.json +0 -1319
  121. package/CHANGELOG.md +0 -504
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
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.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
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.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
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.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { Authority } from './Authority.js';
@@ -10,6 +10,7 @@ export declare type AuthorityOptions = {
10
10
  export declare enum AzureCloudInstance {
11
11
  None = 0,
12
12
  AzurePublic = "https://login.microsoftonline.com",
13
+ AzurePpe = "https://login.windows-ppe.net",
13
14
  AzureChina = "https://login.chinacloudapi.cn",
14
15
  AzureGermany = "https://login.microsoftonline.de",
15
16
  AzureUsGovernment = "https://login.microsoftonline.us"
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorityOptions.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityOptions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,oBAAY,gBAAgB,GAAG;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACvD,CAAC;AAEF,oBAAY,kBAAkB;IAE1B,IAAI,IAAA;IAGJ,WAAW,sCAAsC;IAGjD,UAAU,mCAAmC;IAG7C,YAAY,qCAAqC;IAGjD,iBAAiB,qCAAqC;CACzD"}
1
+ {"version":3,"file":"AuthorityOptions.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityOptions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,oBAAY,gBAAgB,GAAG;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACvD,CAAC;AAEF,oBAAY,kBAAkB;IAE1B,IAAI,IAAA;IAGJ,WAAW,sCAAsC;IAGjD,QAAQ,kCAAkC;IAG1C,UAAU,mCAAmC;IAG7C,YAAY,qCAAqC;IAGjD,iBAAiB,qCAAqC;CACzD"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,6 +10,8 @@ var AzureCloudInstance;
10
10
  AzureCloudInstance[AzureCloudInstance["None"] = 0] = "None";
11
11
  // Microsoft Azure public cloud
12
12
  AzureCloudInstance["AzurePublic"] = "https://login.microsoftonline.com";
13
+ // Microsoft PPE
14
+ AzureCloudInstance["AzurePpe"] = "https://login.windows-ppe.net";
13
15
  // Microsoft Chinese national cloud
14
16
  AzureCloudInstance["AzureChina"] = "https://login.chinacloudapi.cn";
15
17
  // Microsoft German national cloud ("Black Forest")
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorityOptions.js","sources":["../../src/authority/AuthorityOptions.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { AzureRegionConfiguration } from \"./AzureRegionConfiguration\";\n\nexport type AuthorityOptions = {\n protocolMode: ProtocolMode;\n knownAuthorities: Array<string>;\n cloudDiscoveryMetadata: string;\n authorityMetadata: string;\n azureRegionConfiguration?: AzureRegionConfiguration;\n};\n\nexport enum AzureCloudInstance {\n // AzureCloudInstance is not specified.\n None,\n\n // Microsoft Azure public cloud\n AzurePublic = \"https://login.microsoftonline.com\",\n\n // Microsoft Chinese national cloud\n AzureChina = \"https://login.chinacloudapi.cn\",\n\n // Microsoft German national cloud (\"Black Forest\")\n AzureGermany = \"https://login.microsoftonline.de\",\n\n // US Government cloud\n AzureUsGovernment = \"https://login.microsoftonline.us\",\n}\n"],"names":[],"mappings":";;AAAA;;;;IAgBY;AAAZ,WAAY,kBAAkB;;IAE1B,2DAAI,CAAA;;IAGJ,uEAAiD,CAAA;;IAGjD,mEAA6C,CAAA;;IAG7C,uEAAiD,CAAA;;IAGjD,4EAAsD,CAAA;AAC1D,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB;;;;"}
1
+ {"version":3,"file":"AuthorityOptions.js","sources":["../../src/authority/AuthorityOptions.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { AzureRegionConfiguration } from \"./AzureRegionConfiguration\";\n\nexport type AuthorityOptions = {\n protocolMode: ProtocolMode;\n knownAuthorities: Array<string>;\n cloudDiscoveryMetadata: string;\n authorityMetadata: string;\n azureRegionConfiguration?: AzureRegionConfiguration;\n};\n\nexport enum AzureCloudInstance {\n // AzureCloudInstance is not specified.\n None,\n\n // Microsoft Azure public cloud\n AzurePublic = \"https://login.microsoftonline.com\",\n\n // Microsoft PPE\n AzurePpe = \"https://login.windows-ppe.net\",\n\n // Microsoft Chinese national cloud\n AzureChina = \"https://login.chinacloudapi.cn\",\n\n // Microsoft German national cloud (\"Black Forest\")\n AzureGermany = \"https://login.microsoftonline.de\",\n\n // US Government cloud\n AzureUsGovernment = \"https://login.microsoftonline.us\",\n}\n"],"names":[],"mappings":";;AAAA;;;;IAgBY;AAAZ,WAAY,kBAAkB;;IAE1B,2DAAI,CAAA;;IAGJ,uEAAiD,CAAA;;IAGjD,gEAA0C,CAAA;;IAG1C,mEAA6C,CAAA;;IAG7C,uEAAiD,CAAA;;IAGjD,4EAAsD,CAAA;AAC1D,CAAC,EAlBW,kBAAkB,KAAlB,kBAAkB;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { RegionDiscoverySources, ResponseCodes, Constants } from '../utils/Constants.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
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';
@@ -129,7 +129,7 @@ var CacheManager = /** @class */ (function () {
129
129
  * @param realm
130
130
  */
131
131
  CacheManager.prototype.getAccountsFilteredBy = function (accountFilter) {
132
- return this.getAccountsFilteredByInternal(accountFilter ? accountFilter.homeAccountId : "", accountFilter ? accountFilter.environment : "", accountFilter ? accountFilter.realm : "");
132
+ return this.getAccountsFilteredByInternal(accountFilter ? accountFilter.homeAccountId : Constants.EMPTY_STRING, accountFilter ? accountFilter.environment : Constants.EMPTY_STRING, accountFilter ? accountFilter.realm : Constants.EMPTY_STRING);
133
133
  };
134
134
  /**
135
135
  * retrieve accounts matching all provided filters; if no filter is set, get all accounts
@@ -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 : \"\",\n accountFilter ? accountFilter.environment : \"\",\n accountFilter ? accountFilter.realm : \"\"\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 * returns a boolean if the given account is removed\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 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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AAqB,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.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 * returns a boolean if the given account is removed\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 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;QAA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;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,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  import { __extends } from '../../_virtual/_tslib.js';
4
4
  import { CredentialEntity } from './CredentialEntity.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  import { Separators, CacheAccountType, CacheType, Constants } from '../../utils/Constants.js';
4
4
  import { buildClientInfo } from '../../account/ClientInfo.js';
@@ -94,8 +94,8 @@ var AccountEntity = /** @class */ (function () {
94
94
  AccountEntity.generateAccountCacheKey = function (accountInterface) {
95
95
  var accountKey = [
96
96
  accountInterface.homeAccountId,
97
- accountInterface.environment || "",
98
- accountInterface.tenantId || "",
97
+ accountInterface.environment || Constants.EMPTY_STRING,
98
+ accountInterface.tenantId || Constants.EMPTY_STRING,
99
99
  ];
100
100
  return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
101
101
  };
@@ -118,17 +118,17 @@ var AccountEntity = /** @class */ (function () {
118
118
  }
119
119
  account.environment = env;
120
120
  // non AAD scenarios can have empty realm
121
- account.realm = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.tid) || "";
121
+ account.realm = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.tid) || Constants.EMPTY_STRING;
122
122
  account.oboAssertion = oboAssertion;
123
123
  if (idToken) {
124
124
  account.idTokenClaims = idToken.claims;
125
125
  // How do you account for MSA CID here?
126
- account.localAccountId = ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.oid) || ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.sub) || "";
126
+ account.localAccountId = ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.oid) || ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.sub) || Constants.EMPTY_STRING;
127
127
  /*
128
128
  * In B2C scenarios the emails claim is used instead of preferred_username and it is an array. In most cases it will contain a single email.
129
129
  * This field should not be relied upon if a custom policy is configured to return more than 1 email.
130
130
  */
131
- account.username = ((_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.preferred_username) || (((_e = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _e === void 0 ? void 0 : _e.emails) ? idToken.claims.emails[0] : "");
131
+ account.username = ((_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.preferred_username) || (((_e = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _e === void 0 ? void 0 : _e.emails) ? idToken.claims.emails[0] : Constants.EMPTY_STRING);
132
132
  account.name = (_f = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _f === void 0 ? void 0 : _f.name;
133
133
  }
134
134
  account.cloudGraphHostName = cloudGraphHostName;
@@ -146,7 +146,7 @@ var AccountEntity = /** @class */ (function () {
146
146
  account.authorityType = (authority && authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;
147
147
  account.homeAccountId = homeAccountId;
148
148
  // non AAD scenarios can have empty realm
149
- account.realm = "";
149
+ account.realm = Constants.EMPTY_STRING;
150
150
  account.oboAssertion = oboAssertion;
151
151
  var env = environment || authority && authority.getPreferredCache();
152
152
  if (!env) {
@@ -154,10 +154,10 @@ var AccountEntity = /** @class */ (function () {
154
154
  }
155
155
  if (idToken) {
156
156
  // How do you account for MSA CID here?
157
- account.localAccountId = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.oid) || ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.sub) || "";
157
+ account.localAccountId = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.oid) || ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.sub) || Constants.EMPTY_STRING;
158
158
  // upn claim for most ADFS scenarios
159
- account.username = ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.upn) || "";
160
- account.name = ((_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.name) || "";
159
+ account.username = ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.upn) || Constants.EMPTY_STRING;
160
+ account.name = ((_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.name) || Constants.EMPTY_STRING;
161
161
  account.idTokenClaims = idToken === null || idToken === void 0 ? void 0 : idToken.claims;
162
162
  }
163
163
  account.environment = env;
@@ -1 +1 @@
1
- {"version":3,"file":"AccountEntity.js","sources":["../../../src/cache/entities/AccountEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n Separators,\n CacheAccountType,\n CacheType,\n Constants,\n} from \"../../utils/Constants\";\nimport { Authority } from \"../../authority/Authority\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { buildClientInfo } from \"../../account/ClientInfo\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { AccountInfo } from \"../../account/AccountInfo\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\nimport { AuthorityType } from \"../../authority/AuthorityType\";\nimport { Logger } from \"../../logger/Logger\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\n\n/**\n * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\n *\n * Key : Value Schema\n *\n * Key: <home_account_id>-<environment>-<realm*>\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 * realm: Full tenant or organizational identifier that the account belongs to\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\n * authorityType: Accounts authority type as a string\n * name: Full name for the account, including given name and family name,\n * clientInfo: Full base64 encoded client info received from ESTS\n * lastModificationTime: last time this entity was modified in the cache\n * lastModificationApp:\n * oboAssertion: access token passed in as part of OBO request\n * idTokenClaims: Object containing claims parsed from ID token\n * }\n */\nexport class AccountEntity {\n homeAccountId: string;\n environment: string;\n realm: string;\n localAccountId: string;\n username: string;\n authorityType: string;\n name?: string;\n clientInfo?: string;\n lastModificationTime?: string;\n lastModificationApp?: string;\n oboAssertion?: string;\n cloudGraphHostName?: string;\n msGraphHost?: string; \n idTokenClaims?: TokenClaims;\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n const accountId: Array<string> = [this.homeAccountId, this.environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>\n */\n generateAccountKey(): string {\n return AccountEntity.generateAccountCacheKey({\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId\n });\n }\n\n /**\n * returns the type of the cache (in this case account)\n */\n generateType(): number {\n switch (this.authorityType) {\n case CacheAccountType.ADFS_ACCOUNT_TYPE:\n return CacheType.ADFS;\n case CacheAccountType.MSAV1_ACCOUNT_TYPE:\n return CacheType.MSA;\n case CacheAccountType.MSSTS_ACCOUNT_TYPE:\n return CacheType.MSSTS;\n case CacheAccountType.GENERIC_ACCOUNT_TYPE:\n return CacheType.GENERIC;\n default: {\n throw ClientAuthError.createUnexpectedAccountTypeError();\n }\n }\n }\n\n /**\n * Returns the AccountInfo interface for this account.\n */\n getAccountInfo(): AccountInfo {\n return {\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId,\n name: this.name,\n idTokenClaims: this.idTokenClaims\n };\n }\n\n /**\n * Generates account key from interface\n * @param accountInterface\n */\n static generateAccountCacheKey(accountInterface: AccountInfo): string {\n const accountKey = [\n accountInterface.homeAccountId,\n accountInterface.environment || \"\",\n accountInterface.tenantId || \"\",\n ];\n\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\n * @param clientInfo\n * @param authority\n * @param idToken\n * @param policy\n */\n static createAccount(\n clientInfo: string,\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n oboAssertion?: string,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\n account.clientInfo = clientInfo;\n account.homeAccountId = homeAccountId;\n\n const env = environment || (authority && authority.getPreferredCache());\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n account.environment = env;\n // non AAD scenarios can have empty realm\n account.realm = idToken?.claims?.tid || \"\";\n account.oboAssertion = oboAssertion;\n \n if (idToken) {\n account.idTokenClaims = idToken.claims;\n\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || \"\";\n\n /*\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array. In most cases it will contain a single email.\n * This field should not be relied upon if a custom policy is configured to return more than 1 email.\n */\n account.username = idToken?.claims?.preferred_username || (idToken?.claims?.emails? idToken.claims.emails[0]: \"\");\n account.name = idToken?.claims?.name;\n }\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n return account;\n }\n\n /**\n * Builds non-AAD/ADFS account.\n * @param authority\n * @param idToken\n */\n static createGenericAccount(\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n oboAssertion?: string,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = (authority && authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;\n account.homeAccountId = homeAccountId;\n // non AAD scenarios can have empty realm\n account.realm = \"\";\n account.oboAssertion = oboAssertion;\n\n const env = environment || authority && authority.getPreferredCache();\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n if (idToken) {\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || \"\";\n // upn claim for most ADFS scenarios\n account.username = idToken?.claims?.upn || \"\";\n account.name = idToken?.claims?.name || \"\";\n account.idTokenClaims = idToken?.claims;\n }\n\n account.environment = env;\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n /*\n * add uniqueName to claims\n * account.name = idToken.claims.uniqueName;\n */\n\n return account;\n }\n\n /**\n * Generate HomeAccountId from server response\n * @param serverClientInfo\n * @param authType\n */\n static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idToken?: AuthToken): string {\n\n const accountId = idToken?.claims?.sub ? idToken.claims.sub : Constants.EMPTY_STRING;\n\n // since ADFS does not have tid and does not set client_info\n if (authType === AuthorityType.Adfs) {\n return accountId;\n }\n\n // for cases where there is clientInfo\n if (serverClientInfo) {\n try {\n const clientInfo = buildClientInfo(serverClientInfo, cryptoObj);\n if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {\n return `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`;\n }\n } catch (e) {}\n }\n\n // default to \"sub\" claim\n logger.verbose(\"No client info in response\");\n return accountId;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccountEntity(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(\"realm\") &&\n entity.hasOwnProperty(\"localAccountId\") &&\n entity.hasOwnProperty(\"username\") &&\n entity.hasOwnProperty(\"authorityType\")\n );\n }\n\n /**\n * Helper function to determine whether 2 accountInfo objects represent the same account\n * @param accountA \n * @param accountB \n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\n */\n static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean {\n if (!accountA || !accountB) {\n return false;\n }\n\n let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\n if (compareClaims) {\n const accountAClaims = (accountA.idTokenClaims || {}) as TokenClaims;\n const accountBClaims = (accountB.idTokenClaims || {}) as TokenClaims;\n\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\n claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&\n (accountAClaims.nonce === accountBClaims.nonce);\n }\n\n return (accountA.homeAccountId === accountB.homeAccountId) && \n (accountA.localAccountId === accountB.localAccountId) &&\n (accountA.username === accountB.username) &&\n (accountA.tenantId === accountB.tenantId) &&\n (accountA.environment === accountB.environment) &&\n claimsMatch;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;IAuBA;KA0QC;;;;IAvPG,yCAAiB,GAAjB;QACI,IAAM,SAAS,GAAkB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE;;;;IAKD,0CAAkB,GAAlB;QACI,OAAO,aAAa,CAAC,uBAAuB,CAAC;YACzC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,CAAC,CAAC;KACN;;;;IAKD,oCAAY,GAAZ;QACI,QAAQ,IAAI,CAAC,aAAa;YACtB,KAAK,gBAAgB,CAAC,iBAAiB;gBACnC,OAAO,SAAS,CAAC,IAAI,CAAC;YAC1B,KAAK,gBAAgB,CAAC,kBAAkB;gBACpC,OAAO,SAAS,CAAC,GAAG,CAAC;YACzB,KAAK,gBAAgB,CAAC,kBAAkB;gBACpC,OAAO,SAAS,CAAC,KAAK,CAAC;YAC3B,KAAK,gBAAgB,CAAC,oBAAoB;gBACtC,OAAO,SAAS,CAAC,OAAO,CAAC;YAC7B,SAAS;gBACL,MAAM,eAAe,CAAC,gCAAgC,EAAE,CAAC;aAC5D;SACJ;KACJ;;;;IAKD,sCAAc,GAAd;QACI,OAAO;YACH,aAAa,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AC,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,aAAa;aACpD,QAAQ,CAAC,cAAc,KAAK,QAAQ,CAAC,cAAc,CAAC;aACpD,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW,CAAC;YAC/C,WAAW,CAAC;KACnB;IACL,oBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"AccountEntity.js","sources":["../../../src/cache/entities/AccountEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n Separators,\n CacheAccountType,\n CacheType,\n Constants,\n} from \"../../utils/Constants\";\nimport { Authority } from \"../../authority/Authority\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { buildClientInfo } from \"../../account/ClientInfo\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { AccountInfo } from \"../../account/AccountInfo\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\nimport { AuthorityType } from \"../../authority/AuthorityType\";\nimport { Logger } from \"../../logger/Logger\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\n\n/**\n * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\n *\n * Key : Value Schema\n *\n * Key: <home_account_id>-<environment>-<realm*>\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 * realm: Full tenant or organizational identifier that the account belongs to\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\n * authorityType: Accounts authority type as a string\n * name: Full name for the account, including given name and family name,\n * clientInfo: Full base64 encoded client info received from ESTS\n * lastModificationTime: last time this entity was modified in the cache\n * lastModificationApp:\n * oboAssertion: access token passed in as part of OBO request\n * idTokenClaims: Object containing claims parsed from ID token\n * }\n */\nexport class AccountEntity {\n homeAccountId: string;\n environment: string;\n realm: string;\n localAccountId: string;\n username: string;\n authorityType: string;\n name?: string;\n clientInfo?: string;\n lastModificationTime?: string;\n lastModificationApp?: string;\n oboAssertion?: string;\n cloudGraphHostName?: string;\n msGraphHost?: string; \n idTokenClaims?: TokenClaims;\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n const accountId: Array<string> = [this.homeAccountId, this.environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>\n */\n generateAccountKey(): string {\n return AccountEntity.generateAccountCacheKey({\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId\n });\n }\n\n /**\n * returns the type of the cache (in this case account)\n */\n generateType(): number {\n switch (this.authorityType) {\n case CacheAccountType.ADFS_ACCOUNT_TYPE:\n return CacheType.ADFS;\n case CacheAccountType.MSAV1_ACCOUNT_TYPE:\n return CacheType.MSA;\n case CacheAccountType.MSSTS_ACCOUNT_TYPE:\n return CacheType.MSSTS;\n case CacheAccountType.GENERIC_ACCOUNT_TYPE:\n return CacheType.GENERIC;\n default: {\n throw ClientAuthError.createUnexpectedAccountTypeError();\n }\n }\n }\n\n /**\n * Returns the AccountInfo interface for this account.\n */\n getAccountInfo(): AccountInfo {\n return {\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId,\n name: this.name,\n idTokenClaims: this.idTokenClaims\n };\n }\n\n /**\n * Generates account key from interface\n * @param accountInterface\n */\n static generateAccountCacheKey(accountInterface: AccountInfo): string {\n const accountKey = [\n accountInterface.homeAccountId,\n accountInterface.environment || Constants.EMPTY_STRING,\n accountInterface.tenantId || Constants.EMPTY_STRING,\n ];\n\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\n * @param clientInfo\n * @param authority\n * @param idToken\n * @param policy\n */\n static createAccount(\n clientInfo: string,\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n oboAssertion?: string,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\n account.clientInfo = clientInfo;\n account.homeAccountId = homeAccountId;\n\n const env = environment || (authority && authority.getPreferredCache());\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n account.environment = env;\n // non AAD scenarios can have empty realm\n account.realm = idToken?.claims?.tid || Constants.EMPTY_STRING;\n account.oboAssertion = oboAssertion;\n \n if (idToken) {\n account.idTokenClaims = idToken.claims;\n\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || Constants.EMPTY_STRING;\n\n /*\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array. In most cases it will contain a single email.\n * This field should not be relied upon if a custom policy is configured to return more than 1 email.\n */\n account.username = idToken?.claims?.preferred_username || (idToken?.claims?.emails? idToken.claims.emails[0]: Constants.EMPTY_STRING);\n account.name = idToken?.claims?.name;\n }\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n return account;\n }\n\n /**\n * Builds non-AAD/ADFS account.\n * @param authority\n * @param idToken\n */\n static createGenericAccount(\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n oboAssertion?: string,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = (authority && authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;\n account.homeAccountId = homeAccountId;\n // non AAD scenarios can have empty realm\n account.realm = Constants.EMPTY_STRING;\n account.oboAssertion = oboAssertion;\n\n const env = environment || authority && authority.getPreferredCache();\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n if (idToken) {\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || Constants.EMPTY_STRING;\n // upn claim for most ADFS scenarios\n account.username = idToken?.claims?.upn || Constants.EMPTY_STRING;\n account.name = idToken?.claims?.name || Constants.EMPTY_STRING;\n account.idTokenClaims = idToken?.claims;\n }\n\n account.environment = env;\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n /*\n * add uniqueName to claims\n * account.name = idToken.claims.uniqueName;\n */\n\n return account;\n }\n\n /**\n * Generate HomeAccountId from server response\n * @param serverClientInfo\n * @param authType\n */\n static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idToken?: AuthToken): string {\n\n const accountId = idToken?.claims?.sub ? idToken.claims.sub : Constants.EMPTY_STRING;\n\n // since ADFS does not have tid and does not set client_info\n if (authType === AuthorityType.Adfs) {\n return accountId;\n }\n\n // for cases where there is clientInfo\n if (serverClientInfo) {\n try {\n const clientInfo = buildClientInfo(serverClientInfo, cryptoObj);\n if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {\n return `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`;\n }\n } catch (e) {}\n }\n\n // default to \"sub\" claim\n logger.verbose(\"No client info in response\");\n return accountId;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccountEntity(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(\"realm\") &&\n entity.hasOwnProperty(\"localAccountId\") &&\n entity.hasOwnProperty(\"username\") &&\n entity.hasOwnProperty(\"authorityType\")\n );\n }\n\n /**\n * Helper function to determine whether 2 accountInfo objects represent the same account\n * @param accountA \n * @param accountB \n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\n */\n static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean {\n if (!accountA || !accountB) {\n return false;\n }\n\n let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\n if (compareClaims) {\n const accountAClaims = (accountA.idTokenClaims || {}) as TokenClaims;\n const accountBClaims = (accountB.idTokenClaims || {}) as TokenClaims;\n\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\n claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&\n (accountAClaims.nonce === accountBClaims.nonce);\n }\n\n return (accountA.homeAccountId === accountB.homeAccountId) && \n (accountA.localAccountId === accountB.localAccountId) &&\n (accountA.username === accountB.username) &&\n (accountA.tenantId === accountB.tenantId) &&\n (accountA.environment === accountB.environment) &&\n claimsMatch;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;IAuBA;KA0QC;;;;IAvPG,yCAAiB,GAAjB;QACI,IAAM,SAAS,GAAkB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE;;;;IAKD,0CAAkB,GAAlB;QACI,OAAO,aAAa,CAAC,uBAAuB,CAAC;YACzC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,CAAC,CAAC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M,CAAC,cAAc,CAAC,UAAU,CAAC;YACjC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,EACxC;KACL;;;;;;;IAQM,gCAAkB,GAAzB,UAA0B,QAA4B,EAAE,QAA4B,EAAE,aAAuB;QACzG,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE;YACxB,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,aAAa,EAAE;YACf,IAAM,cAAc,IAAI,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAgB,CAAC;YACrE,IAAM,cAAc,IAAI,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAgB,CAAC;;YAGrE,WAAW,GAAG,CAAC,cAAc,CAAC,GAAG,KAAK,cAAc,CAAC,GAAG;iBACvD,cAAc,CAAC,KAAK,KAAK,cAAc,CAAC,KAAK,CAAC,CAAC;SACnD;QAED,OAAO,CAAC,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,aAAa;aACpD,QAAQ,CAAC,cAAc,KAAK,QAAQ,CAAC,cAAc,CAAC;aACpD,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW,CAAC;YAC/C,WAAW,CAAC;KACnB;IACL,oBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  import { Separators, APP_METADATA } from '../../utils/Constants.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  import { AUTHORITY_METADATA_CONSTANTS } from '../../utils/Constants.js';
4
4
  import { TimeUtils } from '../../utils/TimeUtils.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.1.0 2022-02-08 */
1
+ /*! @azure/msal-common v6.2.0 2022-04-04 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.