Recipes
Summary: one short page for each task, with code that compiles. Find your task here.
Key terms: recipe, feature, start, route, device, tenant, recovery, client, e2ee.
Related: Interfaces · Concepts · skill for agents
Each recipe shows how to add one capability to an application, with code that compiles. Find the task in the table,
copy the code, and adapt the names. The table lists the auth-chad crate feature that each recipe needs.
The recipes
| You need | Recipe | Feature |
|---|---|---|
| Passkey accounts in a new application | start | axum, sqlite or postgres |
| A handler that needs a user | protect-a-route | axum |
| The passkey again before a risky action | sensitive-action | axum |
| Invite only, admins | invites | axum |
| Your own tables in the same transaction | own-tables | sqlite, postgres |
| A CLI, device or machine | devices | axum |
| Other apps as clients (OAuth, MCP) | connected-apps | axum |
| An API key for a program that can only send a header (not recommended) | api-keys | axum |
| A way back into an account | recovery | axum |
| “Sign in with…”, company login | external-login | axum |
| Organizations with members (tenants) | tenants | axum |
| Data of each tenant or user in its own database | directory | axum, postgres |
| Many processes, a load balancer, the worker | load-balancer | axum |
| A CLI or a Rust/wasm web app as a client | client | client |
| End-to-end encryption | e2ee | e2ee |
| Support staff who see the application as a user | view-as | axum |
| Tests | testing | dev-dependency auth-chad-testing |
| A Loco or SeaORM application | loco | auth-chad-loco, or sea-orm |
How recipes stay correct
- The Rust code on the recipe pages and on the wiki pages compiles:
rust/recipesincludes each page as a documentation test. A new page goes intorust/recipes/src/lib.rs. - A recipe shows one task. The wiki pages explain the reasons, and the spec has the exact rules.