KeychainCredential interface

A JavaScript object implementing the KeychainCredential interface represents an entry in the application’s Keychain. These store account information and secrets such as passwords, used to configure the platform and plugins.

The "pKeychainRead" privilege is required to use the keychain.

Construction

Use O.keychain.credential() to load a credential by ID or name.

Use O.keychain.query() to discover what credentials are available in the keychain.

Interface

property id

The ID of this credential.

property name

The name of this credential.

property kind

The overall kind of credential, for example, "Generic" or "HTTP".

property instanceKind

The specific kind of credential which specifies the kind of credential (eg "Basic" for HTTP), or system to which it connects (eg "LDAP" for authentication services).

property account

A JavaScript object with properties specifying the account details, for example, a username.

The property names are the names specified in the System Management user interface.

property secret

A JavaScript object with properties specifying the secrets necessary to authenticate, for example, a password.

The "pKeychainReadSecret" privilege is required to read this property.

function encode(encoding)

Encode a credential for a specific purpose, throwing an exception if it is not possible.

The "pKeychainReadSecret" privilege is required to use encode().

Passing in encoding as "http-authorization" will return the credential encoded for an HTTP Authorization header, including the authentication scheme such as Basic.