{"action":"closed","issue":{"url":"https://api.github.com/repos/silexphp/Silex/issues/1146","labels_url":"https://api.github.com/repos/silexphp/Silex/issues/1146/labels{/name}","comments_url":"https://api.github.com/repos/silexphp/Silex/issues/1146/comments","events_url":"https://api.github.com/repos/silexphp/Silex/issues/1146/events","html_url":"https://github.com/silexphp/Silex/issues/1146","id":68130795,"number":1146,"title":"Silex 2 & SecurityServiceProvider","user":{"login":"J7mbo","id":2657310,"avatar_url":"https://avatars.githubusercontent.com/u/2657310?v=3","gravatar_id":"","url":"https://api.github.com/users/J7mbo","html_url":"https://github.com/J7mbo","followers_url":"https://api.github.com/users/J7mbo/followers","following_url":"https://api.github.com/users/J7mbo/following{/other_user}","gists_url":"https://api.github.com/users/J7mbo/gists{/gist_id}","starred_url":"https://api.github.com/users/J7mbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J7mbo/subscriptions","organizations_url":"https://api.github.com/users/J7mbo/orgs","repos_url":"https://api.github.com/users/J7mbo/repos","events_url":"https://api.github.com/users/J7mbo/events{/privacy}","received_events_url":"https://api.github.com/users/J7mbo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-13T15:47:27Z","updated_at":"2015-04-16T09:02:16Z","closed_at":"2015-04-16T09:02:16Z","body":"> **Preface**: This is about 2 which is in Dev and of course not stable yet. I just enjoy using the latest :-)\r\n\r\nI register the SecurityServiceProvider like I did in Silex v1.2:\r\n\r\n        $firewalls   = $config['firewalls'];\r\n        $hierarchy   = $config['hierarchy'];\r\n        $accessRules = $config['access_rules'];\r\n\r\n        $firewalls['default']['users'] = function($app) {\r\n            /** @var EntityManager $orm */\r\n            $orm = $app['orm.em'];\r\n            return $orm->getRepository(self::USER_ENTITY);\r\n        };\r\n\r\n        $app->register(new SecurityServiceProvider, [\r\n            'security.firewalls'           => $firewalls,\r\n            'security.role_hierarchy' => $hierarchy,\r\n            'security.access_rules'   => $accessRules\r\n        ]);\r\n\r\nPlease assume `$config` is correct - it worked fine in 1.2 :) I know 2.0 is in dev, but when running the application I get the following error:\r\n\r\n> Catchable fatal error: Argument 1 passed to Symfony\\Component\\Security\\Http\\Firewall\\ContextListener::__construct() must be an instance of Symfony\\Component\\Security\\Core\\SecurityContextInterface, instance of Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage given, called in /Users/james/Dev/app/vendor/silex/silex/src/Silex/Provider/SecurityServiceProvider.php on line 359 and defined in /Users/james/Dev/app/vendor/symfony/security/Symfony/Component/Security/Http/Firewall/ContextListener.php on line 42\r\n\r\nI know that's not particularly helpful but I'm not sure if there's anything else I can provide. Is this simply because `SecurityServiceProvider` isn't doing what it's supposed to be doing just yet and I should be uncharacteristically patient or is there something different I need to be doing?\r\n\r\nI traced the code through to this in `SecurityServiceProvider`:\r\n\r\n    $app['security.exception_listener._proto'] = $app->protect(function ($entryPoint, $name) use ($app) {\r\n            return $app->share(function () use ($app, $entryPoint, $name) {\r\n                return new ExceptionListener(\r\n                    $app['security'], // I BELIEVE THIS IS WHERE THE ERROR LIES?\r\n                    $app['security.trust_resolver'],\r\n                    $app['security.http_utils'],\r\n                    $name,\r\n                    $app[$entryPoint],\r\n                    null, // errorPage\r\n                    null, // AccessDeniedHandlerInterface\r\n                    $app['logger']\r\n                );\r\n            });\r\n        });\r\n\r\n[Looking at 1.3](https://github.com/silexphp/Silex-Providers/blob/master/SecurityServiceProvider.php#L393), there seem to be some changes like: `$app['security.token_storage']`.\r\n\r\n**TLDR**, any idea on the ETA to get what is in 1.3 up-to-date with Silex 2.0 and Symfony Components (2.6) and make `SecurityServiceProvider` work as expected?"}}