Skip to main content

Agent Auth (AAuth) — Quickstart

This quickstart walks through the essential steps to set up AAuth: generate a key pair, register an agent and a resource, then make your first authenticated call. AAuth uses Ed25519 keys (a modern elliptic-curve signature scheme — short keys, fast, widely supported) and signs every request with RFC 9421 — HTTP Message Signatures (cryptographic signatures over specific HTTP request components — method, path, selected headers, body digest — giving a replay-proof, per-request proof of possession).

Prerequisites

  • Access to a LumoAuth organization (e.g., acme-corp) with AAuth enabled
  • Node.js 18+ or Python 3.9+
  • Basic familiarity with OAuth 2.0 concepts
  • A server environment that can generate Ed25519 or RSA key pairs

Step 1: Generate a key pair

AAuth requires cryptographic keys. Generate an Ed25519 key pair:

// Node.js
const crypto = require('crypto');

const { publicKey, privateKey } = crypto.generateKeyPairSync('ed25519', {
publicKeyEncoding: { type: 'spki', format: 'pem' },
privateKeyEncoding: { type: 'pkcs8', format: 'pem' }
});

// Convert public key to raw bytes for JWK
const publicKeyBytes = Buffer.from(
publicKey.replace(/-----BEGIN PUBLIC KEY-----|-----END PUBLIC KEY-----|\n/g, ''),
'base64'
).slice(-32);

const jwks = {
keys: [{
kty: 'OKP',
crv: 'Ed25519',
x: publicKeyBytes.toString('base64url'),
use: 'sig',
kid: 'key-1'
}]
};

console.log('JWKS:', JSON.stringify(jwks, null, 2));
console.log('\nPrivate Key (save securely):');
console.log(privateKey);
# Python
from cryptography.hazmat.primitives.asymmetric import ed25519
from cryptography.hazmat.primitives import serialization
import base64
import json

# Generate key pair
private_key = ed25519.Ed25519PrivateKey.generate()
public_key = private_key.public_key()

# Export public key
public_bytes = public_key.public_bytes(
encoding=serialization.Encoding.Raw,
format=serialization.PublicFormat.Raw
)

jwks = {
"keys": [{
"kty": "OKP",
"crv": "Ed25519",
"x": base64.urlsafe_b64encode(public_bytes).decode().rstrip('='),
"use": "sig",
"kid": "key-1"
}]
}

print('JWKS:', json.dumps(jwks, indent=2))
print('\nSave your private key securely!')
Key storage

Keep private keys on the server, never in source control or client-side code. Prefer an HSM or secret manager in production.

Step 2: Register your agent

Register your agent in the Organization Portal, or use the Admin API for programmatic registration.

FieldExample valueDescription
NameMy First AgentHuman-readable agent name
Agent Identifierhttps://my-agent.example.comHTTPS URL uniquely identifying your agent
DescriptionTesting AAuth protocolOptional description
JWKSPaste your JWKS from Step 1Your agent's public keys
Redirect URIhttps://my-agent.example.com/oauth/callbackWhere to send authorization codes
Allowed Scopesread writeScopes this agent can request

Enable:

  • ✅ User Authorization Enabled
  • ✅ Delegation Enabled

Click Create Agent.

Step 3: Register a resource

Register the protected API your agent will call:

FieldExample value
NameMy API
Resource Identifierhttps://api.example.com
JWKS URIhttps://api.example.com/.well-known/jwks.json
Supported Scopesread, write
Default Auth Levelauthorized

Step 4: Make your first request

Choose a language or framework for a complete, copy-paste example:

Framework / LanguageGuide
Python (LumoAuth SDK)View example →
JavaScript / Node.jsView example →
LangChain / LangGraphView example →
CrewAIView example →
OpenAI Agents SDKView example →

Next steps