diff --git a/Changelog.md b/Changelog.md index 7b1814e..f5edc58 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/lib/login.ts b/lib/login.ts index db00bee..46c8f12 100644 --- a/lib/login.ts +++ b/lib/login.ts @@ -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); diff --git a/package.json b/package.json index 2869088..48cd840 100644 --- a/package.json +++ b/package.json @@ -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" } -} +} \ No newline at end of file