biometric

WebAuthn and biometric authentication utilities for secure passwordless login using fingerprint, face recognition, and hardware security keys.

Functions

Function
Description
Example

isAvailable

Check if WebAuthn is available

dphelper.biometric.isAvailable()

getWebAuthnSupport

Get detailed support info

dphelper.biometric.getWebAuthnSupport()

isSensorAvailable

Check specific sensor (fingerprint/face/iris)

await dphelper.biometric.isSensorAvailable('fingerprint')

register

Register new credential

await dphelper.biometric.register('user123', 'example.com')

authenticate

Authenticate with credential

await dphelper.biometric.authenticate('user123', 'example.com')

getCredential

Get stored credential by ID

dphelper.biometric.getCredential(credentialId)

deleteCredential

Delete stored credential

dphelper.biometric.deleteCredential(credentialId)

listCredentials

List all stored credentials

dphelper.biometric.listCredentials()

Description

Secure biometric authentication module providing:

  • WebAuthn/FIDO2 - Industry-standard passwordless authentication

  • Platform Authenticators - Fingerprint, Face ID, Windows Hello

  • Cross-platform - Works with hardware security keys (YubiKey, etc.)

  • Credential Management - Store, retrieve, and delete credentials

  • Sensor Detection - Check availability of specific biometric types

Usage Examples

Checking Availability

Registration (Enrolling a Credential)

Authentication (Login)

Credential Management

Advanced Usage

Complete Authentication System

Passwordless Login Flow

Progressive Registration

Security Notes

WebAuthn Security Features

  • Public-key cryptography - Uses asymmetric keys, never transmitted

  • User presence - Requires user action (touch/face) to authenticate

  • Platform binding - Credentials bound to specific device

  • Phishing resistance - Relying Party ID must match exactly

Best Practices

  • Always verify authentication on the server side

  • Store credential IDs in your database, not the credentials themselves

  • Support multiple credentials per user (different devices)

  • Provide fallback for unsupported browsers

Details

  • Author: Dario Passariello

  • Version: 0.0.1

  • Creation Date: 20260313

  • Last Modified: 20260313

  • Environment: Client-side only (browser with WebAuthn support)


Automatically generated document

Last updated