Skip to content

Authentication Flow ​

The authentication process ensures each license key is valid and properly linked to its HWID (if applicable).


Basic Flow ​

  1. The user enters a license key (or username/password).
  2. Your app collects optional HWID information (if the license requires device binding).
  3. The SDK (or your HTTP client) sends a validation request to Keycrate.
  4. Keycrate responds with :
    • success : true or false
    • message : describes the successful validation of failed validation
    • data : license data
  5. Your app handles the response accordingly.

Example (Node JavaScript) ​

javascript
import { configurate } from "keycrate";

const client = configurate("https://api.keycrate.dev", "your-app-id");

const response = await client.authenticate({
    license: "XXXX-XXXX-XXXX",
});

if (response.success) {
    console.log("License active:", response.message);
} else {
    console.log("License invalid:", response.message);
}

Handling Common Responses ​

ResponseMeaningExample Handling
success: true message : "LICENSE_VERIFIED_UNUSED_AND_LOCKED_KEY" License is valid, First time userad and Hwid lockedAllow software access
success : false message : "LICENSE_EXPIRED"License duration endedShow renewal message
success: false message : "HWID_MISSMATCH"Device HWID doesn't matched the stored license HWIDAsk user to reset HWID or contact support
success : false message : "INVALID_USERNAME_OR_PASSWORD"Wrong credentialsPrompt user to re-enter

Authentication Methods ​

Keycrate supports two authentication methods:

License Key ​

javascript
// without HWID
await client.authenticate({ license: "your-license-key" });

or

javascript
// with HWID
await client.authenticate({
    license: "your-license-key",
    hwid: "xxxxx_xxxxx_xxxxx",
});

Username & Password ​

javascript
// without HWID
await client.authenticate({
    username: "user@example.com",
    password: "password123",
});

or

javascript
// with HWID
await client.authenticate({
    username: "user@example.com",
    password: "password123",
    hwid: "xxxxx_xxxxx_xxxxx",
});

Next Steps ​

  • Using an SDK? Choose your language: Python | JavaScript | Go | C# | Rust
  • Implementing HTTP directly? See API Reference
  • Need examples? Check out real-world use cases in the SDK documentation