liveBook · Manning

WebAuthn

As explained in Software Security for Developers

WebAuthn is a web authentication standard that enables passwordless, phishing-resistant authentication through authenticators such as biometrics and physical security keys.

WebAuthn is a web authentication standard for passwordless login. It uses public-key cryptography with device biometrics, built-in authenticators, or phishing-resistant physical security keys. section 15.0 section 2.1.5

Instead of sending a reusable password, the device proves possession of a private key while the application stores and verifies the corresponding public key. Biometrics remain on the device, and hardware keys bind authentication to the original website. section 15.1 section 15.4

A basic WebAuthn flow separates registration from authentication:

  • Check browser support, create a credential and key pair, then associate the credential ID and public key with the user. section 15.3 section 15.4
  • Generate a fresh server challenge, request an assertion with navigator.credentials.get(), and verify the signature, challenge, and origin. section 15.3 section 15.3.1
  • Serve the page from localhost or HTTPS because WebAuthn requires a secure context; provide backup authenticators because losing a key can cause lockout. section 15.4

A small registration and login demo

A plain JavaScript page checks window.PublicKeyCredential, calls navigator.credentials.create() with a challenge and user details, and sends the resulting public-key credential to a backend. During login, the backend returns a random challenge and registered credential ID; the browser signs the challenge, and the backend verifies the signature before authenticating the user. The simplified demonstration omits the polished error handling and feedback expected in production.

Figure 2.6 Externalize application authentication into an SSO service that applications can access using OIDC and WebAuthn. If you know OIDC and WebAuthn, you can use all modern SSO services.
figure

Use the architecture figure to see WebAuthn positioned at the application boundary through an external SSO service, alongside OIDC. section 2.1.5

How Software Security for Developers covers it

How deep it goes
Explains passwordless principles, device binding, registration, challenges, origin checks, and simplified JavaScript-backend implementation.
Examples
Uses browser JavaScript, a Spring-style backend, localhost, platform passkeys, random challenges, and physical security keys.
What it assumes
Assumes foundational familiarity with TLS, JOSE, X.509 certificates, public-key infrastructure, and web application development.
What you can do after
Build it from scratch as a basic JavaScript and Java backend registration and authentication demonstration.
How it connects
Connects passwordless authentication with biometrics, public-key cryptography, phishing attacks, SSO services, OAuth2, and OIDC.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Security for Developers. The section links point to the parts of the book it draws on.