1# Obtaining Supported Authentication Capabilities
2
3
4Different devices support different authentication capabilities (facial authentication, fingerprint authentication, and PIN authentication). Before you start coding, obtain the authentication capabilities supported by the target device.
5
6
7## Available APIs
8
9For details about the parameters, return value, and error codes, see [getAvailableStatus](../../reference/apis-user-authentication-kit/js-apis-useriam-userauth.md#userauthgetavailablestatus9).
10
11| API| Description|
12| -------- | -------- |
13| getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel): void | Checks whether the specified authentication type and authentication trust level are supported by the device.|
14
15
16## How to Develop
17
181. [Request](prerequisites.md#requesting-permissions) the ohos.permission.ACCESS_BIOMETRIC permission.
19
202. Call [getAvailableStatus](../../reference/apis-user-authentication-kit/js-apis-useriam-userauth.md#userauthgetavailablestatus9) to check whether the device supports the specified authentication type ([UserAuthType](../../reference/apis-user-authentication-kit/js-apis-useriam-userauth.md#userauthtype8)) and authentication trust level ([AuthTrustLevel](../../reference/apis-user-authentication-kit/js-apis-useriam-userauth.md#authtrustlevel8)).
21
22Example: Check whether the device supports facial authentication of ATL1 or higher.
23
24```ts
25import { BusinessError } from  '@kit.BasicServicesKit';
26import { userAuth } from '@kit.UserAuthenticationKit';
27
28// Check whether the specified authentication capabilities are supported.
29try {
30    userAuth.getAvailableStatus(userAuth.UserAuthType.FACE, userAuth.AuthTrustLevel.ATL1);
31    console.info('current auth trust level is supported');
32} catch (error) {
33    const err: BusinessError = error as BusinessError;
34    console.error(`current auth trust level is not supported. Code is ${err?.code}, message is ${err?.message}`);
35}
36```
37