@azure/identity 2.1.0-alpha.20220308.3 → 2.1.0-alpha.20220311.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/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
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
  });