android-components / mozilla.components.concept.storage / Login

Login

data class Login (source)

Represents a login that can be used by autofill APIs.

Note that much of this information can be partial (e.g., a user might save a password with a blank username).

Constructors

Name Summary
<init> Login(guid: String? = null, origin: String, formActionOrigin: String? = null, httpRealm: String? = null, username: String, password: String, timesUsed: Int = 0, timeCreated: Long = 0L, timeLastUsed: Long = 0L, timePasswordChanged: Long = 0L, usernameField: String? = null, passwordField: String? = null)
Represents a login that can be used by autofill APIs.

Properties

Name Summary
formActionOrigin val formActionOrigin: String?
The origin this login entry was submitted to. This only applies to form-based login entries. It’s derived from the action attribute set on the form element.
guid val guid: String?
The unique identifier for this login entry.
httpRealm val httpRealm: String?
The HTTP realm this login entry was requested for. This only applies to non-form-based login entries. It’s derived from the WWW-Authenticate header set in a HTTP 401 response, see RFC2617 for details.
origin val origin: String
The origin this login entry applies to.
password val password: String
The password for this login entry.
passwordField val passwordField: String?
HTML field associated with the password.
timeCreated val timeCreated: Long
Time of creation in milliseconds from the unix epoch.
timeLastUsed val timeLastUsed: Long
Time of last use in milliseconds from the unix epoch.
timePasswordChanged val timePasswordChanged: Long
Time of last password change in milliseconds from the unix epoch.
timesUsed val timesUsed: Int
Number of times this password has been used.
username val username: String
The username for this login entry.
usernameField val usernameField: String?
HTML field associated with the username.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.
mergeWithLogin fun Login.mergeWithLogin(login: Login): Login
Will use values from this if they are 1) non-null and 2) non-empty. Otherwise, will fall back to values from this.
toServerPassword fun Login.toServerPassword(): ServerPassword
Converts an Android Components Login to an Application Services ServerPassword