BetterAuth Symfony - Documentation
Modern, secure authentication for Symfony 6.4 / 7.x / 8.0 applications.
Quick Links
Table of Contents
Getting Started
Authentication Modes
Features
Reference
Advanced
Customization
Feature Matrix
| Feature |
API Mode |
Session Mode |
Hybrid Mode |
| Stateless tokens |
✅ |
❌ |
✅ |
| Cookie sessions |
❌ |
✅ |
✅ |
| Refresh tokens |
✅ |
N/A |
✅ |
| CSRF protection |
N/A |
✅ |
✅ |
| OAuth providers |
✅ |
✅ |
✅ |
| 2FA (TOTP) |
✅ |
✅ |
✅ |
| Multi-tenant |
✅ |
✅ |
✅ |
| Session tracking |
✅ |
✅ |
✅ |
Console Commands
# Installation
php bin/console better-auth:install # Full installation wizard
# Features Setup (NEW!)
php bin/console better-auth:setup-features # Enable/disable features with auto entity generation
php bin/console better-auth:setup-features --enable=magic_link --with-controllers --migrate
# Configuration
php bin/console better-auth:configure # Interactive configuration wizard
php bin/console better-auth:switch-mode # Switch authentication mode
php bin/console better-auth:generate-config # Generate config with presets
php bin/console better-auth:cleanup:sessions # Remove expired sessions
php bin/console better-auth:cleanup:tokens # Remove expired refresh tokens
php bin/console better-auth:generate-secret # Generate BETTER_AUTH_SECRET
php bin/console better-auth:publish-templates # Publish email templates
php bin/console better-auth:user-fields # Add/remove optional User fields
# Setup
php bin/console better-auth:setup:dependencies # Install dependencies
php bin/console better-auth:setup:logging # Configure logging
php bin/console better-auth:config:update # Update configuration files
php bin/console better-auth:add-controller # Add individual controllers
Support
Made with ❤️ by the BackToTheFutur Team