MCPcopy Index your code
hub / github.com/curveball/a12n-server

github.com/curveball/a12n-server @v0.31.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.31.7 ↗ · + Follow
784 symbols 1,665 edges 240 files 61 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

@curveball/a12n-server: A simple authentication server

Tests Docker build NPM build

a12n is short for "authentication".

a12n-server is a simple authentication server that implements the OAuth2 and OpenID Connect standards. It's goals is to create a fast, lightweight server that can be quickly deployed on both dev machines and in production.

a12n-server home screenshot

Requirements

  • Node.js > 18.x
  • MySQL, Postgres or Sqlite

Try it out!

Get a test server by running:

mkdir a12n-server && cd a12n-server
npx @curveball/a12n-server

This will automatically create a configuration file and sqlite database in the current directory.

Then, just open http://localhost:8531/ to create your admin account. See Getting started for more ways to run the server.

Contributing or just curious about the code?

Run from source or run the codebase with Docker

🍭 Features

This project has been used in production since 2018 and continues to be actively maintained.

Instead of rolling your own authentication system, you get A LOT of features for free 🪄:

Supported Features Details
User Management • Create, update, delete and list users with our User API

• Password reset/recovery flow | | Authentication Methods | • Username/password login

• Multi-factor authentication (MFA):

• TOTP (Time-based One-Time Passcodes with Google Authenticator)

• Email one-time codes

• WebAuthN hardware keys | | Authorization | • Role-based access control (RBAC)

• Groups and permissions management

• Fine-grained access policies | | OAuth2 Support | • Multiple grant types (Authorization code, client credentials, etc)

• Token introspection and revocation

• PKCE for enhanced security

• JWT access tokens (RFC 9068) | | OpenID Connect | • Standard OIDC configuration endpoints

• Discovery document

• JSON Web Key Sets (JWKS)

• Multiple response types | | Developer Experience | • Browser-based admin UI

• Browsable REST API with HTML and JSON responses

• Signup and login views included

The server supports OAuth2 and OpenID Connect, with support for the following features and standards:

📂 Documentation

Extension points exported contracts — how you extend this code

Tables (Interface)
(no doc)
src/db-types.ts
AppClientEditFormBody (Interface)
(no doc)
src/api-types.ts
Context (Interface)
(no doc)
src/middleware/login.ts
UserAuthFactor (Interface)
(no doc)
src/user-auth-factor/types.ts
AppClientNewFormBody (Interface)
(no doc)
src/api-types.ts
AppNewFormBody (Interface)
(no doc)
src/api-types.ts
App (Interface)
(no doc)
src/api-types.ts
AuthorizationChallengeRequest (Interface)
(no doc)
src/api-types.ts

Core symbols most depended-on inside this repo

set
called by 46
src/kv/redis-store.ts
findByExternalId
called by 45
src/principal/service.ts
has
called by 44
src/privilege/service.ts
getSetting
called by 36
src/server-settings.ts
require
called by 31
src/privilege/service.ts
equals
called by 20
src/middleware/login.ts
save
called by 16
src/principal/service.ts
delete
called by 15
src/kv/redis-store.ts

Shape

Function 381
Class 188
Method 184
Interface 31

Languages

TypeScript100%

Modules by API surface

src/api-types.ts28 symbols
src/oauth2/service.ts25 symbols
src/oauth2/errors.ts25 symbols
src/principal/service.ts24 symbols
src/privilege/service.ts20 symbols
assets/simplewebauthn-browser.min.js15 symbols
src/principal-identity/service.ts12 symbols
src/login/controller/login.ts10 symbols
src/user/service.ts9 symbols
src/oauth2/controller/token.ts9 symbols
src/login/service.ts9 symbols
src/kv/memory-store.ts9 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add a12n-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page