KeyAuth Documentation

Complete guide to integrating KeyAuth authentication system into your applications. Learn how to secure your software with our professional-grade authentication platform.

🚀 Quick Start

Get up and running with KeyAuth in under 5 minutes. Follow our step-by-step guides to integrate authentication into your application.

Quick Start Guide

This guide will walk you through the basic setup of KeyAuth in your application. We'll cover:

  • Creating your first application
  • Downloading the appropriate SDK
  • Basic authentication implementation
  • Testing your integration

Step 1: Create Application

First, you need to create an application in your KeyAuth dashboard:

  1. Login to your KeyAuth dashboard
  2. Click "Create Application"
  3. Enter your application name and description
  4. Copy the generated App Secret and Seller Key

Step 2: Download SDK

Download the appropriate SDK for your programming language:

C# (.NET) SDK

Official SDK for .NET applications with full authentication support

Download C# SDK

Step 3: Basic Implementation

Here's a basic example of how to initialize KeyAuth in your application:

// C# Example
using KeyAuth;

var keyAuth = new KeyAuthApp("app_name", "app_secret", "app_version");

if (await keyAuth.Initialize())
{
    Console.WriteLine("KeyAuth initialized successfully!");
    
    // Login user
    if (await keyAuth.Login("username", "password"))
    {
        Console.WriteLine("User logged in successfully!");
    }
}

C# (.NET) SDK

The C# SDK provides a simple and intuitive way to integrate KeyAuth into your .NET applications. It supports both .NET Framework and .NET Core.

Installation

Install the SDK via NuGet Package Manager:

Install-Package KeyAuth.NET

Or via Package Manager Console:

dotnet add package KeyAuth.NET

Basic Usage

Here's a complete example of a basic KeyAuth integration:

using KeyAuth;
using System;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var app = new KeyAuthApp("your_app_name", "your_app_secret", "1.0");
        
        try
        {
            // Initialize the application
            if (await app.Initialize())
            {
                Console.WriteLine("✅ Application initialized successfully!");
                
                // Login user
                if (await app.Login("username", "password"))
                {
                    Console.WriteLine("✅ User authenticated successfully!");
                    Console.WriteLine($"Welcome, {app.UserData.Username}!");
                    
                    // Check license
                    if (await app.License("your_license_key"))
                    {
                        Console.WriteLine("✅ License validated successfully!");
                        Console.WriteLine("Application is ready to use!");
                    }
                    else
                    {
                        Console.WriteLine("❌ Invalid license key!");
                    }
                }
                else
                {
                    Console.WriteLine("❌ Authentication failed!");
                }
            }
            else
            {
                Console.WriteLine("❌ Failed to initialize application!");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine($"❌ Error: {ex.Message}");
        }
        
        Console.WriteLine("Press any key to exit...");
        Console.ReadKey();
    }
}

Advanced Features

The C# SDK includes several advanced features:

  • HWID Locking: Secure your application to specific hardware
  • VPN Detection: Detect and block VPN connections
  • Memory Protection: Protect against memory manipulation
  • Webhook Support: Receive real-time notifications

API Overview

KeyAuth provides a comprehensive REST API for advanced integrations and custom implementations. All API endpoints use HTTPS and return JSON responses.

Base URL

https://api.keyauth.cc/v1/

Authentication

Most API endpoints require authentication. Include your API key in the request headers:

Authorization: Bearer YOUR_API_KEY

Rate Limiting

API requests are limited to 1000 requests per minute per API key. Exceeding this limit will result in a 429 status code.

API Endpoints

Here are the main API endpoints available in KeyAuth:

POST
/auth/init
Initialize your application with KeyAuth

Parameters

app_name string Required
app_secret string Required
version string Required
POST
/auth/login
Authenticate a user with username and password

Parameters

username string Required
password string Required
POST
/auth/register
Register a new user account

Parameters

username string Required
email string Required
password string Required
POST
/license/validate
Validate a license key

Parameters

license_key string Required
hwid string Optional

Basic Examples

Here are some basic examples of common KeyAuth operations:

User Registration

// C# Example
var userData = new UserRegistrationData
{
    Username = "john_doe",
    Email = "john@example.com",
    Password = "secure_password123"
};

if (await app.Register(userData))
{
    Console.WriteLine("✅ User registered successfully!");
}
else
{
    Console.WriteLine("❌ Registration failed!");
}

License Validation

// C# Example
if (await app.License("XXXX-XXXX-XXXX-XXXX"))
{
    Console.WriteLine("✅ License is valid!");
    Console.WriteLine($"Expires: {app.LicenseData.Expires}");
    Console.WriteLine($"Level: {app.LicenseData.Level}");
}
else
{
    Console.WriteLine("❌ Invalid or expired license!");
}

HWID Management

// C# Example
var hwid = app.GetHWID();
Console.WriteLine($"Current HWID: {hwid}");

if (await app.SetHWID(hwid))
{
    Console.WriteLine("✅ HWID set successfully!");
}
else
{
    Console.WriteLine("❌ Failed to set HWID!");
}

Need Help?

If you need help with integration or have questions about the API:

💡 Pro Tip

Join our Discord community for real-time support and to connect with other developers using KeyAuth!