deviceTokenCredentials.d.ts 2.1 KB

12345678910111213141516171819202122232425262728
  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 DeviceTokenCredentials extends TokenCredentialsBase {
  6. readonly username: string;
  7. /**
  8. * Creates a new DeviceTokenCredentials object that gets a new access token using userCodeInfo (contains user_code, device_code)
  9. * for authenticating user on device.
  10. *
  11. * When this credential is used, the script will provide a url and code. The user needs to copy the url and the code, paste it
  12. * in a browser and authenticate over there. If successful, the script will get the access token.
  13. *
  14. * @constructor
  15. * @param {string} [clientId] The active directory application client id.
  16. * @param {string} [domain] The domain or tenant id containing this application. Default value is "common"
  17. * @param {string} [username] The user name for account in the form: "user@example.com".
  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. * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net}
  21. * for an example.
  22. * @param {Environment} [environment] The azure environment to authenticate with. Default environment is "Azure" popularly known as "Public Azure Cloud".
  23. * @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal.
  24. */
  25. constructor(clientId?: string, domain?: string, username?: string, tokenAudience?: TokenAudience, environment?: Environment, tokenCache?: TokenCache);
  26. getToken(): Promise<TokenResponse>;
  27. }
  28. //# sourceMappingURL=deviceTokenCredentials.d.ts.map