Aura Auth

Configuration

AuraAuthConfig fields passed through AuraAuth(database_url=..., secret=..., **kwargs).

AuraAuth(database_url=..., secret=..., **kwargs) merges supported keys onto AuraAuthConfig (aura_auth._core.config).

Routing

FieldDefaultPurpose
route_prefix"/auth"Prefix for routes returned by auth.router.
Use auth.raw_router to mount with your own prefix.

Sessions

FieldDefaultPurpose
session_lifetime_seconds604800 (7 days)Session row expiry; cookie max-age when using cookies.
verify_token_lifetime_seconds86400Verification rows (e.g. email verify).

Cookies

When cookie_transport is True, register/login call set_token on the response (HTTP-only cookie by default).

FieldDefaultPurpose
cookie_transportFalseUse cookie instead of Bearer for get_token / set_token.
cookie_name"aura_token"Cookie name.
cookie_secureTrueSecure flag. Use False for http:// local dev.
cookie_httponlyTrueHTTP-only.
cookie_samesite"lax"lax, strict, or none.

With cookie_transport=True, the client must send the cookie; the Authorization header is not read by the default transport.

Passwords

FieldDefault
password_min_length8

Models (SQLAlchemy)

Optional overrides passed to the backend:

  • user_model
  • account_model
  • session_model
  • verification_model

If omitted, the built-in Default* models from aura_auth.models.sqlalchemy are used.

Advanced

FieldPurpose
engineInject a pre-built async SQLAlchemy engine (common in tests).

The secret field is required on the public constructor today (reserved for signing and future JWT-oriented features).

On this page