收藏
回答

指纹认证wx.startSoterAuthentication总是返回90007

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.startSoterAuthentication 客户端 6.7.3 2.4.2

- 当前 Bug 的表现(可附上截图)

调用生物认证接口:

wx.startSoterAuthentication({ 
      requestAuthModes: ['fingerPrint'], 
      challenge: '123456', 
      authContent: '请用指纹解锁', 
      success(res) { 
        console.log('指纹成功', res); 
      }, 
      fail(res){ 
        console.log('指纹失败', res); 
      } 
})


但是,总是返回90007错误(在官方的小程序《小程序示例》中调用生物认证也是提示认证失败)

{
    authMode: "fingerPrint",
    resultJSON: "",
    resultJSONSignature: "",
    errCode: 90007,
    errMsg: "startSoterAuthentication:fail auth key update error"
}



附上另外2个接口的返回值情况:

wx.checkIsSupportSoterAuthentication({
      success(res) {
        console.log(res)
      }
 });



wx.checkIsSoterEnrolledInDevice({
      checkAuthMode: 'fingerPrint',
      success(res) {
        console.log(res)
      }
})



- 预期表现

调用成功,出现指纹输入界面


- 复现路径


- 提供一个最简复现 Demo


查阅微信其他平台的开发文档,对错误说明如下:



不知道有没有也碰到这种情况的,该怎么解决?

最后一次编辑于  2018-12-13
回答关注问题邀请回答
收藏

4 个回答

  • Born to the sun 🌻
    Born to the sun 🌻
    2018-12-29

    解决了吗?nova3手机,平时用指纹打开微信,用指纹微信支付,但是调用这个接口就报错90007,另一台vivo手机正常。

    2018-12-29
    有用
    回复
  • 刘金云
    刘金云
    2018-12-19

    我的是这种情况: 我手机储存了多个指纹,只有左手食指正常,其他的手指都报错:90007

    2018-12-19
    有用
    回复 1
    • 曾祥鑫(WilliamTsang)
      曾祥鑫(WilliamTsang)
      2018-12-19

      我试了几个安卓手机体验不一样,我决定屏蔽安卓指纹识别。只支持iOS先。

      2018-12-19
      回复
  • 曾祥鑫(WilliamTsang)
    曾祥鑫(WilliamTsang)
    2018-12-17

    或者尝试检查系统更新,华为是否有新的系统更新包,或者已经支持微信指纹。iOS目前没有发现此问题。

    附上代码,请参考:

    let supportResult = await wepy.checkIsSupportSoterAuthentication().then(res => {
        var isSupportFinger = false;
        res.supportMode.forEach((item, index) => {
            if (item === 'fingerPrint') {
                isSupportFinger = true;
                return false;
            }
        });
     
        return isSupportFinger;
    }).catch(() => {
        // 开发者工具不支持
        return false;
    });
     
    if (supportResult) {
        let enrolledResult = await wepy.checkIsSoterEnrolledInDevice({
            checkAuthMode: 'fingerPrint' //认证方式
        }).then(settingResult => {
            if (!settingResult.isEnrolled === false) {
                return { success: true, errMsg: '' }
            } else {
                return { success: false, errMsg: settingResult.errMsg }
            }
        });
     
        if (!enrolledResult.success === false) {
            // 本机已录入指纹信息
            let authResult = await wepy.startSoterAuthentication({
                requestAuthModes: ['fingerPrint'],
                challenge: 'fingerPrintSetting',
                authContent: '验证指纹提示语'
            }).then(enableResult => {
                return enableResult;
            }).catch(enableErrResult => {
                if (enableErrResult.errCode === 90008) {
                    wepy.showToast({
                        title: '用户已取消', //提示的内容,
                        icon: 'none', //图标,
                        duration: 1000, //延迟时间,
                        mask: true //显示透明蒙层,防止触摸穿透
                    });
                } else if (enableErrResult.errCode === 90009) {
                    wepy.showToast({
                        title: '指纹验证失败', //提示的内容,
                        icon: 'none', //图标,
                        duration: 1000, //延迟时间,
                        mask: true //显示透明蒙层,防止触摸穿透
                    });
                } else {
                    wepy.showToast({
                        title: enableResult.errMsg, //提示的内容,
                        icon: 'none', //图标,
                        duration: 1000, //延迟时间,
                        mask: true //显示透明蒙层,防止触摸穿透
                    });
                }
                return false;
            });
     
            if (!authResult === false) {
                // 将结果上传服务器传输给微信认证结果, TODO:目前服务端报 48001 错误,询问官方中
                wepy.showToast({
                  title: '验证成功', // 提示的内容,
                  icon: 'none', // 图标,
                  duration: 1500, // 延迟时间,
                  mask: true, // 显示透明蒙层,防止触摸穿透
                });
            }
        } else {
            wepy.showToast({
                title: settingResult.errMsg, // 提示的内容,
                icon: 'none', // 图标,
                duration: 1000, // 延迟时间,
                mask: true // 显示透明蒙层,防止触摸穿透
            });
        }
    } else {
        wepy.showToast({
            title: '本机无法支持指纹识别', // 提示的内容,
            icon: 'none', // 图标,
            duration: 1000, // 延迟时间,
            mask: true // 显示透明蒙层,防止触摸穿透
        });
    }


    2018-12-17
    有用
    回复
  • 是小白啊
    是小白啊
    2018-12-13

    其他的手机可以吗?

    2018-12-13
    有用
    回复
登录 后发表内容