Skip to content
Projects

About

A clean room recreation of Auth0 with 1:1 drop in replacement feature parity.

Other Projects

How these counts are measured

Measured star growth

in 24h
+7
in 7 days
+41
in 15 days
+85
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

zeroauthy

Listed on Remade OpenID Certified

An open-source, self-hostable identity server that speaks Auth0's Authentication and Management APIs. Point an existing Auth0 SDK or tool at a zeroauthy tenant and it works with no code changes.

  • Mostly at parity with Auth0. Hosted login, MFA, passkeys, passwordless, social and enterprise connections, Actions, organizations and the Management API all work. Check the compatibility page for what is different or missing before you rely on it, and migrating from Auth0 to move a tenant.
  • OpenID Certified for the Basic, Config and Form Post OP profiles (conformance).
  • A clean-room implementation built from public documentation and open standards, not affiliated with Auth0 or Okta (CLEAN_ROOM.md).
  • Also a test stand-in: one container with known tenants, apps and users lets your test suite run real Auth0 logins locally and in CI (testing guide).

The zeroauthy admin console: a tenant's applications

Set up

This gets zeroauthy running on your machine with Podman, signs you in to the admin console and creates a first tenant. It takes about five minutes. Every podman command works the same with docker.

What you need

  • Podman (or Docker)
  • openssl, to make a master key
  • A browser. Browsers send *.localhost to your own machine, and the console lives at system.localhost.

zeroauthy only speaks HTTPS, even locally: tokens name an https:// issuer and Auth0 SDKs require it. Below, zeroauthy makes its own local certificate; for a real server see TLS.

1. Make a master key

openssl rand -base64 32 > master.key
chmod 0600 master.key

The master key encrypts signing keys and secrets in the database. Keep it safe: the data is unreadable without it, and it cannot be changed later.

2. Start zeroauthy

podman run -d --name zeroauthy -p 8443:8443 \
  -v zeroauthy-data:/data \
  -e ZEROAUTHY_SERVER__LISTEN=:8443 \
  -e ZEROAUTHY_SERVER__SYSTEM_HOST=system.localhost:8443 \
  -e ZEROAUTHY_SERVER__TLS_SELF_SIGNED=true \
  -e ZEROAUTHY_SERVER__TLS_SELF_SIGNED_CA_FILE=/data/ca.pem \
  -e ZEROAUTHY_SECURITY__MASTER_KEY="$(cat master.key)" \
  ghcr.io/occupysaas/zeroauthy:1.0.0-rc.2
  • Use the newest tag from the releases page.
  • The image stores SQLite in the zeroauthy-data volume and updates its schema when it starts. It includes Node.js for Actions.
  • Emails (verification, password reset) are written to the log until you set up an email provider: podman logs zeroauthy.

Check that it answers:

podman cp zeroauthy:/data/ca.pem zeroauthy-ca.pem
curl --cacert zeroauthy-ca.pem https://localhost:8443/healthz
# {"status":"ok"}

3. Trust the local certificate

zeroauthy signed its certificate with a local CA, now in zeroauthy-ca.pem. Either accept the browser warning for https://localhost:8443 and https://system.localhost:8443, or import zeroauthy-ca.pem into your browser's or system's trusted authorities. The CA is new on every start, so copy it again after a restart. Node apps trust it with NODE_EXTRA_CA_CERTS=zeroauthy-ca.pem.

4. Create the first operator

Operators are the admin console's users.

podman exec zeroauthy zeroauthy admin create --email [email protected]

It prints a one-time link, valid for an hour. Open it, choose a password of at least 12 characters, and sign in at https://system.localhost:8443/admin/.

5. Create a tenant, an application and a user

In the console:

  1. Open the tenant switcher in the header, choose Create tenant, name it acme and give it the domain localhost:8443. The new tenant already has the database connection Username-Password-Authentication.
  2. In acme, open Applications → Create, pick an application type and set its callback and logout URLs. On its Connections tab, switch on Username-Password-Authentication.
  3. Open Users → Create user.

Your app now uses localhost:8443 as its Auth0 domain, with the client ID (and secret) from the application's Settings tab. Its Quick start tab has SDK snippets. First login from an app walks through a complete Node.js example and the Management API.

Keep it running

With Podman, a Quadlet file runs zeroauthy as a systemd service that starts at boot. Store the master key as a Podman secret:

podman secret create zeroauthy-master-key master.key

Save this as ~/.config/containers/systemd/zeroauthy.container (or under /etc/containers/systemd/ for a root service):

[Unit]
Description=zeroauthy

[Container]
Image=ghcr.io/occupysaas/zeroauthy:1.0.0-rc.2
ContainerName=zeroauthy
PublishPort=8443:8443
Volume=zeroauthy-data:/data
Environment=ZEROAUTHY_SERVER__LISTEN=:8443
Environment=ZEROAUTHY_SERVER__SYSTEM_HOST=system.localhost:8443
Environment=ZEROAUTHY_SERVER__TLS_SELF_SIGNED=true
Environment=ZEROAUTHY_SERVER__TLS_SELF_SIGNED_CA_FILE=/data/ca.pem
Secret=zeroauthy-master-key,type=env,target=ZEROAUTHY_SECURITY__MASTER_KEY

[Service]
Restart=always

[Install]
WantedBy=default.target

Then replace the container from step 2 with the service:

podman rm -f zeroauthy
systemctl --user daemon-reload
systemctl --user start zeroauthy
loginctl enable-linger "$USER"   # keep a rootless service running after you log out

With Docker, add --restart unless-stopped to the docker run in step 2.

Upgrade

Back up the zeroauthy-data volume and your master key, then run the new image with the same options: podman pull the new tag and recreate the container, or change Image= in the Quadlet file and run systemctl --user daemon-reload && systemctl --user restart zeroauthy. See upgrading for rolling upgrades and rollbacks.

Without a container

Release binaries for linux/amd64, linux/arm64 and darwin/arm64 are on the releases page; check them against SHA256SUMS. The binary is static. Node.js 22.13 or later is needed only for Actions and custom database scripts.

tar xzf zeroauthy_*_linux_amd64.tar.gz && cd zeroauthy_*_linux_amd64
ZEROAUTHY_SERVER__LISTEN=:8443 \
ZEROAUTHY_SERVER__SYSTEM_HOST=system.localhost:8443 \
ZEROAUTHY_SERVER__TLS_SELF_SIGNED=true \
ZEROAUTHY_SERVER__TLS_SELF_SIGNED_CA_FILE=zeroauthy-ca.pem \
ZEROAUTHY_SECURITY__MASTER_KEY="$(cat ../master.key)" \
ZEROAUTHY_STORAGE__DSN=sqlite://zeroauthy.db \
ZEROAUTHY_STORAGE__AUTO_MIGRATE=true \
  ./zeroauthy serve

In a second terminal, run ./zeroauthy admin create --email [email protected] with the same ZEROAUTHY_* variables, then continue at step 4.

Remove it

podman rm -f zeroauthy
podman volume rm zeroauthy-data

Going to production

Start from examples/zeroauthy.yaml and the deployment guide, which covers each of these:

  1. DNS and hosts: a base domain with a wildcard, so tenant acme is served at acme.auth.example.com.
  2. TLS: your own certificate, automatic ACME certificates, or a reverse proxy.
  3. A database: SQLite for one server, PostgreSQL or MySQL for several.
  4. The master key, stored outside the database and backed up separately.
  5. An email provider.
  6. Backups of the database and the master key, and a restore you have tried.

Configuration

Settings come from a YAML file (--config) and ZEROAUTHY_* environment variables, where __ separates levels: ZEROAUTHY_STORAGE__DSN sets storage.dsn. Unknown keys stop the server at startup. The configuration reference lists every setting with its variable and default. Tenants, applications, APIs and users can also come from a seed file.

Documentation

The full list is in docs/. Changes are in the changelog; report vulnerabilities as described in SECURITY.md.

Contributing

See CONTRIBUTING.md for building from source, running the tests and how work is planned. Releases are described in RELEASING.md.

License

Apache-2.0. See LICENSE and NOTICE.

Explore related projects

Loading…