我正在尝试检测运行我的应用程序的设备上的浏览器是否支持使用Javascript的生物识别功能。具体来说,我想检测一下,该设备是否能够实现FaceId或TouchId。我知道,通过WebAuthn你可以做到这一点:
if (window.PublicKeyCredential) {
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
.then((available) => {
if (available) {
console.log("Supported.");
} else {
console.log(
"WebAuthn supported, Platform Authenticator *not* supported."
);
}
})
.catch((err) => console.log("Something went wrong."));
} else {
console.log("Not supported.");
}但是,这只会让我知道这个设备是否具有生物识别能力。它不会区分FaceId和TouchId。我如何通过Javascript获得这个级别的细节?
发布于 2022-04-04 23:22:55
isUserVerifyingPlatformAuthenticatorAvailable并不意味着生物识别。它意味着一个具有用户验证功能的平台身份验证器。用户验证可以是PIN、本地密码或生物识别。
目前没有通过WebAuthn公开平台认证器的生物识别功能。
https://stackoverflow.com/questions/71744361
复制相似问题