[英]Determining the biometric capability of a device using JS
我正在嘗試使用 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 獲得該級別的詳細信息?
isUserVerifyingPlatformAuthenticatorAvailable
並不意味着生物識別。 是指具有用戶驗證能力的平台認證器。 用戶驗證可以是 PIN、本地密碼或生物識別。
平台身份驗證器的生物識別功能目前未通過 WebAuthn 公開。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.