Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

🔐 AuthVaultix Python SDK

The official Python client library for AuthVaultix — a powerful license & authentication management platform.

PythonLicenseAuthVaultixPlatform


📖 Table of Contents


🔐 What is AuthVaultix?

AuthVaultix is a cloud-based software licensing and user authentication system. This Python SDK allows your application to seamlessly connect to the AuthVaultix API to:

  • Authenticate users via login, registration, or license key
  • Protect your software with hardware-locked licensing (HWID)
  • Retrieve user subscriptions, metadata, and custom variables
  • Prevent unauthorized access and piracy

✨ Features

FeatureDescription
🔑 Login / RegisterAuthenticate users with username & password
🪪 License Key AuthAllow access via license key only
🖥️ HWID LockingHardware fingerprinting on Windows, Linux & macOS
📦 Subscription InfoRetrieve active subscriptions with expiry & time left
🔢 Custom VariablesGet/Set server-side variables per user
🚪 Secure LogoutInvalidate session server-side
Session ManagementAuto session-ID handling on init

📋 Requirements

  • Python 3.7+
  • requests library

Install dependencies:

pip install requests

🚀 Installation

Option 1: Clone the repository

git clone https://github.com/AuthVaultix-Python-Example.git
cd authvaultix-python
pip install requests

Option 2: Download manually

Download authvaultix.py and place it in your project directory.


⚡ Quick Start

fromauthvaultiximportAuthVaultixClient# Initialize the clientclient=AuthVaultixClient(
app_name="MyApp",
owner_id="your_owner_id_here",
secret="your_secret_key_here", # Must be 64+ charactersversion="1.0",
api_url="https://authvaultix.com/api/1.0/"
)
# Loginsuccess=client.login("myusername", "mypassword")
ifsuccess:
info=client.get_user_info()
print("Welcome,", info["username"])
print("Subscription expires:", info["subscriptions"][0]["expiry"])

📄 Full Example (main.py)

The included main.py demonstrates a complete authentication flow with a console menu:

fromauthvaultiximportAuthVaultixClientAuthVaultixapp=AuthVaultixClient(
app_name="", # Your app name from dashboardowner_id="", # Your Owner ID from dashboardsecret="", # Your Secret key (64+ chars)version="1.0",
api_url="https://authvaultix.com/api/1.0/"
)
# 1. LoginAuthVaultixapp.login("username", "password")
# 2. RegisterAuthVaultixapp.register("username", "password", "LICENSE-KEY-HERE", "email@example.com")
# 3. License key onlyAuthVaultixapp.license_login("LICENSE-KEY-HERE")
# Get user info after authinfo=AuthVaultixapp.get_user_info()
print("Username:", info["username"])
print("HWID:", info["hwid"])
print("IP:", info["ip"])
forsubininfo["subscriptions"]:
print(f"Sub: {sub['name']} | Expires: {sub['expiry']} | Left: {sub['timeleft']}")

📚 API Reference

AuthVaultixClient(app_name, owner_id, secret, version, api_url)

Initializes and connects your app to the AuthVaultix server.

ParameterTypeDescription
app_namestrYour application name
owner_idstrOwner ID from dashboard (min 10 chars)
secretstrSecret key from dashboard (min 64 chars)
versionstrYour app version (e.g. "1.0")
api_urlstrAPI endpoint URL

Authentication Methods

login(username, password)

Authenticates a user with username and password. Returns True on success.

register(username, password, license_key, email="")

Registers a new user using a license key and optional email. Returns True on success.

license_login(license_key)

Authenticates a user using a license key only (no username/password). Returns True on success.

logout()

Logs the user out and invalidates the current session.


User & Session Management

get_user_info()

Returns a dictionary with the authenticated user's information.

check()

Validates if the current session is still active. Returns True if valid.

upgrade(username, license_key)

Upgrades a user's account/subscription with a new license key.

forgot_password(username, email)

Triggers a password reset email for the given user.

change_username(new_username)

Changes the authenticated user's username.


Variables & Data

get_var(var_name)

Fetches a user-specific server-side variable.

set_var(var_name, value)

Sets a user-specific server-side variable for the current user.

get_global_var(var_key)

Fetches a global server-side variable by its ID.

download(file_id)

Downloads a secure file from the server. Returns the file's binary content.


Security & Logging

log(message)

Sends a log message to the AuthVaultix dashboard.

fetch_online()

Retrieves a list of currently online clients.

ban(reason="")

Bans the currently authenticated user with an optional reason.

check_blacklist()

Checks if the current machine's HWID is blacklisted on the server. Returns True if blacklisted.

fetch_stats()

Fetches application statistics (users, active, etc.) into app_info.


Communication & Webhooks

chat_send(message, channel)

Sends a message to a specific chat channel.

chat_fetch(channel)

Retrieves chat history for a specific channel.

webhook(web_id, param, body="", conttype="")

Triggers a custom webhook on the AuthVaultix server.


🖥️ HWID Detection

The SDK automatically generates a unique Hardware ID (HWID) for each machine and locks the license to it. It supports:

PlatformSources Used
WindowsCPU Processor ID + Disk Serial + Motherboard Serial + Machine GUID
Linux/etc/machine-id + CPU Serial + Disk Serial
macOSHardware Serial Number

The raw hardware data is hashed with SHA-256 and converted to a Windows SID-style format (e.g. S-1-5-21-XXXX-XXXX-XXXX-XXXX).

You can also get the HWID manually:

fromauthvaultiximportHardwareIdentifierhwid=HardwareIdentifier.fetch()
print("Your HWID:", hwid)

📦 User Data Structure

After a successful login/register/license, get_user_info() returns:

{
"username": "john_doe",
"ip": "123.456.789.0",
"hwid": "S-1-5-21-XXXX-XXXX-XXXX-XXXX",
"created": "2024-01-15 10:30:00 AM",
"last_login": "2024-06-01 08:00:00 AM",
"expires": "2025-01-15 10:30:00 AM",
"subscriptions": [
{
"name": "premium",
"expiry": "2025-01-15 10:30:00 AM",
"timeleft": "215d 14h 30m"
}
]
}

⚠️ Error Handling

The SDK prints descriptive error messages to the console. Common errors:

ErrorCause
Invalid owneridownerid is missing or less than 10 characters
Invalid secretsecret is missing or less than 64 characters
Invalid API URLapi_url doesn't start with http
Init failedApp not found or version mismatch in dashboard
Login failedWrong credentials or HWID mismatch
Request timed outServer is down or network issue

🗂️ Project Structure

📦 authvaultix-python/
┣ 📄 authvaultix.py ← Core SDK (import this in your project)
┣ 📄 main.py ← Full usage example with console menu
┗ 📄 README.md ← You are here

📜 License

This project is licensed under the MIT License — you are free to use, modify, and distribute it.


Made with ❤️ for the AuthVaultix community

🌐 Website📧 Support

About

Official Python SDK for AuthVaultix authentication system with login, registration, license management, session validation, variables, file downloads, chat, and security features.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages