FastAPI
A FastAPI service with sign-in routes and one protected route.
This page is a draft. The code exists, and not all of it has been run for this page yet. The page says what was checked.
What you get
lumo_auth_router()with login, callback and logout routes.- A route with the dependency
get_current_user. - A
.envfile with your organization and client.
Create it
Install the lumo CLI, then run:
lumo init --framework fastapi
The command asks for your organization and the client ID, and writes the project and its .env file.
Settings
| Variable | Value |
|---|---|
LUMOAUTH_URL | https://app.lumoauth.dev, or https://eu.app.lumoauth.dev for the EU region. |
LUMOAUTH_ORG_ID | Your organization, for example acme-corp. |
LUMOAUTH_CLIENT_ID | The client ID of a confidential application. |
LUMOAUTH_CLIENT_SECRET | Its secret. |
Next steps
- Protect your API: Protect routes in each framework.
Where the code is today
lumo init --framework fastapi writes this project.