Constructor |
Description |
|---|---|
SharedCredential(jsonObject) |
Constructs a SharedCredential object from a JSON object. The attribute name of the JSON object is the same as that of SharedCredential. |
Attribute |
Type |
Description |
|---|---|---|
owner |
Subclass of AppIdentity. |
Credential owner. This attribute is read-only. |
type |
int |
Credential type. This attribute is read-only. The options are as follows:
|
username |
String |
User name, which can contain a maximum of 128 characters. This attribute is read-only. |
content |
ArrayBuffer |
Password, token, and federation information, which can contain a maximum of 16,384 characters. The information can be obtained by calling the getContent() method. |
displayName |
String |
Display name, which can contain a maximum of 128 characters. |
avatarUrl |
String |
URL of a user's avatar, which can contain a maximum of 16,384 characters. |
tag |
String |
Tag of a credential (defined by you), which can contain a maximum of 1024 characters. |
syncAble |
Bool |
Indicates whether a credential can be synchronized between devices. During synchronization, sensitive information in the credential is encrypted using password technologies. Huawei will not obtain the credential content. This method is reserved. In this version, this parameter can be set but does not take effect. In versions released later, the parameter setting will take effect to support credential synchronization between devices. |
userAuth |
Bool |
Indicates whether user authentication is enabled to verify the user's lock screen password or fingerprint when they try to obtain the credential content. This attribute is read-only. |
sharedWith |
AppIdentity[] |
App or website with which the credentials are shared. If credentials are not shared, you do not need to set this parameter. |
timeCreated |
long |
Time when a credential is created, which is a UNIX time. This attribute is read-only. |
timeUpdated |
long |
Time when a credential is updated the last time, which is a UNIX time. This attribute is read-only. |
timeLastUsed |
long |
Time when a credential is used the last time, which is a UNIX time. This attribute is read-only. |
Constant |
Description |
|---|---|
PASSWORD |
Password credential. The value is 0. |
TOKEN |
Token credential. The value is 1. |
FEDERATION |
Federated authentication credential. The value is 2. |