PasswordCredential Class

A user name and password credential (https://w3c.github.io/webappsec-credential-management/#passwordcredential-interface), stored by navigator.credentials.store() and returned by navigator.credentials.get({ password: true }). The credential store of the user agent is the one of the UserAgentUIBackend: see UserAgentUIBackend.ChooseCredentialAsync and UserAgentUIBackend.StoreCredentialAsync.

public sealed class PasswordCredential : Credential
Inheritance
Credential PasswordCredential

Constructors

NameDescription
PasswordCredential(HtmlFormElement)Creates a credential from the fields of a form (https://w3c.github.io/webappsec-credential-management/#construct-passwordcredential-form): the values of its submittable elements whose autofill field name is username (the identifier), current-password or new-password (the password, a new password winning), name or nickname (the name) and photo (the icon URL). The origin is the origin of the document of the current global object. Throws a TypeErrorException when the identifier or the password is empty.
PasswordCredential(PasswordCredentialData)Creates a credential from its data (https://w3c.github.io/webappsec-credential-management/#construct-passwordcredential-data). Throws a TypeErrorException when the identifier, the origin or the password is empty.

PasswordCredential overloads

PasswordCredential(HtmlFormElement)

PasswordCredential.cs

Creates a credential from the fields of a form (https://w3c.github.io/webappsec-credential-management/#construct-passwordcredential-form): the values of its submittable elements whose autofill field name is username (the identifier), current-password or new-password (the password, a new password winning), name or nickname (the name) and photo (the icon URL). The origin is the origin of the document of the current global object. Throws a TypeErrorException when the identifier or the password is empty.

public PasswordCredential(HtmlFormElement form)

PasswordCredential(PasswordCredentialData)

PasswordCredential.cs

Creates a credential from its data (https://w3c.github.io/webappsec-credential-management/#construct-passwordcredential-data). Throws a TypeErrorException when the identifier, the origin or the password is empty.

public PasswordCredential(PasswordCredentialData data)

Properties

NameDescription
IconUrlGets the URL of the image of the account (the empty string when there is none).
IdGets the identifier of the credential.
NameGets the name of the account (the empty string when there is none).
OriginGets the serialization of the origin of the credential ([[origin]]): the site that the credential signs in to.
PasswordGets the password.
TypeGets the type of the credential (the [[type]] of its interface, e.g. password or public-key).

Gets the URL of the image of the account (the empty string when there is none).

public string IconUrl { get; }

Gets the identifier of the credential.

public override string Id { get; }

Gets the name of the account (the empty string when there is none).

public string Name { get; }

Gets the serialization of the origin of the credential ([[origin]]): the site that the credential signs in to.

public string Origin { get; }

Property value

string

Gets the type of the credential (the [[type]] of its interface, e.g. password or public-key).

public override string Type { get; }