msiAppServiceTokenCredentials.d.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { MSITokenCredentials, MSIOptions, MSITokenResponse } from "./msiTokenCredentials";
  2. import { WebResource } from "@azure/ms-rest-js";
  3. /**
  4. * @interface MSIAppServiceOptions Defines the optional parameters for authentication with MSI for AppService.
  5. */
  6. export interface MSIAppServiceOptions extends MSIOptions {
  7. /**
  8. * @property {string} [msiEndpoint] - The local URL from which your app can request tokens.
  9. * Either provide this parameter or set the environment variable `MSI_ENDPOINT`.
  10. * For example: `export MSI_ENDPOINT="http://127.0.0.1:41741/MSI/token/"`
  11. */
  12. msiEndpoint?: string;
  13. /**
  14. * @property {string} [msiSecret] - The secret used in communication between your code and the local MSI agent.
  15. * Either provide this parameter or set the environment variable `MSI_SECRET`.
  16. * For example: `export MSI_SECRET="69418689F1E342DD946CB82994CDA3CB"`
  17. */
  18. msiSecret?: string;
  19. /**
  20. * @property {string} [msiApiVersion] - The api-version of the local MSI agent. Default value is "2017-09-01".
  21. */
  22. msiApiVersion?: string;
  23. }
  24. /**
  25. * @class MSIAppServiceTokenCredentials
  26. */
  27. export declare class MSIAppServiceTokenCredentials extends MSITokenCredentials {
  28. /**
  29. * @property {string} msiEndpoint - The local URL from which your app can request tokens.
  30. * Either provide this parameter or set the environment variable `MSI_ENDPOINT`.
  31. * For example: `MSI_ENDPOINT="http://127.0.0.1:41741/MSI/token/"`
  32. */
  33. msiEndpoint: string;
  34. /**
  35. * @property {string} msiSecret - The secret used in communication between your code and the local MSI agent.
  36. * Either provide this parameter or set the environment variable `MSI_SECRET`.
  37. * For example: `MSI_SECRET="69418689F1E342DD946CB82994CDA3CB"`
  38. */
  39. msiSecret: string;
  40. /**
  41. * @property {string} [msiApiVersion] The api-version of the local MSI agent. Default value is "2017-09-01".
  42. */
  43. msiApiVersion?: string;
  44. /**
  45. * Creates an instance of MSIAppServiceTokenCredentials.
  46. * @param {string} [options.msiEndpoint] - The local URL from which your app can request tokens.
  47. * Either provide this parameter or set the environment variable `MSI_ENDPOINT`.
  48. * For example: `MSI_ENDPOINT="http://127.0.0.1:41741/MSI/token/"`
  49. * @param {string} [options.msiSecret] - The secret used in communication between your code and the local MSI agent.
  50. * Either provide this parameter or set the environment variable `MSI_SECRET`.
  51. * For example: `MSI_SECRET="69418689F1E342DD946CB82994CDA3CB"`
  52. * @param {string} [options.resource] - The resource uri or token audience for which the token is needed.
  53. * For e.g. it can be:
  54. * - resource management endpoint "https://management.azure.com/" (default)
  55. * - management endpoint "https://management.core.windows.net/"
  56. * @param {string} [options.msiApiVersion] - The api-version of the local MSI agent. Default value is "2017-09-01".
  57. */
  58. constructor(options?: MSIAppServiceOptions);
  59. /**
  60. * Prepares and sends a GET request to a service endpoint indicated by the app service, which responds with the access token.
  61. * @return {Promise<MSITokenResponse>} Promise with the tokenResponse (tokenType and accessToken are the two important properties).
  62. */
  63. getToken(): Promise<MSITokenResponse>;
  64. protected prepareRequestOptions(): WebResource;
  65. }
  66. //# sourceMappingURL=msiAppServiceTokenCredentials.d.ts.map