diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md index 96766c334d7167b6c577e78f1294dec0b6e76d67..57d3ad6ddbd25ff75da0532dc83ca2fb7700263b 100644 --- a/en/application-dev/reference/apis/js-apis-appAccount.md +++ b/en/application-dev/reference/apis/js-apis-appAccount.md @@ -134,7 +134,7 @@ Implicitly adds an app account based on the specified account owner, authenticat | owner | string | Yes | Owner of the app account to add. The value is the bundle name of the app. | | authType | string | Yes | Authentication type of the app account to add. The authentication type is customized. | | options | {[key: string]: any} | Yes | Authentication options, which can be set as required.| -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the authentication result. | **Example** @@ -285,7 +285,7 @@ Enables an app account to access an app with the given bundle name. This API use | Name | Type | Mandatory | Description | | ---------- | ------------------------- | ---- | --------------------------------- | | name | string | Yes | Name of the target app account. | -| bundleName | string | Yes | Bundle name of an app. | +| bundleName | string | Yes | Bundle name of the app. | | callback | AsyncCallback<void> | Yes | Callback used to return the result.| **Example** @@ -310,7 +310,7 @@ Enables an app account to access an app with the given bundle name. This API use | Name | Type | Mandatory | Description | | ---------- | ------ | ---- | --------- | | name | string | Yes | Name of the target app account. | -| bundleName | string | Yes | Bundle name of an app.| +| bundleName | string | Yes | Bundle name of the app.| **Return Value** @@ -809,7 +809,7 @@ Obtains information about all accessible app accounts. This API uses an asynchro | Name | Type | Mandatory | Description | | -------- | ---------------------------------------- | ---- | --------- | -| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| +| callback | AsyncCallback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return information about all accessible app accounts.| **Example** @@ -835,7 +835,7 @@ Obtains information about all accessible app accounts. This API uses a promise t | Type | Description | | ---------------------------------------- | --------------------- | -| Promise<Array<AppAccountInfo>> | Promise used to return the result.| +| Promise<Array<[AppAccountInfo](#appaccountinfo)>> | Promise used to return the result.| **Example** @@ -863,7 +863,7 @@ Obtains information about all app accounts of the specified app. This API uses a | Name | Type | Mandatory | Description | | -------- | ---------------------------------------- | ---- | --------- | | owner | string | Yes | Owner of the app account. The value is the bundle name of the app. | -| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return the app account information obtained.| +| callback | AsyncCallback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return information about all accessible app accounts.| **Example** @@ -896,7 +896,7 @@ Obtains information about all app accounts of the specified app. This API uses a | Type | Description | | ---------------------------------------- | --------------------- | -| Promise<Array<AppAccountInfo>> | Promise used to return the result.| +| Promise<Array<[AppAccountInfo](#appaccountinfo)>> | Promise used to return the result.| **Example** @@ -924,7 +924,7 @@ Subscribes to the account change events of the specified account owners. This AP | -------- | ---------------------------------------- | ---- | ------------------------------ | | type | 'change' | Yes | Account change events to subscribe to. The subscriber will receive a notification when the account owners update their accounts.| | owners | Array<string> | Yes | Account owners. | -| callback | Callback<Array<AppAccountInfo>> | Yes | Callback invoked to return the account changes. | +| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return the account changes. | **Example** @@ -954,7 +954,7 @@ Unsubscribes from the account change events. This API uses an asynchronous callb | Name | Type | Mandatory | Description | | -------- | -------------------------------- | ---- | ------------ | | type | 'change' | Yes | Account change events to unsubscribe from. | -| callback | Callback> | No | Callback used to report the account changes.| +| callback | Callback> | No | Callback used to report the account changes.| **Example** @@ -990,7 +990,7 @@ Authenticates an app account to obtain the Open Authorization (OAuth) token. Thi | owner | string | Yes | Owner of the app account. The value is the bundle name of the app. | | authType | string | Yes | Authentication type. | | options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the authentication result.| **Example** @@ -1446,7 +1446,7 @@ Obtains the authenticator callback for an authentication session. This API uses | Name | Type | Mandatory | Description | | --------- | ---------------------------------------- | ---- | -------- | | sessionId | string | Yes | ID of the authentication session.| -| callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result.| +| callback | AsyncCallback<[AuthenticatorCallback](#authenticatorcallback8)> | Yes | Callback invoked to return the result.| **Example** @@ -1487,7 +1487,7 @@ Obtains the authenticator callback for an authentication session. This API uses | Type | Description | | ------------------------------------ | --------------------- | -| Promise<AuthenticatorCallback> | Promise used to return the result.| +| Promise<[AuthenticatorCallback](#authenticatorcallback8)> | Promise used to return the result.| **Example** @@ -1522,7 +1522,7 @@ Obtains authenticator information of an app account. This API uses an asynchrono | Name | Type | Mandatory | Description | | -------- | -------------------------------------- | ---- | ----------- | | owner | string | Yes | Owner of the app account. The value is the bundle name of the app.| -| callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. | +| callback | AsyncCallback<[AuthenticatorInfo](#authenticatorinfo8)> | Yes | Callback invoked to return the result. | **Example** @@ -1552,7 +1552,7 @@ Obtains authenticator information of an app account. This API uses a promise to | Type | Description | | -------------------------------- | --------------------- | -| Promise<AuthenticatorInfo> | Promise used to return the result.| +| Promise<[AuthenticatorInfo](#authenticatorinfo8)> | Promise used to return the result.| **Example** @@ -1695,7 +1695,7 @@ Checks whether an app account has specific labels. This API uses an asynchronous | -------------- | ------------------------- | ----- | --------------- | | name | string | Yes | Name of the target app account. | | owner | string | Yes | Owner of the app account. The value is the bundle name of the app.| -| labels | Array<string< | Yes | Labels to check. | +| labels | Array<string> | Yes | Labels to check. | | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | **Example** @@ -1722,7 +1722,7 @@ Checks whether an app account has specific labels. This API uses a promise to re | -------------- | ------------------------- | ----- | --------------- | | name | string | Yes | Name of the target app account. | | owner | string | Yes | Owner of the app account. The value is the bundle name of the app.| -| labels | Array<string< | Yes | Labels to check. | +| labels | Array<string> | Yes | Labels to check. | **Parameters** @@ -1754,7 +1754,7 @@ Selects the accounts accessible to the requester based on the options. This API | Name | Type | Mandatory | Description | | -------------- | ----------------------------------- | ----- | --------------- | | options | SelectAccountsOptions | Yes | Options for selecting accounts. | -| callback | AsyncCallback<AppAccountInfo> | Yes | Callback invoked to return the result. | +| callback | AsyncCallback<[AppAccountInfo](#appaccountinfo)> | Yes | Callback invoked to return the result. | **Example** @@ -1781,13 +1781,13 @@ Selects the accounts accessible to the requester based on the options. This API | Name | Type | Mandatory | Description | | -------------- | ------------------------- | ----- | --------------- | -| options | SelectAccountsOptions | Yes | Options for selecting accounts. | +| options | [SelectAccountsOptions](#selectaccountsoptions9) | Yes | Options for selecting accounts. | **Parameters** | Type | Description | | ------------------- | -------------------------------- | -| Promise<AppAccountInfo> | Promise used to return the result.| +| Promise<[AppAccountInfo](#appaccountinfo)> | Promise used to return the result.| **Example** @@ -1817,7 +1817,7 @@ Verifies the user credential. This API uses an asynchronous callback to return t | -------- | --------------------- | ----- | ----------------------- | | name | string | Yes | Name of the target app account. | | owner | string | Yes | Owner of the app account. The value is the bundle name of the app. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the verification result.| +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the verification result.| **Example** @@ -1848,8 +1848,8 @@ Verifies the user credential. This API uses an asynchronous callback to return t | -------- | ----------------------- | ----- | ----------------------- | | name | string | Yes | Name of the target app account. | | owner | string | Yes | Owner of the app account. The value is the bundle name of the app. | -| options | VerifyCredentialOptions | Yes | Options for verifying the user credential. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the verification result.| +| options | [VerifyCredentialOptions](#verifycredentialoptions9) | Yes | Options for verifying the user credential. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the verification result.| **Example** @@ -1883,8 +1883,8 @@ Sets authenticator properties. This API uses an asynchronous callback to return | Name | Type | Mandatory | Description | | -------- | --------------------- | ----- | ----------------------- | | owner | string | Yes | Owner of the authenticator. | -| options | SetPropertiesOptions | Yes | Authenticator properties to set. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the result.| +| options | [SetPropertiesOptions](#setpropertiesoptions9) | Yes | Authenticator properties to set. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the result.| **Example** @@ -1914,8 +1914,8 @@ Sets authenticator properties. This API uses an asynchronous callback to return | Name | Type | Mandatory | Description | | -------- | --------------------- | ----- | ----------------------- | | owner | string | Yes | Owner of the authenticator. | -| options | SetPropertiesOptions | Yes | Authenticator properties to set. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the result.| +| options | [SetPropertiesOptions](#setpropertiesoptions9) | Yes | Authenticator properties to set. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the result.| **Example** @@ -1977,7 +1977,7 @@ Represents the options for selecting accounts. | Name | Type | Mandatory | Description | | --------------- | --------------------------- | ----- | ------------------- | -| allowedAccounts | Array<AppAccountInfo> | No | Allowed accounts. | +| allowedAccounts | Array<[AppAccountInfo](#appAccountinfo)> | No | Allowed accounts. | | allowedOwners | Array<string> | No | Allowed account owners.| | requiredLabels | Array<string> | No | Labels required for the authenticator. | @@ -2160,7 +2160,7 @@ Implicitly adds an app account based on the specified authentication type and op | authType | string | Yes | Authentication type. | | callerBundleName | string | Yes | Bundle name of the authentication requester. | | options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the authentication result.| ### authenticate8+ @@ -2177,7 +2177,7 @@ Authenticates an app account to obtain the OAuth access token. This API uses an | authType | string | Yes | Authentication type. | | callerBundleName | string | Yes | Bundle name of the authentication requester. | | options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the authentication result.| ### verifyCredential9+ @@ -2188,11 +2188,11 @@ Verifies the app account credential. This API uses an asynchronous callback to r **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory | Description | -| --------- | ------------------------ | -- -- | --------------------------- | +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | | name | string | Yes | Name of the target app account. | -| options | VerifyCredentialOptions | Yes | Optional for credential verification. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the verification result.| +| options | [VerifyCredentialOptions](#verifycredentialoptions9) | Yes | Optional for credential verification. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the verification result.| ### setProperties9+ @@ -2203,10 +2203,10 @@ Sets authenticator properties. This API uses an asynchronous callback to return **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory | Description | -| --------- | --------------------- | -- -- | --------------------------- | -| options | SetPropertiesOptions | Yes | Authenticator properties to set. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the result.| +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | +| options | [SetPropertiesOptions](#setpropertiesoptions9) | Yes | Authenticator properties to set. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the result.| ### checkAccountLabels9+ @@ -2217,11 +2217,11 @@ Checks the account labels. This API uses an asynchronous callback to return the **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory | Description | -| --------- | --------------------- | -- -- | --------------------------- | +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | | name | string | Yes | Name of the target app account. | -| labels | Array | Yes | Labels to check. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the check result.| +| labels | Array<string> | Yes | Labels to check. | +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the check result.| ### isAccountRemovable9+ @@ -2232,10 +2232,10 @@ Checks whether an app account can be deleted. This API uses an asynchronous call **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory | Description | -| --------- | --------------------- | -- -- | --------------------------- | +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | | name | string | Yes | Name of the target app account. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the result.| +| callback | [AuthenticatorCallback](#authenticatorcallback8) | Yes | Authenticator callback invoked to return the result.| ### getRemoteObject9+ @@ -2277,7 +2277,7 @@ Obtains the remote object of an authenticator. This API cannot be overloaded. callback.onResult(account_appAccount.ResultCode.SUCCESS, {}); } - checkAccountLabels(name: string, labels: Array<string>, callback: AuthenticatorCallback) { + checkAccountLabels(name: string, labels: Array, callback: AuthenticatorCallback) { var result = {[account_appAccount.Constants.KEY_BOOLEAN_RESULT]: false}; callback.onResult(account_appAccount.ResultCode.SUCCESS, result); } @@ -2287,10 +2287,11 @@ Obtains the remote object of an authenticator. This API cannot be overloaded. callback.onResult(account_appAccount.ResultCode.SUCCESS, result); } } - + var authenticator = null; export default { onConnect(want) { - return new MyAuthenticator(); + authenticator = new MyAuthenticator(); + return authenticator.getRemoteObject(); } } ``` diff --git a/en/application-dev/security/accesstoken-guidelines.md b/en/application-dev/security/accesstoken-guidelines.md index 4e07595f90bd8cec73857cf59077d56a87450ea6..0eefcc9175b85437a425d73dd9c7759adf649674 100644 --- a/en/application-dev/security/accesstoken-guidelines.md +++ b/en/application-dev/security/accesstoken-guidelines.md @@ -72,7 +72,7 @@ Declare the permissions required by the app one by one in the **config.json** fi The permission level of **ohos.permission.PERMISSION2** is **system_basic**, which is higher than the app's APL. In this case, use the ACL. -In addition to declaring all the permissions in the **config.json** file, you must declare the permissions whose levels are higher than the app's APL in the app's profile. In this example, declare the permission under the **acls** field: +In addition to declaring all the permissions in the **config.json** file, you must declare the permissions whose levels are higher than the app's APL in the app's [profile](../quick-start/app-provision-structure.md). In this example, declare the permission under the **acls** field: ```json { "version-name": "1.0.0",