Download the PHP package kristiansnts/filament-api-login without Composer
On this page you can find all versions of the php package kristiansnts/filament-api-login. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kristiansnts/filament-api-login
More information about kristiansnts/filament-api-login
Files in kristiansnts/filament-api-login
Package filament-api-login
Short Description Token-based authentication for FilamentPHP that authenticates against external APIs without requiring local database users
License MIT
Informations about the package filament-api-login
Filament API Login
Token-based authentication for FilamentPHP that authenticates against external APIs without requiring local database users.
Features
- 🔐 External API Authentication - Authenticate users against your existing API
- 🚫 No Local Users - No need for local database user records
- 🎫 Token-Based - Secure session management with API tokens
- 🔧 Easy Setup - Simple configuration and installation
- 📝 Fully Customizable - Customize API requests, user mapping, and access control
Installation
You can install the package via Composer:
Publish the configuration file:
Configuration
1. Environment Variables
Add these variables to your .env file:
2. Authentication Guard
Add the external guard to your config/auth.php:
3. Filament Panel Configuration
Update your Filament Panel Provider to use the external authentication:
Usage
Basic Authentication Flow
- User enters credentials on the Filament login page
- Package sends credentials to your external API
- API validates and returns token + user data
- Package stores token and user data in session
- User is authenticated and can access Filament
API Response Format
Your external API should return a response in this format:
Customizing API Requests
You can customize the API request by extending the ExternalAuthService:
Then bind your custom service in a service provider:
Customizing User Access Control
Override the canAccessPanel method in your panel configuration:
Configuration Options
The package configuration file includes these options:
api_url- Your external authentication API endpoint (env:FILAMENT_API_LOGIN_URL)timeout- API request timeout in seconds (env:FILAMENT_API_LOGIN_TIMEOUT)log_failures- Enable/disable logging of authentication failures (env:FILAMENT_API_LOGIN_LOG_FAILURES)
Security Considerations
- ✅ API URL stored securely in environment variables
- ✅ No passwords stored locally
- ✅ Secure session management with Laravel's built-in security
- ✅ Token-based authentication
- ✅ Session regeneration on successful login
- ✅ Configurable request timeouts
- ✅ Failed attempt logging for monitoring
Troubleshooting
Common Issues
- API Connection Issues: Check your
FILAMENT_API_LOGIN_URLand network connectivity - Authentication Failures: Verify your API response format matches the expected structure
- Session Issues: Ensure your session driver is properly configured
Debug Logging
Enable logging in the configuration to debug authentication issues:
Or via environment variable:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-api-login with dependencies
laravel/framework Version ^10.0|^11.0|^12.0
filament/filament Version ^3.0|^4.0