@azure/identity 3.1.3 → 3.1.4

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/dist/index.js CHANGED
@@ -256,7 +256,7 @@ function credentialLogger(title, log = logger$l) {
256
256
  /**
257
257
  * Current version of the `@azure/identity` package.
258
258
  */
259
- const SDK_VERSION = `3.1.2`;
259
+ const SDK_VERSION = `3.1.4`;
260
260
  /**
261
261
  * The default client ID for authentication
262
262
  * @internal
@@ -1184,7 +1184,7 @@ To work with multiple accounts for the same Client ID and Tenant ID, please prov
1184
1184
  * Attempts to retrieve a token from cache.
1185
1185
  */
1186
1186
  async getTokenSilent(scopes, options) {
1187
- var _a, _b;
1187
+ var _a, _b, _c;
1188
1188
  await this.getActiveAccount();
1189
1189
  if (!this.account) {
1190
1190
  throw new AuthenticationRequiredError({
@@ -1203,7 +1203,14 @@ To work with multiple accounts for the same Client ID and Tenant ID, please prov
1203
1203
  };
1204
1204
  try {
1205
1205
  this.logger.info("Attempting to acquire token silently");
1206
- const response = (_b = (await ((_a = this.confidentialApp) === null || _a === void 0 ? void 0 : _a.acquireTokenSilent(silentRequest)))) !== null && _b !== void 0 ? _b : (await this.publicApp.acquireTokenSilent(silentRequest));
1206
+ /**
1207
+ * The following code to retrieve all accounts is done as a workaround in an attempt to force the
1208
+ * refresh of the token cache with the token and the account passed in through the
1209
+ * `authenticationRecord` parameter. See issue - https://github.com/Azure/azure-sdk-for-js/issues/24349#issuecomment-1496715651
1210
+ * This workaround serves as a workoaround for silent authentication not happening when authenticationRecord is passed.
1211
+ */
1212
+ await ((_a = (this.publicApp || this.confidentialApp)) === null || _a === void 0 ? void 0 : _a.getTokenCache().getAllAccounts());
1213
+ const response = (_c = (await ((_b = this.confidentialApp) === null || _b === void 0 ? void 0 : _b.acquireTokenSilent(silentRequest)))) !== null && _c !== void 0 ? _c : (await this.publicApp.acquireTokenSilent(silentRequest));
1207
1214
  return this.handleResult(scopes, this.clientId, response || undefined);
1208
1215
  }
1209
1216
  catch (err) {