Skip to content

Authentication

Base URL: https://api.moenet.work

MoeNet supports three authentication methods against the DN42 registry: GPG, SSH, and Email.

Authentication Flow

Endpoints

Query User Info

Check if an ASN is registered and available authentication methods.

bash
curl -X POST https://api.moenet.work/auth \
  -H "Content-Type: application/json" \
  -d '{"action": "query", "asn": 4242421080}'

Response:

json
{
  "exists": true,
  "mntner": "EXAMPLE-MNT",
  "methods": ["gpg", "ssh", "email"]
}

Request Challenge

bash
curl -X POST https://api.moenet.work/auth \
  -H "Content-Type: application/json" \
  -d '{"action": "request", "asn": 4242421080, "method": "gpg"}'

Response:

json
{
  "challenge": "base64-encoded-challenge",
  "expires": 300
}

Verify Challenge

Submit signed challenge to receive JWT token.

bash
curl -X POST https://api.moenet.work/auth \
  -H "Content-Type: application/json" \
  -d '{
    "action": "verify",
    "asn": 4242421080,
    "method": "gpg",
    "signature": "base64-encoded-signature"
  }'

Response:

json
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expiresIn": 86400
}

Using the Token

All authenticated endpoints require the JWT token in the Authorization header:

bash
Authorization: Bearer <jwt-token>

Error Codes

CodeDescription
AUTH_FAILEDSignature verification failed
INVALID_TOKENJWT token invalid or expired
ASN_BLOCKEDASN has been blocked by admin
ASN_NOT_FOUNDASN not found in DN42 registry

Rate Limits

RouteLimit
/auth60 requests/min

MoeNet DN42 Network — AS4242420998