



One use case for WebAuthn is two-factor authentication with a security key. Scoped credentials: a credential registered for site.example can't be used on evil-site.example.This makes databases less attractive to hackers, because the public keys aren't useful to them. No shared secret: the server stores no secret.It's not secret, because it's useless without the corresponding private key. The public key is used by the server to prove the user's identity. The public key and randomly generated credential ID are sent to the server for storage.The private key is stored securely on the user's device.Websites can create a credential, consisting of a private-public keypair. WebAuthn allows servers to register and authenticate users using public key cryptography instead of a password. The Web Authentication API, or WebAuthn, is a standardized phishing-resistant protocol that can be used by any web application. The industry's collective response to this problem has been multi-factor authentication, but implementations are fragmented and many still don't adequately address phishing. Phishing is a massive security issue on the web: most account breaches leverage weak or stolen passwords that are reused across sites. Take a look at the finished web app and try it out. A credential management interface: a list of credentials that enables users to rename and delete credentials.A two-factor-authentication flow where the user is asked for their second factor-a WebAuthn credential-if they've registered one.A way for a user to register a WebAuthn credential.To do so, you'll implement the following: You'll then add support for two-factor authentication via a security key, based on WebAuthn. You'll start with a basic web application that supports password-based login.
