src/Silex/Security/Core/Authentication/Provider/DbalUserProvider.php
public function register(Application $app)
    {
        foreach (array_keys($app['security.firewalls']) as $firewallName) {
            if (!isset($app['security.firewalls']['users'])) {
                $app['security.user_provider.' . $firewallName] = $app->share(
                    function ($app) {
                        $connectionName = $app['security.user_providers.connection'];
                        if (null == $connectionName) {
                            $this->setConnection($app['db']);
                        } else {
                            $this->setConnection($app['dbs'][$connectionName]);
                        }
                        return $this;
                    }
                );
            }
        }
    }
public function register(Application $app)
    {
        foreach (array_keys($app['security.firewalls']) as $firewallName) {
            if (!isset($app['security.firewalls']['users'])) {
                $app['security.user_provider.' . $firewallName] = $app->share(
                    function ($app) {
                        $connectionName = $app['security.user_providers.connection'];
                        if (null == $connectionName) {
                            $this->setConnection($app['db']);
                        } else {
                            $this->setConnection($app['dbs'][$connectionName]);
                        }
                        return $this;
                    }
                );
            }
        }
    }
Registers services on the given app.

This method should only be used to configure services and parameters.
It should not get services.

@param Application $app An Application instance

@return void