🔐 DTLAuth: Modern Identity & Access Tokens

DTLAuth is a modern authentication and authorization layer built on DTL. Instead of JWT, SAML, or OIDC, DTLAuth uses compact, deterministic, cryptographically sealed tokens that are perfect for Web3, microservices, and critical infrastructure.

What is DTLAuth?

DTLAuth is an identity and access management system where tokens are DTL files, not opaque strings. Every token contains:

ID Tokens (dtID Domain)

An ID token identifies who the user is. Example:

@dtlv1.0^dtID^pDTLAuthID1^c2^s1^w2^hb3^sged
@sec^fh88ff22aa44dd...^wa0xABCD99EF...^sg0xf122aa33bb...^chZC01

USER|uid:s,iss:s,aud:a(s),name:s,email:s,roles:a(s),exp:i,iat:i,nonce:s|1|S1|W2|C2
u-9001|https://login.dtlaz.org|alif-portal,iris-vision|Padam Sundar Kafle|padam@example.com|admin,superintelligence|1736990000|1736986400|xyz123

What this means:

Access Tokens (dtAC Domain)

An access token defines what you can do. Example:

@dtlv1.0^dtAC^pDTLAuthACC1^c2^s1^w2^hb3^sged
@sec^fh7711aa22bbff...^wa0xABCD99EF...^sg0xab11cd22dd77...^chZC01

ACCESS|uid:s,client_id:s,scopes:a(s),resources:a(s),exp:i,iat:i,nonce:s|1|S1|W2|C2
u-9001|alif-portal|triage.read,lab.write,patient.read|patient:*,org:aster|1736990400|1736986400|acc-xyz123

What this means:

DTLAuth Gateway

The DTLAuth Gateway is a FastAPI microservice that:

Token Flow

  1. User logs in: POST /auth/login with username + password
  2. Gateway validates, creates ID + Access tokens (both DTL files)
  3. Returns tokens as strings: { "id_token": "...", "access_token": "..." }
  4. Client stores tokens locally (or in secure httpOnly cookie)
  5. Client includes access_token in API request header
  6. API calls POST /auth/verify with token
  7. Gateway verifies hash + signature, returns identity JSON
  8. API checks scopes/resources, allows/denies request

DTLAuth vs JWT vs SAML vs OIDC

Aspect DTLAuth JWT SAML OIDC
Token Format DTL (deterministic) Base64(JSON) XML JWT
Size Tiny Medium Huge Medium
Signature Schemes Ed25519, secp256k1 HS256, RS256 RSA, etc. RS256, etc.
Web3 Compatible Native (wallets) No No No
Canonical Form Single (deterministic) No (multiple valid) No (XML ambiguity) No (JSON ambiguity)
alg=none Vulnerable No (enforced sig_alg) Yes (if not checked) N/A Yes (builds on JWT)

Security Model

DTLAuth tokens have multiple layers of security:

Read Full DTLAuth Spec → Python SDK →