nsILoginInfo is an object containing information for a login stored by the Login Manager.
To create and manage logins use nsILoginManager.
Inherits from: nsISupports
Implemented by: @mozilla.org/login-manager/loginInfo;1. To create an instance, use:
var loginInfo = Components.classes["@mozilla.org/login-manager/loginInfo;1"]
.createInstance(Components.interfaces.nsILoginInfo);
nsILoginInfo clone(); |
boolean equals(in nsILoginInfo aLoginInfo); |
void init(in AString aHostname, in AString aFormSubmitURL, in AString aHttpRealm, in AString aUsername, in AString aPassword, in AString aUsernameField, in AString aPasswordField); |
boolean matches(in nsILoginInfo aLoginInfo, in boolean ignorePassword); |
| Attribute | Type | Description |
formSubmitURL |
AString |
The origin, not URL, a form-based login was submitted to. For logins obtained from HTML forms, this field is the action attribute from the form element, with the path removed (for example, "https://www.site.com"). Forms with no action attribute default to submitting to their origin URL, so that is stored here. This field is null for logins attained from protocol authentications and "" means to match against any form action. |
hostname |
AString |
The origin, not hostname, to which the login applies (for example, "https://www.site.com"). A port number (":123") may be appended. |
httpRealm |
AString |
The HTTP Realm for which the login was requested. When an HTTP server sends a 401 result, the WWW-Authenticate header includes a realm to identify the "protection space." See RFC 2617. If the result did not include a realm, or it was blank, the hostname is used instead. For logins obtained from HTML forms, this field is null. |
password |
AString |
The password for the login. |
passwordField |
AString |
The name attribute for the password input in a form. Non-form logins should specify an empty string (""). |
username |
AString |
The username for the login. |
usernameField |
AString |
The name attribute for the username input in a form. Non-form logins should specify an empty string (""). |
Returns a clone of this login.
nsILoginInfo clone();
None.
An nsILoginInfo containing a clone of the login on which this method was invoked.
Tests to determine whether this login is exactly equal to another nsILoginInfo object.
boolean equals( in nsILoginInfo aLoginInfo );
aLoginInfotrue if the two logins are exactly equal or false if they're not.
Initializes a newly created nsILoginInfo object.
void init( in AString aHostname, in AString aFormSubmitURL, in AString aHttpRealm, in AString aUsername, in AString aPassword, in AString aUsernameField, in AString aPasswordField );
aHostnamehostname field.aFormSubmitURLformSubmitURL field.aHttpRealmhttpRealm field.aUsernameusername field.aPasswordpassword field.aUsernameFieldusernameField field.aPasswordFieldpasswordField field.Tests to determine whether this login is loosely equivalent to another nsILoginInfo object. The passwordField and usernameField values are ignored, and the password values may be optionally ignored. If one login's formSubmitURL is an empty string (but not null), it will be treated as a wildcard.
A blank value indicates the login was stored before bug 360493 was fixed.
boolean matches( in nsILoginInfo aLoginInfo, in boolean ignorePassword );
aLoginInfoignorePasswordtrue, do not examine the password value when matching.true if the two logins are equivilant or false if they're not.