nsIAuthInformation 编辑

netwerk/base/public/nsIAuthInformation.idlScriptable A object that holds authentication information. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

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.

Attributes

AttributeTypeDescription
authenticationSchemeAUTF8StringThe 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. Read only.
domainAStringThe initial value should be used to prefill the dialog or be shown 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.
flagsunsigned long

Flags describing this dialog. A bitwise OR of the constants.

It is possible that neither #AUTH_HOST nor #AUTH_PROXY are set.

Auth prompts should ignore flags they do not understand; especially, they should not throw an exception because of an unsupported flag. Read only.
passwordAStringThe initial value should be used to prefill the dialog or be shown in some other way to the user. The password should not be shown in clear. On return, this parameter should contain the password entered by the user.
realmAStringThe 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". Read only.
usernameAStringThe initial value should be used to prefill the dialog or be shown in some other way to the user. On return, this parameter should contain the username entered by the user. This field can only be changed if the #ONLY_PASSWORD flag is not set.

Constants

ConstantValueDescription
AUTH_HOST1This dialog belongs to a network host.
AUTH_PROXY2This dialog belongs to a proxy.
NEED_DOMAIN4This dialog needs domain information. The user interface should show a domain field, prefilled with the domain attributes value.
ONLY_PASSWORD8

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".

This flag is mutually exclusive with #NEED_DOMAIN.
PREVIOUS_FAILED16We 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:46 次

字数:5389

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文