share(function (Application $app){ return new Authenticator($app, $app['browser'], $app['session'], $app['EM'], $app['phraseanet.registry']); }); // $app['authentication.suggestion-finder'] = $app->share(function (Application $app) { // return new SuggestionFinder($app); // }); $app['authentication.providers'] = $app->share(function (Application $app) { $config = array(); $config['appId'] = '252378391562465'; $config['secret'] = 'd9df4bb1ad34aab4f6728b4076e1f9c4'; $facebook = new \Facebook($config); $providers = new ProvidersCollection(); $providers->register(new Facebook($facebook, $app['url_generator'])); return $providers; }); $app['authentication.manager'] = $app->share(function (Application $app) { return new Manager($app['authentication'], $app['authentication.providers']); }); $app['auth.password-encoder'] = $app->share(function (Application $app) { return new PasswordEncoder($app['phraseanet.registry']->get('GV_sit')); }); $app['auth.old-password-encoder'] = $app->share(function (Application $app) { return new OldPasswordEncoder(); }); $app['auth.native.failure-manager'] = $app->share(function (Application $app) { return new FailureManager($app['EM'], $app['recaptcha']); }); $app['auth.native'] = $app->share(function (Application $app) { return new NativeAuthentication($app['auth.password-encoder'], $app['auth.old-password-encoder'], $app['auth.native.failure-manager'], $app['phraseanet.appbox']->get_connection()); }); } public function boot(Application $app) { } }