diff --git a/lib/credentials/applicationTokenCredentials.ts b/lib/credentials/applicationTokenCredentials.ts index d6bee5e..ea7cd69 100644 --- a/lib/credentials/applicationTokenCredentials.ts +++ b/lib/credentials/applicationTokenCredentials.ts @@ -16,7 +16,7 @@ export class ApplicationTokenCredentials extends TokenCredentialsBase { * @param {string} clientId The active directory application client id. * @param {string} domain The domain or tenant id containing this application. * @param {string} secret The authentication secret for the application. - * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph' or any other resource like 'https://vault.azure.com/'. + * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.com/'. * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format). * @param {AzureEnvironment} [environment] The azure environment to authenticate with. * @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal. diff --git a/lib/credentials/deviceTokenCredentials.ts b/lib/credentials/deviceTokenCredentials.ts index a721344..0903dad 100644 --- a/lib/credentials/deviceTokenCredentials.ts +++ b/lib/credentials/deviceTokenCredentials.ts @@ -20,7 +20,7 @@ export class DeviceTokenCredentials extends TokenCredentialsBase { * @param {string} [clientId] The active directory application client id. * @param {string} [domain] The domain or tenant id containing this application. Default value is "common" * @param {string} [username] The user name for account in the form: "user@example.com". - * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph' or any other resource like 'https://vault.azure.com/'. + * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.com/'. * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format). * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} * for an example. diff --git a/lib/credentials/tokenCredentialsBase.ts b/lib/credentials/tokenCredentialsBase.ts index 7cb4859..242c2b5 100644 --- a/lib/credentials/tokenCredentialsBase.ts +++ b/lib/credentials/tokenCredentialsBase.ts @@ -45,7 +45,7 @@ export abstract class TokenCredentialsBase { resource = this.tokenAudience; if (this.tokenAudience === "graph") { resource = this.environment.activeDirectoryGraphResourceId; - } else if (this.tokenAudience === "graph") { + } else if (this.tokenAudience === "batch") { resource = this.environment.batchResourceId; } } diff --git a/lib/credentials/userTokenCredentials.ts b/lib/credentials/userTokenCredentials.ts index 2315b2a..8ae86dd 100644 --- a/lib/credentials/userTokenCredentials.ts +++ b/lib/credentials/userTokenCredentials.ts @@ -20,7 +20,7 @@ export class UserTokenCredentials extends TokenCredentialsBase { * @param {string} domain The domain or tenant id containing this application. * @param {string} username The user name for the Organization Id account. * @param {string} password The password for the Organization Id account. - * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph' or any other resource like 'https://vault.azure.com/'. + * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.com/'. * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format). * @param {AzureEnvironment} [environment] The azure environment to authenticate with. * @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal. diff --git a/lib/login.ts b/lib/login.ts index 4fec5e8..624d6e6 100644 --- a/lib/login.ts +++ b/lib/login.ts @@ -37,7 +37,7 @@ if (process.env["AZURE_ADAL_LOGGING_ENABLED"]) { */ export interface AzureTokenCredentialsOptions { /** - * @property {TokenAudience} [tokenAudience] - The audience for which the token is requested. Valid values are 'graph' or any other resource like 'https://vault.azure.com/'. + * @property {TokenAudience} [tokenAudience] - The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.com/'. * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format). */ tokenAudience?: TokenAudience; @@ -143,7 +143,7 @@ export interface LoginWithMSIOptions { * @param {string} [options.clientId] The active directory application client id. * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} * for an example. - * @param {string} [options.tokenAudience] The audience for which the token is requested. Valid values are 'graph' or any other resource like 'https://vault.azure.com/'. + * @param {string} [options.tokenAudience] The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.com/'. * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format). * @param {string} [options.domain] The domain or tenant id containing this application. Default value "common". * @param {AzureEnvironment} [options.environment] The azure environment to authenticate with. @@ -661,7 +661,7 @@ export function withServicePrincipalSecret(clientId: string, secret: string, dom * @param {string} [options.clientId] The active directory application client id. * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} * for an example. - * @param {string} [options.tokenAudience] The audience for which the token is requested. Valid values are 'graph' or any other resource like 'https://vault.azure.com/'. + * @param {string} [options.tokenAudience] The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.com/'. * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format). * @param {string} [options.domain] The domain or tenant id containing this application. Default value "common". * @param {AzureEnvironment} [options.environment] The azure environment to authenticate with.