AuthSharp.SDK 1.0.0

dotnet add package AuthSharp.SDK --version 1.0.0
                    
NuGet\Install-Package AuthSharp.SDK -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AuthSharp.SDK" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AuthSharp.SDK" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AuthSharp.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AuthSharp.SDK --version 1.0.0
                    
#r "nuget: AuthSharp.SDK, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AuthSharp.SDK@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AuthSharp.SDK&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AuthSharp.SDK&version=1.0.0
                    
Install as a Cake Tool

AuthSharp SDK

A comprehensive authentication and licensing SDK for .NET applications with built-in encryption, session management, and hardware fingerprinting.

Website

🌐 AuthSharp

Installation

dotnet add package AuthSharp.SDK

Or via NuGet Package Manager:

Install-Package AuthSharp.SDK

Supported Frameworks

  • .NET Standard 2.0
  • .NET Framework 4.8
  • .NET 6.0
  • .NET 7.0
  • .NET 8.0
  • .NET 9.0

Features

  • 🔐 User Authentication - Secure registration and login with bcrypt password hashing
  • 🎫 License Management - Built-in license key activation and validation
  • 🔑 Session Management - Encrypted session tokens with automatic expiration
  • 🖥️ Hardware Fingerprinting - HWID-based device tracking and validation
  • 📦 Variable Storage - Store user-specific and application-level variables
  • 🛡️ End-to-End Encryption - RSA + AES encryption for all communications
  • Async/Await Support - Modern async methods for all operations

Quick Start

Basic Usage

using AuthSharp;
using AuthSharp.SDK.Enums;

// Create and initialize the client
var client = new AuthClient("YOUR_APPLICATION_ID", "YOUR_PUBLIC_KEY_SHA256");
client.Init();

// Register a new user
var registerResult = client.Register("username", "password");
if (registerResult.Result == RegisterResults.Success)
{
    Console.WriteLine("Registration successful!");
}

// Login
var loginResult = client.Login("username", "password");
if (loginResult.Result == LoginResults.Success)
{
    var user = loginResult.UserData;
    Console.WriteLine($"Welcome, {user.Username}!");
    Console.WriteLine($"Account created: {user.CreatedAt}");
    Console.WriteLine($"Last login: {user.LastLogin}");
}

Async Usage

using AuthSharp;
using AuthSharp.SDK.Enums;

var client = new AuthClient("YOUR_APPLICATION_ID", "YOUR_PUBLIC_KEY_SHA256");
await client.InitAsync();

// Register with license key
var registerResult = await client.RegisterAsync("username", "password", "LICENSE-KEY-HERE");
if (registerResult.Result == RegisterResults.Success)
{
    Console.WriteLine(registerResult.Message);
}

// Login
var loginResult = await client.LoginAsync("username", "password");
if (loginResult.Result == LoginResults.Success)
{
    var user = loginResult.UserData;
    
    // Store user-specific data
    user.SetVar("LastLevel", 10);
    user.SetVar("Score", 1500);
    
    // Retrieve user data
    var level = user.GetVar<int>("LastLevel");
    Console.WriteLine($"Welcome back! You're on level {level}");
}

License Management

// Activate a license key
var result = client.UseLicense("YOUR-LICENSE-KEY");
if (result == RedeemLicenseResults.Success)
{
    Console.WriteLine("License activated successfully!");
}

// Get all user licenses
var licenses = client.GetLicenses();
foreach (var license in licenses)
{
    Console.WriteLine($"License: {license.Key}");
    Console.WriteLine($"Expires: {license.ExpiresAt}");
}

Application Variables

// Get application-level variables (requires permissions)
var varResult = client.GetVariable("ServerVersion");
if (varResult.Success)
{
    Console.WriteLine($"Server version: {varResult.Value}");
}
else
{
    Console.WriteLine($"Access denied: {varResult.Message}");
}

Password Management

// Change password
try
{
    client.ChangePassword("oldPassword", "newPassword");
    Console.WriteLine("Password changed successfully!");
}
catch (PasswordChangeException ex)
{
    Console.WriteLine($"Failed to change password: {ex.Message}");
}

// Async version
await client.ChangePasswordAsync("oldPassword", "newPassword");

Logout and Cleanup

// Logout (invalidates session on server)
client.LogOut();

// Or use async
await client.LogOutAsync();

// Dispose when done (automatically terminates session)
using (var client = new AuthClient("APP_ID", "PUBLIC_KEY_SHA256"))
{
    client.Init();
    // ... your code ...
} // Session automatically terminated

Error Handling

using AuthSharp.SDK.Exceptions;

try
{
    var client = new AuthClient("APP_ID", "PUBLIC_KEY_SHA256");
    client.Init();
    var result = client.Login("username", "password");
    
    // Check result status
    switch (result.Result)
    {
        case LoginResults.Success:
            Console.WriteLine("Logged in!");
            break;
        case LoginResults.InvalidCredentials:
            Console.WriteLine("Wrong username or password");
            break;
        case LoginResults.Userblacklisted:
            Console.WriteLine($"Account banned: {result.BlacklistReason}");
            break;
        case LoginResults.FingerprintMismatch:
            Console.WriteLine("Hardware ID mismatch - please contact support");
            break;
    }
}
catch (InitializationException ex)
{
    Console.WriteLine($"Failed to initialize: {ex.Message}");
}
catch (UserLoginException ex)
{
    Console.WriteLine($"Login error: {ex.Message}");
}
catch (UnableToConnectException ex)
{
    Console.WriteLine($"Connection error: {ex.Message}");
}

Configuration

To use AuthSharp SDK, you need:

  1. Application ID - Your unique application identifier from the AuthSharp dashboard
  2. Public Key SHA256 - The SHA256 hash of your application's public key

These can be obtained from your AuthSharp server dashboard.

Documentation

For complete documentation, API reference, and advanced usage:

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 275 11/30/2025