Python wrapper for Authentrend AuthFi WebAuthn/FIDO2 API
Project description
AuthFi API Python Client
A comprehensive Python wrapper for the Authentrend AuthFi WebAuthn/FIDO2 API, providing easy-to-use methods for authentication, registration, and user management.
Features
- WebAuthn/FIDO2 Support: Complete implementation of WebAuthn standards
- Mobile Authentication: Support for mobile authenticator apps
- User Management: Create, list, suspend, and delete users
- Credential Management: Manage authentication keys and credentials
- QR Code Generation: Generate QR codes for mobile registration and verification
- Type Safety: Full type hints and validation using Pydantic
- Error Handling: Comprehensive error codes and messages
Installation
pip install authfi-api
Quick Start
from authfi import AuthFiApi
from fido2.webauthn import UserVerificationRequirement
# Initialize the API client
api = AuthFiApi(
api_accesspoint="https://authfi.authentrend.com/your-endpoint",
api_key="your-api-key"
)
# Begin user registration
response = api.register_begin(
user_name="user@example.com",
user_display_name="John Doe"
)
# List registered users
users = api.list_users(page=1, size=20)
# Generate QR code for mobile registration
qr_response = api.generate_registration_qrcode(
user_name="user@example.com",
path="/callback"
)
API Methods
Registration
register_begin() - Begin WebAuthn registration register_complete() - Complete WebAuthn registration npk_register_begin() - Begin mobile (non-passkey) registration npk_register_complete() - Complete mobile registration
Authentication
login_begin() - Begin WebAuthn login login_complete() - Complete WebAuthn login authenticate_begin() - Begin authentication authenticate_complete() - Complete authentication npk_authenticate_begin() - Begin mobile authentication npk_authenticate_complete() - Complete mobile authentication
User Management
list_users() - List all users set_user_state() - Activate or suspend users delete_user() - Delete a user
Credential Management
list_keys() - List user's credentials set_key_name() - Set friendly name for credentials delete_key() - Delete a credential
Mobile/QR Code
generate_registration_qrcode() - Generate registration QR code get_registration_status() - Check registration status get_registered_username() - Get registered username generate_verification_qrcode() - Generate verification QR code get_verification_status() - Check verification status
Configuration
The AuthFiApi class accepts the following parameters:
- api_accesspoint (str): Your AuthFi API endpoint URL
- api_key (str): Your AuthFi API key
- timeout (int): Request timeout in seconds (default: 10)
- authenticator_attachment: Default authenticator attachment preference
- require_resident_key: Default resident key requirement
- user_verification: Default user verification requirement
- attestation: Default attestation conveyance preference
Error Handling
The package includes comprehensive error handling with descriptive error messages:
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file authfi_api-0.0.3.tar.gz.
File metadata
- Download URL: authfi_api-0.0.3.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0670450ddff7c3182e6c4496bcd5f8a2b06997aa69c65bd2ecb9b03420dc05c0
|
|
| MD5 |
507e320c91c9e8c267db6d90b252541e
|
|
| BLAKE2b-256 |
6975fbe41807f9c189761bbb2237ecf5615bb15fe7ec1022227394745219ac59
|
File details
Details for the file authfi_api-0.0.3-py3-none-any.whl.
File metadata
- Download URL: authfi_api-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adfe032b9e5c6c919bd58c0ae9aa4ee10b119b33b25d88b6e067765eb655adb1
|
|
| MD5 |
bca792824180df6bc5ac86b5dba73b38
|
|
| BLAKE2b-256 |
113bf6f2421d6edf43a9a9467de5254f8da6afc9c567e8e6f5032cda34ece629
|