title: Taro.startSoterAuthentication(option)

sidebar_label: startSoterAuthentication

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.

Reference

Type

  1. (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

  1. Taro.startSoterAuthentication({
  2. requestAuthModes: ['fingerPrint'],
  3. challenge: '123456',
  4. authContent: 'Unlock with your fingerprint',
  5. success: function (res) { }
  6. })
  1. {
  2. "raw":"msg",
  3. "fid":"2",
  4. "counter":123,
  5. "tee_n":"TEE Name",
  6. "tee_v":"TEE Version",
  7. "fp_n":"Fingerprint Sensor Name",
  8. "fp_v":"Fingerprint Sensor Version",
  9. "cpu_id":"CPU Id",
  10. "uid":"21"
  11. }

API Support

API WeChat Mini-Program H5 React Native
Taro.startSoterAuthentication ✔️