@azure/identity 2.0.2-alpha.20211203.1 → 2.0.2-alpha.20211217.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.

Potentially problematic release.


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

package/CHANGELOG.md CHANGED
@@ -11,6 +11,7 @@
11
11
  ### Bugs Fixed
12
12
 
13
13
  - Challenge claims now are properly being passed through to the outgoing token requests.
14
+ - The `ManagedIdentityCredential` now properly parses expiration dates from token exchange requests.
14
15
 
15
16
  ### Other Changes
16
17
 
package/README.md CHANGED
@@ -10,7 +10,7 @@ Key links:
10
10
  - [Package (npm)](https://www.npmjs.com/package/@azure/identity)
11
11
  - [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/identity)
12
12
  - [Product documentation](https://azure.microsoft.com/services/active-directory/)
13
- - [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples)
13
+ - [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/v2)
14
14
 
15
15
  ## Getting started
16
16
 
package/dist/index.js CHANGED
@@ -1253,13 +1253,13 @@ class VisualStudioCodeCredential {
1253
1253
  return tokenResponse.accessToken;
1254
1254
  }
1255
1255
  else {
1256
- const error = new CredentialUnavailableError("Could not retrieve the token associated with Visual Studio Code. Have you connected using the 'Azure Account' extension recently? To troubleshoot, visit https://aka.ms/azsdk/js/identity/visualstudiocodecredential/troubleshoot.");
1256
+ const error = new CredentialUnavailableError("Could not retrieve the token associated with Visual Studio Code. Have you connected using the 'Azure Account' extension recently? To troubleshoot, visit https://aka.ms/azsdk/js/identity/vscodecredential/troubleshoot.");
1257
1257
  logger$1.getToken.info(formatError(scopes, error));
1258
1258
  throw error;
1259
1259
  }
1260
1260
  }
1261
1261
  else {
1262
- const error = new CredentialUnavailableError("Could not retrieve the token associated with Visual Studio Code. Did you connect using the 'Azure Account' extension? To troubleshoot, visit https://aka.ms/azsdk/js/identity/visualstudiocodecredential/troubleshoot.");
1262
+ const error = new CredentialUnavailableError("Could not retrieve the token associated with Visual Studio Code. Did you connect using the 'Azure Account' extension? To troubleshoot, visit https://aka.ms/azsdk/js/identity/vscodecredential/troubleshoot.");
1263
1263
  logger$1.getToken.info(formatError(scopes, error));
1264
1264
  throw error;
1265
1265
  }
@@ -2549,13 +2549,6 @@ const arcMsi = {
2549
2549
  const msiName$4 = "ManagedIdentityCredential - Token Exchange";
2550
2550
  const logger$d = credentialLogger(msiName$4);
2551
2551
  const readFileAsync$2 = util.promisify(fs__default.readFile);
2552
- /**
2553
- * Formats the expiration date of the received token into the number of milliseconds between that date and midnight, January 1, 1970.
2554
- */
2555
- function expiresOnParser$2(requestBody) {
2556
- // Parses a string representation of the seconds since epoch into a number value
2557
- return Number(requestBody.expires_on);
2558
- }
2559
2552
  /**
2560
2553
  * Generates the options used on the request for an access token.
2561
2554
  */
@@ -2627,7 +2620,7 @@ function tokenExchangeMsi() {
2627
2620
  const request = coreRestPipeline.createPipelineRequest(Object.assign(Object.assign({ abortSignal: getTokenOptions.abortSignal }, prepareRequestOptions$4(scopes, assertion, clientId || process.env.AZURE_CLIENT_ID)), {
2628
2621
  // Generally, MSI endpoints use the HTTP protocol, without transport layer security (TLS).
2629
2622
  allowInsecureConnection: true }));
2630
- const tokenResponse = await identityClient.sendTokenRequest(request, expiresOnParser$2);
2623
+ const tokenResponse = await identityClient.sendTokenRequest(request);
2631
2624
  return (tokenResponse && tokenResponse.accessToken) || null;
2632
2625
  }
2633
2626
  };
@@ -2649,7 +2642,7 @@ const logger$e = credentialLogger(msiName$5);
2649
2642
  /**
2650
2643
  * Formats the expiration date of the received token into the number of milliseconds between that date and midnight, January 1, 1970.
2651
2644
  */
2652
- function expiresOnParser$3(requestBody) {
2645
+ function expiresOnParser$2(requestBody) {
2653
2646
  // Parses a string representation of the milliseconds since epoch into a number value
2654
2647
  return Number(requestBody.expires_on);
2655
2648
  }
@@ -2720,7 +2713,7 @@ const fabricMsi = {
2720
2713
  // The alternative path is to verify the certificate using the IDENTITY_SERVER_THUMBPRINT env variable.
2721
2714
  rejectUnauthorized: false
2722
2715
  });
2723
- const tokenResponse = await identityClient.sendTokenRequest(request, expiresOnParser$3);
2716
+ const tokenResponse = await identityClient.sendTokenRequest(request, expiresOnParser$2);
2724
2717
  return (tokenResponse && tokenResponse.accessToken) || null;
2725
2718
  }
2726
2719
  };