Batteries Included
AuthTuna comes with a comprehensive set of features out of the box, allowing you to focus on building your application rather than reinventing authentication.
Core Authentication
- User Registration & Login: Secure endpoints for user signup, login, and logout with password hashing and JWT tokens.
- Password Reset: Built-in password reset flow with email verification.
- Email Verification: Automatic email verification for new users.
- Session Management: Automatic session handling with secure cookies and token refresh.
API Endpoints:
POST
/auth/signup - User registrationPOST
/auth/login - User loginPOST/GET
/auth/logout - User logoutPOST
/auth/forgot-password - Password reset requestPOST
/auth/reset-password - Password resetPOST
/auth/change-password - Change passwordGET/POST
/auth/user-info - Get user informationGET
/auth/verify - Email verificationUI Pages:
GET
/auth/signup - Registration pageGET
/auth/login - Login pageGET
/auth/forgot-password - Forgot password pageGET
/auth/reset-password - Reset password pageMulti-Factor Authentication (MFA)
- TOTP (Time-based One-Time Password): Support for authenticator apps like Google Authenticator.
- Backup Codes: One-time use codes for account recovery.
- MFA Enforcement: Configurable MFA requirements for users.
API Endpoints:
POST
/mfa/setup - Setup MFA for userPOST
/mfa/verify - Verify MFA codeGET
/mfa/qr-code - Get QR code for TOTP setupPOST
/mfa/validate-login - Validate MFA during loginPOST
/mfa/disable - Disable MFAGET
/mfa/challenge - Get MFA challengeUI Pages:
GET
/mfa/setup - MFA setup pageSocial Authentication
- OAuth Providers: Integration with popular providers like Google, GitHub, Facebook, etc.
- Custom Providers: Easy to add support for additional OAuth providers.
- Social Account Linking: Link multiple social accounts to a single user.
API Endpoints:
GET
/social/{provider_name}/login - Initiate OAuth loginGET
/social/{provider_name}/callback - OAuth callback handlerPasskey Authentication
- WebAuthn Support: Passwordless authentication using biometrics or hardware keys.
- Cross-Platform Compatibility: Works on desktop and mobile devices.
- Secure & User-Friendly: Eliminates password-related vulnerabilities.
API Endpoints:
POST
/passkey/register-options - Generate registration optionsPOST
/passkey/register - Register new passkeyPOST
/passkey/login-options - Generate login optionsPOST
/passkey/login - Passwordless loginGET
/passkey/ - List user passkeysDELETE
/passkey/{credential_id_b64} - Delete passkeyPOST
/passkey/mfa-login - Passkey as MFAUser Management & Admin
- Admin Dashboard: Web-based admin interface for managing users and permissions.
- Role-Based Access Control (RBAC): Flexible permission system with roles and permissions.
- User Profiles: Built-in user profile management.
- Organization Support: Multi-tenant organization management.
API Endpoints:
GET
/admin/users/search - Search and filter usersGET
/admin/users/{user_id}/details-data - Get user detailsGET
/admin/users/{user_id}/audit-log - Get user audit logPOST
/admin/users/{user_id}/suspend - Suspend userPOST
/admin/users/{user_id}/unsuspend - Unsuspend userGET
/admin/roles - List all rolesPOST
/admin/roles - Create roleDELETE
/admin/roles/{role_name} - Delete rolePOST
/admin/roles/{role_name}/permissions - Add permission to rolePOST
/admin/users/roles/assign - Assign role to userPOST
/admin/users/roles/revoke - Revoke role from userPOST
/admin/permissions - Create permissionGET
/admin/roles/{role_name}/details-data - Get role detailsGET
/admin/assignable-roles - Get assignable rolesGET
/admin/users/{user_id}/assignable-roles - Get assignable roles for userUI Pages:
GET
/admin/dashboard - Admin dashboardGET
/admin/users/{user_id} - User detail pageGET
/admin/roles/{role_name} - Role detail pageAPI & Integrations
- FastAPI Integration: Seamless integration with FastAPI applications.
- RESTful API: Complete REST API for all authentication operations.
- Middleware: Authentication middleware for protecting routes.
- Dependency Injection: FastAPI dependencies for user authentication in endpoints.
Security & Monitoring
- Rate Limiting: Built-in rate limiting for login attempts and API calls.
- Audit Logging: Comprehensive logging of authentication events.
- Encryption: Secure encryption for sensitive data.
- Brute Force Protection: Automatic protection against brute force attacks.
UI & Templates
- Responsive UI: Modern, responsive user interface components.
- Email Templates: Customizable HTML email templates.
- Theming: Easy theming and customization options.
- Dashboard: User dashboard for account management.
UI Pages:
GET
/ui/dashboard - User dashboardGET
/ui/profile - User profile page