Recipes
One feature in a few files, in each SDK that supports it. Copy a recipe into an app that you already have.
A recipe answers one question, for example "how does an agent ask a person for approval?". It lists what to set up in LumoAuth, shows the code in each language, and says how to check the result.
Each language of a recipe says how far it was checked: run against a LumoAuth organization, compiled only, or not run.
A person allows an agent to act for them. The agent then holds a token that names both: the person as subject, the agent as actor.
An agent that lacks a permission asks for it with a reason. A person approves, and the agent gets a token for that task only.
Before each action, the agent asks LumoAuth whether it may do it, and receives the answer with the reason.
Ask LumoAuth whether a person may do something, from each server SDK and from plain HTTP.
Point a coding agent at your protected MCP server. It finds LumoAuth, signs the person in, and calls the tools.
Install LumoAuth Guard in OpenClaw. Each tool call is checked against what you allowed, and risky ones ask you first.
A LangGraph agent whose tools ask LumoAuth before they run, and a payment that waits in an interrupt until a person approves it.
Give each business customer its own members, roles and invitations inside your product.
Handle events from LumoAuth in your backend: verify the signature, answer fast, and survive a repeat.
Give an agent its own identity in the registry, choose how it proves that identity, and say what it may do.
Tell LumoAuth about your MCP server: its address, its scopes and who may connect. Then read what a client reads.
Give a backend service its own identity, get a token with the scopes of one job, and call another service.
Send the browser to your organization's sign-in page and come back with tokens. The app never sees a password.
End the session at LumoAuth, and tell the other applications of that session to sign the person out.
An agent gets a token for one MCP server and calls a tool. The token works at that server only.
Start an agent with a client ID and secret, get a token with its capabilities, and read its own identity.
Let a rule approve the requests that are always fine, so that people see only the ones that need a decision.
Decide inside the agent, from the list of its capabilities, with the same matching rules as the server.
A crew in which each member is its own registered agent with its own capabilities, and a refund that waits for a person.
Install LumoAuth Guard in Hermes, with the same presets and the same checks as for OpenClaw.
An agent passes part of a task to another agent, with fewer scopes, and the token records the whole chain.
Give the administrators of a customer a portal in which they invite people and assign roles, with no work for your team.
Show the active sessions of a person, and end one of them or all of them.
Add LumoAuth to a FastMCP server in three lines: discovery, the 401 challenge and token checks.
Refuse a request before the handler runs, with the idiom of each framework: middleware, a dependency, an attribute or an annotation.
Find who did what, and export a period as CSV or JSON for a review.
Send an email and a password that your own form collected to LumoAuth. This is the legacy option, for apps that are not a browser page.
Check a token inside your service with the published keys: signature, issuer, audience, expiry and scopes.
Give an agent a private key in place of a secret. Nothing that can be copied out of a log is sent.
Before a risky action, the agent sends an approval request to the phone of the person it acts for, and waits for the answer.
Run a recipe
Every recipe is a folder in recipes/ of the examples repository. You run each one from that folder.
git clone https://github.com/LumoAuth/examples
cd examples/recipes
1. Set the three values
Every recipe reads the address of LumoAuth, your organization and a credential from the environment. The SDKs read the same names, so the code needs no settings of its own.
export LUMOAUTH_URL="https://app.lumoauth.dev" # or https://eu.app.lumoauth.dev
export LUMOAUTH_ORG_ID="acme-corp" # your organization
export LUMOAUTH_API_KEY="lmk_..." # an API key: portal, Applications & developer tools, API keys
A recipe that needs more values lists them under "Before you start". Most recipes have a setup script that creates what the recipe needs and prints those values.
2. Set the folder up once for your language
- Node.js
- Python
- Go
- PHP
- Java
- C#
- curl
- lumo CLI
Node.js 20 or later.
npm install
Python 3.10 or later.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Go 1.22 or later. There is nothing to install: go run fetches the SDK.
PHP 8.1 or later, and Composer.
composer install
Java 17 or later, and Maven. Each recipe is one source file that java runs directly.
mvn -f java/pom.xml dependency:copy-dependencies -DoutputDirectory=lib
The .NET 10 SDK. Each recipe is one file that dotnet run builds and runs. The first line of the file names the package.
curl, and a shell.
The lumo CLI. It reads LUMO_API_KEY, LUMO_ORG and LUMO_BASE_URL:
export LUMO_API_KEY="$LUMOAUTH_API_KEY" LUMO_ORG="$LUMOAUTH_ORG_ID" LUMO_BASE_URL="$LUMOAUTH_URL"
3. Run it
Each recipe shows its command. For example:
node authorization/check-a-permission/setup.mjs
node authorization/check-a-permission/js/check.mjs