This is a Java authentication SDK for desktop and Java applications that want simple integration with the AuthlyX API.
This folder is primarily for SDK users. The sample app here is only a reference example to help you integrate faster.
The SDK supports:
- Java 11+
This example project uses Maven and gson.
public static AuthlyX AuthlyXApp = new AuthlyX(
"12345678",
"MYAPP",
"1.0.0",
"your-secret"
);
/*
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 AuthlyX AuthlyXApp = new AuthlyX(
"12345678",
"MYAPP",
"1.0.0",
"your-secret",
false,
"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 = "")ChangePassword(oldPassword, newPassword)ExtendTime(username, licenseKey)GetVariable(key)SetVariable(key, value)Log(message)GetChats(channelName)SendChat(message, channelName = "general")ValidateSession()
// Username + password
AuthlyXApp.Login("username", "password");
// License key only
AuthlyXApp.Login("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX");
// Device login
AuthlyXApp.Login("YOUR_MOTHERBOARD_ID", null, "motherboard");The SDK routes Login(...) automatically:
password + identifierfor username loginidentifier onlyfor license logindeviceType + identifierfor device login
AuthlyXApp.Login("username", "password");
if (AuthlyXApp.response.success) {
System.out.println("Login success");
System.out.println(AuthlyXApp.userData.Username);
System.out.println(AuthlyXApp.userData.SubscriptionLevel);
} else {
System.out.println(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) {
System.out.println("License login success");
} else {
System.out.println(AuthlyXApp.response.message);
}AuthlyXApp.Login("YOUR_MOTHERBOARD_ID", null, "motherboard");
if (AuthlyXApp.response.success) {
System.out.println("Motherboard login success");
} else {
System.out.println(AuthlyXApp.response.message);
}AuthlyXApp.Login("YOUR_PROCESSOR_ID", null, "processor");
if (AuthlyXApp.response.success) {
System.out.println("Processor login success");
} else {
System.out.println(AuthlyXApp.response.message);
}AuthlyXApp.SetVariable("theme", "dark");
String value = AuthlyXApp.GetVariable("theme");
System.out.println(value);AuthlyXApp.ChangePassword("oldpass", "newpass");
if (AuthlyXApp.response.success) {
System.out.println("Password changed successfully");
} else {
System.out.println(AuthlyXApp.response.message);
}AuthlyXApp.SendChat("Hello world", "general");
String chats = AuthlyXApp.GetChats("general");
System.out.println(chats);