2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-08-27 01:42:54 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A object that hold authentication information. The caller of
|
|
|
|
* nsIAuthPrompt2::promptUsernameAndPassword or
|
|
|
|
* nsIAuthPrompt2::promptPasswordAsync provides an object implementing this
|
|
|
|
* interface; the prompt implementation can then read the values here to prefill
|
|
|
|
* the dialog. After the user entered the authentication information, it should
|
|
|
|
* set the attributes of this object to indicate to the caller what was entered
|
|
|
|
* by the user.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(0d73639c-2a92-4518-9f92-28f71fea5f20)]
|
|
|
|
interface nsIAuthInformation : nsISupports
|
|
|
|
{
|
|
|
|
/** @name Flags */
|
|
|
|
/* @{ */
|
|
|
|
/**
|
|
|
|
* This dialog belongs to a network host.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t AUTH_HOST = 1;
|
2006-08-27 01:42:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This dialog belongs to a proxy.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t AUTH_PROXY = 2;
|
2006-08-27 01:42:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This dialog needs domain information. The user interface should show a
|
|
|
|
* domain field, prefilled with the domain attribute's value.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t NEED_DOMAIN = 4;
|
2006-08-27 01:42:54 +04:00
|
|
|
|
|
|
|
/**
|
2006-09-23 01:01:59 +04:00
|
|
|
* This dialog only asks for password information. Authentication prompts
|
|
|
|
* SHOULD NOT show a username field. Attempts to change the username field
|
|
|
|
* will have no effect. nsIAuthPrompt2 implementations should, however, show
|
|
|
|
* its initial value to the user in some form. For example, a paragraph in
|
|
|
|
* the dialog might say "Please enter your password for user jsmith at
|
|
|
|
* server intranet".
|
2006-08-27 01:42:54 +04:00
|
|
|
*
|
|
|
|
* This flag is mutually exclusive with #NEED_DOMAIN.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t ONLY_PASSWORD = 8;
|
2010-02-12 19:55:11 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* We have already tried to log in for this channel
|
|
|
|
* (with auth values from a previous promptAuth call),
|
|
|
|
* but it failed, so we now ask the user to provide a new, correct login.
|
|
|
|
*
|
|
|
|
* @see also RFC 2616, Section 10.4.2
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t PREVIOUS_FAILED = 16;
|
2016-06-06 02:06:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A cross-origin sub-resource requests an authentication.
|
|
|
|
* The message presented to users must reflect that.
|
|
|
|
*/
|
|
|
|
const uint32_t CROSS_ORIGIN_SUB_RESOURCE = 32;
|
2006-08-27 01:42:54 +04:00
|
|
|
/* @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flags describing this dialog. A bitwise OR of the flag values
|
|
|
|
* above.
|
|
|
|
*
|
|
|
|
* It is possible that neither #AUTH_HOST nor #AUTH_PROXY are set.
|
|
|
|
*
|
2006-09-23 01:01:59 +04:00
|
|
|
* Auth prompts should ignore flags they don't understand; especially, they
|
2006-08-27 01:42:54 +04:00
|
|
|
* should not throw an exception because of an unsupported flag.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long flags;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The server-supplied realm of the authentication as defined in RFC 2617.
|
|
|
|
* Can be the empty string if the protocol does not support realms.
|
|
|
|
* Otherwise, this is a human-readable string like "Secret files".
|
|
|
|
*/
|
|
|
|
readonly attribute AString realm;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The authentication scheme used for this request, if applicable. If the
|
|
|
|
* protocol for this authentication does not support schemes, this will be
|
|
|
|
* the empty string. Otherwise, this will be a string such as "basic" or
|
|
|
|
* "digest". This string will always be in lowercase.
|
|
|
|
*/
|
|
|
|
readonly attribute AUTF8String authenticationScheme;
|
|
|
|
|
|
|
|
/**
|
2006-09-23 01:01:59 +04:00
|
|
|
* The initial value should be used to prefill the dialog or be shown
|
|
|
|
* in some other way to the user.
|
2006-08-27 01:42:54 +04:00
|
|
|
* On return, this parameter should contain the username entered by
|
|
|
|
* the user.
|
2006-09-23 01:01:59 +04:00
|
|
|
* This field can only be changed if the #ONLY_PASSWORD flag is not set.
|
2006-08-27 01:42:54 +04:00
|
|
|
*/
|
|
|
|
attribute AString username;
|
|
|
|
|
|
|
|
/**
|
2006-09-23 01:01:59 +04:00
|
|
|
* The initial value should be used to prefill the dialog or be shown
|
2006-08-27 01:42:54 +04:00
|
|
|
* in some other way to the user.
|
2006-09-23 01:01:59 +04:00
|
|
|
* The password should not be shown in clear.
|
|
|
|
* On return, this parameter should contain the password entered by
|
2006-08-27 01:42:54 +04:00
|
|
|
* the user.
|
|
|
|
*/
|
|
|
|
attribute AString password;
|
|
|
|
|
|
|
|
/**
|
2006-09-23 01:01:59 +04:00
|
|
|
* The initial value should be used to prefill the dialog or be shown
|
2006-08-27 01:42:54 +04:00
|
|
|
* in some other way to the user.
|
|
|
|
* On return, this parameter should contain the domain entered by
|
|
|
|
* the user.
|
|
|
|
* This attribute is only used if flags include #NEED_DOMAIN.
|
|
|
|
*/
|
|
|
|
attribute AString domain;
|
|
|
|
};
|
|
|
|
|