@azure/msal-node 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/cache/NodeStorage.cjs +24 -20
  2. package/dist/cache/NodeStorage.cjs.map +1 -1
  3. package/dist/cache/NodeStorage.d.ts +2 -2
  4. package/dist/cache/NodeStorage.d.ts.map +1 -1
  5. package/dist/cache/NodeStorage.mjs +25 -21
  6. package/dist/cache/NodeStorage.mjs.map +1 -1
  7. package/dist/cache/TokenCache.cjs +1 -1
  8. package/dist/cache/TokenCache.mjs +1 -1
  9. package/dist/cache/distributed/DistributedCachePlugin.cjs +1 -1
  10. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  11. package/dist/cache/serializer/Deserializer.cjs +4 -10
  12. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  13. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  14. package/dist/cache/serializer/Deserializer.mjs +5 -11
  15. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  16. package/dist/cache/serializer/Serializer.cjs +1 -1
  17. package/dist/cache/serializer/Serializer.mjs +1 -1
  18. package/dist/client/ClientApplication.cjs +2 -2
  19. package/dist/client/ClientApplication.cjs.map +1 -1
  20. package/dist/client/ClientApplication.d.ts.map +1 -1
  21. package/dist/client/ClientApplication.mjs +3 -3
  22. package/dist/client/ClientApplication.mjs.map +1 -1
  23. package/dist/client/ClientAssertion.cjs +1 -1
  24. package/dist/client/ClientAssertion.mjs +1 -1
  25. package/dist/client/ClientCredentialClient.cjs +1 -1
  26. package/dist/client/ClientCredentialClient.mjs +1 -1
  27. package/dist/client/ConfidentialClientApplication.cjs +1 -1
  28. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  29. package/dist/client/DeviceCodeClient.cjs +1 -1
  30. package/dist/client/DeviceCodeClient.mjs +1 -1
  31. package/dist/client/OnBehalfOfClient.cjs +1 -1
  32. package/dist/client/OnBehalfOfClient.mjs +1 -1
  33. package/dist/client/PublicClientApplication.cjs +1 -1
  34. package/dist/client/PublicClientApplication.mjs +1 -1
  35. package/dist/client/UsernamePasswordClient.cjs +1 -1
  36. package/dist/client/UsernamePasswordClient.mjs +1 -1
  37. package/dist/config/Configuration.cjs +1 -1
  38. package/dist/config/Configuration.mjs +1 -1
  39. package/dist/crypto/CryptoProvider.cjs +1 -1
  40. package/dist/crypto/CryptoProvider.mjs +1 -1
  41. package/dist/crypto/GuidGenerator.cjs +1 -1
  42. package/dist/crypto/GuidGenerator.mjs +1 -1
  43. package/dist/crypto/HashUtils.cjs +1 -1
  44. package/dist/crypto/HashUtils.mjs +1 -1
  45. package/dist/crypto/PkceGenerator.cjs +1 -1
  46. package/dist/crypto/PkceGenerator.mjs +1 -1
  47. package/dist/error/NodeAuthError.cjs +1 -1
  48. package/dist/error/NodeAuthError.mjs +1 -1
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.mjs +1 -1
  51. package/dist/internals.cjs +1 -1
  52. package/dist/internals.mjs +1 -1
  53. package/dist/network/HttpClient.cjs +1 -1
  54. package/dist/network/HttpClient.mjs +1 -1
  55. package/dist/network/LoopbackClient.cjs +1 -1
  56. package/dist/network/LoopbackClient.mjs +1 -1
  57. package/dist/packageMetadata.cjs +2 -2
  58. package/dist/packageMetadata.d.ts +1 -1
  59. package/dist/packageMetadata.mjs +2 -2
  60. package/dist/utils/Constants.cjs +1 -1
  61. package/dist/utils/Constants.mjs +1 -1
  62. package/dist/utils/EncodingUtils.cjs +1 -1
  63. package/dist/utils/EncodingUtils.mjs +1 -1
  64. package/dist/utils/NetworkUtils.cjs +1 -1
  65. package/dist/utils/NetworkUtils.mjs +1 -1
  66. package/package.json +2 -2
  67. package/src/cache/NodeStorage.ts +31 -25
  68. package/src/cache/serializer/Deserializer.ts +12 -14
  69. package/src/client/ClientApplication.ts +3 -1
  70. package/src/packageMetadata.ts +1 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { BaseClient, TimeUtils, ResponseHandler, UrlString, RequestParameterBuilder, createClientAuthError, ClientAuthErrorCodes, Constants, createAuthError, AuthErrorCodes, GrantType, StringUtils } from '@azure/msal-common';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { BaseClient, ScopeSet, CacheOutcome, createClientAuthError, ClientAuthErrorCodes, TimeUtils, AuthToken, ResponseHandler, AuthenticationScheme, CredentialType, UrlString, RequestParameterBuilder, GrantType, AADServerParamKeys, Constants } from '@azure/msal-common';
4
4
  import { EncodingUtils } from '../utils/EncodingUtils.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { ApiId, LOOPBACK_SERVER_CONSTANTS, Constants as Constants$1 } from '../utils/Constants.mjs';
4
4
  import { AuthError, OIDC_DEFAULT_SCOPES, ResponseMode, CodeChallengeMethodValues, ServerError, Constants } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { BaseClient, TimeUtils, ResponseHandler, UrlString, CcsCredentialType, RequestParameterBuilder, GrantType, StringUtils } from '@azure/msal-common';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { Constants, ProtocolMode, AzureCloudInstance, LogLevel } from '@azure/msal-common';
4
4
  import { HttpClient } from '../network/HttpClient.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { GuidGenerator } from './GuidGenerator.mjs';
4
4
  import { EncodingUtils } from '../utils/EncodingUtils.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { v4 } from 'uuid';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { Hash } from '../utils/Constants.mjs';
4
4
  import crypto from 'crypto';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { Constants } from '@azure/msal-common';
4
4
  import { RANDOM_OCTET_SIZE, CharSet } from '../utils/Constants.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { AuthError } from '@azure/msal-common';
4
4
 
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import * as internals from './internals.mjs';
4
4
  export { internals };
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  export { Serializer } from './cache/serializer/Serializer.mjs';
4
4
  export { Deserializer } from './cache/serializer/Deserializer.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { HttpStatus } from '@azure/msal-common';
4
4
  import { ProxyStatus, Constants, HttpMethod } from '../utils/Constants.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { Constants, UrlString, HttpStatus } from '@azure/msal-common';
4
4
  import http from 'http';
@@ -1,10 +1,10 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  /* eslint-disable header/header */
6
6
  const name = "@azure/msal-node";
7
- const version = "2.2.0";
7
+ const version = "2.4.0";
8
8
 
9
9
  exports.name = name;
10
10
  exports.version = version;
@@ -1,3 +1,3 @@
1
1
  export declare const name = "@azure/msal-node";
2
- export declare const version = "2.2.0";
2
+ export declare const version = "2.4.0";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  /* eslint-disable header/header */
4
4
  const name = "@azure/msal-node";
5
- const version = "2.2.0";
5
+ const version = "2.4.0";
6
6
 
7
7
  export { name, version };
8
8
  //# sourceMappingURL=packageMetadata.mjs.map
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  import { Constants } from '@azure/msal-common';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0 2023-10-05 */
1
+ /*! @azure/msal-node v2.4.0 2023-10-30 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@azure/msal-node",
4
- "version": "2.2.0",
4
+ "version": "2.4.0",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "email": "nugetaad@microsoft.com",
@@ -77,7 +77,7 @@
77
77
  "yargs": "^17.3.1"
78
78
  },
79
79
  "dependencies": {
80
- "@azure/msal-common": "14.1.0",
80
+ "@azure/msal-common": "14.3.0",
81
81
  "jsonwebtoken": "^9.0.0",
82
82
  "uuid": "^8.3.0"
83
83
  },
@@ -18,6 +18,8 @@ import {
18
18
  ICrypto,
19
19
  AuthorityMetadataEntity,
20
20
  ValidCredentialType,
21
+ StaticAuthorityOptions,
22
+ CacheHelpers,
21
23
  } from "@azure/msal-common";
22
24
 
23
25
  import { Deserializer } from "./serializer/Deserializer.js";
@@ -38,8 +40,13 @@ export class NodeStorage extends CacheManager {
38
40
  private cache: CacheKVStore = {};
39
41
  private changeEmitters: Array<Function> = [];
40
42
 
41
- constructor(logger: Logger, clientId: string, cryptoImpl: ICrypto) {
42
- super(clientId, cryptoImpl, logger);
43
+ constructor(
44
+ logger: Logger,
45
+ clientId: string,
46
+ cryptoImpl: ICrypto,
47
+ staticAuthorityOptions?: StaticAuthorityOptions
48
+ ) {
49
+ super(clientId, cryptoImpl, logger, staticAuthorityOptions);
43
50
  this.logger = logger;
44
51
  }
45
52
 
@@ -72,22 +79,20 @@ export class NodeStorage extends CacheManager {
72
79
  };
73
80
 
74
81
  for (const key in cache) {
75
- if (cache[key as string] instanceof AccountEntity) {
76
- inMemoryCache.accounts[key] = cache[key] as AccountEntity;
77
- } else if (cache[key] instanceof IdTokenEntity) {
78
- inMemoryCache.idTokens[key] = cache[key] as IdTokenEntity;
79
- } else if (cache[key] instanceof AccessTokenEntity) {
80
- inMemoryCache.accessTokens[key] = cache[
81
- key
82
- ] as AccessTokenEntity;
83
- } else if (cache[key] instanceof RefreshTokenEntity) {
84
- inMemoryCache.refreshTokens[key] = cache[
85
- key
86
- ] as RefreshTokenEntity;
87
- } else if (cache[key] instanceof AppMetadataEntity) {
88
- inMemoryCache.appMetadata[key] = cache[
89
- key
90
- ] as AppMetadataEntity;
82
+ const value = cache[key];
83
+ if (typeof value !== "object") {
84
+ continue;
85
+ }
86
+ if (value instanceof AccountEntity) {
87
+ inMemoryCache.accounts[key] = value as AccountEntity;
88
+ } else if (CacheHelpers.isIdTokenEntity(value)) {
89
+ inMemoryCache.idTokens[key] = value as IdTokenEntity;
90
+ } else if (CacheHelpers.isAccessTokenEntity(value)) {
91
+ inMemoryCache.accessTokens[key] = value as AccessTokenEntity;
92
+ } else if (CacheHelpers.isRefreshTokenEntity(value)) {
93
+ inMemoryCache.refreshTokens[key] = value as RefreshTokenEntity;
94
+ } else if (value instanceof AppMetadataEntity) {
95
+ inMemoryCache.appMetadata[key] = value as AppMetadataEntity;
91
96
  } else {
92
97
  continue;
93
98
  }
@@ -235,7 +240,7 @@ export class NodeStorage extends CacheManager {
235
240
  */
236
241
  getIdTokenCredential(idTokenKey: string): IdTokenEntity | null {
237
242
  const idToken = this.getItem(idTokenKey) as IdTokenEntity;
238
- if (IdTokenEntity.isIdTokenEntity(idToken)) {
243
+ if (CacheHelpers.isIdTokenEntity(idToken)) {
239
244
  return idToken;
240
245
  }
241
246
  return null;
@@ -246,7 +251,7 @@ export class NodeStorage extends CacheManager {
246
251
  * @param idToken - cache value to be set of type IdTokenEntity
247
252
  */
248
253
  setIdTokenCredential(idToken: IdTokenEntity): void {
249
- const idTokenKey = idToken.generateCredentialKey();
254
+ const idTokenKey = CacheHelpers.generateCredentialKey(idToken);
250
255
  this.setItem(idTokenKey, idToken);
251
256
  }
252
257
 
@@ -256,7 +261,7 @@ export class NodeStorage extends CacheManager {
256
261
  */
257
262
  getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null {
258
263
  const accessToken = this.getItem(accessTokenKey) as AccessTokenEntity;
259
- if (AccessTokenEntity.isAccessTokenEntity(accessToken)) {
264
+ if (CacheHelpers.isAccessTokenEntity(accessToken)) {
260
265
  return accessToken;
261
266
  }
262
267
  return null;
@@ -267,7 +272,7 @@ export class NodeStorage extends CacheManager {
267
272
  * @param accessToken - cache value to be set of type AccessTokenEntity
268
273
  */
269
274
  setAccessTokenCredential(accessToken: AccessTokenEntity): void {
270
- const accessTokenKey = accessToken.generateCredentialKey();
275
+ const accessTokenKey = CacheHelpers.generateCredentialKey(accessToken);
271
276
  this.setItem(accessTokenKey, accessToken);
272
277
  }
273
278
 
@@ -281,7 +286,7 @@ export class NodeStorage extends CacheManager {
281
286
  const refreshToken = this.getItem(
282
287
  refreshTokenKey
283
288
  ) as RefreshTokenEntity;
284
- if (RefreshTokenEntity.isRefreshTokenEntity(refreshToken)) {
289
+ if (CacheHelpers.isRefreshTokenEntity(refreshToken)) {
285
290
  return refreshToken as RefreshTokenEntity;
286
291
  }
287
292
  return null;
@@ -292,7 +297,8 @@ export class NodeStorage extends CacheManager {
292
297
  * @param refreshToken - cache value to be set of type RefreshTokenEntity
293
298
  */
294
299
  setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void {
295
- const refreshTokenKey = refreshToken.generateCredentialKey();
300
+ const refreshTokenKey =
301
+ CacheHelpers.generateCredentialKey(refreshToken);
296
302
  this.setItem(refreshTokenKey, refreshToken);
297
303
  }
298
304
 
@@ -510,7 +516,7 @@ export class NodeStorage extends CacheManager {
510
516
  currentCacheKey: string,
511
517
  credential: ValidCredentialType
512
518
  ): string {
513
- const updatedCacheKey = credential.generateCredentialKey();
519
+ const updatedCacheKey = CacheHelpers.generateCredentialKey(credential);
514
520
 
515
521
  if (currentCacheKey !== updatedCacheKey) {
516
522
  const cacheItem = this.getItem(currentCacheKey);
@@ -15,6 +15,8 @@ import {
15
15
  RefreshTokenEntity,
16
16
  AppMetadataEntity,
17
17
  CacheManager,
18
+ CredentialType,
19
+ AuthenticationScheme,
18
20
  } from "@azure/msal-common";
19
21
  import {
20
22
  JsonCache,
@@ -82,16 +84,15 @@ export class Deserializer {
82
84
  if (idTokens) {
83
85
  Object.keys(idTokens).map(function (key) {
84
86
  const serializedIdT = idTokens[key];
85
- const mappedIdT = {
87
+ const idToken: IdTokenEntity = {
86
88
  homeAccountId: serializedIdT.home_account_id,
87
89
  environment: serializedIdT.environment,
88
- credentialType: serializedIdT.credential_type,
90
+ credentialType:
91
+ serializedIdT.credential_type as CredentialType,
89
92
  clientId: serializedIdT.client_id,
90
93
  secret: serializedIdT.secret,
91
94
  realm: serializedIdT.realm,
92
95
  };
93
- const idToken: IdTokenEntity = new IdTokenEntity();
94
- CacheManager.toObject(idToken, mappedIdT);
95
96
  idObjects[key] = idToken;
96
97
  });
97
98
  }
@@ -109,10 +110,11 @@ export class Deserializer {
109
110
  if (accessTokens) {
110
111
  Object.keys(accessTokens).map(function (key) {
111
112
  const serializedAT = accessTokens[key];
112
- const mappedAT = {
113
+ const accessToken: AccessTokenEntity = {
113
114
  homeAccountId: serializedAT.home_account_id,
114
115
  environment: serializedAT.environment,
115
- credentialType: serializedAT.credential_type,
116
+ credentialType:
117
+ serializedAT.credential_type as CredentialType,
116
118
  clientId: serializedAT.client_id,
117
119
  secret: serializedAT.secret,
118
120
  realm: serializedAT.realm,
@@ -122,13 +124,11 @@ export class Deserializer {
122
124
  extendedExpiresOn: serializedAT.extended_expires_on,
123
125
  refreshOn: serializedAT.refresh_on,
124
126
  keyId: serializedAT.key_id,
125
- tokenType: serializedAT.token_type,
127
+ tokenType: serializedAT.token_type as AuthenticationScheme,
126
128
  requestedClaims: serializedAT.requestedClaims,
127
129
  requestedClaimsHash: serializedAT.requestedClaimsHash,
128
130
  userAssertionHash: serializedAT.userAssertionHash,
129
131
  };
130
- const accessToken: AccessTokenEntity = new AccessTokenEntity();
131
- CacheManager.toObject(accessToken, mappedAT);
132
132
  atObjects[key] = accessToken;
133
133
  });
134
134
  }
@@ -147,19 +147,17 @@ export class Deserializer {
147
147
  if (refreshTokens) {
148
148
  Object.keys(refreshTokens).map(function (key) {
149
149
  const serializedRT = refreshTokens[key];
150
- const mappedRT = {
150
+ const refreshToken: RefreshTokenEntity = {
151
151
  homeAccountId: serializedRT.home_account_id,
152
152
  environment: serializedRT.environment,
153
- credentialType: serializedRT.credential_type,
153
+ credentialType:
154
+ serializedRT.credential_type as CredentialType,
154
155
  clientId: serializedRT.client_id,
155
156
  secret: serializedRT.secret,
156
157
  familyId: serializedRT.family_id,
157
158
  target: serializedRT.target,
158
159
  realm: serializedRT.realm,
159
160
  };
160
- const refreshToken: RefreshTokenEntity =
161
- new RefreshTokenEntity();
162
- CacheManager.toObject(refreshToken, mappedRT);
163
161
  rtObjects[key] = refreshToken;
164
162
  });
165
163
  }
@@ -32,6 +32,7 @@ import {
32
32
  StringUtils,
33
33
  createClientAuthError,
34
34
  ClientAuthErrorCodes,
35
+ buildStaticAuthorityOptions,
35
36
  } from "@azure/msal-common";
36
37
  import {
37
38
  Configuration,
@@ -95,7 +96,8 @@ export abstract class ClientApplication {
95
96
  this.storage = new NodeStorage(
96
97
  this.logger,
97
98
  this.config.auth.clientId,
98
- this.cryptoProvider
99
+ this.cryptoProvider,
100
+ buildStaticAuthorityOptions(this.config.auth)
99
101
  );
100
102
  this.tokenCache = new TokenCache(
101
103
  this.storage,
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-node";
3
- export const version = "2.2.0";
3
+ export const version = "2.4.0";