AuthGuard Python SDK - Secure authentication client with NaCl encryption
Project description
AuthGuard Python SDK
Python SDK for the AuthGuard v2 API with NaCl box encryption.
Features
- Full v2 API support with encrypted request/response bodies
- NaCl box encryption (Curve25519 + XSalsa20-Poly1305)
- DPoP (Proof-of-Possession) token support
- Automatic token refresh
- Device registration and session management
- SDK secret authentication (required)
- Anti-debug report endpoints
Installation
pip install authguard-py
Or install from source:
pip install -r requirements.txt
Quick Start
from authguard import AuthGuardClient
# Initialize client
client = AuthGuardClient(
app_id="your-app-id",
owner_id="developer-user-id",
sdk_secret="your-sdk-secret"
)
# Initialize session and device
client.init_session()
client.ensure_device()
# Login
result = client.login("username", "password")
if result.ok:
print("Logged in!")
print(f"User: {result.data.get('username')}")
# Or use license key
result = client.license("XXXX-XXXX-XXXX-XXXX")
# Check session validity
result = client.check()
# Get app variable
result = client.get_var("my_variable")
# Send heartbeat
result = client.heartbeat()
# Log event
client.log("user_action", {"detail": "something happened"})
Configuration Options
client = AuthGuardClient(
app_id="your-app-id",
owner_id="developer-user-id",# Developer ID for SDK auth (required)
sdk_secret="your-sdk-secret",# SDK secret for developer auth (required)
host="api.evora.lol", # API host (default: api.evora.lol)
port=443, # API port (default: 443)
use_https=True, # Use HTTPS (default: True)
hwid=None, # Custom HWID (auto-generated if None)
)
API Reference
Session Management
init_session()- Initialize app sessionensure_device()- Register/refresh device credentialsensure_access_token()- Get valid access token (auto-refreshes)
Authentication
login(username, password)- Authenticate with username/passwordregister(username, password, email=None, key=None)- Create new accountlicense(license_key)- Authenticate with license keyupgrade(license_key)- Upgrade account with license key
Session Operations
check()- Verify session is validheartbeat()- Send heartbeat (keep session alive)get_var(name)- Get application variablelog(action, data=None)- Log an event
Advanced
call_protected(path, data)- Make authenticated API callcall_bootstrap(path, data)- Make bootstrap API call (no auth)
Security Notes
- All request bodies are encrypted on the wire using NaCl box
- Device credentials are stored locally (consider encrypting at rest)
- The SDK automatically handles token refresh
- DPoP tokens prove possession of device key
License
MIT
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
authguard_py-1.0.4.tar.gz
(14.0 kB
view details)
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 authguard_py-1.0.4.tar.gz.
File metadata
- Download URL: authguard_py-1.0.4.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9dc3c8f1e9179e68bca9ccaadadfbac3e12b8e48f84b4980f3ec24db330c0d3
|
|
| MD5 |
64b9b977cd737bf7ef6e6975c96dba00
|
|
| BLAKE2b-256 |
e7e1d6d88499fbd04dfdac6eff54924734c16460d913d8fa46afb9bd2f799022
|
File details
Details for the file authguard_py-1.0.4-py3-none-any.whl.
File metadata
- Download URL: authguard_py-1.0.4-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f57bbdb24e68772458bbd6852b4dd9bf6481be765181e7f35c55ed80f57fb58f
|
|
| MD5 |
cd7429442afd52cdb5c87b5bdb809687
|
|
| BLAKE2b-256 |
9e9a0fecb17e8133e158d8380ab1d269b69e1cb0cde935370c8ed0149c91448e
|