michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIPrincipal; michael@0: michael@0: /** michael@0: * nsIHttpAuthManager michael@0: * michael@0: * This service provides access to cached HTTP authentication michael@0: * user credentials (domain, username, password) for sites michael@0: * visited during the current browser session. michael@0: * michael@0: * This interface exists to provide other HTTP stacks with the michael@0: * ability to share HTTP authentication credentials with Necko. michael@0: * This is currently used by the Java plugin (version 1.5 and michael@0: * higher) to avoid duplicate authentication prompts when the michael@0: * Java client fetches content from a HTTP site that the user michael@0: * has already logged into. michael@0: */ michael@0: [scriptable, uuid(54f90444-c52b-4d2d-8916-c59a2bb25938)] michael@0: interface nsIHttpAuthManager : nsISupports michael@0: { michael@0: /** michael@0: * Lookup auth identity. michael@0: * michael@0: * @param aScheme michael@0: * the URL scheme (e.g., "http"). NOTE: for proxy authentication, michael@0: * this should be "http" (this includes authentication for CONNECT michael@0: * tunneling). michael@0: * @param aHost michael@0: * the host of the server issuing a challenge (ASCII only). michael@0: * @param aPort michael@0: * the port of the server issuing a challenge. michael@0: * @param aAuthType michael@0: * optional string identifying auth type used (e.g., "basic") michael@0: * @param aRealm michael@0: * optional string identifying auth realm. michael@0: * @param aPath michael@0: * optional string identifying auth path. empty for proxy auth. michael@0: * @param aUserDomain michael@0: * return value containing user domain. michael@0: * @param aUserName michael@0: * return value containing user name. michael@0: * @param aUserPassword michael@0: * return value containing user password. michael@0: * @param aIsPrivate michael@0: * whether to look up a private or public identity (they are michael@0: * stored separately, for use by private browsing) michael@0: * @param aPrincipal michael@0: * the principal from which to derive information about which michael@0: * app/mozbrowser is in use for this request michael@0: */ michael@0: void getAuthIdentity(in ACString aScheme, michael@0: in ACString aHost, michael@0: in int32_t aPort, michael@0: in ACString aAuthType, michael@0: in ACString aRealm, michael@0: in ACString aPath, michael@0: out AString aUserDomain, michael@0: out AString aUserName, michael@0: out AString aUserPassword, michael@0: [optional] in bool aIsPrivate, michael@0: [optional] in nsIPrincipal aPrincipal); michael@0: michael@0: /** michael@0: * Store auth identity. michael@0: * michael@0: * @param aScheme michael@0: * the URL scheme (e.g., "http"). NOTE: for proxy authentication, michael@0: * this should be "http" (this includes authentication for CONNECT michael@0: * tunneling). michael@0: * @param aHost michael@0: * the host of the server issuing a challenge (ASCII only). michael@0: * @param aPort michael@0: * the port of the server issuing a challenge. michael@0: * @param aAuthType michael@0: * optional string identifying auth type used (e.g., "basic") michael@0: * @param aRealm michael@0: * optional string identifying auth realm. michael@0: * @param aPath michael@0: * optional string identifying auth path. empty for proxy auth. michael@0: * @param aUserDomain michael@0: * optional string containing user domain. michael@0: * @param aUserName michael@0: * optional string containing user name. michael@0: * @param aUserPassword michael@0: * optional string containing user password. michael@0: * @param aIsPrivate michael@0: * whether to store a private or public identity (they are michael@0: * stored separately, for use by private browsing) michael@0: * @param aPrincipal michael@0: * the principal from which to derive information about which michael@0: * app/mozbrowser is in use for this request michael@0: */ michael@0: void setAuthIdentity(in ACString aScheme, michael@0: in ACString aHost, michael@0: in int32_t aPort, michael@0: in ACString aAuthType, michael@0: in ACString aRealm, michael@0: in ACString aPath, michael@0: in AString aUserDomain, michael@0: in AString aUserName, michael@0: in AString aUserPassword, michael@0: [optional] in boolean aIsPrivate, michael@0: [optional] in nsIPrincipal aPrincipal); michael@0: michael@0: /** michael@0: * Clear all auth cache. michael@0: */ michael@0: void clearAll(); michael@0: };