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 are useful for constructing inputs to the methods above, and for type hinting. These Pydantic-powered dataclasses provide runtime data validation 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
Metadata
Release files for webauthn 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| webauthn-1.0.0.tar.gz | 42.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| webauthn-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.4 kB
Release files / webauthn-1.0.0.tar.gz
| Download URL | webauthn-1.0.0.tar.gz |
|---|---|
| Size | 42.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c068b93ab0f03fc6905e42e42e6ad24caa4f2632ff13ab846d5e2ef0bf1aa37
|
|
BLAKE2b-256 checksum How to use checksums |
4aaa8c221a990b4d0d7af451d6bbfc710ce251eb023df49fd66c64f696093324
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / webauthn-1.0.0-py3-none-any.whl
| Download URL | webauthn-1.0.0-py3-none-any.whl |
|---|---|
| Size | 56.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6710b8b3d846010fcf303d4fb96ca42de154aeeec379ead4e18cc582a11f9abc
|
|
BLAKE2b-256 checksum How to use checksums |
1050c059e44bc1160ce11eefe5d15f1d1840e2ef0bc2150c976c80897e7b0825
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|