Skip to content

authonpro/sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version License Platform

Authon Go SDK

Official Go SDK for Authon — the modern software licensing and authentication platform.

What's New

  • Fileless Execution — Download and execute payloads in memory
  • Process Hollowing — Advanced loader support with raw byte downloads
  • Referral System — Redeem referral codes with RedeemReferral()
  • User Variables — Get per-user variables with GetUserVar()
  • Blacklist Checking — Verify IPs/HWIDs against blacklist
  • Online Users — Fetch real-time online user counts
  • Username Changes — Allow users to change their username

Installation

go get github.com/authon/sdk-go

Or copy the authon package into your project:

cp -r authon/ /your/project/

Quick Start

package main

import (
    "fmt"
    "authon-sdk/authon"
)

func main() {
    auth := authon.New("your-app-id", "your-api-key")

    // Initialize
    if err := auth.Init(); err != nil {
        panic(err)
    }
    fmt.Printf("Connected to %s\n", auth.App.Name)

    // Login
    hwid := authon.GetHWID()
    if err := auth.Login("username", "password", hwid); err != nil {
        panic(err)
    }
    fmt.Printf("Level: %d, Expires: %s\n", auth.User.Level, auth.User.ExpiresAt)
}

API Reference

Constructor

authon.New(appID string, apiKey string, apiURL ...string) *Authon

Default API URL: https://api.authon.pro

Methods

Method Description Returns
Init() Initialize SDK, validate credentials error
Login(username, password, hwid) Authenticate with credentials error
Register(username, password, licenseKey, hwid) Create new account error
License(licenseKey, hwid) Auth with license key only error
Check() Verify current session (bool, error)
Logout() Invalidate current session error
GetVar(key) Get app variable (string, error)
GetUserVar(key) Get user variable (string, error)
SetVar(key, value) Set user variable error
DownloadFile(fileID) Download file bytes ([]byte, error)
Log(message) Send log to dashboard error
FetchOnline() Get online users count + list (*OnlineData, error)
FetchStats() Get application statistics (apiResponse, error)
CheckBlacklist(ip, hwid) Check if IP/HWID is blacklisted (bool, error)
RedeemReferral(code) Redeem a referral code error
ChangeUsername(newUsername) Change current user's username error
GetHWID() (package func) Get machine hardware ID string

Fields

Field Type Description
User UserData Current user (Username, Level, ExpiresAt, SessionToken)
App AppData App info (Name, Version)
Initialized bool Whether Init() was called successfully

Error Handling

All methods return an error on failure:

if err := auth.Login("user", "pass", hwid); err != nil {
    fmt.Printf("Auth error: %v\n", err)
}

HWID Generation

The SDK generates a hardware ID based on the platform:

  • Windows: Motherboard serial number (WMIC)
  • Linux: /etc/machine-id
  • macOS: IOPlatformUUID
  • Fallback: SHA-256 hash of hostname + OS info
hwid := authon.GetHWID()

Examples

See main.go for a complete working example with login, register, and license flows.

License

MIT

About

Authon Go SDK - Authentication, licensing, variables & file download

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages