Skip to main content

Pythonic WebAuthn

Project description

py_webauthn

PyPI GitHub license Pythonic 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webauthn-1.4.0.tar.gz (43.6 kB view details)

Uploaded Source

Built Distribution

webauthn-1.4.0-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file webauthn-1.4.0.tar.gz.

File metadata

  • Download URL: webauthn-1.4.0.tar.gz
  • Upload date:
  • Size: 43.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for webauthn-1.4.0.tar.gz
Algorithm Hash digest
SHA256 3b2ac481b93f9b61c8f1bcfc6622a24efefb579d11fc7d643b6ac0028be45b2e
MD5 9acf7a6dc8145e56830b48f1cb3b12e9
BLAKE2b-256 594fc689ca37c1ef5bdaad04a51ed88131796e01ca173ef218d48f377a6c109c

See more details on using hashes here.

File details

Details for the file webauthn-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: webauthn-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for webauthn-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 114a1e7266c232a18d1af7ea44d8eeee7c226aef5bdac458cac4693d23ab3f10
MD5 38d0195b856266b32fbd6c3ac3e13d6e
BLAKE2b-256 4b013a1810916a1c166d30bb6260eadd0122c8a20de5eb8a14f185f99802624a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page