Manoj Amalraj
Manoj Amalraj

Reputation: 575

Determining the biometric capability of a device using JS

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?

Upvotes: 0

Views: 931

Answers (1)

Tim
Tim

Reputation: 1230

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.

Upvotes: 3

Related Questions