Skip to content
Write to me

Built on my own

Central Auth

Central Auth is the one sign-in server every one of my apps uses, built on authentik, an open-source identity server. My part is everything around it. One file configures it, my own pages replace the stock ones, and every deploy has to prove the security still holds.

  • authentik
  • PostgreSQL
  • React
  • TypeScript
  • Vite
  • Playwright
  • Python
  • Docker Compose

Use ← → to move through the scenes.

01 of 03SecurityFilm 0:59

One sign-in for all my apps, re-proved on every deploy.

promises checked on every deploy
37
lines in the one configuration file
1,505
lines in the API mock
851

Every one of my apps signs in through one door that wears its colours. A human check, a password and always a second step guard it, and every deploy re-proves 37 security promises.

How I did itHide how I did it

Each app sends you to the same sign-in, dressed in that app's colours and name. My own pages talk to the server one step at a time, so the server still makes every decision, and anything they do not recognise hands over to the built-in pages. The human check comes on its own page, then the password, and there is always a second step.

Nothing is set up by hand. One 1,505-line file configures the whole server. After every deploy, a check inside the server tests 37 promises against the live database. On a test server, I added one stray flow. The check named it and the deploy failed.

Transcript

Every app I build needs a sign-in. Each one is a door someone can try. So they all use one sign-in server. It runs on authentik. I built the pages, the rules and the checks. It looks like the app you're signing in to. My pages just show what the server decides. Unknown steps fall back to the built-in pages. The human check gets its own page. Real and made-up names get the same check. So no step shows which accounts exist. After the password, there's always a second step. It's a passkey or a code. One file sets up all of it. Every deploy has to pass 37 security checks. They run inside the server, against the live database. I tried adding a flow that shouldn't exist. The check names it. And the deploy stops. It's one door, and every deploy checks it.

02 of 03Account privacy

Why the robot check has its own page.

The real human check page, twice, once after a real username and once after a made-up one. The two pages are the same.

The human check has a page of its own, after the username. A real name and a made-up one meet the same check, so no step tells anyone which accounts exist.

How I did itHide how I did it

If the human check sat on the username page, the server would skip it for names that do not exist. That tells anyone which usernames are real.

So the check is its own step. Real and made-up names meet the same check and get the same response, and no step reveals whether an account exists. It uses a real check, never test keys that let everyone through. The picture uses a test stand-in for the check. Every sign-in also ends in a second factor, with passkeys first.

03 of 03Sign-in pages

Signing in looks like where you're going.

The real sign-in page at phone size, four times, each dressed in a different invented app's colours, icon and name.

I replaced the stock sign-in pages with my own. Each one wears the colours, icon and name of the app you're signing in to, and the server still makes every decision.

How I did itHide how I did it

I replaced the stock sign-in pages with my own. They talk to the server one step at a time, so the server still makes every decision. Each page takes on the colours, icon and name of the app you're signing in to.

If my pages ever meet a step they do not recognise, they hand over to the built-in pages, which always stay reachable. A bug in my pages cannot lock anyone out.

Also in Central Auth

  • The pages are tested without the real server. Unit tests replay challenges recorded from it, and browser tests run against an 851-line mock of its API, so CI needs no Docker and no network.
  • Machines get short-lived tokens too. The one machine client can use only that grant, has no return address, and is limited to a single service account.

That is the last project.

Every project is on the work page.