userTokenCredentials.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import { TokenCredentialsBase } from "./tokenCredentialsBase";
  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 UserTokenCredentials extends TokenCredentialsBase {
  6. readonly username: string;
  7. readonly password: string;
  8. /**
  9. * Creates a new UserTokenCredentials object.
  10. *
  11. * @constructor
  12. * @param {string} clientId The active directory application client id.
  13. * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net}
  14. * for an example.
  15. * @param {string} domain The domain or tenant id containing this application.
  16. * @param {string} username The user name for the Organization Id account.
  17. * @param {string} password The password for the Organization Id account.
  18. * @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/'.
  19. * 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).
  20. * @param {Environment} [environment] The azure environment to authenticate with.
  21. * @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal.
  22. */
  23. constructor(clientId: string, domain: string, username: string, password: string, tokenAudience?: TokenAudience, environment?: Environment, tokenCache?: TokenCache);
  24. private crossCheckUserNameWithToken;
  25. /**
  26. * Tries to get the token from cache initially. If that is unsuccessful then it tries to get the token from ADAL.
  27. * @returns {Promise<TokenResponse>}
  28. * {object} [tokenResponse] The tokenResponse (tokenType and accessToken are the two important properties).
  29. * @memberof UserTokenCredentials
  30. */
  31. getToken(): Promise<TokenResponse>;
  32. }
  33. //# sourceMappingURL=userTokenCredentials.d.ts.map