nsIHttpAuthManager.idl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. interface nsIPrincipal;
  7. /**
  8. * nsIHttpAuthManager
  9. *
  10. * This service provides access to cached HTTP authentication
  11. * user credentials (domain, username, password) for sites
  12. * visited during the current browser session.
  13. *
  14. * This interface exists to provide other HTTP stacks with the
  15. * ability to share HTTP authentication credentials with Necko.
  16. * This is currently used by the Java plugin (version 1.5 and
  17. * higher) to avoid duplicate authentication prompts when the
  18. * Java client fetches content from a HTTP site that the user
  19. * has already logged into.
  20. */
  21. [scriptable, uuid(54f90444-c52b-4d2d-8916-c59a2bb25938)]
  22. interface nsIHttpAuthManager : nsISupports
  23. {
  24. /**
  25. * Lookup auth identity.
  26. *
  27. * @param aScheme
  28. * the URL scheme (e.g., "http"). NOTE: for proxy authentication,
  29. * this should be "http" (this includes authentication for CONNECT
  30. * tunneling).
  31. * @param aHost
  32. * the host of the server issuing a challenge (ASCII only).
  33. * @param aPort
  34. * the port of the server issuing a challenge.
  35. * @param aAuthType
  36. * optional string identifying auth type used (e.g., "basic")
  37. * @param aRealm
  38. * optional string identifying auth realm.
  39. * @param aPath
  40. * optional string identifying auth path. empty for proxy auth.
  41. * @param aUserDomain
  42. * return value containing user domain.
  43. * @param aUserName
  44. * return value containing user name.
  45. * @param aUserPassword
  46. * return value containing user password.
  47. * @param aIsPrivate
  48. * whether to look up a private or public identity (they are
  49. * stored separately, for use by private browsing)
  50. * @param aPrincipal
  51. * the principal from which to derive information about which
  52. * app/mozbrowser is in use for this request
  53. */
  54. void getAuthIdentity(in ACString aScheme,
  55. in ACString aHost,
  56. in int32_t aPort,
  57. in ACString aAuthType,
  58. in ACString aRealm,
  59. in ACString aPath,
  60. out AString aUserDomain,
  61. out AString aUserName,
  62. out AString aUserPassword,
  63. [optional] in bool aIsPrivate,
  64. [optional] in nsIPrincipal aPrincipal);
  65. /**
  66. * Store auth identity.
  67. *
  68. * @param aScheme
  69. * the URL scheme (e.g., "http"). NOTE: for proxy authentication,
  70. * this should be "http" (this includes authentication for CONNECT
  71. * tunneling).
  72. * @param aHost
  73. * the host of the server issuing a challenge (ASCII only).
  74. * @param aPort
  75. * the port of the server issuing a challenge.
  76. * @param aAuthType
  77. * optional string identifying auth type used (e.g., "basic")
  78. * @param aRealm
  79. * optional string identifying auth realm.
  80. * @param aPath
  81. * optional string identifying auth path. empty for proxy auth.
  82. * @param aUserDomain
  83. * optional string containing user domain.
  84. * @param aUserName
  85. * optional string containing user name.
  86. * @param aUserPassword
  87. * optional string containing user password.
  88. * @param aIsPrivate
  89. * whether to store a private or public identity (they are
  90. * stored separately, for use by private browsing)
  91. * @param aPrincipal
  92. * the principal from which to derive information about which
  93. * app/mozbrowser is in use for this request
  94. */
  95. void setAuthIdentity(in ACString aScheme,
  96. in ACString aHost,
  97. in int32_t aPort,
  98. in ACString aAuthType,
  99. in ACString aRealm,
  100. in ACString aPath,
  101. in AString aUserDomain,
  102. in AString aUserName,
  103. in AString aUserPassword,
  104. [optional] in boolean aIsPrivate,
  105. [optional] in nsIPrincipal aPrincipal);
  106. /**
  107. * Clear all auth cache.
  108. */
  109. void clearAll();
  110. };