Skip to main content

FastAPI

A FastAPI service with sign-in routes and one protected route.

StarterDraftView source
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.
Packages
lumoauth
Works with
PythonFastAPI

What you get​

  • lumo_auth_router() with login, callback and logout routes.
  • A route with the dependency get_current_user.
  • A .env file 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​

VariableValue
LUMOAUTH_URLhttps://app.lumoauth.dev, or https://eu.app.lumoauth.dev for the EU region.
LUMOAUTH_ORG_IDYour organization, for example acme-corp.
LUMOAUTH_CLIENT_IDThe client ID of a confidential application.
LUMOAUTH_CLIENT_SECRETIts secret.

Next steps​

Where the code is today​

lumo init --framework fastapi writes this project.