Skip to content

Authentication, start to finish

The AuthHero Book ​

Most documentation answers the question how do I configure this? This book answers the one that comes before it: what is this, and why does it work that way?

It starts with what a login actually is and ends with running AuthHero in production. On the way it covers tokens, sessions, single sign-on, multi-factor authentication, permissions, organizations, extensibility and multi-tenancy. Each chapter explains the idea first, in plain terms, and then shows how AuthHero handles it.

Start with chapter 1Download PDFDownload EPUB

Who it is for ​

  • Developers adding login to a product who want to understand what the libraries are doing on their behalf.
  • Teams evaluating AuthHero who want the whole picture before reading reference pages.
  • Anyone who has nodded along when someone said "the access token's audience is wrong" and would like to nod sincerely next time.

You need to know roughly what an HTTP request and a cookie are. Nothing else is assumed.

How to read it ​

Front to back. The chapters are short, about five minutes each, and each one builds on the ones before. A small fictional company called Larder, which makes kitchen software for restaurants, appears throughout and grows a new requirement in most chapters.

Every chapter ends with links to the reference pages for the features it covered. Read the book for the shape of things, then use the reference when you sit down to build.

Contents ​

The basics

  1. 1Who goes there?What authentication is, why login turns into a product of its own, and where AuthHero fits.
  2. 2The moving partsTenants, applications, connections, users and APIs, and the three surfaces AuthHero exposes.
  3. 3The login danceThe authorization code flow with PKCE, one redirect at a time.
  4. 4TokensID tokens, access tokens and refresh tokens: what is inside, how to verify them, how long they live.
  5. 5Sessions, single sign-on and logging outHow one login serves many applications, and what logging out really ends.

Signing in

  1. 6Ways to sign inPasswords, codes, magic links, social and company logins, passkeys, and one account across all of them.
  2. 7A second lockMulti-factor authentication: the factors, when to ask, and how to roll it out.
  3. 8The login pageUniversal Login: branding, languages, forms, emails and the self-service account page.

Who may do what

  1. 9Who may do whatAPIs, scopes, roles and permissions, machine-to-machine access and consent.
  2. 10Teams and companiesOrganizations, invitations, company single sign-on, SCIM provisioning and SAML.

Making it yours

  1. 11Your own rulesActions, hooks, webhooks and flows, and a pipeline that keeps your code from breaking logins.
  2. 12Beyond the browser tabSingle-page and mobile apps, devices, machines, outside developers and AI agents.

Running it

  1. 13Many tenantsWhat a tenant isolates, three strengths of isolation, and custom domains.
  2. 14Where it runsA library with pluggable databases, on Docker, Cloudflare or AWS, and the tools to manage it.
  3. 15Keeping watchLogs, audit events, attack protection, encryption, signing keys and conformance.
  4. 16Moving inMigrating from Auth0 or your own login, what will differ, and where to go next.

Dual-licensed: AGPL-3.0-only or commercial license.