Skip to content

WebAuthn demo with biometric authentication (Face ID / fingerprint)

License

Notifications You must be signed in to change notification settings

peterdee/webauthn-demo

Repository files navigation

webauthn-demo

WebAuthn demo with biometric authentication (Face ID / fingerprint)

WebAuthn documentation:

https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create

https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get

Assertion check is not featured in this project, current example can be used as a replacement for TOTP or other 2FA / MFA solutions

Deploy

git clone https://github.com/peterdee/webauthn-demo
cd ./webauthn-demo
nvm use 22
npm ci

Launch

For local testing just launch the application:

npm run dev

WebAuthn requires HTTPS, so the app will be available at https://localhost:5173

Testing on another device is possible with Ngrok:

ngrok http https://localhost:5173

WebAuthn forbids using IP addresses as domains, so it won't work if you access the app from your local network via IP address!

License

MIT