The **appAccount** module provides APIs for app account management. You can use the APIs to add, delete, query, modify, and authorize app accounts, write data to disks, and synchronize data.
...
...
@@ -154,7 +154,7 @@ Implicitly adds an app account based on the specified account owner, authenticat
The osAccount module provides basic capabilities for managing operating system (OS) accounts, including adding, deleting, querying, setting, subscribing to, and enabling an OS account, and storing OS account data to disks.
The **osAccount** module provides basic capabilities for managing operating system (OS) accounts, including adding, deleting, querying, setting, subscribing to, and enabling an OS account, and storing OS account data to disks.
> **NOTE**<br>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...
...
@@ -440,12 +440,10 @@ This is a system API and cannot be called by third-party applications.
| request | [GetPropertyRequest](#GetPropertyRequest<sup>8+</sup>) | Yes | Request information, including the authentication credential type and property list.|
| callback | AsyncCallback<[ExecutorProperty](#ExecutorProperty<sup>8+</sup>)> | Yes | Callback invoked to return the executor property obtained. |
| request | [GetPropertyRequest](#getpropertyrequest8) | Yes | Request information, including the authentication credential type and property list.|
| callback | AsyncCallback<[ExecutorProperty](#executorproperty8)> | Yes | Callback invoked to return the executor property obtained. |
| request | [GetPropertyRequest](#GetPropertyRequest<sup>8+</sup>) | Yes | Request information, including the authentication credential type and property list.|
| request | [GetPropertyRequest](#getpropertyrequest8) | Yes | Request information, including the authentication credential type and property list.|
| request | [SetPropertyRequest](#SetPropertyRequest<sup>8+</sup>)| Yes | Request information, including the authentication credential type and key value to set. |
| callback | AsyncCallback<number> | Yes | Callback invoked to return the [result code](#ResultCode<sup>8+</sup>).|
| request | [SetPropertyRequest](#setpropertyrequest8)| Yes | Request information, including the authentication credential type and key value to set. |
| callback | AsyncCallback<number> | Yes | Callback invoked to return the [result](#resultcode8).|
| request | [SetPropertyRequest](#SetPropertyRequest<sup>8+</sup>) | Yes | Request information, including the authentication credential type and the key value to set.|
| request | [SetPropertyRequest](#setpropertyrequest8) | Yes | Request information, including the authentication credential type and the key value to set.|
| authTrustLevel | [AuthTrustLevel](#AuthTrustLevel<sup>8+</sup>) | Yes | Trust level of the authentication result. |
| callback | [IUserAuthCallback](#IUserAuthCallback<sup>8+</sup>) | Yes | Callback invoked to return the authentication result and obtained information. |
| authTrustLevel | [AuthTrustLevel](#AuthTrustLevel<sup>8+</sup>) | Yes | Trust level of the authentication result. |
| callback | [IUserAuthCallback](#IUserAuthCallback<sup>8+</sup>) | Yes | Callback invoked to return the authentication result and obtained information. |
| callback | AsyncCallback<Uint8Array> | Yes | Callback invoked to return the result. If **0** is returned, the operation failed. If the operation is successful, the challenge value (a non-zero value) will be returned.|
| callback | AsyncCallback<Uint8Array> | Yes | Callback invoked to return the challenge value. If **0** is returned, the operation failed.|
**Example**
```js
varuserIDM=newosAccount.UserIdentityManager();
varchallenge;
userIDM.openSession(function(err,data){
try{
console.log("====>test for examples before get challenge");
console.log("====>test for examples + "+data);
challenge=data;
console.log("====>test for examples end ");
console.log("====>test for examples after get challenge");
}
catch(e){
console.info('====>test for examples openSession error = '+JSON.stringify(e));
| Promise<Uint8Array> | Promise used to return the result. If **0** is returned, the operation failed. If the operation is successful, the challenge value (a non-zero value) will be returned.|
| Promise<Uint8Array> | Promise used to return the challenge value. If **0** is returned, the operation failed.|
**Example**
```js
varuserIDM=newosAccount.UserIdentityManager();
varchallenge;
userIDM.openSession().then((data)=>{
try{
console.log("====>test for examples before get challenge");
console.log("====>test for examples + "+data);
challenge=data;
console.log("====>test for examples end ");
console.log("====>test for examples after get challenge");
}
catch(err){
console.info('====>test for examples faceDemo openSession error1 = '+JSON.stringify(err));
}
})
.catch((err)=>{
console.info('====>test for examples faceDemo openSession error2 = '+JSON.stringify(err));
| callback | AsyncCallback<Array<[EnrolledCredInfo](#enrolledcredinfo8)>> | Yes | Callback invoked to return information about all enrolled credentials of the specified type.|
| callback | AsyncCallback<Array<[EnrolledCredInfo](#EnrolledCredInfo<sup>8+</sup>)>> | Yes | Callback invoked to return information about all enrolled credentials of the specified type of the user.|
| callback | AsyncCallback<Array<[EnrolledCredInfo](#enrolledcredinfo8)>> | Yes | Callback invoked to return information about all the user's enrolled credentials of the specified type.|
**Example**
```js
varuserIDM=newosAccount.UserIdentityManager();
varauthType=osAccount.AuthType.PIN;
userIDM.getAuthInfo(authType,function(authInfo){
console.log("====>test for examples getAuthInfo AsyncCallback = "+JSON.stringify(authInfo))
| Promise<Array<[EnrolledCredInfo](#EnrolledCredInfo<sup>8+</sup>)>> | Promise used to return information about all enrolled credentials of the specified type of the user.|
| Promise<Array<[EnrolledCredInfo](#enrolledcredinfo8)>> | Promise used to return information about all the user's enrolled credentials of the specified type.|
**Example**
```js
varuserIDM=newosAccount.UserIdentityManager();
varauthType=osAccount.AuthType.PIN;
userIDM.getAuthInfo(authType).then((authInfo)=>{
console.log("====>test for examples getAuthInfo AsyncCallback = "+JSON.stringify(authInfo))
| result | number | Yes | Authentication result code.|
| extraInfo | [AuthResult](#AuthResult<sup>8+</sup>) | Yes | Specific authentication result information. If the authentication is successful, the authentication token is returned in **extrainfo**. If the authentication fails, the remaining authentication time is returned. If the authentication executor is locked, the freezing time is returned.|
| extraInfo | [AuthResult](#authresult8) | Yes | Specific authentication result information. If the authentication is successful, the authentication token is returned in **extrainfo**. If the authentication fails, the remaining authentication time is returned. If the authentication executor is locked, the freezing time is returned.|
**Example**
```js
letuserAuth=newosAccount.UserAuth();
letauthType=osAccount.AuthType.PIN;
letchallenge=1;
letauthTrustLevel=osAccount.AuthTrustLevel.ATL1;
letonresult={
authresult:null,
authextr:null,
}
userAuth.auth(challenge,authType,authTrustLevel,{
onResult:function(result,extraInfo){
console.log("====>test for examples auth result = "+result);
onresult.authresult=result;
console.log("====>test for examples auth extraInfo = "+JSON.stringify(extraInfo));
onresult.authextr=extraInfo;
console.info('====>test for examples auth onResult = '+JSON.stringify(onresult));