@azure/msal-node 1.9.1 → 1.10.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.
@@ -1752,7 +1752,7 @@ class TokenCache {
1752
1752
 
1753
1753
  /* eslint-disable header/header */
1754
1754
  const name = "@azure/msal-node";
1755
- const version = "1.9.1";
1755
+ const version = "1.10.0";
1756
1756
 
1757
1757
  /*
1758
1758
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2320,9 +2320,20 @@ class ConfidentialClientApplication extends ClientApplication {
2320
2320
 
2321
2321
 
2322
2322
  async acquireTokenByClientCredential(request) {
2323
- this.logger.info("acquireTokenByClientCredential called", request.correlationId);
2323
+ this.logger.info("acquireTokenByClientCredential called", request.correlationId); // If there is a client assertion present in the request, it overrides the one present in the client configuration
2324
+
2325
+ let clientAssertion;
2326
+
2327
+ if (request.clientAssertion) {
2328
+ clientAssertion = {
2329
+ assertion: request.clientAssertion,
2330
+ assertionType: Constants.JWT_BEARER_ASSERTION_TYPE
2331
+ };
2332
+ }
2333
+
2324
2334
  const validRequest = { ...request,
2325
- ...(await this.initializeBaseRequest(request))
2335
+ ...(await this.initializeBaseRequest(request)),
2336
+ clientAssertion
2326
2337
  };
2327
2338
  const azureRegionConfiguration = {
2328
2339
  azureRegion: validRequest.azureRegion,
@@ -2364,8 +2375,8 @@ class ConfidentialClientApplication extends ClientApplication {
2364
2375
  };
2365
2376
 
2366
2377
  try {
2367
- const clientCredentialConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
2368
- const oboClient = new OnBehalfOfClient(clientCredentialConfig);
2378
+ const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
2379
+ const oboClient = new OnBehalfOfClient(onBehalfOfConfig);
2369
2380
  this.logger.verbose("On behalf of client created", validRequest.correlationId);
2370
2381
  return oboClient.acquireToken(validRequest);
2371
2382
  } catch (e) {