In the previous article, we implemented SAML authentication inside Laravel Filament using Socialite and the SAML2 provider.
Authentication is only the first step.
In real enterprise environments, applications also need:
- centralized authorization
- Active Directory group synchronization
- role-based access control
- automatic provisioning
- panel access restrictions
In this article, we’ll build a production-ready authorization layer using:
- Active Directory groups
- SAML claims
- Spatie Permission
The objective is simple: when a user authenticates through SSO:
- Retrieve AD groups
- Map them to application roles
- Synchronize permissions automatically
- Restrict access to Filament panels
We use Spatie Permission to handle role synchronization in this setup. The implementation details are not covered in this article. This article focuses specifically on SAML authentication and the SSO flow.