msiVmTokenCredentials.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { MSITokenCredentials, MSIOptions, MSITokenResponse } from "./msiTokenCredentials";
  2. import { WebResource, HttpMethods } from "@azure/ms-rest-js";
  3. /**
  4. * @interface MSIVmOptions Defines the optional parameters for authentication with MSI for Virtual Machine.
  5. */
  6. export interface MSIVmOptions extends MSIOptions {
  7. /**
  8. * @property {string} [msiEndpoint] - Azure Instance Metadata Service identity endpoint.
  9. *
  10. * The default and recommended endpoint is "http://169.254.169.254/metadata/identity/oauth2/token"
  11. * per https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
  12. */
  13. msiEndpoint?: string;
  14. /**
  15. * The API version parameter specifies the Azure Instance Metadata Service version.
  16. * Use api-version=2018-02-01 (default) or higher.
  17. */
  18. apiVersion?: string;
  19. /**
  20. * HTTP method used to make HTTP request to MSI service. GET by default.
  21. */
  22. httpMethod?: HttpMethods;
  23. /**
  24. * The objectId of the managed identity you would like the token for. Required, if your
  25. * VM has multiple user-assigned managed identities.
  26. */
  27. objectId?: string;
  28. /**
  29. * The clientId of the managed identity you would like the token for. Required, if your
  30. * VM has multiple user-assigned managed identities.
  31. */
  32. clientId?: string;
  33. /**
  34. * The `Azure Resource ID` of the managed identity you would like the token for. Required,
  35. * if your VM has multiple user-assigned managed identities.
  36. */
  37. identityId?: string;
  38. }
  39. /**
  40. * @class MSIVmTokenCredentials
  41. */
  42. export declare class MSIVmTokenCredentials extends MSITokenCredentials {
  43. msiEndpoint: string;
  44. apiVersion: string;
  45. httpMethod: HttpMethods;
  46. objectId?: string;
  47. clientId?: string;
  48. identityId?: string;
  49. constructor(options?: MSIVmOptions);
  50. /**
  51. * Prepares and sends a POST request to a service endpoint hosted on the Azure VM, which responds with the access token.
  52. * @return {Promise<MSITokenResponse>} Promise with the tokenResponse (tokenType and accessToken are the two important properties).
  53. */
  54. getToken(): Promise<MSITokenResponse>;
  55. protected prepareRequestOptions(): WebResource;
  56. }
  57. //# sourceMappingURL=msiVmTokenCredentials.d.ts.map