@azure/identity 2.1.0-alpha.20220302.2 → 2.1.0-alpha.20220309.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
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ## 2.1.0-beta.2 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ - Fixed a bug that caused [Continuous Access Enforcement (CAE)](https://docs.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation) and [Conditional Access authentication context](https://techcommunity.microsoft.com/t5/azure-active-directory-identity/granular-conditional-access-for-sensitive-data-and-actions/ba-p/1751775) authentication to fail with newer versions of MSAL.
12
+
13
+ ### Other Changes
14
+
3
15
  ## 2.1.0-beta.1 (2022-03-02)
4
16
 
5
17
  ### Features Added
@@ -57,7 +69,7 @@
57
69
 
58
70
  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.
59
71
 
60
- This changelog entry showcases the changes that have been made from version 1 of this package. See the [v1-to-v2 migration guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/migration-v1-v2.md) for details on how to upgrade your application to use the version 2 of `@azure/identity`. For information on troubleshooting the Identity package, see the [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/Troubleshooting.md).
72
+ This changelog entry showcases the changes that have been made from version 1 of this package. See the [v1-to-v2 migration guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/migration-v1-v2.md) for details on how to upgrade your application to use the version 2 of `@azure/identity`. For information on troubleshooting the Identity package, see the [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md).
61
73
 
62
74
  ### Features Added
63
75
 
@@ -138,7 +150,7 @@ Azure Service Fabric support hasn't been added on the initial version 2 of Ident
138
150
  - `InteractiveBrowserCredential` has a new `loginHint` constructor option, which allows a username to be pre-selected for interactive logins.
139
151
  - In `AzureCliCredential`, we allow specifying a `tenantId` in the parameters through the `AzureCliCredentialOptions`.
140
152
  - A new error, named `AuthenticationRequiredError`, has been added. This error shows up when a credential fails to authenticate silently.
141
- - Errors and logged exceptions may point to the new [troubleshooting guidelines](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/Troubleshooting.md).
153
+ - Errors and logged exceptions may point to the new [troubleshooting guidelines](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md).
142
154
  - On all of the credentials we're providing, the initial authentication attempt in the lifetime of your app will include an additional request to first discover relevant endpoint metadata information from Azure.
143
155
 
144
156
  ### Breaking changes
package/README.md CHANGED
@@ -123,6 +123,7 @@ If used from Node.js, the `DefaultAzureCredential` will attempt to authenticate
123
123
  - Environment - The `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate.
124
124
  - Managed Identity - If the application is deployed to an Azure host with Managed Identity enabled, the `DefaultAzureCredential` will authenticate with that account.
125
125
  - 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.
126
+ - In `@azure/identity` version 2.0 or later, the [`@azure/identity-vscode`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-vscode) package must be installed for the Visual Studio Code authentication to work.
126
127
  - Azure CLI - If the developer has authenticated an account via the Azure CLI `az login` command, the `DefaultAzureCredential` will authenticate with that account.
127
128
  - Azure PowerShell - If the developer has authenticated using the Azure PowerShell module `Connect-AzAccount` command, the `DefaultAzureCredential` will authenticate with that account.
128
129
 
@@ -297,7 +298,7 @@ import { setLogLevel } from "@azure/logger";
297
298
  setLogLevel("info");
298
299
  ```
299
300
 
300
- For assistance with troubleshooting, see the [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/Troubleshooting.md).
301
+ For assistance with troubleshooting, see the [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md).
301
302
 
302
303
  ## Next steps
303
304
 
package/dist/index.js CHANGED
@@ -368,7 +368,7 @@ function getIdentityClientAuthorityHost(options) {
368
368
  class IdentityClient extends coreClient.ServiceClient {
369
369
  constructor(options) {
370
370
  var _a;
371
- const packageDetails = `azsdk-js-identity/2.1.0-beta.1`;
371
+ const packageDetails = `azsdk-js-identity/2.1.0-beta.2`;
372
372
  const userAgentPrefix = ((_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix)
373
373
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
374
374
  : `${packageDetails}`;
@@ -1115,6 +1115,17 @@ To work with multiple accounts for the same Client ID and Tenant ID, please prov
1115
1115
  options.correlationId = (options === null || options === void 0 ? void 0 : options.correlationId) || this.generateUuid();
1116
1116
  await this.init(options);
1117
1117
  try {
1118
+ // MSAL now caches tokens based on their claims,
1119
+ // so now one has to keep track fo claims in order to retrieve the newer tokens from acquireTokenSilent
1120
+ // This update happened on PR: https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/4533
1121
+ const optionsClaims = options.claims;
1122
+ if (optionsClaims) {
1123
+ this.cachedClaims = optionsClaims;
1124
+ }
1125
+ if (this.cachedClaims && !optionsClaims) {
1126
+ options.claims = this.cachedClaims;
1127
+ }
1128
+ // We don't return the promise since we want to catch errors right here.
1118
1129
  return await this.getTokenSilent(scopes, options);
1119
1130
  }
1120
1131
  catch (err) {
@@ -3269,8 +3280,6 @@ class MsalDeviceCode extends MsalNode {
3269
3280
  claims: options === null || options === void 0 ? void 0 : options.claims,
3270
3281
  };
3271
3282
  const promise = this.publicApp.acquireTokenByDeviceCode(requestOptions);
3272
- // TODO:
3273
- // This should work, but it currently doesn't. I'm waiting for an answer from the MSAL team.
3274
3283
  const deviceResponse = await this.withCancellation(promise, options === null || options === void 0 ? void 0 : options.abortSignal, () => {
3275
3284
  requestOptions.cancel = true;
3276
3285
  });