WaffleAuth Documentation
Prerequisites
To use WaffleAuth effectively, you need to install the following packages via NuGet:
- Discord Rich Presence: Adds functionality for displaying status information through Discord.
- Newtonsoft.Json: Required for JSON parsing and serialization tasks.
Getting Started
WaffleAuth is a license authentication system that provides functionality for generating and validating license keys.
WaffleAuth.dll
Library File
WaffleHWID.exe
HWID Generator
Important: Before using WaffleAuth, you need to configure your own Firebase/Firestore credentials and endpoints.
Initial Setup
Initialize WaffleAuth with the following configuration methods:
Required Configuration Methods
WaffleAuthFuncs.SetURL("YOUR_FIRESTORE_URL");
WaffleAuthFuncs.SetAPIKey("YOUR_API_KEY");
WaffleAuthFuncs.SetEndPoint("YOUR_ENDPOINT_URL");
WaffleAuthFuncs.SetInitials("LA");
WaffleAuthFuncs.MessageBoxes(true);
| Method |
Description |
Parameter Type |
SetURL() |
Sets the Firestore database URL |
string |
SetAPIKey() |
Sets the API key for authentication |
string |
SetEndPoint() |
Sets the endpoint URL for queries |
string |
SetInitials() |
Sets the initials for key generation |
string |
MessageBoxes() |
Enables/disables message boxes |
bool |
Initialize() |
Loads saved keys and validates them |
bool |
Initialize and Load Saved Keys
After setting up the configuration, initialize WaffleAuth to load and validate any saved keys:
bool isValid = await WaffleAuthFuncs.Initialize();
if (isValid) {
} else {
return;
}
Returns:
bool: True if saved keys are valid, false otherwise
Generate and Validate License Keys
WaffleAuth now requires you to generate keys with specific parameters. This includes duration for standard keys and additional settings for earning keys.
string generatedKey = await WaffleAuthFuncs.GenerateKeyAsync(10);
string adLinkKey = await WaffleAuthFuncs.GenerateEarningKeyAsync("https://youtube.com", 1, 60);
- The first integer for
GenerateKeyAsync() specifies the duration of the key in hours.
- For
GenerateEarningKeyAsync(), the first integer is the number of seconds you need to stay on the site, and the second integer is how many hours the key lasts.
Validate License Key
To check if a license key is valid:
bool isKeyValid = await WaffleAuthFuncs.CheckKey(keyString);
Example Implementation
using WaffleAuth;
public partial class Form1: Form {
public Form1() {
WaffleAuthFuncs.SetURL("YOUR_FIRESTORE_URL");
WaffleAuthFuncs.SetAPIKey("YOUR_API_KEY");
WaffleAuthFuncs.SetEndPoint("YOUR_ENDPOINT_URL");
WaffleAuthFuncs.SetInitials("LA");
WaffleAuthFuncs.MessageBoxes(true);
bool isValid = await WaffleAuthFuncs.Initialize();
if(!isValid) {
Application.Exit();
}
InitializeComponent();
}
private async void ValidateKey_Click(object sender, EventArgs e) {
bool isKeyValid = await WaffleAuthFuncs.CheckKey(licenseKey);
if(!isKeyValid) {
Application.Exit();
}
}
}
Security Note
Always keep your API keys and credentials secure and never expose them in client-side code or public repositories.