passkey-forwardauth is a WebAuthn/passkey authentication service for reverse proxies that use forward auth.
The service handles login, sessions, and auth checks for protected applications.
This project focuses on a small set of functions.
Included features:
- passkey login with WebAuthn discoverable credentials
- forward-auth check endpoint
- session cookies
- redirect allowlisting
- temporary bootstrap admin interface for user and credential enrollment
- optional one-time approval flow
Main service:
GET /loginPOST /webauthn/login/beginPOST /webauthn/login/finishPOST /one-time/login/beginGET /one-time/login/statusPOST /one-time/login/approveGET /authPOST /logout
Bootstrap admin:
GET /adminGET /api/libraryPOST /api/users/addPOST /api/users/deletePOST /api/users/togglePOST /api/credentials/register/beginPOST /api/credentials/register/finishPOST /api/credentials/togglePOST /api/credentials/delete
- The reverse proxy calls
GET /auth. - When the session is missing or invalid, the proxy returns or redirects to
GET /login?rd=.... - The user completes WebAuthn login.
- The service sets a session cookie.
- Later
GET /authrequests return200 OKandX-Auth-Userfor valid sessions.
The service loads configuration from /etc/passkey-forwardauth/config.{yaml,yml,json,env}.
The service stores state in a JSON identity file. The file contains:
- RP binding (
rp_id,rp_origin,cookie_domain) - users
- registered WebAuthn credentials
- credential metadata
- counters and backup flags
Passkey private keys stay on the authenticator.
listen_addr: ""
listen_unix: "/run/passkey-forwardauth/passkey-forwardauth.sock"
listen_unix_mode: "0660"
cookie_name: "auth_session"
cookie_domain: ".example.com"
admin_cred_path: "/etc/passkey-forwardauth/secrets/identity.json"
proxy_verify_header: "X-Internal-Auth"
proxy_verify_value: "/etc/passkey-forwardauth/secrets/proxy_token"
trusted_proxy_cidrs:
- "127.0.0.1/32"
- "::1/128"
redirect_allowed_hosts:
- "*.example.com"
rp_id: "auth.example.com"
rp_origin: "https://auth.example.com"
login_template: "/usr/share/passkey-forwardauth/templates/login.template"
approve_template: "/usr/share/passkey-forwardauth/templates/approve.template"
static_dir: "/usr/share/passkey-forwardauth/static"
session_ttl: "24h"
session_idle_ttl: "8h"
admin_template: "/usr/share/passkey-forwardauth/templates/admin.template"
bootstrap_listen_addr: "127.0.0.1:19091"
bootstrap_allow_remote: false
bootstrap_idle_timeout: "5m"
bootstrap_max_auth_failures: 3
bootstrap_static_dir: "/usr/share/passkey-forwardauth/static"{
"version": 1,
"rp_id": "auth.example.com",
"rp_origin": "https://auth.example.com",
"cookie_domain": ".example.com",
"users": []
}Download a package from GitHub Releases and install it:
sudo apt install ./passkey-forwardauth_0.2.0_amd64.deb
sudo systemctl daemon-reloador:
sudo rpm -Uvh passkey-forwardauth-0.2.0-1.x86_64.rpm
sudo systemctl daemon-reloadThen edit the config and enable the service:
sudoedit /etc/passkey-forwardauth/config.yaml
sudo systemctl enable --now passkey-forwardauth.serviceGitHub Actions uses GoReleaser to build Linux binaries plus .deb and .rpm
packages for amd64 and arm64.
Create a GitHub release by pushing a version tag:
git tag v0.2.1
git push origin v0.2.1The same release workflow can be run manually from GitHub Actions by entering
an existing v* tag.
The packages install:
/usr/bin/passkey-forwardauth/usr/bin/passkey-forwardauth-bootstrap/etc/passkey-forwardauth/config.yaml/etc/passkey-forwardauth/secrets/identity.json/lib/systemd/system/passkey-forwardauth.serviceon Debian packages/usr/lib/systemd/system/passkey-forwardauth.serviceon RPM packages/usr/share/passkey-forwardauth/templates//usr/share/passkey-forwardauth/static//usr/share/doc/passkey-forwardauth/examples/
Expected behavior:
- reverse proxy calls
GET /auth - reverse proxy sends a trusted internal verification header
- service returns
200 OKfor authenticated sessions - service returns
401 Unauthorizedfor unauthenticated requests - service sets
X-Auth-Useron successful auth checks
The bootstrap admin handles initial enrollment and maintenance.
Recommended usage:
- local listen address
- explicit enablement
- basic auth
- idle timeout
- shutdown after repeated auth failures
Recommended deployment:
- temporary use
- local or otherwise restricted access
go test ./...
go build ./cmd/passkey-forwardauth
go build ./cmd/passkey-forwardauth-bootstrapLicensed under the Apache License 2.0. See LICENSE.