applicationTokenCredentialsBase.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930
  1. import { TokenCredentialsBase } from "./tokenCredentialsBase";
  2. import { Environment } from "@azure/ms-rest-azure-env";
  3. import { TokenAudience } from "../util/authConstants";
  4. import { TokenCache, TokenResponse } from "adal-node";
  5. export declare abstract class ApplicationTokenCredentialsBase extends TokenCredentialsBase {
  6. /**
  7. * Creates a new ApplicationTokenCredentials object.
  8. * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net}
  9. * for detailed instructions on creating an Azure Active Directory application.
  10. * @constructor
  11. * @param {string} clientId The active directory application client id.
  12. * @param {string} domain The domain or tenant id containing this application.
  13. * @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/'.
  14. * 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).
  15. * @param {Environment} [environment] The azure environment to authenticate with.
  16. * @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal.
  17. */
  18. constructor(clientId: string, domain: string, tokenAudience?: TokenAudience, environment?: Environment, tokenCache?: TokenCache);
  19. protected getTokenFromCache(): Promise<TokenResponse>;
  20. /**
  21. * Removes invalid items from token cache. This method is different. Here we never reject in case of error.
  22. * Rather we resolve with an object that says the result is false and error information is provided in
  23. * the details property of the resolved object. This is done to do better error handling in the above function
  24. * where removeInvalidItemsFromCache() is called.
  25. * @param {object} query The query to be used for finding the token for service principal from the cache
  26. * @returns {result: boolean, details?: Error} resultObject with more info.
  27. */
  28. private removeInvalidItemsFromCache;
  29. }
  30. //# sourceMappingURL=applicationTokenCredentialsBase.d.ts.map