Litestar Security#

Authentication and authorization for Litestar applications.

Litestar Security connects local accounts, external identity providers, API keys, and workload tokens to Litestar’s middleware, dependency injection, guards, OpenAPI schema, and WebSocket lifecycle.

Get started

Install the plugin and choose an authentication method.

Getting started
Choose a provider

Use local accounts, OAuth, OIDC, IAP, API keys, or workload JWTs.

Authentication providers
Protect routes

Declare public routes and enforce scopes, roles, teams, and tenants.

Authentication and authorization
Run an example

Try each supported authentication method with local dependencies.

Runnable examples
API reference

Browse the public packages and types.

API reference