The Simplest Way to Make Caddy and Webauthn Work Like They Should
Using caddy and webauthn together lets teams protect web apps with hardware passkeys. Caddy handles web traffic and TLS, while WebAuthn checks user passkeys at login. This pairing removes shared passwords from daily work. Users tap a security key or use a device sensor to log in. Caddy then routes the checked request to the right backend app. How caddy and webauthn handle logins and permissions Caddy serves as the front door for incoming web traffic. It manages TLS certificates by default an
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Using caddy and webauthn together lets teams protect web apps with hardware passkeys. Caddy handles web traffic and TLS, while WebAuthn checks user passkeys at login.
This pairing removes shared passwords from daily work. Users tap a security key or use a device sensor to log in. Caddy then routes the checked request to the right backend app.
How caddy and webauthn handle logins and permissions
Caddy serves as the front door for incoming web traffic. It manages TLS certificates by default and routes requests to internal services. On its own, the core web server does not store passkey records. Teams pair it with an external login service or a dedicated security module.
When a user visits a protected page, Caddy pauses the request. It sends the user to the login portal to start the check. The login portal sends a fresh challenge to the user browser. The browser asks the user to tap a hardware key or use biometrics.
WebAuthn uses public key math to sign that login challenge. The private key stays inside the user hardware at all times. The browser sends the signed challenge back to the login portal. The portal checks the signature against the stored public key for that user.
Once the signature passes, the login portal issues a session cookie or token. Caddy checks this token on every new web request from that browser. It reads the user identity and group roles from the login response. Then it passes those user details to the upstream app in HTTP headers.
Common failure modes and how to scope roles
Even with strong passkeys, bad setup rules can still leave gaps. One common mistake is passing broad admin headers to every backend app. If an attacker steals a session cookie, they gain full control across apps. Teams must scope session lifetimes to short windows to limit this risk.
FIDO2 / WebAuthn + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Another failure mode comes from weak network paths behind the web server. If backend apps accept traffic from anywhere, attackers can skip the login check. Teams must lock down backend network paths so only Caddy can reach them. Local firewall rules should block all direct traffic to internal app ports.
Shared accounts also break the value of hardware passkeys. Sometimes teams register multiple hardware keys under one shared admin profile. When someone makes a change, the logs only show the shared profile name. Every person on the team needs their own user profile and passkey record.
Unlogged requests and raw data leaks create major blind spots during audits. Web logs tells you who opened a page, not what data came back. If an app returns emails, phone numbers, or card numbers, masking rewrites matched fields in results. Teams should also log every role check and rejected login attempt.
Keeping passkey sessions safe in production
Hardware keys can get lost or break during travel. If a user only has one key, a lost device stops their work. Teams should ask users to register a backup security key on day one. This keeps the recovery flow safe without falling back to weak passwords.
Origin mismatches also cause frequent login blocks for remote teams. WebAuthn binds every passkey to a specific domain name. If Caddy routes traffic through multiple domain aliases, the browser rejects the challenge. Keep the login domain clean and consistent across all internal apps.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Does Caddy support WebAuthn without extra tools?
Base Caddy needs a third-party auth plugin or an external identity provider. These extra components handle the WebAuthn challenge and store user public keys.
Why does WebAuthn fail behind a Caddy reverse server?
WebAuthn requires a valid HTTPS connection and a matching domain name. If Caddy passes the wrong host header, the browser rejects the passkey check.
How do we handle lost security keys for team members?
Require every person to register two separate passkeys during onboarding. Admins can then revoke the lost key while the user logs in with their backup.
Related guides
In this post