This is a Python authentication SDK for desktop, CLI, and utility apps that want simple integration with the AuthlyX API.
This folder includes the SDK in AuthlyX.py and a runnable example in main.py.
- Python
3.8or later requestscryptography,pyOpenSSL>=24.0.0, andurllib3>=1.26.18,<3(installrequirements.txt)
HTTPS connections to authly.cc validate the normal CA chain and hostname, then
check full DER SHA-256 CA certificate pins before sending any HTTP data. A
connection-local PyOpenSSL context exposes the verified chain on Python 3.8+;
the SDK does not globally replace urllib3's TLS backend. Other HTTPS hosts use
normal requests validation. There is no leaf-only or fail-open fallback.
from AuthlyX import AuthlyX
AuthlyXApp = AuthlyX(
ownerId="12345678",
appName="MYAPP",
version="1.0.0",
secret="your-secret",
debug=True,
api="https://authly.cc/api/v2",
)
AuthlyXApp.Init()AuthlyXApp = AuthlyX(
ownerId="12345678",
appName="MYAPP",
version="1.0.0",
secret="your-secret",
debug=False,
api="https://example.com/api/v2",
)-
debug- Default:
True - Set
Falseto disable SDK logs
- Default:
-
api- Default:
https://authly.cc/api/v2 - Use this for your custom domain
- Default:
Init()Login(identifier, password=None, deviceType=None)Register(username, password, licenseKey, email="")ChangePassword(oldPassword, newPassword)ExtendTime(username, licenseKey)GetVariable(key)SetVariable(key, value)Log(message)GetChats(channelName, limit=100, cursor=None)SendChat(message, channelName=None)ValidateSession()
# Username + password
AuthlyXApp.Login("username", password="password")
# License key only
AuthlyXApp.Login("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX")
# Device login
AuthlyXApp.Login("YOUR_DEVICE_ID", deviceType="motherboard")AuthlyXApp.Login("username", password="password")
if AuthlyXApp.response["success"]:
print("Login success")
print(AuthlyXApp.userData["Username"])
print(AuthlyXApp.userData["SubscriptionLevel"])
else:
print(AuthlyXApp.response["message"])AuthlyXApp.SetVariable("theme", "dark")
value = AuthlyXApp.GetVariable("theme")
print(value)By default, SDK logging is enabled.
Logs are written to:
C:\ProgramData\AuthlyX\{AppName}\YYYY_MM_DD.log
Sensitive values such as passwords, secrets, session IDs, request IDs, nonces, license keys, and hashes are masked automatically.
The runnable example in main.py uses the public test app by default for Init().
If you want to run the authenticated example too, set:
AUTHLYX_USERNAMEAUTHLYX_PASSWORD
Optional extra test values:
AUTHLYX_LICENSE_KEYAUTHLYX_MOTHERBOARD_IDAUTHLYX_PROCESSOR_ID
Then run:
pip install requests
python main.py