@azure/identity 2.0.0-beta.5 → 2.0.0-beta.6

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 (81) hide show
  1. package/CHANGELOG.md +49 -10
  2. package/README.md +26 -21
  3. package/dist/index.js +461 -211
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/client/errors.js +1 -1
  6. package/dist-esm/src/client/errors.js.map +1 -1
  7. package/dist-esm/src/client/identityClient.js +2 -6
  8. package/dist-esm/src/client/identityClient.js.map +1 -1
  9. package/dist-esm/src/credentials/applicationCredential.js +0 -3
  10. package/dist-esm/src/credentials/applicationCredential.js.map +1 -1
  11. package/dist-esm/src/credentials/authorizationCodeCredential.js +12 -76
  12. package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
  13. package/dist-esm/src/credentials/chainedTokenCredential.js +4 -3
  14. package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
  15. package/dist-esm/src/credentials/clientCertificateCredential.js +3 -0
  16. package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
  17. package/dist-esm/src/credentials/clientSecretCredential.browser.js +1 -4
  18. package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
  19. package/dist-esm/src/credentials/clientSecretCredential.js +3 -0
  20. package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -1
  21. package/dist-esm/src/credentials/credentialPersistenceOptions.js.map +1 -1
  22. package/dist-esm/src/credentials/defaultAzureCredential.js +5 -8
  23. package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
  24. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js +21 -10
  25. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -1
  26. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js +23 -12
  27. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
  28. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js +22 -11
  29. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -1
  30. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +19 -7
  31. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
  32. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js +29 -20
  33. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  34. package/dist-esm/src/credentials/managedIdentityCredential/index.js +13 -10
  35. package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
  36. package/dist-esm/src/credentials/managedIdentityCredential/models.js.map +1 -1
  37. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js +82 -0
  38. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -0
  39. package/dist-esm/src/credentials/managedIdentityCredential/utils.js +10 -5
  40. package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -1
  41. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js +17 -0
  42. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -0
  43. package/dist-esm/src/credentials/onBehalfOfCredential.js +62 -0
  44. package/dist-esm/src/credentials/onBehalfOfCredential.js.map +1 -0
  45. package/dist-esm/src/credentials/{visualStudioCodeCredentialExtension.js → onBehalfOfCredentialOptions.js} +1 -1
  46. package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js.map +1 -0
  47. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js +10 -13
  48. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
  49. package/dist-esm/src/credentials/usernamePasswordCredential.js +3 -0
  50. package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
  51. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js +1 -1
  52. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js.map +1 -1
  53. package/dist-esm/src/credentials/visualStudioCodeCredential.js +11 -1
  54. package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
  55. package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js +4 -0
  56. package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js.map +1 -0
  57. package/dist-esm/src/index.js +2 -1
  58. package/dist-esm/src/index.js.map +1 -1
  59. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js +41 -0
  60. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js.map +1 -0
  61. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js +48 -29
  62. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js.map +1 -1
  63. package/dist-esm/src/msal/nodeFlows/msalClientSecret.js.map +1 -1
  64. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js +56 -0
  65. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js.map +1 -0
  66. package/dist-esm/src/msal/nodeFlows/nodeCommon.js +6 -1
  67. package/dist-esm/src/msal/nodeFlows/nodeCommon.js.map +1 -1
  68. package/dist-esm/src/msal/nodeFlows/tokenCachePersistenceOptions.js.map +1 -1
  69. package/dist-esm/src/plugins/consumer.browser.js +7 -0
  70. package/dist-esm/src/plugins/consumer.browser.js.map +1 -0
  71. package/dist-esm/src/{extensions → plugins}/consumer.js +12 -12
  72. package/dist-esm/src/plugins/consumer.js.map +1 -0
  73. package/dist-esm/src/{extensions → plugins}/provider.js +0 -0
  74. package/dist-esm/src/plugins/provider.js.map +1 -0
  75. package/package.json +10 -12
  76. package/types/identity.d.ts +126 -41
  77. package/dist-esm/src/credentials/visualStudioCodeCredentialExtension.js.map +0 -1
  78. package/dist-esm/src/extensions/consumer.browser.js +0 -7
  79. package/dist-esm/src/extensions/consumer.browser.js.map +0 -1
  80. package/dist-esm/src/extensions/consumer.js.map +0 -1
  81. package/dist-esm/src/extensions/provider.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Release History
2
2
 
3
+ ## 2.0.0-beta.6 (2021-09-09)
4
+
5
+ ### Features Added
6
+
7
+ - Added the `OnBehalfOfCredential`, which allows users to authenticate through the [On-Behalf-Of authentication flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
8
+ - `ManagedIdentityCredential` now supports token exchange authentication.
9
+
10
+ ### Breaking Changes
11
+
12
+ - `ClientCertificateCredential` now evaluates the validity of the PEM certificate path on `getToken` and not on the constructor.
13
+
14
+ #### Breaking Changes from 2.0.0-beta.5
15
+
16
+ - The property named `selectedCredential` that was added to `ChainedTokenCredential` and `DefaultAzureCredential` has been removed, since customers reported that logging was enough.
17
+ - Renamed the `allowUnencryptedStorage` property of `TokenCachePersistenceOptions` to `unsafeAllowUnencryptedStorage` to make it clear that enabling the unencrypted storage feature is not generally safe for production use.
18
+ - Changed the name of the "extension" API to the "plugin" API to reduce confusion between this package and VS Code extensions. The function `useIdentityExtension` was renamed to `useIdentityPlugin`, and "extension packages" are now known as "plugin packages".
19
+ - Renamed the `allowUnencryptedStorage` property of `TokenCachePersistenceOptions` to `unsafeAllowUnencryptedStorage` to make it clear that enabling the unencrypted storage feature is not generally safe for production use.
20
+
21
+ ### Bugs Fixed
22
+
23
+ - `ClientSecretCredential`, `ClientCertificateCredential` and `UsernamePasswordCredential` now throw if the required parameters are not provided (even in JavaScript).
24
+ - Fixed a bug introduced on 2.0.0-beta.5 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.
25
+ - Fixed bug on the `AggregateAuthenticationError`, which caused an inconsistent error message on the `ChainedTokenCredential`, `DefaultAzureCredential` and `ApplicationCredential`.
26
+
27
+ ### Other Changes
28
+
29
+ - The errors thrown by the `ManagedIdentityCredential` have been improved.
30
+
3
31
  ## 2.0.0-beta.5 (2021-08-10)
4
32
 
5
33
  ### Features Added
@@ -19,6 +47,27 @@
19
47
 
20
48
  - 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.
21
49
 
50
+ ## 1.5.2 (2021-09-01)
51
+
52
+ - 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.
53
+
54
+ ## 1.5.1 (2021-08-12)
55
+
56
+ - 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.
57
+ - Added support for the `AZURE_POD_IDENTITY_AUTHORITY_HOST` environment variable. If present, the IMDS endpoint initial verification will be skipped.
58
+
59
+ ## 1.5.0 (2021-07-19)
60
+
61
+ - 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.
62
+
63
+ ## 1.4.0 (2021-07-09)
64
+
65
+ - With this release, we drop support for Node.js versions that have reached the end of life, like Node.js 8. Read our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
66
+ - Updated the default timeout of the first request of the IMDS MSI from half a second to three seconds to compensate for the slowness caused by `node-fetch` for initial requests in specific environments, like Kubernetes pods.
67
+ - Upgraded `@azure/core-http` to version `^2.0.0`, and `@azure/core-tracing` to version `1.0.0-preview.12`.
68
+
69
+ - Upgraded the `AuthorizationCodeCredential` to use the latest `@azure/msal-node`.
70
+
22
71
  ## 2.0.0-beta.4 (2021-07-07)
23
72
 
24
73
  ### Features Added
@@ -78,16 +127,6 @@
78
127
 
79
128
  > With the plans for [third party cookies to be removed from browsers](https://docs.microsoft.com/azure/active-directory/develop/reference-third-party-cookies-spas), the **implicit grant flow is no longer a suitable authentication method**. The [silent SSO features](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow#getting-access-tokens-silently-in-the-background) of the implicit flow do not work without third party cookies, causing applications to break when they attempt to get a new token. We strongly recommend that all new applications use the authorization code flow that now supports single page apps in place of the implicit flow, and that [existing single page apps begin migrating to the authorization code flow](https://docs.microsoft.com/azure/active-directory/develop/migrate-spa-implicit-to-auth-code) as well.
80
129
 
81
- ## 1.5.0 (2021-07-19)
82
-
83
- - 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.
84
-
85
- ## 1.4.0 (2021-07-09)
86
-
87
- - With this release, we drop support for Node.js versions that have reached the end of life, like Node.js 8. Read our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
88
- - Updated the default timeout of the first request of the IMDS MSI from half a second to three seconds to compensate for the slowness caused by `node-fetch` for initial requests in specific environments, like Kubernetes pods.
89
- - Upgraded `@azure/core-http` to version `^2.0.0`, and `@azure/core-tracing` to version `1.0.0-preview.12`.
90
-
91
130
  ## 1.3.0 (2021-04-05)
92
131
 
93
132
  ### Tracing Changes
package/README.md CHANGED
@@ -5,6 +5,7 @@ The Azure Identity library provides [Azure Active Directory (AAD)](https://docs.
5
5
  You can find examples for these various credentials in the [Azure Identity Examples Page](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md)
6
6
 
7
7
  Key links:
8
+
8
9
  - [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity)
9
10
  - [Package (npm)](https://www.npmjs.com/package/@azure/identity)
10
11
  - [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/identity)
@@ -13,6 +14,15 @@ Key links:
13
14
 
14
15
  ## Getting started
15
16
 
17
+ ### Currently supported environments
18
+
19
+ - [LTS versions of Node.js](https://nodejs.org/about/releases/)
20
+ - **Note:** If your application runs on Node.js v8 or lower and you cannot upgrade your Node.js version to latest stable version, then pin your `@azure/identity` dependency to version 1.1.0.
21
+ - Latest versions of Safari, Chrome, Edge, and Firefox.
22
+ - **Note**: Among the different credentials exported in this library, `InteractiveBrowserCredential` is the only one that is supported in the browser.
23
+
24
+ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
25
+
16
26
  ### Install the package
17
27
 
18
28
  Install Azure Identity with `npm`:
@@ -26,12 +36,6 @@ npm install --save @azure/identity
26
36
  - An [Azure subscription](https://azure.microsoft.com/free/).
27
37
  - Optional: The [Azure CLI][azure_cli] and/or [Azure PowerShell][azure_powershell] can also be useful for authenticating in a development environment and managing account roles.
28
38
 
29
- #### Supported Node.js versions
30
-
31
- This version of `@azure/identity` supports stable (even numbered) versions of Node.js starting from v10. While it may run in Node.js v8, no support is guaranteed.
32
-
33
- > **Note:** If your application runs on Node.js v8 or lower, we strongly recommend you to upgrade your Node.js version to latest stable version or pin your `@azure/identity` dependency to version 1.1.0.
34
-
35
39
  ### When to use @azure/identity
36
40
 
37
41
  The credential classes exposed by `@azure/identity` are focused on providing the most straightforward way to authenticate the Azure SDK clients locally, in your development environments, and in production. We aim for simplicity and reasonable support of the authentication protocols to cover most of the authentication scenarios possible on Azure. We're actively expanding to cover more scenarios. For a full list of the credentials offered, see the [Credential Classes](#credential-classes) section.
@@ -106,15 +110,16 @@ If used from Node.js, the `DefaultAzureCredential` will attempt to authenticate
106
110
 
107
111
  - Environment - The `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate.
108
112
  - Managed Identity - If the application is deployed to an Azure host with Managed Identity enabled, the `DefaultAzureCredential` will authenticate with that account.
113
+ - Visual Studio Code - If the developer has authenticated with the [Visual Studio Code Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account), the `DefaultAzureCredential` will authenticate using that account.
109
114
  - Azure CLI - If the developer has authenticated an account via the Azure CLI `az login` command, the `DefaultAzureCredential` will authenticate with that account.
110
115
  - Azure PowerShell - If the developer has authenticated using the Azure PowerShell module `Connect-AzAccount` command, the `DefaultAzureCredential` will authenticate with that account.
111
116
 
112
- ## Extensions
117
+ ## Plugins
113
118
 
114
- Azure Identity for JavaScript provides an extension API that allows us to provide certain functionality through separate _extension packages_. The `@azure/identity` package exports a top-level function (`useIdentityExtension`) that can be used to enable an extension, and we provide two extension packages:
119
+ Azure Identity for JavaScript provides a plugin API that allows us to provide certain functionality through separate _plugin packages_. The `@azure/identity` package exports a top-level function (`useIdentityPlugin`) that can be used to enable a plugin. We provide two plugin packages:
115
120
 
116
- - [`@azure/identity-cache-persistence`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-cache-persistence), which provides persistent token caching in Node.js using a native secure storage system provided by your operating system. This extension allows cached `access_token` values to persist across sessions, meaning that an interactive login flow does not need to be repeated as long as a cached token is available.
117
- - [`@azure/identity-vscode`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-vscode), which provides the dependencies of `VisualStudioCodeCredential` and enables it. Without this extension, the `VisualStudioCodeCredential` in this package will throw a `CredentialUnavailableError`. The extension provides the underlying implementation of this credential, enabling it for use both on its own and as part of the `DefaultAzureCredential` described above.
121
+ - [`@azure/identity-cache-persistence`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-cache-persistence), which provides persistent token caching in Node.js using a native secure storage system provided by your operating system. This plugin allows cached `access_token` values to persist across sessions, meaning that an interactive login flow does not need to be repeated as long as a cached token is available.
122
+ - [`@azure/identity-vscode`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-vscode), which provides the dependencies of `VisualStudioCodeCredential` and enables it. Without this plugin, the `VisualStudioCodeCredential` in this package will throw a `CredentialUnavailableError`. The plugin provides the underlying implementation of this credential, enabling it for use both on its own and as part of the `DefaultAzureCredential` described above.
118
123
 
119
124
  ## Environment Variables
120
125
 
@@ -210,8 +215,8 @@ For examples of how to use managed identity for authentication please refer to [
210
215
 
211
216
  ### Authenticating Azure Hosted Applications
212
217
 
213
- | credential | usage | example |
214
- | --------------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
218
+ | credential | usage | example |
219
+ | --------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
215
220
  | `DefaultAzureCredential` | Provides a simplified authentication experience to quickly start developing applications run in the Azure cloud. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-defaultazurecredential) |
216
221
  | `ChainedTokenCredential` | 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) |
217
222
  | `EnvironmentCredential` | 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) |
@@ -219,24 +224,24 @@ For examples of how to use managed identity for authentication please refer to [
219
224
 
220
225
  ### Authenticating Service Principals
221
226
 
222
- | credential | usage | example | reference |
223
- | ----------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
227
+ | credential | usage | example | reference |
228
+ | ----------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
224
229
  | `ClientSecretCredential` | Authenticates a service principal using a secret. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-a-client-secret) | [Service principal authentication](https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals) |
225
230
  | `ClientCertificateCredential` | Authenticates a service principal using a certificate. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-a-client-certificate) | [Service principal authentication](https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals) |
226
231
 
227
232
  ### Authenticating Users
228
233
 
229
- | credential | usage | example | reference |
230
- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
234
+ | credential | usage | example | reference |
235
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
231
236
  | `InteractiveBrowserCredential` | Interactively authenticates a user with the default system browser. Read more about how this happens [here](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/interactive-browser-credential.md). | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-interactively-in-the-browser) | [OAuth2 authentication code](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) |
232
- | `DeviceCodeCredential` | Interactively authenticates a user on devices with limited UI. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-device-code-flow) | [Device code authentication](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-device-code) |
233
- | `UsernamePasswordCredential` | Authenticates a user with a username and password. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-username-and-password) | [Username + password authentication](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth-ropc) |
234
- | `AuthorizationCodeCredential` | Authenticate a user with a previously obtained authorization code. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-auth-code-flow) | [OAuth2 authentication code](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) |
237
+ | `DeviceCodeCredential` | Interactively authenticates a user on devices with limited UI. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-device-code-flow) | [Device code authentication](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-device-code) |
238
+ | `UsernamePasswordCredential` | Authenticates a user with a username and password. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-username-and-password) | [Username + password authentication](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth-ropc) |
239
+ | `AuthorizationCodeCredential` | Authenticate a user with a previously obtained authorization code. | [example](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-auth-code-flow) | [OAuth2 authentication code](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) |
235
240
 
236
241
  ### Authenticating via Development Tools
237
242
 
238
- | credential | usage | example | reference |
239
- | --------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
243
+ | credential | usage | example | reference |
244
+ | --------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
240
245
  | `AzureCliCredential` | 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://docs.microsoft.com/cli/azure/authenticate-azure-cli) |
241
246
  | `AzurePowerShellCredential` | 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://docs.microsoft.com/powershell/azure/authenticate-azureps) |
242
247