L3S DRM Developer Guide

Error Codes Reference

This page documents all error codes returned by the L3DRM authentication system. These codes appear in session logs and help diagnose authentication issues.

Error Code Categories

PrefixCategoryHTTP StatusDescription
AUTH_Authentication401Request authentication failures (credentials, API key, payload)
AUTHZ_Authorization403Access control failures (key status, user blocked, permissions)
RATE_Rate Limiting429Too many failed authentication attempts
PRE_Pre-Check403Pre-validation failures before full authentication (API key revoked, user blocked)
SRV_Server5xxServer-side errors (internal errors, database issues)
TMPR_Client-SideN/ALocal tamper detection errors raised by the WASM module (file hash issues)

Authentication Errors (HTTP 401)

These errors occur when the request cannot be authenticated.

CodeDescriptionTrigger ConditionMessage
AUTH_001Invalid user agentThe DRM library is not properly integrated - User-Agent must start with "KittyHawk"Authentication failed
AUTH_002Missing credentialsThe DRM request is missing required encrypted payload fieldsAuthentication failed
AUTH_003Invalid Client API keyThe Client API key in the WASM build is invalid or not configured in the dashboardInvalid or incorrect key
AUTH_004Inactive Client API keyThe Client API key has been deactivated - the product needs to be updatedPlease update this product
AUTH_005Malformed payloadPayload decryption failed - possible tampering or corrupted DRM libraryAuthentication failed

Authorization Errors (HTTP 403)

These errors occur when the request is authenticated but access is denied.

CodeDescriptionTrigger ConditionMessage
AUTHZ_001Activation key not foundThe activation key doesn't exist for this projectInvalid or incorrect key
AUTHZ_002Activation key disabledThe activation key has been disabled in the dashboardKey is inactive
AUTHZ_003Activation key expiredThe activation key's expiry date has passedKey has expired
AUTHZ_004User blockedThis Xbox/MSFS username has been blocked by the project ownerAccess denied
AUTHZ_005Invalid WASM hashThe WASM binary hash doesn't match an approved version - possible tampering or outdated buildAccess denied
AUTHZ_006Missing WASM hashHash verification is required but the client didn't provide a file hashAccess denied
AUTHZ_007User switch cooldownUser changed too recently - wait ~15 minutes between user switches on the same keyAccess denied
AUTHZ_008Activation key requiredThis project requires an activation key - store/keyless authentication is disabledAccess denied

Pre-Check Errors (HTTP 403)

These errors occur during the pre-validation step, before the full authentication flow runs.

CodeDescriptionTrigger ConditionMessage
PRE_001API key revokedThe Client API key has been revoked or is inactive - checked during the pre-validation stepAccess denied
PRE_002User blocked (pre-check)This Xbox/MSFS username has been blocked - checked during the pre-validation stepAccess denied

Rate Limiting Errors (HTTP 429)

These errors protect against brute force and credential stuffing attacks.

CodeDescriptionTrigger ConditionMessage
RATE_001Activation key rate limitedToo many failed attempts with this key (10+ failures in 10 minutes)Too many requests
RATE_002User rate limitedToo many failed attempts for this user (5+ failures in 10 minutes)Too many requests

Rate Limiting Details:

  • RATE_001 (Per-Key): 10 failed attempts within 10 minutes
  • RATE_002 (Per-User): 5 failed attempts within 10 minutes

Failed attempts are counted from the sessions table where auth_response != '200'.


Server Errors (HTTP 5xx)

These errors indicate server-side issues.

CodeHTTP StatusDescriptionTrigger Condition
SRV_001500Internal server errorUnexpected server error - please try again or contact support
SRV_002503Database unavailableDatabase is temporarily unavailable - please try again in a few moments

Client-Side Errors (File Hash Verification)

These errors are raised locally by the WASM module when file hash verification fails. They do not involve a server request. If autoAbort is enabled, the module will crash; otherwise, the onTamper callback is called.

CodeDescriptionTrigger Condition
TMPR_019File hash mismatchA registered file's hash does not match the expected value - the file may have been modified after release, or the hash was not updated after editing the file
TMPR_020WASM path emptyThe .wasmPath() builder option is empty or was not set - this is required for file hash verification
TMPR_021File hash computation failedThe DRM module could not read or compute the hash of a registered file - check that the file path is correct and the file exists in the package

Tip: Enable .debug(true) in your builder (in a debug build only) to see which file failed hash verification in the MSFS console.


Authentication Flow

The auth4 endpoint validates requests in this order:

  1. User-Agent validation → AUTH_001
  2. Required fields check → AUTH_002
  3. API key lookup → AUTH_003 / AUTH_004
  4. Payload decryption → AUTH_005
  5. Activation key lookup → AUTHZ_001
  6. Rate limiting → RATE_001 / RATE_002
  7. Key status check → AUTHZ_002 / AUTHZ_003
  8. User block check → AUTHZ_004
  9. File hash validation → AUTHZ_005 / AUTHZ_006
  10. User switch cooldown → AUTHZ_007
  11. Success → HTTP 200

Tip: When troubleshooting authentication issues, check the error code in the session history to identify exactly where the authentication failed.