-
Fabien Potencier authored
This PR was squashed before being merged into the 2.0.x-dev branch (closes #1296). Discussion ---------- Add support for the Guard component to the SecurityServiceProvider | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #1260 | License | MIT | Doc PR | included Services configuration are extracted from the SecurityBundle [`guard.xml`](https://github.com/symfony/symfony/blob/3.0/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.xml) and [`GuardAuthenticationFactory`](https://github.com/symfony/symfony/blob/3.0/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php) Usage is quite simple, the `guard` type can be configured in the firewall like other ones. ```php $app['app.authenticator'] = function ($app) { return new Authenticator(); }; $app->register(new Silex\Provider\SecurityServiceProvider(), [ 'security.firewalls' => [ 'main' => [ 'pattern' => '^/admin', 'guard' => [ 'authenticators' => [ 'app.authenticator' ] ] ] ] ]); ``` Commits ------- 4b5ccc9a Add support for the Guard component to the SecurityServiceProvider
bade8a07