@azure/identity 3.2.2 → 3.2.3-alpha.20230614.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.

package/README.md CHANGED
@@ -161,10 +161,10 @@ This example demonstrates authenticating the `KeyClient` from the [@azure/keyvau
161
161
  // If environment configuration is incomplete, it will try managed identity.
162
162
 
163
163
  // Azure Key Vault service to use
164
- const { KeyClient } = require("@azure/keyvault-keys");
164
+ import { KeyClient } from "@azure/keyvault-keys";
165
165
 
166
166
  // Azure authentication library to access Azure Key Vault
167
- const { DefaultAzureCredential } = require("@azure/identity");
167
+ import { DefaultAzureCredential } from "@azure/identity";
168
168
 
169
169
  // Azure SDK clients accept the credential as a parameter
170
170
  const credential = new DefaultAzureCredential();
@@ -181,8 +181,8 @@ A relatively common scenario involves authenticating using a user-assigned manag
181
181
 
182
182
  While the `DefaultAzureCredential` is generally the quickest way to get started developing applications for Azure, more advanced users may want to customize the credentials considered when authenticating. The `ChainedTokenCredential` enables users to combine multiple credential instances to define a customized chain of credentials. This example demonstrates creating a `ChainedTokenCredential` which will attempt to authenticate using two differently configured instances of `ClientSecretCredential`, to then authenticate the `KeyClient` from the [@azure/keyvault-keys](https://www.npmjs.com/package/@azure/keyvault-keys):
183
183
 
184
- ```javascript
185
- const { ClientSecretCredential, ChainedTokenCredential } = require("@azure/identity");
184
+ ```typescript
185
+ import { ClientSecretCredential, ChainedTokenCredential } from "@azure/identity";
186
186
 
187
187
  // When an access token is requested, the chain will try each
188
188
  // credential in order, stopping when one provides a token
@@ -191,7 +191,7 @@ const secondCredential = new ClientSecretCredential(tenantId, anotherClientId, a
191
191
  const credentialChain = new ChainedTokenCredential(firstCredential, secondCredential);
192
192
 
193
193
  // The chain can be used anywhere a credential is required
194
- const { KeyClient } = require("@azure/keyvault-keys");
194
+ import { KeyClient } from "@azure/keyvault-keys";
195
195
  const client = new KeyClient(vaultUrl, credentialChain);
196
196
  ```
197
197
 
@@ -213,7 +213,7 @@ For examples of how to use managed identity for authentication, see [the example
213
213
 
214
214
  Credentials default to authenticating to the Azure AD endpoint for Azure Public Cloud. To access resources in other clouds, such as Azure Government or a private cloud, configure credentials with the `authorityHost` argument in the constructor. The `AzureAuthorityHosts` interface defines authorities for well-known clouds. For the US Government cloud, you could instantiate a credential this way:
215
215
 
216
- ```ts
216
+ ```typescript
217
217
  import { AzureAuthorityHosts, ClientSecretCredential } from "@azure/identity";
218
218
  const credential = new ClientSecretCredential(
219
219
  "<YOUR_TENANT_ID>",
@@ -237,7 +237,7 @@ Not all credentials require this configuration. Credentials that authenticate th
237
237
  | [`ChainedTokenCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/chainedtokencredential?view=azure-node-latest) | Allows users to define custom authentication flows composing multiple credentials. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#chaining-credentials) |
238
238
  | [`EnvironmentCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/environmentcredential?view=azure-node-latest) | Authenticates a service principal or user via credential information specified in environment variables. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-environment-credentials) |
239
239
  | [`ManagedIdentityCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/managedidentitycredential?view=azure-node-latest) | Authenticates the managed identity of an Azure resource. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-in-azure-with-managed-identity) |
240
- |`WorkloadIdentityCredential`| Supports [Azure AD workload identity](https://learn.microsoft.com/azure/aks/workload-identity-overview) on Kubernetes. | |
240
+ | [`WorkloadIdentityCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/workloadidentitycredential?view=azure-node-latest)| Supports [Azure AD workload identity](https://learn.microsoft.com/azure/aks/workload-identity-overview) on Kubernetes. | |
241
241
 
242
242
  ### Authenticate service principals
243
243
 
@@ -261,8 +261,8 @@ Not all credentials require this configuration. Credentials that authenticate th
261
261
 
262
262
  | Credential | Usage | Example | Reference |
263
263
  | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
264
- | `AzureDeveloperCliCredential` | Authenticate in a development environment with the enabled user or service principal in Azure Developer CLI. | | [Azure Developer CLI Reference](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference) |
265
264
  | [`AzureCliCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/azureclicredential?view=azure-node-latest) | Authenticate in a development environment with the Azure CLI. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-azure-cli) | [Azure CLI authentication](https://learn.microsoft.com/cli/azure/authenticate-azure-cli) |
265
+ | [`AzureDeveloperCliCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/azuredeveloperclicredential?view=azure-node-latest) | Authenticate in a development environment with the enabled user or service principal in Azure Developer CLI. | | [Azure Developer CLI Reference](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference) |
266
266
  | [`AzurePowerShellCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/azurepowershellcredential?view=azure-node-latest) | Authenticate in a development environment using Azure PowerShell. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-azure-powershell) | [Azure PowerShell authentication](https://learn.microsoft.com/powershell/azure/authenticate-azureps) |
267
267
  | [`VisualStudioCodeCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/visualstudiocodecredential?view=azure-node-latest) | Authenticates as the user signed in to the Visual Studio Code Azure Account extension.| | [VS Code Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account)
268
268
 
@@ -299,7 +299,9 @@ Not all credentials require this configuration. Credentials that authenticate th
299
299
  Configuration is attempted in the above order. For example, if values for a client secret and certificate are both present, the client secret will be used.
300
300
 
301
301
  ## Token caching
302
+
302
303
  Token caching is a feature provided by the Azure Identity library that allows apps to:
304
+
303
305
  - Cache tokens in memory (default) and on disk (opt-in).
304
306
  - Improve resilience and performance.
305
307
  - Reduce the number of requests made to Azure AD to obtain access tokens.
@@ -325,7 +327,7 @@ require("dotenv").config({ path: ".env" });
325
327
 
326
328
  Alternatively, logging can be enabled at runtime by calling `setLogLevel` from the `@azure/logger` package:
327
329
 
328
- ```javascript
330
+ ```typescript
329
331
  import { setLogLevel } from "@azure/logger";
330
332
 
331
333
  setLogLevel("info");
package/dist/index.js CHANGED
@@ -257,7 +257,7 @@ function credentialLogger(title, log = logger$n) {
257
257
  /**
258
258
  * Current version of the `@azure/identity` package.
259
259
  */
260
- const SDK_VERSION = `3.2.2`;
260
+ const SDK_VERSION = `3.2.3`;
261
261
  /**
262
262
  * The default client ID for authentication
263
263
  * @internal