webauthn
Pythonic WebAuthn
What it is and what it does
py_webauthn is a server-side implementation of the WebAuthn specification that handles the cryptographic validation of passwordless authentication credentials. It works with any FIDO2-compliant authenticator—security keys, Touch ID, Face ID, Windows Hello, Android biometrics—and exposes four core methods: generate_registration_options, verify_registration_response, generate_authentication_options, and verify_authentication_response. The library assumes JSON transport between server and browser, with base64url encoding for binary data to avoid extra dependencies.
The package depends on pyasn1, pyasn1-modules, cbor2, cryptography, and pyOpenSSL to handle the underlying cryptographic operations and ASN.1 parsing required by the WebAuthn spec. It provides helper dataclasses for type-safe construction of inputs and outputs, and utility functions for JSON serialization and base64url conversion. Developers integrate it by generating challenge-based options on the server, sending them to the browser's WebAuthn API, then validating the returned credential against the server-stored challenge.
Use it for:
- Add passwordless login to a web application using hardware security keys or platform biometrics.
- Implement multi-factor authentication where WebAuthn serves as a second factor alongside passwords.
- Build a registration flow that enrolls users' authenticators and stores their public keys server-side.
- Verify authentication responses from browser-based WebAuthn ceremonies without managing passwords.
- Support cross-platform authentication across desktop, mobile, and web clients with a single server implementation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements server-side WebAuthn validation for passwordless authentication using FIDO2-compliant authenticators like security keys, biometrics, and platform authenticators.
Yes. This is a production-stable, actively maintained library with no known vulnerabilities, low install friction, and a permissive license. Install it if you need to add WebAuthn support to a Python backend and are targeting Python 3.10+. The API is straightforward and the dependency footprint is small and well-established.
Install
webauthn on PyPI
pip
pip install webauthnuv
uv add webauthnpoetry
poetry add webauthnInstalling webauthn
Before you install
Low install friction with a pure-Python wheel and five stable runtime dependencies. Active maintenance with a recent release and no known vulnerabilities.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install webauthn
from webauthn import generate_registration_options, verify_registration_response
options = generate_registration_options(rp_id="example.com", rp_name="Example")
# Send options to client, receive response, then:
verified = verify_registration_response(credential=response, expected_challenge=challenge)
Requires Python 3.10 or later.
Verify before relying
- Whether the library's type hints and dataclass helpers fully cover all WebAuthn spec edge cases in production deployments.
- Performance characteristics when handling high-volume concurrent registration and authentication flows.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — pyasn1, pyasn1-modules, cbor2, cryptography, pyOpenSSL |
| Maintenance | actively maintained — 46 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,984,854/month — #1,801 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: webauthn-3.0.0-py3-none-any.whl
Keywords: webauthn, fido2
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
django-otp-webauthnAdds WebAuthn Passkey support to Django OTP,…
permissive · top 15,000 on PyPI
fido2Implements FIDO2 and WebAuthn protocols for…
unclear · top 5,000 on PyPI
soft-webauthnEmulates a WebAuthn authenticator in Python for…
permissive · top 15,000 on PyPI
django-authlibProvides passwordless authentication for Django…
permissive · top 15,000 on PyPI
pyobjc-framework-LocalAuthenticationProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
djoserProvides Django REST Framework views for user…
permissive · top 15,000 on PyPI
PyOTPPyOTP generates and verifies one-time passwords…
permissive · top 1,000 on PyPI
django-magiclinkAdds passwordless email-based authentication to…
permissive · top 15,000 on PyPI
Flask-Security-TooAdds user authentication, authorization, and…
permissive · top 15,000 on PyPI
stytchA Python client library for integrating…
permissive · top 5,000 on PyPI