@azure/identity 2.1.0-alpha.20220415.2 → 2.1.0-alpha.20220419.3

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 (25) hide show
  1. package/README.md +29 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/src/client/identityClient.js.map +1 -1
  4. package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
  5. package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -1
  6. package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
  7. package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
  8. package/dist-esm/src/credentials/environmentCredential.js.map +1 -1
  9. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
  10. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  11. package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
  12. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  13. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
  14. package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
  15. package/dist-esm/src/errors.js.map +1 -1
  16. package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
  17. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js.map +1 -1
  18. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js.map +1 -1
  19. package/dist-esm/src/msal/nodeFlows/msalClientSecret.js.map +1 -1
  20. package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js.map +1 -1
  21. package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js.map +1 -1
  22. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js.map +1 -1
  23. package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js.map +1 -1
  24. package/dist-esm/src/msal/nodeFlows/msalUsernamePassword.js.map +1 -1
  25. package/package.json +1 -1
package/README.md CHANGED
@@ -284,7 +284,10 @@ Credentials raise `AuthenticationError` when they fail to authenticate. This cla
284
284
 
285
285
  ### Logging
286
286
 
287
- Enabling logging may help uncover useful information about failures. To see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. You can read this environment variable from the *.env* file by explicitly specifying a file path:
287
+ Enabling logging may help uncover useful information about failures.
288
+
289
+ To see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`.
290
+ You can read this environment variable from the *.env* file by explicitly specifying a file path:
288
291
 
289
292
  ```javascript
290
293
  require("dotenv").config({ path: ".env" });
@@ -297,6 +300,31 @@ import { setLogLevel } from "@azure/logger";
297
300
 
298
301
  setLogLevel("info");
299
302
  ```
303
+
304
+ In cases where the authenticate code might be running in an environment with more than one credential available,
305
+ the `@azure/identity` package offers a unique form of logging. On the optional parameters for every credential,
306
+ developers can set `allowLoggingAccountIdentifiers` to true in the
307
+ `loggingOptions` to log information specific to the authenticated account after
308
+ each successful authentication, including the Client ID, the Tenant ID, the
309
+ Object ID of the authenticated user, and if possible the User Principal Name.
310
+
311
+ For example, using the `DefaultAzureCredential`:
312
+
313
+ ```js
314
+ import { setLogLevel } from "@azure/logger";
315
+
316
+ setLogLevel("info");
317
+
318
+ const credential = new DefaultAzureCredential({
319
+ loggingOptions: { allowLoggingAccountIdentifiers: true }
320
+ });
321
+ ```
322
+
323
+ Once that credential authenticates, the following message will appear in the logs (with the real information instead of `HIDDEN`):
324
+
325
+ ```
326
+ azure:identity:info [Authenticated account] Client ID: HIDDEN. Tenant ID: HIDDEN. User Principal Name: HIDDEN. Object ID (user): HIDDEN
327
+ ```
300
328
 
301
329
  For assistance with troubleshooting, see the [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md).
302
330