Determining the biometric capability of a device using JS

678 views Asked by At

I am trying to detect if a browser on the device running my app supports biometric capability, using Javascript. Specifically, I would like to detect, if the device is capable of FaceId or TouchId. I know that though WebAuthn you can do this:

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.");
}

But, this would only let me know if the device is biometric capable. It wouldn't distinguish between FaceId or TouchId. How do I get that level of detail through Javascript?

1

There are 1 answers

1
Tim On

isUserVerifyingPlatformAuthenticatorAvailable does not mean a biometric. It means a platform authenticator with user verification capabilities. User verification could be a PIN, local password, or biometric.

The biometric capabilities of a platform authenticator are not currently disclosed via WebAuthn.