Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $app->register(
- new Silex\Provider\SecurityServiceProvider(),
- array(
- 'security.firewalls' => array(
- 'default' => array(
- 'ldap' => true,
- 'pattern' => '^/admin/',
- 'form' => array(
- 'login_path' => '/login',
- 'check_path' => '/admin/login_check',
- ),
- 'logout' => array(
- 'logout_path' => '/admin/logout'
- ),
- 'users' => $app->share(
- function () use ($app) {
- return new App\LdapUserProvider(
- array('ROLE_USER')
- );
- }
- ),
- ),
- ),
- )
- );
- $app['security.authentication_listener.factory.ldap'] = $app->protect(
- function ($name, $options) use ($app) {
- $app['security.authentication_provider.'.$name.'.ldap'] = $app->share(
- function () use ($app) {
- return new App\LdapAuthenticationProvider(
- $app['security.user_provider.default'],
- 'default'
- );
- }
- );
- $app['security.authentication_listener.'.$name.'.ldap'] = $app->share(
- function () use ($app) {
- return new App\LdapAuthenticationListener(
- $app['security'],
- $app['security.authentication_manager'],
- $app['security.http_utils']
- );
- }
- );
- return array(
- 'security.authentication_provider.'.$name.'.ldap',
- 'security.authentication_listener.'.$name.'.ldap',
- null,
- 'form'
- );
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement