@azure/identity 2.0.0 → 2.0.2-alpha.20211105.2

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.

Potentially problematic release.


This version of @azure/identity might be problematic. Click here for more details.

Files changed (33) hide show
  1. package/CHANGELOG.md +31 -9
  2. package/dist/index.js +121 -30
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/client/identityClient.js +1 -1
  5. package/dist-esm/src/client/identityClient.js.map +1 -1
  6. package/dist-esm/src/credentials/azureCliCredential.js +1 -1
  7. package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
  8. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +7 -2
  9. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
  10. package/dist-esm/src/credentials/managedIdentityCredential/index.js +2 -3
  11. package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
  12. package/dist-esm/src/credentials/managedIdentityCredential/utils.js +4 -1
  13. package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -1
  14. package/dist-esm/src/msal/browserFlows/msalAuthCode.js +2 -0
  15. package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
  16. package/dist-esm/src/msal/credentials.js.map +1 -1
  17. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js +4 -1
  18. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js.map +1 -1
  19. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js +2 -1
  20. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js.map +1 -1
  21. package/dist-esm/src/msal/nodeFlows/msalClientSecret.js +2 -1
  22. package/dist-esm/src/msal/nodeFlows/msalClientSecret.js.map +1 -1
  23. package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js +2 -1
  24. package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js.map +1 -1
  25. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js +1 -0
  26. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js.map +1 -1
  27. package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js +2 -0
  28. package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js.map +1 -1
  29. package/dist-esm/src/msal/nodeFlows/msalUsernamePassword.js +2 -1
  30. package/dist-esm/src/msal/nodeFlows/msalUsernamePassword.js.map +1 -1
  31. package/dist-esm/src/msal/nodeFlows/nodeCommon.js +3 -2
  32. package/dist-esm/src/msal/nodeFlows/nodeCommon.js.map +1 -1
  33. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Release History
2
2
 
3
+ ## 2.0.2 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ - Challenge claims now are properly being passed through to the outgoing token requests.
12
+
13
+ ### Other Changes
14
+
15
+ ## 2.0.1 (2021-10-28)
16
+
17
+ ### Features Added
18
+
19
+ - The `ManagedIdentityCredential` now supports the Service Fabric environment.
20
+
21
+ ### Bugs Fixed
22
+
23
+ - Fixed a bug that caused the `AzureCliCredential` to fail on Windows. Issue [18268](https://github.com/Azure/azure-sdk-for-js/issues/18268).
24
+
3
25
  ## 2.0.0 (2021-10-15)
4
26
 
5
27
  After multiple beta releases over the past year, we're proud to announce the general availability of version 2 of the `@azure/identity` package. This version includes the best parts of v1, plus several improvements.
@@ -156,6 +178,15 @@ Identity v2 for JavaScript now also depends on the latest available versions of
156
178
 
157
179
  - The errors thrown by the `ManagedIdentityCredential` have been improved.
158
180
 
181
+ ## 1.5.2 (2021-09-01)
182
+
183
+ - Fixed a bug introduced on 1.5.0 that caused the `ManagedIdentityCredential` to fail authenticating in Arc environments. Since our new core disables unsafe requests by default, we had to change the security settings for the first request of the Arc MSI, which retrieves the file path where the authentication value is stored since this request generally happens through an HTTP endpoint.
184
+
185
+ ## 1.5.1 (2021-08-12)
186
+
187
+ - Fixed how we verify the IMDS endpoint is available. Now, besides skipping the `Metadata` header, we skip the URL query. Both will ensure that all the known IMDS endpoints return as early as possible.
188
+ - Added support for the `AZURE_POD_IDENTITY_AUTHORITY_HOST` environment variable. If present, the IMDS endpoint initial verification will be skipped.
189
+
159
190
  ## 2.0.0-beta.5 (2021-08-10)
160
191
 
161
192
  ### Features Added
@@ -175,15 +206,6 @@ Identity v2 for JavaScript now also depends on the latest available versions of
175
206
 
176
207
  - With this release, we've migrated from using `@azure/core-http` to `@azure/core-rest-pipeline` for the handling of HTTP requests. See [Azure Core v1 vs v2](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/documentation/core2.md) for more on the difference and benefits of the move. This removes our dependency on `node-fetch` and along with it issues we have seen in using this dependency in specific environments like Kubernetes pods.
177
208
 
178
- ## 1.5.2 (2021-09-01)
179
-
180
- - Fixed a bug introduced on 1.5.0 that caused the `ManagedIdentityCredential` to fail authenticating in Arc environments. Since our new core disables unsafe requests by default, we had to change the security settings for the first request of the Arc MSI, which retrieves the file path where the authentication value is stored since this request generally happens through an HTTP endpoint.
181
-
182
- ## 1.5.1 (2021-08-12)
183
-
184
- - Fixed how we verify the IMDS endpoint is available. Now, besides skipping the `Metadata` header, we skip the URL query. Both will ensure that all the known IMDS endpoints return as early as possible.
185
- - Added support for the `AZURE_POD_IDENTITY_AUTHORITY_HOST` environment variable. If present, the IMDS endpoint initial verification will be skipped.
186
-
187
209
  ## 1.5.0 (2021-07-19)
188
210
 
189
211
  - With this release, we've migrated from using `@azure/core-http` to `@azure/core-rest-pipeline` for the handling of HTTP requests. See [Azure Core v1 vs v2](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/documentation/core2.md) for more on the difference and benefits of the move. This removes our dependency on `node-fetch` and along with it issues we have seen in using this dependency in specific environments like Kubernetes pods.
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ var coreTracing = require('@azure/core-tracing');
10
10
  var coreUtil = require('@azure/core-util');
11
11
  var coreRestPipeline = require('@azure/core-rest-pipeline');
12
12
  var abortController = require('@azure/abort-controller');
13
- var logger$j = require('@azure/logger');
13
+ var logger$k = require('@azure/logger');
14
14
  var msalCommon = require('@azure/msal-common');
15
15
  var uuid = require('uuid');
16
16
  var fs = require('fs');
@@ -21,6 +21,7 @@ var child_process = require('child_process');
21
21
  var child_process__default = _interopDefault(child_process);
22
22
  var crypto = require('crypto');
23
23
  var util = require('util');
24
+ var https = _interopDefault(require('https'));
24
25
  var http = _interopDefault(require('http'));
25
26
  var open = _interopDefault(require('open'));
26
27
  var stoppable = _interopDefault(require('stoppable'));
@@ -240,7 +241,7 @@ async function trace(operationName, options, fn, createSpanFn = createSpan) {
240
241
  /**
241
242
  * The AzureLogger used for all clients within the identity package
242
243
  */
243
- const logger = logger$j.createClientLogger("identity");
244
+ const logger = logger$k.createClientLogger("identity");
244
245
  /**
245
246
  * Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.
246
247
  * @param supportedEnvVars - List of environment variable names
@@ -331,7 +332,7 @@ function getIdentityClientAuthorityHost(options) {
331
332
  class IdentityClient extends coreClient.ServiceClient {
332
333
  constructor(options) {
333
334
  var _a;
334
- const packageDetails = `azsdk-js-identity/2.0.0`;
335
+ const packageDetails = `azsdk-js-identity/2.0.2`;
335
336
  const userAgentPrefix = ((_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix)
336
337
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
337
338
  : `${packageDetails}`;
@@ -937,7 +938,7 @@ class MsalNode extends MsalBaseUtilities {
937
938
  this.authorityHost = options.authorityHost || process.env.AZURE_AUTHORITY_HOST;
938
939
  const authority = getAuthority(tenantId, this.authorityHost);
939
940
  this.identityClient = new IdentityClient(Object.assign(Object.assign({}, options.tokenCredentialOptions), { authorityHost: authority }));
940
- let clientCapabilities = ["CP1"];
941
+ let clientCapabilities = ["cp1"];
941
942
  if (process.env.AZURE_IDENTITY_DISABLE_CP1) {
942
943
  clientCapabilities = [];
943
944
  }
@@ -1051,7 +1052,8 @@ To work with multiple accounts for the same Client ID and Tenant ID, please prov
1051
1052
  account: publicToMsal(this.account),
1052
1053
  correlationId: options === null || options === void 0 ? void 0 : options.correlationId,
1053
1054
  scopes,
1054
- authority: options === null || options === void 0 ? void 0 : options.authority
1055
+ authority: options === null || options === void 0 ? void 0 : options.authority,
1056
+ claims: options === null || options === void 0 ? void 0 : options.claims
1055
1057
  };
1056
1058
  try {
1057
1059
  this.logger.info("Attempting to acquire token silently");
@@ -1447,7 +1449,7 @@ const cliCredentialInternals = {
1447
1449
  "--resource",
1448
1450
  resource,
1449
1451
  ...tenantSection
1450
- ], { cwd: cliCredentialInternals.getSafeWorkingDir() }, (error, stdout, stderr) => {
1452
+ ], { cwd: cliCredentialInternals.getSafeWorkingDir(), shell: true }, (error, stdout, stderr) => {
1451
1453
  resolve({ stdout: stdout, stderr: stderr, error });
1452
1454
  });
1453
1455
  }
@@ -1749,7 +1751,8 @@ class MsalClientSecret extends MsalNode {
1749
1751
  scopes,
1750
1752
  correlationId: options.correlationId,
1751
1753
  azureRegion: this.azureRegion,
1752
- authority: options.authority
1754
+ authority: options.authority,
1755
+ claims: options.claims
1753
1756
  });
1754
1757
  // The Client Credential flow does not return an account,
1755
1758
  // so each time getToken gets called, we will have to acquire a new token through the service.
@@ -1876,7 +1879,8 @@ class MsalClientCertificate extends MsalNode {
1876
1879
  scopes,
1877
1880
  correlationId: options.correlationId,
1878
1881
  azureRegion: this.azureRegion,
1879
- authority: options.authority
1882
+ authority: options.authority,
1883
+ claims: options.claims
1880
1884
  });
1881
1885
  // Even though we're providing the same default in memory persistence cache that we use for DeviceCodeCredential,
1882
1886
  // The Client Credential flow does not return the account information from the authentication service,
@@ -1955,7 +1959,8 @@ class MsalUsernamePassword extends MsalNode {
1955
1959
  username: this.username,
1956
1960
  password: this.password,
1957
1961
  correlationId: options === null || options === void 0 ? void 0 : options.correlationId,
1958
- authority: options === null || options === void 0 ? void 0 : options.authority
1962
+ authority: options === null || options === void 0 ? void 0 : options.authority,
1963
+ claims: options === null || options === void 0 ? void 0 : options.claims
1959
1964
  };
1960
1965
  const result = await this.publicApp.acquireTokenByUsernamePassword(requestOptions);
1961
1966
  return this.handleResult(scopes, this.clientId, result || undefined);
@@ -2123,6 +2128,7 @@ const imdsHost = "http://169.254.169.254";
2123
2128
  const imdsEndpointPath = "/metadata/identity/oauth2/token";
2124
2129
  const imdsApiVersion = "2018-02-01";
2125
2130
  const azureArcAPIVersion = "2019-11-01";
2131
+ const azureFabricVersion = "2019-07-01-preview";
2126
2132
 
2127
2133
  // Copyright (c) Microsoft Corporation.
2128
2134
  /**
@@ -2149,8 +2155,11 @@ function mapScopesToResource(scopes) {
2149
2155
  }
2150
2156
  return scope.substr(0, scope.lastIndexOf(DefaultScopeSuffix));
2151
2157
  }
2152
- async function msiGenericGetToken(identityClient, requestOptions, expiresInParser, getTokenOptions = {}) {
2158
+ async function msiGenericGetToken(identityClient, requestOptions, expiresInParser, getTokenOptions = {}, agent) {
2153
2159
  const request = coreRestPipeline.createPipelineRequest(Object.assign(Object.assign({ abortSignal: getTokenOptions.abortSignal }, requestOptions), { allowInsecureConnection: true }));
2160
+ if (agent) {
2161
+ request.agent = agent;
2162
+ }
2154
2163
  const tokenResponse = await identityClient.sendTokenRequest(request, expiresInParser);
2155
2164
  return (tokenResponse && tokenResponse.accessToken) || null;
2156
2165
  }
@@ -2573,7 +2582,84 @@ function tokenExchangeMsi() {
2573
2582
  }
2574
2583
 
2575
2584
  // Copyright (c) Microsoft Corporation.
2576
- const logger$e = credentialLogger("ManagedIdentityCredential");
2585
+ const msiName$5 = "ManagedIdentityCredential - Fabric MSI";
2586
+ const logger$e = credentialLogger(msiName$5);
2587
+ function expiresInParser$5(requestBody) {
2588
+ // Parses a string representation of the seconds since epoch into a number value
2589
+ return Number(requestBody.expires_on);
2590
+ }
2591
+ function prepareRequestOptions$5(scopes, clientId) {
2592
+ const resource = mapScopesToResource(scopes);
2593
+ if (!resource) {
2594
+ throw new Error(`${msiName$5}: Multiple scopes are not supported.`);
2595
+ }
2596
+ const queryParameters = {
2597
+ resource,
2598
+ "api-version": azureFabricVersion
2599
+ };
2600
+ if (clientId) {
2601
+ queryParameters.client_id = clientId;
2602
+ }
2603
+ const query = new URLSearchParams(queryParameters);
2604
+ // This error should not bubble up, since we verify that this environment variable is defined in the isAvailable() method defined below.
2605
+ if (!process.env.IDENTITY_ENDPOINT) {
2606
+ throw new Error("Missing environment variable: IDENTITY_ENDPOINT");
2607
+ }
2608
+ if (!process.env.IDENTITY_HEADER) {
2609
+ throw new Error("Missing environment variable: IDENTITY_HEADER");
2610
+ }
2611
+ return {
2612
+ url: `${process.env.IDENTITY_ENDPOINT}?${query.toString()}`,
2613
+ method: "GET",
2614
+ headers: coreRestPipeline.createHttpHeaders({
2615
+ Accept: "application/json",
2616
+ Secret: process.env.IDENTITY_HEADER
2617
+ })
2618
+ };
2619
+ }
2620
+ // This credential can be easily tested by deploying a container to Azure Service Fabric with the Dockerfile:
2621
+ //
2622
+ // FROM node:12
2623
+ // RUN wget https://host.any/path/bash.sh
2624
+ // CMD ["bash", "bash.sh"]
2625
+ //
2626
+ // Where the bash script contains:
2627
+ //
2628
+ // curl --insecure $IDENTITY_ENDPOINT'?api-version=2019-07-01-preview&resource=https://vault.azure.net/' -H "Secret: $IDENTITY_HEADER"
2629
+ //
2630
+ const fabricMsi = {
2631
+ async isAvailable(scopes) {
2632
+ const resource = mapScopesToResource(scopes);
2633
+ if (!resource) {
2634
+ logger$e.info(`${msiName$5}: Unavailable. Multiple scopes are not supported.`);
2635
+ return false;
2636
+ }
2637
+ const env = process.env;
2638
+ const result = Boolean(env.IDENTITY_ENDPOINT && env.IDENTITY_HEADER && env.IDENTITY_SERVER_THUMBPRINT);
2639
+ if (!result) {
2640
+ logger$e.info(`${msiName$5}: Unavailable. The environment variables needed are: IDENTITY_ENDPOINT, IDENTITY_HEADER and IDENTITY_SERVER_THUMBPRINT`);
2641
+ }
2642
+ return result;
2643
+ },
2644
+ async getToken(configuration, getTokenOptions = {}) {
2645
+ const { scopes, identityClient, clientId } = configuration;
2646
+ logger$e.info([
2647
+ `${msiName$5}:`,
2648
+ "Using the endpoint and the secret coming from the environment variables:",
2649
+ `IDENTITY_ENDPOINT=${process.env.IDENTITY_ENDPOINT},`,
2650
+ "IDENTITY_HEADER=[REDACTED] and",
2651
+ "IDENTITY_SERVER_THUMBPRINT=[REDACTED]."
2652
+ ].join(" "));
2653
+ return msiGenericGetToken(identityClient, prepareRequestOptions$5(scopes, clientId), expiresInParser$5, getTokenOptions, new https.Agent({
2654
+ // This is necessary because Service Fabric provides a self-signed certificate.
2655
+ // The alternative path is to verify the certificate using the IDENTITY_SERVER_THUMBPRINT env variable.
2656
+ rejectUnauthorized: false
2657
+ }));
2658
+ }
2659
+ };
2660
+
2661
+ // Copyright (c) Microsoft Corporation.
2662
+ const logger$f = credentialLogger("ManagedIdentityCredential");
2577
2663
  /**
2578
2664
  * Attempts authentication using a managed identity that has been assigned
2579
2665
  * to the deployment environment. This authentication type works in Azure VMs,
@@ -2604,9 +2690,7 @@ class ManagedIdentityCredential {
2604
2690
  if (this.cachedMSI) {
2605
2691
  return this.cachedMSI;
2606
2692
  }
2607
- // "fabricMsi" can't be added yet because our HTTPs pipeline doesn't allow skipping the SSL verification step,
2608
- // which is necessary since Service Fabric only provides self-signed certificates on their Identity Endpoint.
2609
- const MSIs = [appServiceMsi2017, cloudShellMsi, arcMsi, tokenExchangeMsi(), imdsMsi];
2693
+ const MSIs = [fabricMsi, appServiceMsi2017, cloudShellMsi, arcMsi, tokenExchangeMsi(), imdsMsi];
2610
2694
  for (const msi of MSIs) {
2611
2695
  if (await msi.isAvailable(scopes, this.identityClient, clientId, getTokenOptions)) {
2612
2696
  this.cachedMSI = msi;
@@ -2663,7 +2747,7 @@ class ManagedIdentityCredential {
2663
2747
  // It also means that the endpoint answered with either 200 or 201 (see the sendTokenRequest method),
2664
2748
  // yet we had no access token. For this reason, we'll throw once with a specific message:
2665
2749
  const error = new CredentialUnavailableError("The managed identity endpoint was reached, yet no tokens were received.");
2666
- logger$e.getToken.info(formatError(scopes, error));
2750
+ logger$f.getToken.info(formatError(scopes, error));
2667
2751
  throw error;
2668
2752
  }
2669
2753
  // Since `authenticateManagedIdentity` didn't throw, and the result was not null,
@@ -2675,10 +2759,10 @@ class ManagedIdentityCredential {
2675
2759
  // We've previously determined that the endpoint was unavailable,
2676
2760
  // either because it was unreachable or permanently unable to authenticate.
2677
2761
  const error = new CredentialUnavailableError("The managed identity endpoint is not currently available");
2678
- logger$e.getToken.info(formatError(scopes, error));
2762
+ logger$f.getToken.info(formatError(scopes, error));
2679
2763
  throw error;
2680
2764
  }
2681
- logger$e.getToken.info(formatSuccess(scopes));
2765
+ logger$f.getToken.info(formatSuccess(scopes));
2682
2766
  return result;
2683
2767
  }
2684
2768
  catch (err) {
@@ -2700,14 +2784,14 @@ class ManagedIdentityCredential {
2700
2784
  // we can safely assume the credential is unavailable.
2701
2785
  if (err.code === "ENETUNREACH") {
2702
2786
  const error = new CredentialUnavailableError(`ManagedIdentityCredential is unavailable. Network unreachable. Message: ${err.message}`);
2703
- logger$e.getToken.info(formatError(scopes, error));
2787
+ logger$f.getToken.info(formatError(scopes, error));
2704
2788
  throw error;
2705
2789
  }
2706
2790
  // If either the host was unreachable,
2707
2791
  // we can safely assume the credential is unavailable.
2708
2792
  if (err.code === "EHOSTUNREACH") {
2709
2793
  const error = new CredentialUnavailableError(`ManagedIdentityCredential is unavailable. No managed identity endpoint found. Message: ${err.message}`);
2710
- logger$e.getToken.info(formatError(scopes, error));
2794
+ logger$f.getToken.info(formatError(scopes, error));
2711
2795
  throw error;
2712
2796
  }
2713
2797
  // If err.statusCode has a value of 400, it comes from sendTokenRequest,
@@ -2922,8 +3006,10 @@ class MsalOpenBrowser extends MsalNode {
2922
3006
  this.pkceCodes = await cryptoProvider.generatePkceCodes();
2923
3007
  const authCodeUrlParameters = {
2924
3008
  scopes: scopeArray,
3009
+ correlationId: options === null || options === void 0 ? void 0 : options.correlationId,
2925
3010
  redirectUri: this.redirectUri,
2926
3011
  authority: options === null || options === void 0 ? void 0 : options.authority,
3012
+ claims: options === null || options === void 0 ? void 0 : options.claims,
2927
3013
  loginHint: this.loginHint,
2928
3014
  codeChallenge: this.pkceCodes.challenge,
2929
3015
  codeChallengeMethod: "S256" // Use SHA256 Algorithm
@@ -2939,7 +3025,7 @@ class MsalOpenBrowser extends MsalNode {
2939
3025
  }
2940
3026
 
2941
3027
  // Copyright (c) Microsoft Corporation.
2942
- const logger$f = credentialLogger("InteractiveBrowserCredential");
3028
+ const logger$g = credentialLogger("InteractiveBrowserCredential");
2943
3029
  /**
2944
3030
  * Enables authentication to Azure Active Directory inside of the web browser
2945
3031
  * using the interactive login flow.
@@ -2961,7 +3047,7 @@ class InteractiveBrowserCredential {
2961
3047
  const redirectUri = typeof options.redirectUri === "function"
2962
3048
  ? options.redirectUri()
2963
3049
  : options.redirectUri || "http://localhost";
2964
- this.msalFlow = new MsalOpenBrowser(Object.assign(Object.assign({}, options), { tokenCredentialOptions: options, logger: logger$f,
3050
+ this.msalFlow = new MsalOpenBrowser(Object.assign(Object.assign({}, options), { tokenCredentialOptions: options, logger: logger$g,
2965
3051
  redirectUri }));
2966
3052
  this.disableAutomaticAuthentication = options === null || options === void 0 ? void 0 : options.disableAutomaticAuthentication;
2967
3053
  }
@@ -3022,7 +3108,8 @@ class MsalDeviceCode extends MsalNode {
3022
3108
  scopes,
3023
3109
  cancel: false,
3024
3110
  correlationId: options === null || options === void 0 ? void 0 : options.correlationId,
3025
- authority: options === null || options === void 0 ? void 0 : options.authority
3111
+ authority: options === null || options === void 0 ? void 0 : options.authority,
3112
+ claims: options === null || options === void 0 ? void 0 : options.claims
3026
3113
  };
3027
3114
  const promise = this.publicApp.acquireTokenByDeviceCode(requestOptions);
3028
3115
  // TODO:
@@ -3039,7 +3126,7 @@ class MsalDeviceCode extends MsalNode {
3039
3126
  }
3040
3127
 
3041
3128
  // Copyright (c) Microsoft Corporation.
3042
- const logger$g = credentialLogger("DeviceCodeCredential");
3129
+ const logger$h = credentialLogger("DeviceCodeCredential");
3043
3130
  /**
3044
3131
  * Method that logs the user code from the DeviceCodeCredential.
3045
3132
  * @param deviceCodeInfo - The device code.
@@ -3073,7 +3160,7 @@ class DeviceCodeCredential {
3073
3160
  * @param options - Options for configuring the client which makes the authentication requests.
3074
3161
  */
3075
3162
  constructor(options) {
3076
- this.msalFlow = new MsalDeviceCode(Object.assign(Object.assign({}, options), { logger: logger$g, userPromptCallback: (options === null || options === void 0 ? void 0 : options.userPromptCallback) || defaultDeviceCodePromptCallback, tokenCredentialOptions: options || {} }));
3163
+ this.msalFlow = new MsalDeviceCode(Object.assign(Object.assign({}, options), { logger: logger$h, userPromptCallback: (options === null || options === void 0 ? void 0 : options.userPromptCallback) || defaultDeviceCodePromptCallback, tokenCredentialOptions: options || {} }));
3077
3164
  this.disableAutomaticAuthentication = options === null || options === void 0 ? void 0 : options.disableAutomaticAuthentication;
3078
3165
  }
3079
3166
  /**
@@ -3139,7 +3226,10 @@ class MsalAuthorizationCode extends MsalNode {
3139
3226
  const result = await ((_a = this.confidentialApp) === null || _a === void 0 ? void 0 : _a.acquireTokenByCode({
3140
3227
  scopes,
3141
3228
  redirectUri: this.redirectUri,
3142
- code: this.authorizationCode
3229
+ code: this.authorizationCode,
3230
+ correlationId: options === null || options === void 0 ? void 0 : options.correlationId,
3231
+ authority: options === null || options === void 0 ? void 0 : options.authority,
3232
+ claims: options === null || options === void 0 ? void 0 : options.claims
3143
3233
  }));
3144
3234
  // The Client Credential flow does not return an account,
3145
3235
  // so each time getToken gets called, we will have to acquire a new token through the service.
@@ -3152,7 +3242,7 @@ class MsalAuthorizationCode extends MsalNode {
3152
3242
  }
3153
3243
 
3154
3244
  // Copyright (c) Microsoft Corporation.
3155
- const logger$h = credentialLogger("AuthorizationCodeCredential");
3245
+ const logger$i = credentialLogger("AuthorizationCodeCredential");
3156
3246
  /**
3157
3247
  * Enables authentication to Azure Active Directory using an authorization code
3158
3248
  * that was obtained through the authorization code flow, described in more detail
@@ -3166,7 +3256,7 @@ class AuthorizationCodeCredential {
3166
3256
  * @internal
3167
3257
  */
3168
3258
  constructor(tenantId, clientId, clientSecretOrAuthorizationCode, authorizationCodeOrRedirectUri, redirectUriOrOptions, options) {
3169
- checkTenantId(logger$h, tenantId);
3259
+ checkTenantId(logger$i, tenantId);
3170
3260
  let clientSecret = clientSecretOrAuthorizationCode;
3171
3261
  if (typeof redirectUriOrOptions === "string") {
3172
3262
  // the clientId+clientSecret constructor
@@ -3182,7 +3272,7 @@ class AuthorizationCodeCredential {
3182
3272
  options = redirectUriOrOptions;
3183
3273
  }
3184
3274
  this.msalFlow = new MsalAuthorizationCode(Object.assign(Object.assign({}, options), { clientSecret,
3185
- clientId, tokenCredentialOptions: options || {}, logger: logger$h, redirectUri: this.redirectUri, authorizationCode: this.authorizationCode }));
3275
+ clientId, tokenCredentialOptions: options || {}, logger: logger$i, redirectUri: this.redirectUri, authorizationCode: this.authorizationCode }));
3186
3276
  }
3187
3277
  /**
3188
3278
  * Authenticates with Azure Active Directory and returns an access token if successful.
@@ -3242,6 +3332,7 @@ class MsalOnBehalfOf extends MsalNode {
3242
3332
  scopes,
3243
3333
  correlationId: options.correlationId,
3244
3334
  authority: options.authority,
3335
+ claims: options.claims,
3245
3336
  oboAssertion: this.userAssertionToken
3246
3337
  });
3247
3338
  return this.handleResult(scopes, this.clientId, result || undefined);
@@ -3254,7 +3345,7 @@ class MsalOnBehalfOf extends MsalNode {
3254
3345
 
3255
3346
  // Copyright (c) Microsoft Corporation.
3256
3347
  const credentialName$1 = "OnBehalfOfCredential";
3257
- const logger$i = credentialLogger(credentialName$1);
3348
+ const logger$j = credentialLogger(credentialName$1);
3258
3349
  /**
3259
3350
  * Enables authentication to Azure Active Directory using the [On Behalf Of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
3260
3351
  */
@@ -3288,7 +3379,7 @@ class OnBehalfOfCredential {
3288
3379
  if (!tenantId || !clientId || !(clientSecret || certificatePath) || !userAssertionToken) {
3289
3380
  throw new Error(`${credentialName$1}: tenantId, clientId, clientSecret (or certificatePath) and userAssertionToken are required parameters.`);
3290
3381
  }
3291
- this.msalFlow = new MsalOnBehalfOf(Object.assign(Object.assign({}, this.options), { logger: logger$i, tokenCredentialOptions: this.options }));
3382
+ this.msalFlow = new MsalOnBehalfOf(Object.assign(Object.assign({}, this.options), { logger: logger$j, tokenCredentialOptions: this.options }));
3292
3383
  }
3293
3384
  /**
3294
3385
  * Authenticates with Azure Active Directory and returns an access token if successful.