applicationTokenCredentials.d.ts 1.9 KB

123456789101112131415161718192021222324252627
  1. import { ApplicationTokenCredentialsBase } from "./applicationTokenCredentialsBase";
  2. import { Environment } from "@azure/ms-rest-azure-env";
  3. import { TokenAudience } from "../util/authConstants";
  4. import { TokenResponse, TokenCache } from "adal-node";
  5. export declare class ApplicationTokenCredentials extends ApplicationTokenCredentialsBase {
  6. readonly secret: string;
  7. /**
  8. * Creates a new ApplicationTokenCredentials object.
  9. * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net}
  10. * for detailed instructions on creating an Azure Active Directory application.
  11. * @constructor
  12. * @param {string} clientId The active directory application client id.
  13. * @param {string} domain The domain or tenant id containing this application.
  14. * @param {string} secret The authentication secret for the application.
  15. * @param {string} [tokenAudience] The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.net/'.
  16. * 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).
  17. * @param {Environment} [environment] The azure environment to authenticate with.
  18. * @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal.
  19. */
  20. constructor(clientId: string, domain: string, secret: string, tokenAudience?: TokenAudience, environment?: Environment, tokenCache?: TokenCache);
  21. /**
  22. * Tries to get the token from cache initially. If that is unsuccessfull then it tries to get the token from ADAL.
  23. * @returns {Promise<TokenResponse>} A promise that resolves to TokenResponse and rejects with an Error.
  24. */
  25. getToken(): Promise<TokenResponse>;
  26. }
  27. //# sourceMappingURL=applicationTokenCredentials.d.ts.map