Taro.startSoterAuthentication(option)
Starts SOTER biometric authentication. For the verification procedure, see description.
resultJSON description
This data is the JSON data obtained in the device's TEE by combining the incoming challenge parameter and other security information in the TEE. The fields are described as follows.
Field | Description |
---|---|
raw | The challenge factor passed in by the caller |
fid | (Supported only on Android) The ID of the biometric information for the current biometric recognition and authentication (for example, for fingerprint recognition, this field indicates the ID of fingerprint information in this device). |
counter | A parameter of the anti-replay feature |
tee_n | TEE name (for example, Qualcomm or trustonic) |
tee_v | TEE version |
fp_n | The provider of the fingerprints and related logic modules (such as the FPC) |
fp_v | The version of the fingerprints and related modules |
cpu_id | The unique device ID |
uid | App ID, which is similar to the UID defined on Android. |
Type
(option: Option) => Promise<SuccessCallbackResult>
Parameters
Option
Property | Type | Required | Description |
---|---|---|---|
challenge | string | Yes | Challenge factor, which is the key recognition information of a string used for signing that is prepared by the caller for the current biometric authentication. It serves as a part of resultJSON to help the caller recognize this request. For example, if the user is requested to authorize and confirm an order, the order number can be entered in this parameter. |
requestAuthModes | ("fingerPrint" | "facial" | "speech")[] | Yes | Accepted biometric authentication methods in the request |
authContent | string | No | Verification description, i.e. the hint in a dialog box displayed on the UI during recognition. |
complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail | (res: any) => void | No | The callback function for a failed API call |
success | (res: Result) => void | No | The callback function for a successful API call |
SuccessCallbackResult
Property | Type | Description |
---|---|---|
authMode | string | Biometric authentication method |
resultJSON | string | The device security information (for example, the name and version of the Trusted Execution Environment (TEE), and anti-replay parameters) obtained in the TEE and information for this authentication (for example, the fingerprint ID. It is supported only on Android). |
resultJSONSignature | string | The signature (SHA-256 with RSA/PSS, saltlen=20) on resultJSON generated using the SOTER security key |
errCode | number | Error code |
errMsg | string | Error message |
requestAuthModes
Property | Description |
---|---|
fingerPrint | Fingerprint recognition |
facial | Face recognition |
speech | Voiceprint recognition (not supported) |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
requestAuthModes.speech |
Sample Code
Taro.startSoterAuthentication({
requestAuthModes: ['fingerPrint'],
challenge: '123456',
authContent: 'Unlock with your fingerprint',
success: function (res) { }
})
{
"raw":"msg",
"fid":"2",
"counter":123,
"tee_n":"TEE Name",
"tee_v":"TEE Version",
"fp_n":"Fingerprint Sensor Name",
"fp_v":"Fingerprint Sensor Version",
"cpu_id":"CPU Id",
"uid":"21"
}
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.startSoterAuthentication | ✔️ |