This is a C# authentication SDK for desktop and .NET applications that want simple integration with the AuthlyX API.
This package is for SDK users. The Console and WinForms apps in the example folder are only reference examples to help you integrate faster.
The SDK supports:
.NET Framework 4.8.NET Standard 2.0.NET.NET Core
Modern .NET and .NET Core projects can consume the netstandard2.0 build.
Choose the setup that fits your project.
This is the quickest option and the easiest one to maintain.
Install the package from NuGet:
Install-Package AuthlyXOr with the .NET CLI:
dotnet add package AuthlyXOnce installed, import the namespace in your project:
using AuthlyX;Use this option if you want package updates, clean dependency management, and the simplest setup.
If you prefer to keep the SDK as a source file inside your project, you can add AuthlyX.cs manually.
Steps:
- Download
AuthlyX.cs. - Add it to your project.
- Install the required dependencies manually:
Newtonsoft.JsonPortable.BouncyCastle
- Import the namespace:
using AuthlyX;You can install the dependencies with NuGet Package Manager:
Install-Package Newtonsoft.Json
Install-Package Portable.BouncyCastleOr with the .NET CLI:
dotnet add package Newtonsoft.Json
dotnet add package Portable.BouncyCastleThis option works well if you want the SDK source directly in your solution and prefer to manage updates yourself.
If you already have a compiled AuthlyX.dll, you can reference it manually instead of installing the full package through NuGet.
Steps:
- Build or obtain
AuthlyX.dll. - In Visual Studio, right-click References or Dependencies.
- Choose Add Reference.
- Browse to
AuthlyX.dlland add it. - Make sure your project also has the required dependencies:
Newtonsoft.JsonPortable.BouncyCastle
- Import the namespace:
using AuthlyX;This option is useful when you want to ship or test a specific SDK build without pulling from NuGet.
public static Auth AuthlyXApp = new Auth(
ownerId: "12345678",
appName: "MYAPP",
version: "1.0.0",
secret: "qIBFoBJWQH4jaOZr6Sf8BJZyEVnT0LiN4QfGxJGn"
);
/*
Optional:
- Set debug to false to disable SDK logs.
- Set api to your custom domain, for example: https://example.com/api/v2
*/Then initialize:
AuthlyXApp.Init();public static Auth AuthlyXApp = new Auth(
ownerId: "12345678",
appName: "MYAPP",
version: "1.0.0",
secret: "qIBFoBJWQH4jaOZr6Sf8BJZyEVnT0LiN4QfGxJGn",
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 = null, deviceType = null)Register(username, password, licenseKey, email = null)ChangePassword(oldPassword, newPassword)ExtendTime(username, licenseKey)GetVariable(key)SetVariable(key, value)Log(message)GetChats(channelName)SendChat(message, channelName = null)ValidateSession()
// Username + password
AuthlyXApp.Login("username", "password");
// License key only
AuthlyXApp.Login("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX");
// Device login
AuthlyXApp.Login("YOUR_MOTHERBOARD_ID", deviceType: "motherboard");The SDK routes Login(...) automatically:
password + identifierfor username loginidentifier onlyfor license logindeviceType + identifierfor device login
AuthlyXApp.Login("username", "password");
if (AuthlyXApp.response.success)
{
Console.WriteLine("Login success");
Console.WriteLine(AuthlyXApp.userData.Username);
Console.WriteLine(AuthlyXApp.userData.SubscriptionLevel);
}
else
{
Console.WriteLine(AuthlyXApp.response.message);
}userData.SubscriptionLevel is populated automatically after username, license, and device authentication flows.
AuthlyXApp.Login("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX");
if (AuthlyXApp.response.success)
{
Console.WriteLine("License login success");
}
else
{
Console.WriteLine(AuthlyXApp.response.message);
}AuthlyXApp.Login("YOUR_MOTHERBOARD_ID", deviceType: "motherboard");
if (AuthlyXApp.response.success)
{
Console.WriteLine("Motherboard login success");
}
else
{
Console.WriteLine(AuthlyXApp.response.message);
}AuthlyXApp.Login("YOUR_PROCESSOR_ID", deviceType: "processor");
if (AuthlyXApp.response.success)
{
Console.WriteLine("Processor login success");
}
else
{
Console.WriteLine(AuthlyXApp.response.message);
}AuthlyXApp.SetVariable("theme", "dark");
string value = AuthlyXApp.GetVariable("theme");
Console.WriteLine(value);AuthlyXApp.ChangePassword("oldpass", "newpass");
if (AuthlyXApp.response.success)
{
Console.WriteLine("Password changed successfully");
}
else
{
Console.WriteLine(AuthlyXApp.response.message);
}AuthlyXApp.SendChat("Hello world", "MAIN");
string chats = AuthlyXApp.GetChats("MAIN");
Console.WriteLine(chats);For WinForms or UI apps, use the callback overloads so the app does not freeze:
AuthlyXApp.Login("user", "pass", callback: response =>
{
if (response.success)
{
MessageBox.Show("Logged in");
}
else
{
MessageBox.Show(response.message);
}
});You can also use callback-based versions of the main methods, including:
InitLoginRegisterGetVariableGetChatsValidateSession
By default, SDK logging is enabled.
Logs are written to:
C:\ProgramData\AuthlyX\{AppName}\YYYY_MM_DD.log
To disable logs:
debug: falseSensitive values such as passwords, secrets, and signatures are masked automatically.
The SDK accepts both PascalCase and lowercase method names.
Examples:
AuthlyXApp.Login("username", "password");
AuthlyXApp.login("username", "password");
AuthlyXApp.Init();
AuthlyXApp.init();- The SDK currently supports both
sidandhwidfor compatibility with older integrations. - If you are starting fresh, treat
sidas the preferred system identifier concept. - The example apps in the example folder are reference integrations, not required project structure.