diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 1c32948cc15bd2a92ebacb2c6280d46ac8ee523a..68e1229c90d478feb38d7e4ec28177283b1d9d55 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -2612,6 +2612,24 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Prepares remote authentication. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { string } remoteNetworkId - Indicates the remote network identifier. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid remoteNetworkId. + * @throws { BusinessError } 12300090 - Cross-device capability not supported. + * @throws { BusinessError } 12300091 - Cross-device communication failed. + * @throws { BusinessError } 12300111 - Operation timeout. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ prepareRemoteAuth(remoteNetworkId: string): Promise; /** @@ -2673,6 +2691,41 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Executes authentication. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { Uint8Array } challenge - Indicates the challenge value. + * @param { AuthType } authType - Indicates the authentication type. + * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. + * @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo. + * @returns { Uint8Array } Returns a context ID for cancellation. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid challenge, authType or authTrustLevel. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @throws { BusinessError } 12300090 - Cross-device capability not supported. + * @throws { BusinessError } 12300091 - Cross-device communication failed. + * @throws { BusinessError } 12300101 - The credential is incorrect. + * @throws { BusinessError } 12300102 - The credential does not exist. + * @throws { BusinessError } 12300105 - The trust level is not supported. + * @throws { BusinessError } 12300106 - The authentication type is not supported. + * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. + * @throws { BusinessError } 12300110 - The authentication is locked. + * @throws { BusinessError } 12300111 - The authentication timeout. + * @throws { BusinessError } 12300112 - The authentication service is busy. + * @throws { BusinessError } 12300113 - The authentication service does not exist. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300117 - PIN is expired. + * @throws { BusinessError } 12300119 - Multi-factor authentication failed. + * @throws { BusinessError } 12300211 - Server unreachable. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ auth( challenge: Uint8Array, authType: AuthType, @@ -2714,6 +2767,43 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Executes authentication. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { Uint8Array } challenge - Indicates the challenge value. + * @param { AuthType } authType - Indicates the authentication type. + * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. + * @param { AuthOptions } options - Indicates authentication options. + * @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo. + * @returns { Uint8Array } Returns a context ID for cancellation. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid challenge, authType, authTrustLevel or options. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @throws { BusinessError } 12300090 - Cross-device capability not supported. + * @throws { BusinessError } 12300091 - Cross-device communication failed. + * @throws { BusinessError } 12300101 - The credential is incorrect. + * @throws { BusinessError } 12300102 - The credential does not exist. + * @throws { BusinessError } 12300105 - The trust level is not supported. + * @throws { BusinessError } 12300106 - The authentication type is not supported. + * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. + * @throws { BusinessError } 12300110 - The authentication is locked. + * @throws { BusinessError } 12300111 - The authentication timeout. + * @throws { BusinessError } 12300112 - The authentication service is busy. + * @throws { BusinessError } 12300113 - The authentication service does not exist. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300117 - PIN is expired. + * @throws { BusinessError } 12300119 - Multi-factor authentication failed. + * @throws { BusinessError } 12300211 - Server unreachable. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ auth( challenge: Uint8Array, authType: AuthType, @@ -2784,6 +2874,43 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Executes user authentication. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { number } userId - Indicates the user identification. + * @param { Uint8Array } challenge - Indicates the challenge value. + * @param { AuthType } authType - Indicates the authentication type. + * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. + * @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo. + * @returns { Uint8Array } Returns a context ID for cancellation. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid challenge, authType or authTrustLevel. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @throws { BusinessError } 12300090 - Cross-device capability not supported. + * @throws { BusinessError } 12300091 - Cross-device communication failed. + * @throws { BusinessError } 12300101 - The credential is incorrect. + * @throws { BusinessError } 12300102 - The credential does not exist. + * @throws { BusinessError } 12300105 - The trust level is not supported. + * @throws { BusinessError } 12300106 - The authentication type is not supported. + * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. + * @throws { BusinessError } 12300110 - The authentication is locked. + * @throws { BusinessError } 12300111 - The authentication timeout. + * @throws { BusinessError } 12300112 - The authentication service is busy. + * @throws { BusinessError } 12300113 - The authentication service does not exist. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300117 - PIN is expired. + * @throws { BusinessError } 12300119 - Multi-factor authentication failed. + * @throws { BusinessError } 12300211 - Server unreachable. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ authUser( userId: number, challenge: Uint8Array, @@ -3475,6 +3602,8 @@ declare namespace osAccount { * @param { DomainAccountInfo } newAccountInfo - Indicates the new domain account information. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - The new account info is invalid. @@ -3655,6 +3784,8 @@ declare namespace osAccount { * @param { Record } parameters - Indicates the server config parameters. * @returns { Promise } Returns the added domain server config. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid server config parameters. @@ -3674,6 +3805,8 @@ declare namespace osAccount { * @param { string } configId - Indicates the server config identifier. * @returns { Promise } Returns void. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300212 - Server config not found. @@ -3692,6 +3825,8 @@ declare namespace osAccount { * @param { Record } parameters - Indicates the server config parameters. * @returns { Promise } Returns the updated domain server config. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid server config parameters. @@ -3712,6 +3847,8 @@ declare namespace osAccount { * @param { string } configId - Indicates the server config identifier. * @returns { Promise } Returns the server config. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300212 - Server config not found. @@ -3742,6 +3879,8 @@ declare namespace osAccount { * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. * @returns { Promise } Returns the domain server config. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300003 - Domain account not found.