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: /** michael@0: * A object that hold authentication information. The caller of michael@0: * nsIAuthPrompt2::promptUsernameAndPassword or michael@0: * nsIAuthPrompt2::promptPasswordAsync provides an object implementing this michael@0: * interface; the prompt implementation can then read the values here to prefill michael@0: * the dialog. After the user entered the authentication information, it should michael@0: * set the attributes of this object to indicate to the caller what was entered michael@0: * by the user. michael@0: */ michael@0: [scriptable, uuid(0d73639c-2a92-4518-9f92-28f71fea5f20)] michael@0: interface nsIAuthInformation : nsISupports michael@0: { michael@0: /** @name Flags */ michael@0: /* @{ */ michael@0: /** michael@0: * This dialog belongs to a network host. michael@0: */ michael@0: const uint32_t AUTH_HOST = 1; michael@0: michael@0: /** michael@0: * This dialog belongs to a proxy. michael@0: */ michael@0: const uint32_t AUTH_PROXY = 2; michael@0: michael@0: /** michael@0: * This dialog needs domain information. The user interface should show a michael@0: * domain field, prefilled with the domain attribute's value. michael@0: */ michael@0: const uint32_t NEED_DOMAIN = 4; michael@0: michael@0: /** michael@0: * This dialog only asks for password information. Authentication prompts michael@0: * SHOULD NOT show a username field. Attempts to change the username field michael@0: * will have no effect. nsIAuthPrompt2 implementations should, however, show michael@0: * its initial value to the user in some form. For example, a paragraph in michael@0: * the dialog might say "Please enter your password for user jsmith at michael@0: * server intranet". michael@0: * michael@0: * This flag is mutually exclusive with #NEED_DOMAIN. michael@0: */ michael@0: const uint32_t ONLY_PASSWORD = 8; michael@0: michael@0: /** michael@0: * We have already tried to log in for this channel michael@0: * (with auth values from a previous promptAuth call), michael@0: * but it failed, so we now ask the user to provide a new, correct login. michael@0: * michael@0: * @see also RFC 2616, Section 10.4.2 michael@0: */ michael@0: const uint32_t PREVIOUS_FAILED = 16; michael@0: /* @} */ michael@0: michael@0: /** michael@0: * Flags describing this dialog. A bitwise OR of the flag values michael@0: * above. michael@0: * michael@0: * It is possible that neither #AUTH_HOST nor #AUTH_PROXY are set. michael@0: * michael@0: * Auth prompts should ignore flags they don't understand; especially, they michael@0: * should not throw an exception because of an unsupported flag. michael@0: */ michael@0: readonly attribute unsigned long flags; michael@0: michael@0: /** michael@0: * The server-supplied realm of the authentication as defined in RFC 2617. michael@0: * Can be the empty string if the protocol does not support realms. michael@0: * Otherwise, this is a human-readable string like "Secret files". michael@0: */ michael@0: readonly attribute AString realm; michael@0: michael@0: /** michael@0: * The authentication scheme used for this request, if applicable. If the michael@0: * protocol for this authentication does not support schemes, this will be michael@0: * the empty string. Otherwise, this will be a string such as "basic" or michael@0: * "digest". This string will always be in lowercase. michael@0: */ michael@0: readonly attribute AUTF8String authenticationScheme; michael@0: michael@0: /** michael@0: * The initial value should be used to prefill the dialog or be shown michael@0: * in some other way to the user. michael@0: * On return, this parameter should contain the username entered by michael@0: * the user. michael@0: * This field can only be changed if the #ONLY_PASSWORD flag is not set. michael@0: */ michael@0: attribute AString username; michael@0: michael@0: /** michael@0: * The initial value should be used to prefill the dialog or be shown michael@0: * in some other way to the user. michael@0: * The password should not be shown in clear. michael@0: * On return, this parameter should contain the password entered by michael@0: * the user. michael@0: */ michael@0: attribute AString password; michael@0: michael@0: /** michael@0: * The initial value should be used to prefill the dialog or be shown michael@0: * in some other way to the user. michael@0: * On return, this parameter should contain the domain entered by michael@0: * the user. michael@0: * This attribute is only used if flags include #NEED_DOMAIN. michael@0: */ michael@0: attribute AString domain; michael@0: }; michael@0: