@azure/identity 3.1.3-alpha.20230131.2 → 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 +17 -4
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +1 -1
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/credentials/azureApplicationCredential.js +2 -0
- package/dist-esm/src/credentials/azureApplicationCredential.js.map +1 -1
- package/dist-esm/src/credentials/chainedTokenCredential.js +4 -0
- package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.js +2 -0
- package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js +9 -2
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js.map +1 -1
- package/package.json +11 -11
- package/types/identity.d.ts +4 -0
- package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js +0 -23
- package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js.map +0 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js +0 -136
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js.map +0 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js +0 -4
- package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js.map +0 -1
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.
|
|
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
|
-
|
|
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) {
|
|
@@ -2202,7 +2209,7 @@ class ManagedIdentityCredential {
|
|
|
2202
2209
|
const appTokenParameters = {
|
|
2203
2210
|
correlationId: this.identityClient.getCorrelationId(),
|
|
2204
2211
|
tenantId: (options === null || options === void 0 ? void 0 : options.tenantId) || "organizations",
|
|
2205
|
-
scopes:
|
|
2212
|
+
scopes: [...scopes],
|
|
2206
2213
|
claims: options === null || options === void 0 ? void 0 : options.claims,
|
|
2207
2214
|
};
|
|
2208
2215
|
this.confidentialApp.SetAppTokenProvider(async (appTokenProviderParameters = appTokenParameters) => {
|
|
@@ -2714,6 +2721,10 @@ class ChainedTokenCredential {
|
|
|
2714
2721
|
* ```
|
|
2715
2722
|
*/
|
|
2716
2723
|
constructor(...sources) {
|
|
2724
|
+
/**
|
|
2725
|
+
* The message to use when the chained token fails to get a token
|
|
2726
|
+
*/
|
|
2727
|
+
this.UnavailableMessage = "ChainedTokenCredential => failed to retrieve a token from the included credentials";
|
|
2717
2728
|
this._sources = [];
|
|
2718
2729
|
this._sources = sources;
|
|
2719
2730
|
}
|
|
@@ -3239,6 +3250,8 @@ const defaultCredentials = [
|
|
|
3239
3250
|
class DefaultAzureCredential extends ChainedTokenCredential {
|
|
3240
3251
|
constructor(options) {
|
|
3241
3252
|
super(...defaultCredentials.map((ctor) => new ctor(options)));
|
|
3253
|
+
this.UnavailableMessage =
|
|
3254
|
+
"DefaultAzureCredential => failed to retrieve a token from the included credentials. To troubleshoot, visit https://aka.ms/azsdk/js/identity/defaultazurecredential/troubleshoot.";
|
|
3242
3255
|
}
|
|
3243
3256
|
}
|
|
3244
3257
|
|