Added
Session Management for FastAPI
about 1 month ago by Jim Verducci
📣 FastAPI Auth SDK 1.0.0 Release 🎉
Please refer to the GitHub README for updated documentation and details.
Version 1.0.0 - Major Release
New Features
- Built-in session management: Added
SessionMiddlewarewith encrypted cookie-based sessions - CSRF protection: Automatic token generation and validation via Synchronizer Token Pattern
- Route protection: New
create_session_auth_dependency()method for FastAPI dependency-based auth with automatic token refresh - Session/Token endpoints: Added
get_session_response()andget_token_response()helpers for Wristband frontend SDK integration, along withSessionResponseandTokenResponsePydantic models
Breaking Changes
If you're coming from a previous version of the FastAPI SDK, refer to the v1 Migration Guide to see how to upgrade.
- Renamed
default_tenant_domain_name→default_tenant_name(LoginConfig) - Renamed
tenant_domain_name→tenant_name(CallbackData, LogoutConfig) - Changed
UserInfofrom dict to typed Pydantic model with field name mappings (e.g.,sub→user_id) - Added
UserInfoRolemodel for typed role data - Renamed
reqparameter torequestforWristbandAuthmethods
FastAPI Demo App
- The FastAPI Demo App has been updated to use this SDK's session management features.