@azure/msal-node 2.10.0 → 2.11.1

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 (109) hide show
  1. package/dist/cache/NodeStorage.cjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/TokenCache.cjs +1 -1
  4. package/dist/cache/TokenCache.mjs +1 -1
  5. package/dist/cache/distributed/DistributedCachePlugin.cjs +1 -1
  6. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  7. package/dist/cache/serializer/Deserializer.cjs +1 -1
  8. package/dist/cache/serializer/Deserializer.mjs +1 -1
  9. package/dist/cache/serializer/Serializer.cjs +1 -1
  10. package/dist/cache/serializer/Serializer.mjs +1 -1
  11. package/dist/client/ClientApplication.cjs +1 -1
  12. package/dist/client/ClientApplication.mjs +1 -1
  13. package/dist/client/ClientAssertion.cjs +31 -4
  14. package/dist/client/ClientAssertion.cjs.map +1 -1
  15. package/dist/client/ClientAssertion.d.ts +9 -0
  16. package/dist/client/ClientAssertion.d.ts.map +1 -1
  17. package/dist/client/ClientAssertion.mjs +31 -4
  18. package/dist/client/ClientAssertion.mjs.map +1 -1
  19. package/dist/client/ClientCredentialClient.cjs +1 -1
  20. package/dist/client/ClientCredentialClient.mjs +1 -1
  21. package/dist/client/ConfidentialClientApplication.cjs +18 -15
  22. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  23. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  24. package/dist/client/ConfidentialClientApplication.mjs +19 -16
  25. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  26. package/dist/client/DeviceCodeClient.cjs +1 -1
  27. package/dist/client/DeviceCodeClient.mjs +1 -1
  28. package/dist/client/ManagedIdentityApplication.cjs +1 -1
  29. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  30. package/dist/client/ManagedIdentityClient.cjs +1 -1
  31. package/dist/client/ManagedIdentityClient.mjs +1 -1
  32. package/dist/client/ManagedIdentitySources/AppService.cjs +1 -1
  33. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  34. package/dist/client/ManagedIdentitySources/AzureArc.cjs +1 -1
  35. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  36. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +1 -1
  37. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  38. package/dist/client/ManagedIdentitySources/CloudShell.cjs +1 -1
  39. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  40. package/dist/client/ManagedIdentitySources/Imds.cjs +1 -1
  41. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  42. package/dist/client/ManagedIdentitySources/ServiceFabric.cjs +1 -1
  43. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  44. package/dist/client/OnBehalfOfClient.cjs +1 -1
  45. package/dist/client/OnBehalfOfClient.mjs +1 -1
  46. package/dist/client/PublicClientApplication.cjs +1 -1
  47. package/dist/client/PublicClientApplication.mjs +1 -1
  48. package/dist/client/UsernamePasswordClient.cjs +1 -1
  49. package/dist/client/UsernamePasswordClient.mjs +1 -1
  50. package/dist/config/Configuration.cjs +9 -1
  51. package/dist/config/Configuration.cjs.map +1 -1
  52. package/dist/config/Configuration.d.ts +7 -2
  53. package/dist/config/Configuration.d.ts.map +1 -1
  54. package/dist/config/Configuration.mjs +9 -1
  55. package/dist/config/Configuration.mjs.map +1 -1
  56. package/dist/config/ManagedIdentityId.cjs +1 -1
  57. package/dist/config/ManagedIdentityId.mjs +1 -1
  58. package/dist/config/ManagedIdentityRequestParameters.cjs +1 -1
  59. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  60. package/dist/crypto/CryptoProvider.cjs +1 -1
  61. package/dist/crypto/CryptoProvider.mjs +1 -1
  62. package/dist/crypto/GuidGenerator.cjs +1 -1
  63. package/dist/crypto/GuidGenerator.mjs +1 -1
  64. package/dist/crypto/HashUtils.cjs +1 -1
  65. package/dist/crypto/HashUtils.mjs +1 -1
  66. package/dist/crypto/PkceGenerator.cjs +1 -1
  67. package/dist/crypto/PkceGenerator.mjs +1 -1
  68. package/dist/error/ManagedIdentityError.cjs +1 -1
  69. package/dist/error/ManagedIdentityError.mjs +1 -1
  70. package/dist/error/ManagedIdentityErrorCodes.cjs +1 -1
  71. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  72. package/dist/error/NodeAuthError.cjs +11 -1
  73. package/dist/error/NodeAuthError.cjs.map +1 -1
  74. package/dist/error/NodeAuthError.d.ts +8 -0
  75. package/dist/error/NodeAuthError.d.ts.map +1 -1
  76. package/dist/error/NodeAuthError.mjs +11 -1
  77. package/dist/error/NodeAuthError.mjs.map +1 -1
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.mjs +1 -1
  80. package/dist/internals.cjs +1 -1
  81. package/dist/internals.mjs +1 -1
  82. package/dist/network/HttpClient.cjs +1 -1
  83. package/dist/network/HttpClient.mjs +1 -1
  84. package/dist/network/HttpClientWithRetries.cjs +1 -1
  85. package/dist/network/HttpClientWithRetries.mjs +1 -1
  86. package/dist/network/LoopbackClient.cjs +1 -1
  87. package/dist/network/LoopbackClient.mjs +1 -1
  88. package/dist/packageMetadata.cjs +2 -2
  89. package/dist/packageMetadata.d.ts +1 -1
  90. package/dist/packageMetadata.mjs +2 -2
  91. package/dist/retry/LinearRetryPolicy.cjs +1 -1
  92. package/dist/retry/LinearRetryPolicy.mjs +1 -1
  93. package/dist/utils/Constants.cjs +3 -1
  94. package/dist/utils/Constants.cjs.map +1 -1
  95. package/dist/utils/Constants.d.ts +2 -0
  96. package/dist/utils/Constants.d.ts.map +1 -1
  97. package/dist/utils/Constants.mjs +3 -1
  98. package/dist/utils/Constants.mjs.map +1 -1
  99. package/dist/utils/EncodingUtils.cjs +1 -1
  100. package/dist/utils/EncodingUtils.mjs +1 -1
  101. package/dist/utils/NetworkUtils.cjs +1 -1
  102. package/dist/utils/NetworkUtils.mjs +1 -1
  103. package/package.json +2 -2
  104. package/src/client/ClientAssertion.ts +40 -3
  105. package/src/client/ConfidentialClientApplication.ts +24 -19
  106. package/src/config/Configuration.ts +18 -2
  107. package/src/error/NodeAuthError.ts +14 -0
  108. package/src/packageMetadata.ts +1 -1
  109. package/src/utils/Constants.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../src/utils/Constants.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,yBAAyB,EAAE,MAAwB,CAAC;AACjE,eAAO,MAAM,oBAAoB,EAAE,MAAmB,CAAC;AACvD,eAAO,MAAM,8BAA8B,EAAE,MAA4B,CAAC;AAC1E,eAAO,MAAM,iCAAiC,EAAE,MAAiB,CAAC;AAClE,eAAO,MAAM,gCAAgC,EAAE,MAAsB,CAAC;AACtE,eAAO,MAAM,qCAAqC,EAAE,MAAmB,CAAC;AACxE,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAC9E,eAAO,MAAM,+BAA+B,qBAAqB,CAAC;AAClE,eAAO,MAAM,sCAAsC,QAA0E,CAAC;AAE9H;;GAEG;AACH,eAAO,MAAM,uCAAuC;;;;;;;CAO1C,CAAC;AACX,MAAM,MAAM,uCAAuC,GAC/C,CAAC,OAAO,uCAAuC,CAAC,CAAC,MAAM,OAAO,uCAAuC,CAAC,CAAC;AAE3G;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;CAO7B,CAAC;AACX;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAC7B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,UAAU;;;CAGb,CAAC;AACX,MAAM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S;;;;;;CAOrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;;;;;;;CAOjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaxB,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;CAGrC,CAAC;AAEF,eAAO,MAAM,oCAAoC,OAAO,CAAC;AAEzD,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,8CAA8C,uCAO1D,CAAC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.10.0 2024-07-01 */
1
+ /*! @azure/msal-node v2.11.1 2024-07-16 */
2
2
  'use strict';
3
3
  import { HttpStatus } from '@azure/msal-common';
4
4
 
@@ -112,6 +112,8 @@ const ApiId = {
112
112
  const JwtConstants = {
113
113
  ALGORITHM: "alg",
114
114
  RSA_256: "RS256",
115
+ PSS_256: "PS256",
116
+ X5T_256: "x5t#S256",
115
117
  X5T: "x5t",
116
118
  X5C: "x5c",
117
119
  AUDIENCE: "aud",
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.mjs","sources":["../../src/utils/Constants.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;AACO,MAAM,yBAAyB,GAAW,gBAAgB;AAC1D,MAAM,oBAAoB,GAAW,WAAW;AAChD,MAAM,8BAA8B,GAAW,oBAAoB;AACnE,MAAM,iCAAiC,GAAW,SAAS;AAC3D,MAAM,gCAAgC,GAAW,cAAc;AAC/D,MAAM,qCAAqC,GAAW,WAAW;AACjE,MAAM,2BAA2B,GAAG,mCAAmC;AACvE,MAAM,+BAA+B,GAAG,mBAAmB;AACrD,MAAA,sCAAsC,GAAG,CAAqC,kCAAA,EAAA,+BAA+B,IAAI;AAE9H;;AAE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AAA,oCAAoC,GAAG,KAAK;AAElD,MAAM,4BAA4B,GAAG,EAAE;AACvC,MAAM,4BAA4B,GAAG,KAAK;AACpC,MAAA,8CAA8C,GAAG;AAC1D,IAAA,UAAU,CAAC,SAAS;AACpB,IAAA,UAAU,CAAC,eAAe;AAC1B,IAAA,UAAU,CAAC,iBAAiB;AAC5B,IAAA,UAAU,CAAC,YAAY;AACvB,IAAA,UAAU,CAAC,mBAAmB;AAC9B,IAAA,UAAU,CAAC,eAAe;;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.10.0 2024-07-01 */
1
+ /*! @azure/msal-node v2.11.1 2024-07-16 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.10.0 2024-07-01 */
1
+ /*! @azure/msal-node v2.11.1 2024-07-16 */
2
2
  'use strict';
3
3
  import { Constants } from '@azure/msal-common';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.10.0 2024-07-01 */
1
+ /*! @azure/msal-node v2.11.1 2024-07-16 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.10.0 2024-07-01 */
1
+ /*! @azure/msal-node v2.11.1 2024-07-16 */
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.10.0",
4
+ "version": "2.11.1",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "email": "nugetaad@microsoft.com",
@@ -79,7 +79,7 @@
79
79
  "yargs": "^17.3.1"
80
80
  },
81
81
  "dependencies": {
82
- "@azure/msal-common": "14.13.0",
82
+ "@azure/msal-common": "14.13.1",
83
83
  "jsonwebtoken": "^9.0.0",
84
84
  "uuid": "^8.3.0"
85
85
  },
@@ -22,6 +22,7 @@ export class ClientAssertion {
22
22
  private jwt: string;
23
23
  private privateKey: string;
24
24
  private thumbprint: string;
25
+ private useSha256: boolean;
25
26
  private expirationTime: number;
26
27
  private issuer: string;
27
28
  private jwtAudience: string;
@@ -38,6 +39,7 @@ export class ClientAssertion {
38
39
  }
39
40
 
40
41
  /**
42
+ * @deprecated Use fromCertificateWithSha256Thumbprint instead, with a SHA-256 thumprint
41
43
  * Initialize the ClientAssertion class from the certificate passed by the user
42
44
  * @param thumbprint - identifier of a certificate
43
45
  * @param privateKey - secret key
@@ -51,6 +53,29 @@ export class ClientAssertion {
51
53
  const clientAssertion = new ClientAssertion();
52
54
  clientAssertion.privateKey = privateKey;
53
55
  clientAssertion.thumbprint = thumbprint;
56
+ clientAssertion.useSha256 = false;
57
+ if (publicCertificate) {
58
+ clientAssertion.publicCertificate =
59
+ this.parseCertificate(publicCertificate);
60
+ }
61
+ return clientAssertion;
62
+ }
63
+
64
+ /**
65
+ * Initialize the ClientAssertion class from the certificate passed by the user
66
+ * @param thumbprint - identifier of a certificate
67
+ * @param privateKey - secret key
68
+ * @param publicCertificate - electronic document provided to prove the ownership of the public key
69
+ */
70
+ public static fromCertificateWithSha256Thumbprint(
71
+ thumbprint: string,
72
+ privateKey: string,
73
+ publicCertificate?: string
74
+ ): ClientAssertion {
75
+ const clientAssertion = new ClientAssertion();
76
+ clientAssertion.privateKey = privateKey;
77
+ clientAssertion.thumbprint = thumbprint;
78
+ clientAssertion.useSha256 = true;
54
79
  if (publicCertificate) {
55
80
  clientAssertion.publicCertificate =
56
81
  this.parseCertificate(publicCertificate);
@@ -107,14 +132,26 @@ export class ClientAssertion {
107
132
  const issuedAt = TimeUtils.nowSeconds();
108
133
  this.expirationTime = issuedAt + 600;
109
134
 
135
+ const algorithm = this.useSha256
136
+ ? JwtConstants.PSS_256
137
+ : JwtConstants.RSA_256;
110
138
  const header: jwt.JwtHeader = {
111
- alg: JwtConstants.RSA_256,
112
- x5t: EncodingUtils.base64EncodeUrl(this.thumbprint, "hex"),
139
+ alg: algorithm,
113
140
  };
114
141
 
142
+ const thumbprintHeader = this.useSha256
143
+ ? JwtConstants.X5T_256
144
+ : JwtConstants.X5T;
145
+ Object.assign(header, {
146
+ [thumbprintHeader]: EncodingUtils.base64EncodeUrl(
147
+ this.thumbprint,
148
+ "hex"
149
+ ),
150
+ } as Partial<jwt.JwtHeader>);
151
+
115
152
  if (this.publicCertificate) {
116
153
  Object.assign(header, {
117
- x5c: this.publicCertificate,
154
+ [JwtConstants.X5C]: this.publicCertificate,
118
155
  } as Partial<jwt.JwtHeader>);
119
156
  }
120
157
 
@@ -19,7 +19,6 @@ import {
19
19
  AuthenticationResult,
20
20
  AzureRegionConfiguration,
21
21
  AuthError,
22
- Constants,
23
22
  IAppTokenProvider,
24
23
  OIDC_DEFAULT_SCOPES,
25
24
  UrlString,
@@ -67,7 +66,7 @@ export class ConfidentialClientApplication
67
66
  */
68
67
  constructor(configuration: Configuration) {
69
68
  super(configuration);
70
- this.setClientCredential(this.config);
69
+ this.setClientCredential();
71
70
  this.appTokenProvider = undefined;
72
71
  }
73
72
 
@@ -218,15 +217,13 @@ export class ConfidentialClientApplication
218
217
  }
219
218
  }
220
219
 
221
- private setClientCredential(configuration: Configuration): void {
222
- const clientSecretNotEmpty = !!configuration.auth.clientSecret;
223
- const clientAssertionNotEmpty = !!configuration.auth.clientAssertion;
224
- const certificate = configuration.auth.clientCertificate || {
225
- thumbprint: Constants.EMPTY_STRING,
226
- privateKey: Constants.EMPTY_STRING,
227
- };
220
+ private setClientCredential(): void {
221
+ const clientSecretNotEmpty = !!this.config.auth.clientSecret;
222
+ const clientAssertionNotEmpty = !!this.config.auth.clientAssertion;
228
223
  const certificateNotEmpty =
229
- !!certificate.thumbprint || !!certificate.privateKey;
224
+ (!!this.config.auth.clientCertificate.thumbprint ||
225
+ !!this.config.auth.clientCertificate.thumbprintSha256) &&
226
+ !!this.config.auth.clientCertificate.privateKey;
230
227
 
231
228
  /*
232
229
  * If app developer configures this callback, they don't need a credential
@@ -247,14 +244,14 @@ export class ConfidentialClientApplication
247
244
  );
248
245
  }
249
246
 
250
- if (configuration.auth.clientSecret) {
251
- this.clientSecret = configuration.auth.clientSecret;
247
+ if (this.config.auth.clientSecret) {
248
+ this.clientSecret = this.config.auth.clientSecret;
252
249
  return;
253
250
  }
254
251
 
255
- if (configuration.auth.clientAssertion) {
252
+ if (this.config.auth.clientAssertion) {
256
253
  this.developerProvidedClientAssertion =
257
- configuration.auth.clientAssertion;
254
+ this.config.auth.clientAssertion;
258
255
  return;
259
256
  }
260
257
 
@@ -263,11 +260,19 @@ export class ConfidentialClientApplication
263
260
  ClientAuthErrorCodes.invalidClientCredential
264
261
  );
265
262
  } else {
266
- this.clientAssertion = ClientAssertion.fromCertificate(
267
- certificate.thumbprint,
268
- certificate.privateKey,
269
- configuration.auth.clientCertificate?.x5c
270
- );
263
+ this.clientAssertion = !!this.config.auth.clientCertificate
264
+ .thumbprintSha256
265
+ ? ClientAssertion.fromCertificateWithSha256Thumbprint(
266
+ this.config.auth.clientCertificate.thumbprintSha256,
267
+ this.config.auth.clientCertificate.privateKey,
268
+ this.config.auth.clientCertificate.x5c
269
+ )
270
+ : ClientAssertion.fromCertificate(
271
+ // guaranteed to be a string, due to prior error checking in this function
272
+ this.config.auth.clientCertificate.thumbprint as string,
273
+ this.config.auth.clientCertificate.privateKey,
274
+ this.config.auth.clientCertificate.x5c
275
+ );
271
276
  }
272
277
  }
273
278
  }
@@ -27,6 +27,7 @@ import {
27
27
  } from "../utils/Constants.js";
28
28
  import { LinearRetryPolicy } from "../retry/LinearRetryPolicy.js";
29
29
  import { HttpClientWithRetries } from "../network/HttpClientWithRetries.js";
30
+ import { NodeAuthError } from "../error/NodeAuthError.js";
30
31
 
31
32
  /**
32
33
  * - clientId - Client id of the application.
@@ -34,7 +35,7 @@ import { HttpClientWithRetries } from "../network/HttpClientWithRetries.js";
34
35
  * - knownAuthorities - Needed for Azure B2C and ADFS. All authorities that will be used in the client application. Only the host of the authority should be passed in.
35
36
  * - clientSecret - Secret string that the application uses when requesting a token. Only used in confidential client applications. Can be created in the Azure app registration portal.
36
37
  * - clientAssertion - A ClientAssertion object containing an assertion string or a callback function that returns an assertion string that the application uses when requesting a token, as well as the assertion's type (urn:ietf:params:oauth:client-assertion-type:jwt-bearer). Only used in confidential client applications.
37
- * - clientCertificate - Certificate that the application uses when requesting a token. Only used in confidential client applications. Requires hex encoded X.509 SHA-1 thumbprint of the certificiate, and the PEM encoded private key (string should contain -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- )
38
+ * - clientCertificate - Certificate that the application uses when requesting a token. Only used in confidential client applications. Requires hex encoded X.509 SHA-1 or SHA-256 thumbprint of the certificate, and the PEM encoded private key (string should contain -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- )
38
39
  * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
39
40
  * - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
40
41
  * @public
@@ -45,7 +46,12 @@ export type NodeAuthOptions = {
45
46
  clientSecret?: string;
46
47
  clientAssertion?: string | ClientAssertionCallback;
47
48
  clientCertificate?: {
48
- thumbprint: string;
49
+ /**
50
+ * @deprecated Use thumbprintSha2 property instead. Thumbprint needs to be computed with SHA-256 algorithm.
51
+ * SHA-1 is only needed for backwards compatibility with older versions of ADFS.
52
+ */
53
+ thumbprint?: string;
54
+ thumbprintSha256?: string;
49
55
  privateKey: string;
50
56
  x5c?: string;
51
57
  };
@@ -138,6 +144,7 @@ const DEFAULT_AUTH_OPTIONS: Required<NodeAuthOptions> = {
138
144
  clientAssertion: Constants.EMPTY_STRING,
139
145
  clientCertificate: {
140
146
  thumbprint: Constants.EMPTY_STRING,
147
+ thumbprintSha256: Constants.EMPTY_STRING,
141
148
  privateKey: Constants.EMPTY_STRING,
142
149
  x5c: Constants.EMPTY_STRING,
143
150
  },
@@ -217,6 +224,15 @@ export function buildAppConfiguration({
217
224
  disableInternalRetries: system?.disableInternalRetries || false,
218
225
  };
219
226
 
227
+ // if client certificate was provided, ensure that at least one of the SHA-1 or SHA-256 thumbprints were provided
228
+ if (
229
+ !!auth.clientCertificate &&
230
+ !!!auth.clientCertificate.thumbprint &&
231
+ !!!auth.clientCertificate.thumbprintSha256
232
+ ) {
233
+ throw NodeAuthError.createStateNotFoundError();
234
+ }
235
+
220
236
  return {
221
237
  auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
222
238
  broker: { ...broker },
@@ -37,6 +37,10 @@ export const NodeAuthErrorMessage = {
37
37
  code: "state_not_found",
38
38
  desc: "State not found. Please verify that the request originated from msal.",
39
39
  },
40
+ thumbprintMissing: {
41
+ code: "thumbprint_missing_from_client_certificate",
42
+ desc: "Client certificate does not contain a SHA-1 or SHA-256 thumbprint.",
43
+ },
40
44
  };
41
45
 
42
46
  export class NodeAuthError extends AuthError {
@@ -114,4 +118,14 @@ export class NodeAuthError extends AuthError {
114
118
  NodeAuthErrorMessage.stateNotFoundError.desc
115
119
  );
116
120
  }
121
+
122
+ /**
123
+ * Creates an error thrown when client certificate was provided, but neither the SHA-1 or SHA-256 thumbprints were provided
124
+ */
125
+ static createThumbprintMissingError(): NodeAuthError {
126
+ return new NodeAuthError(
127
+ NodeAuthErrorMessage.thumbprintMissing.code,
128
+ NodeAuthErrorMessage.thumbprintMissing.desc
129
+ );
130
+ }
117
131
  }
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-node";
3
- export const version = "2.10.0";
3
+ export const version = "2.11.1";
@@ -146,6 +146,8 @@ export type ApiId = (typeof ApiId)[keyof typeof ApiId];
146
146
  export const JwtConstants = {
147
147
  ALGORITHM: "alg",
148
148
  RSA_256: "RS256",
149
+ PSS_256: "PS256",
150
+ X5T_256: "x5t#S256",
149
151
  X5T: "x5t",
150
152
  X5C: "x5c",
151
153
  AUDIENCE: "aud",