denniseilander/laravel-passport-scopes-restriction
Restrict which OAuth scopes users can request with Laravel Passport. Assign allowed scopes per user or model and enforce them during token issuance, so clients can't obtain permissions they shouldn't have—keeping API access tightly scoped with minimal setup.
laravel-passport-scopes-restriction lets a Laravel app constrain which OAuth scopes a client or user may actually be granted, closing a common gap where any registered client can request any defined scope. That makes it directly relevant to decisions about tightening third-party and partner API access without rebuilding the authorization layer.Consider adoption when:
Look elsewhere when:
To executives: Our API can currently grant any defined scope to any registered client. This package adds a restriction layer so clients and users can only receive the scopes they're entitled to — a direct least-privilege control and a checkable item in security reviews. The latest release (3.0.1) adds Laravel 12 support, so it also clears a dependency from our framework upgrade path. Cost is low: one dependency and configuration, no rework of the auth system.
To engineering: Small, focused package that hooks into Passport's scope granting to enforce per-client/per-user allowlists. v3.0.1 is largely maintenance (Dependabot bumps) plus the material change: Laravel 12 compatibility — no breaking changes signaled from 3.0.0. Recommended next step is a short spike: confirm our grant types and personal access token flows are covered, pin the version, and add tests asserting that disallowed scopes are rejected at token issuance and refresh. If our model diverges from the package's assumptions, the fallback is a thin custom policy layer of comparable scope.
How can I help you explore Laravel packages today?