首页 > 微信 > 详细

微信小程序调用指纹验证

时间:2019-08-28 21:31:45      阅读:191      评论:0      收藏:0      [点我收藏+]

微信小程序调用指纹验证共有三个相关的接口

1.wx.checkIsSupportSoterAuthentication() 获取本机支持的 SOTER 生物认证方式

wx.checkIsSupportSoterAuthentication({
  success(res) {
    // res.supportMode = [] 不具备任何被SOTER支持的生物识别方式
    // res.supportMode = [‘fingerPrint‘] 只支持指纹识别
    // res.supportMode = [‘fingerPrint‘, ‘facial‘] 支持指纹识别和人脸识别
  }
})

2.wx.checkIsSoterEnrolledInDevice() 获取设备内是否录入如指纹等生物信息的接口

wx.checkIsSoterEnrolledInDevice({
  checkAuthMode: ‘fingerPrint‘,
  success(res) {
    console.log(res.isEnrolled)// isEnrolled的值是0或者1,不知道是不是指纹个数或是Boolean
} })

3.wx.startSoterAuthentication() 开始 SOTER 生物认证

wx.startSoterAuthentication({
   requestAuthModes: [‘fingerPrint‘],
   challenge: ‘123456‘,
   authContent: ‘请用指纹解锁‘,
   success(res) {
   }
})

如果只是简单的验证指纹功能,可以只到这一步了

但是要做防止在客户端被破解,还需要后台进行向小程序后台进行api验证

技术分享图片

相关链接:
https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.startSoterAuthentication.html

https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/soter/soter.verifySignature.html

 

 

后续补充项目实践代码......

微信小程序调用指纹验证

原文:https://www.cnblogs.com/wuyijuan/p/11426156.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!