Skip to content
Docs search⌘K
Pre-1.0 · M1–M6 built · Don't use with real users yet

Self-hosted auth in one container.

Sign-in, passkeys, 2FA, OAuth 2.1 / OIDC, SAML SSO, and MCP authorization — backed by SQLite in a single folder you can move anywhere.

$ git clone https://github.com/Anmolnoor/authwapi.git && cd authwapi
$ docker build -t authwapi .
$ docker run -d --name authwapi \
    -p 127.0.0.1:4000:4000 -v "$PWD/authwapi-data:/data" authwapi
$ curl http://localhost:4000/health
{"status":"ok"}
200 OK · 127.0.0.1:40000 external DBs · rootless ready
Built on
  • Better Auth
  • Hono
  • SQLite
  • OAuth 2.1 + PKCE
  • OpenID Connect
  • SAML 2.0
  • Passkeys
  • MCP Auth

Everything included, nothing bolted on

Complete M1–M6 auth capabilities packaged into a single container.

Full capability list →

Sign-in, 2FA & Passkeys

Zero-JS UI

Email + password verification, one-use magic links, Google & GitHub OAuth, TOTP two-factor authentication with backup codes, and WebAuthn passkeys — all on server-rendered hosted pages.

Hosted pages →

One portable folder

SQLite, signing keys, local outbox, JSON logs, and online export/import backups all live in /data. Stop the container, copy the folder, done.

authwapi.dboutbox/backups/

OAuth 2.1 & Org SSO

Authorization code + PKCE, ID tokens, JWT access tokens, JWKS, refresh-token rotation, organizations with roles, and per-org OIDC & SAML 2.0 SSO.

OIDCSAML 2.0JWKS

Built for AI agents & MCP servers

/mcp + /llms.txt

Bootstrap the Admin MCP server with a one-time key, mint scoped revocable agent keys, manage users & orgs, read the audit log, and act as the OAuth authorization server for your own MCP servers via Client ID Metadata Documents.

mint_agent_keyresource link/llms.txt/openapi.json

Safe by default

127.0.0.1

Publishes on loopback only in every example, refuses unknown Host andOrigin headers, rate-limits auth endpoints, runs non-root on Docker & rootless Podman, and never logs tokens or verification links.

Tested end-to-end by agents

CI verified

Fresh AI agents start the container, bootstrap /mcp, create users, and wire up OAuth clients from these docs alone — both on host and container-to-container.

View agent test runs ↗

Two ways to get started

Built from the ground up for both developers and autonomous AI agents.

01 / START

Run one container

docker run -d --name authwapi \
  -p 127.0.0.1:4000:4000 \
  -v "$PWD/data:/data" authwapi
02 / VERIFY

Sign up & inspect outbox

open http://localhost:4000/sign-up
cat data/outbox/*.json
03 / CONNECT

Register an OAuth client

docker exec -u 1000 authwapi \
  node src/cli.ts clients create \
  --redirect http://localhost:3000/cb
No email server needed locally — verification & magic links write to outbox/.Read Quick start →

Architecture at a glance

One process, zero external databases, clean security boundaries.

Single container · SQLite WAL
Your Apps & MCP ServersOAuth 2.1 · OIDC · JWTAI AgentsAdmin /mcp · Scoped KeysAuthWAPI ContainerHono + Better AuthZero-JS UI · SAML/OIDC SSOPasskeys · 2FA · Rate Limits127.0.0.1:4000 · non-rootSingle /data Volumeauthwapi.db (SQLite)outbox/ · backups/instance.key · JSON logsexport / import safe live