fix: correctly pass through the `tokenCache` option (#107)
This commit is contained in:
Родитель
c6b149d297
Коммит
4c177518c3
|
@ -1,5 +1,8 @@
|
|||
# Changelog
|
||||
|
||||
## 3.0.9 - Unreleased
|
||||
- Pass user provided `tokenCache` option to `withUsernamePasswordWithAuthResponse` and `withServicePrincipalSecretWithAuthResponse` methods to the credentials being created.
|
||||
|
||||
## 3.0.8 - 2021/03/23
|
||||
- Fix command injection in core function `execAz()` by replacing `exec()` with `execFile()` - CVE-2021-28458
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ export async function withUsernamePasswordWithAuthResponse(username: string, pas
|
|||
options.environment = Environment.AzureCloud;
|
||||
}
|
||||
|
||||
const creds = new UserTokenCredentials(options.clientId, options.domain, username, password, options.tokenAudience, options.environment);
|
||||
const creds = new UserTokenCredentials(options.clientId, options.domain, username, password, options.tokenAudience, options.environment, options.tokenCache);
|
||||
const tokenResponse = await creds.getToken();
|
||||
|
||||
// The token cache gets propulated for all the tenants as a part of building the tenantList.
|
||||
|
@ -214,7 +214,7 @@ export async function withServicePrincipalSecretWithAuthResponse(clientId: strin
|
|||
options.environment = Environment.AzureCloud;
|
||||
}
|
||||
|
||||
const creds = new ApplicationTokenCredentials(clientId, domain, secret, options.tokenAudience, options.environment);
|
||||
const creds = new ApplicationTokenCredentials(clientId, domain, secret, options.tokenAudience, options.environment, options.tokenCache);
|
||||
await creds.getToken();
|
||||
|
||||
const subscriptionList = await _getSubscriptions(creds, [domain], options.tokenAudience);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"email": "azsdkteam@microsoft.com",
|
||||
"url": "https://github.com/Azure/ms-rest-nodeauth"
|
||||
},
|
||||
"version": "3.0.8",
|
||||
"version": "3.0.9",
|
||||
"description": "Azure Authentication library in node.js with type definitions.",
|
||||
"keywords": [
|
||||
"node",
|
||||
|
@ -70,4 +70,4 @@
|
|||
"test:unit": "mocha",
|
||||
"check:packagejsonversion": "ts-node ./.scripts/checkPackageJsonVersion.ts"
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче