Skip to main content

Requirements

  • Rust 1.70 or later
  • Crates used by the SDK:
    • hmac
    • sha2
    • serde
    • serde_json
    • ureq
    • base64
    • mac_address
    • hostname

Installation

The crate is published on crates.io/crates/authforge as authforge.
Or set a semver range in Cargo.toml (for example 1.0 for compatible 1.x releases):
Optional: pin branch, tag, or rev.

Quick start

Config struct reference

Validate license (no heartbeat)

validate_license runs the same /auth/validate request and signature checks as login, but does not store a session on the client or start the heartbeat thread. It returns the same LoginResult on success.

Billing

  • Each successful login() or validate_license() costs 1 credit (one /auth/validate debit).
  • Heartbeats cost 1 credit per 10 successful calls (billed on every 10th heartbeat). Any heartbeat_interval ≥ 1 is economically safe.
  • Revocations take effect on the next heartbeat regardless of interval.

Methods reference

Error enum reference

Heartbeat modes

See Heartbeat Modes for a detailed comparison.