offline-agency / filament-spid
SPID authentication plugin for Filament based on italia/spid-laravel
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/offline-agency/filament-spid
Requires
- php: ^8.2
- filament/filament: ^3.0|^4.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- italia/spid-laravel: ^2.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^7.10|^8.0
- nunomaduro/larastan: ^2.9
- orchestra/testbench: ^8.0|^9.0
- pestphp/pest: ^2.36
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.4
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
This package is auto-updated.
Last update: 2025-10-09 22:37:14 UTC
README
SPID (Sistema Pubblico di Identità Digitale) authentication plugin for Filament based on italia/spid-laravel.
This package allows you to integrate SPID authentication into your Filament admin panels, enabling Italian public administration identity management.
Features
- 🇮🇹 Full SPID integration for Filament
- 🔐 Secure SAML2 authentication
- 🎨 Customizable login view
- 🔧 Compatible with Filament 3 & 4
- 📦 Support for Laravel 10, 11, 12
- ⚡ PHP 8.2+ ready
- 🧪 Fully tested
Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x
- Filament 3.x or 4.x
- italia/spid-laravel package
Installation
You can install the package via composer:
composer require offline-agency/filament-spid
Publish the configuration file:
php artisan vendor:publish --tag="filament-spid-config"
Publish and run the migrations:
php artisan vendor:publish --tag="filament-spid-migrations"
php artisan migrate
Optionally, you can publish the views:
php artisan vendor:publish --tag="filament-spid-views"
SPID Configuration
First, configure the base SPID Laravel package. Follow the italia/spid-laravel documentation to:
- Generate SPID certificates
- Configure your Service Provider metadata
- Set up SPID Identity Providers
Add the following fields to your users table migration (if not already published):
$table->string('fiscal_code')->unique()->nullable(); $table->json('spid_data')->nullable();
Usage
Register the plugin in your Filament Panel Provider:
use OfflineAgency\FilamentSpid\SpidPlugin; public function panel(Panel $panel): Panel { return $panel ->default() ->id('admin') ->path('admin') ->plugin( SpidPlugin::make() ->spidButtonLabel('Entra con SPID') ->providers([ 'arubaid', 'infocertid', 'lepidaid', 'namirialid', 'posteid', 'sielteid', 'spiditalia', 'timid', 'teamsystemid' ]) ); }
Customization
Custom Login View
SpidPlugin::make() ->loginView('your-custom-view')
Custom Routes
SpidPlugin::make() ->loginRoute('custom.spid.login') ->logoutRoute('custom.spid.logout') ->acsRoute('custom.spid.acs') ->metadataRoute('custom.spid.metadata')
Hide SPID Button
SpidPlugin::make() ->showSpidButton(false)
Custom Button Label and Icon
SpidPlugin::make() ->spidButtonLabel('Login con SPID') ->spidButtonIcon('heroicon-o-shield-check')
Select Specific Providers
SpidPlugin::make() ->providers(['posteid', 'arubaid', 'infocertid'])
Configuration
The config/filament-spid.php
configuration file allows you to customize:
return [ 'user_model' => \App\Models\User::class, 'redirect_after_login' => '/admin', 'spid_level' => 'https://www.spid.gov.it/SpidL2', ];
User Model
Your User model should have these fields:
protected $fillable = [ 'name', 'email', 'fiscal_code', 'spid_data', // ... other fields ]; protected $casts = [ 'spid_data' => 'array', ];
SPID Levels
SPID supports three security levels:
SpidL1
- Level 1 (Username and password)SpidL2
- Level 2 (Username, password, and OTP) - DefaultSpidL3
- Level 3 (Smart card or hardware token)
Configure the level in your config file or when calling the login:
route('spid.login', ['provider' => 'posteid', 'level' => 'SpidL2'])
Testing
composer test
Run tests with coverage:
composer test-coverage
Code Style
composer format
Static Analysis
composer analyse
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Support
For support and questions:
- Email: support@offlineagency.it
- GitHub Issues: Create an issue
License
The MIT License (MIT). Please see License File for more information.
About Offline Agency
Offline Agency is a web development agency based in Italy, specializing in Laravel and Filament applications.
- Website: https://offlineagency.it
- GitHub: @offline-agency
- Email: support@offlineagency.it