Pythonic WebAuthn
Project description
py_webauthn
A Python3 implementation of the WebAuthn API focused on making it easy to leverage the power of WebAuthn.
This library supports all FIDO2-compliant authenticators, including security keys, Touch ID, Face ID, Windows Hello, Android biometrics...and pretty much everything else.
Installation
This module is available on PyPI:
pip install webauthn
Requirements
- Python 3.8 and up
Usage
The library exposes just a few core methods on the root webauthn
module:
generate_registration_options()
verify_registration_response()
generate_authentication_options()
verify_authentication_response()
Two additional helper methods are also exposed:
options_to_json()
base64url_to_bytes()
Additional data structures are available on webauthn.helpers.structs
. These attrs-powered dataclasses are useful for constructing inputs to the methods above, and for providing type hinting to help ensure consistency in the shape of data being passed around.
Registration
See examples/registration.py for practical examples of using generate_registration_options()
and verify_registration_response()
.
You can also run these examples with the following:
# See "Development" below for venv setup instructions
venv $> python -m examples.registration
Authentication
See examples/authentication.py for practical examples of using generate_authentication_options()
and verify_authentication_response()
.
You can also run these examples with the following:
# See "Development" below for venv setup instructions
venv $> python -m examples.authentication
Development
Installation
Set up a virtual environment, and then install the project's requirements:
$> python3 -m venv venv
$> source venv/bin/activate
venv $> pip install -r requirements.txt
Testing
Python's unittest module can be used to execute everything in the tests/ directory:
venv $> python -m unittest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file webauthn-1.5.0.tar.gz
.
File metadata
- Download URL: webauthn-1.5.0.tar.gz
- Upload date:
- Size: 43.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9e0629202f05095d12cf715adbcfcda1f1aae9c46f1c06596990a42c4d02fb4 |
|
MD5 | 8338bed5b23581405d461da909624dca |
|
BLAKE2b-256 | 7e3de993d4065a27e0485c81dd9686a33e430bf8a5aabd55387d493caf8b1681 |
File details
Details for the file webauthn-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: webauthn-1.5.0-py3-none-any.whl
- Upload date:
- Size: 57.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d419d2c0337906d706fdb987666361e1a8ca1285f78375b8538c3cf56f21ec |
|
MD5 | 73f12366a01c8789882a2689d2ac7274 |
|
BLAKE2b-256 | 597a68d56d45f448c395b41fec75c9ec28a226f1cfc2b651329537ecf8df4b9f |