# 生物认证
小程序通过 SOTER 提供以下生物认证方式。
目前支持指纹识别、人脸识别认证。设备支持的生物认证方式可使用 wx.checkIsSupportSoterAuthentication 查询。
# 调用流程
# 流程步骤说明
调用 wx.startSoterAuthentication,获取
resultJSON和resultJSONSignature。(可选)签名校验。此处
resultJSONSignature使用 SHA256withRSA/PSS 作为签名算法进行验签,公式定义如下:验签结果 = verify(用于签名的原串,签名串,验证签名的公钥)。微信提供后台接口用于可信的密钥验签服务,微信将保证该接口返回验签结果的正确性与可靠性;针对 Android root 场景,该接口同样会返回是否保证 root 情况下的安全性。
接口地址:
POST https://api.weixin.qq.com/cgi-bin/soter/verify_signature?access_token=%access_token
post 数据内容(JSON 编码):
{"openid":"$openid", "json_string" : "$resultJSON", "json_signature" : "$resultJSONSignature" }
请求返回数据内容(JSON 编码):
// 验证成功返回
{"is_ok":true}
// 验证失败返回
{"is_ok":false}
// 接口调用失败
{"errcode":"xxx","errmsg":"xxxxx"}