spomky-labs/oauth2-server-scope-manager-bundle
A Symfony bundle that integrates scope management with the spomky-labs OAuth2 server, helping define, organize, and validate OAuth2 scopes for access control. It simplifies scope configuration and handling in PHP applications.
This bundle is a companion to Spomky-Labs/OAuth2ServerBundle — it does nothing on its own. It provides a configurable scope manager service that the main OAuth2 server bundle consumes to validate and assign scopes on token/authorize requests. If you don't already have the main OAuth2 server bundle installed and working, install that first; this bundle is only useful as the scope layer on top of it.
Minimal steps:
composer require spomky-labs/oauth2-server-scope-manager-bundleAppKernel.php after the main OAuth2 server bundle so its service definitions/compiler pass win.config.yml (fixed list + a policy such as default/error/none).bin/console debug:container / debug:container --show-private).Where to look first:
DependencyInjection/Configuration.php — the authoritative list of config keys; the bundle README is often stale.Resources/config/*.yml — the service IDs it registers and, crucially, which service it decorates or aliases as the server's scope manager.First real use case: a small app with a fixed scope set (read, write, admin), where a token request's scope parameter must be validated against that list and, if omitted, filled from a default set. That is exactly the shape this bundle is built for.
ScopeManagerInterface implementation. Only override the service alias if you have another bundle also claiming that role.ScopeManagerInterface yourself, register it, and alias the server's scope-manager service ID to your implementation. Treat this bundle as a reference implementation you graduate away from.oauth2-server-bundle / league/oauth2-server). Symfony 2 is EOL and this bundle is effectively unmaintained — do not start a new project on it. If you inherit it, plan a migration rather than extending it.debug:container for the actual class behind the scope-manager service ID.oauth2_server key. Use config:dump-reference <bundle-alias> to get the real key names instead of trusting examples.invalid_scope — enable the underlying library's logger to see the actual comparison.ScopeManagerInterface service alias, not subclassing bundle internals — the internal services and class names are not stable across the (few) releases.How can I help you explore Laravel packages today?