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:
Metadata
Release files for authfi-api 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| authfi_api-0.0.3.tar.gz | 11.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| authfi_api-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / authfi_api-0.0.3.tar.gz
| Download URL | authfi_api-0.0.3.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0670450ddff7c3182e6c4496bcd5f8a2b06997aa69c65bd2ecb9b03420dc05c0
|
|
BLAKE2b-256 checksum How to use checksums |
6975fbe41807f9c189761bbb2237ecf5615bb15fe7ec1022227394745219ac59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|
Release files / authfi_api-0.0.3-py3-none-any.whl
| Download URL | authfi_api-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adfe032b9e5c6c919bd58c0ae9aa4ee10b119b33b25d88b6e067765eb655adb1
|
|
BLAKE2b-256 checksum How to use checksums |
113bf6f2421d6edf43a9a9467de5254f8da6afc9c567e8e6f5032cda34ece629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|