litestar-authentication
Installation
SKILL.md
Authentication
Execution Workflow
- Choose the identity mechanism first: session, JWT header, JWT cookie, OAuth2 password bearer, or custom middleware based on client and trust boundaries.
- Attach authentication once at app scope with
on_app_initor middleware. - Configure exclusion rules explicitly for login, schema, health, and other public routes.
- Use
request.userandrequest.authonly after authentication has been established. - Apply guards separately for authorization checks.
- Keep missing or invalid credential behavior consistent with the exception-handling strategy.