{"action":"created","issue":{"url":"https://api.github.com/repos/silexphp/Silex/issues/1259","labels_url":"https://api.github.com/repos/silexphp/Silex/issues/1259/labels{/name}","comments_url":"https://api.github.com/repos/silexphp/Silex/issues/1259/comments","events_url":"https://api.github.com/repos/silexphp/Silex/issues/1259/events","html_url":"https://github.com/silexphp/Silex/issues/1259","id":107649890,"number":1259,"title":"[2.0][SecurityServiceProvider] Redirect to login page after successfull auth","user":{"login":"arduanov","id":8693029,"avatar_url":"https://avatars.githubusercontent.com/u/8693029?v=3","gravatar_id":"","url":"https://api.github.com/users/arduanov","html_url":"https://github.com/arduanov","followers_url":"https://api.github.com/users/arduanov/followers","following_url":"https://api.github.com/users/arduanov/following{/other_user}","gists_url":"https://api.github.com/users/arduanov/gists{/gist_id}","starred_url":"https://api.github.com/users/arduanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arduanov/subscriptions","organizations_url":"https://api.github.com/users/arduanov/orgs","repos_url":"https://api.github.com/users/arduanov/repos","events_url":"https://api.github.com/users/arduanov/events{/privacy}","received_events_url":"https://api.github.com/users/arduanov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-22T05:46:09Z","updated_at":"2015-09-22T11:13:27Z","closed_at":"2015-09-22T11:13:27Z","body":"After success login silex redirect to my controller, but then  \"An AuthenticationException was thrown; redirecting to authentication entry point\" and redirect to login page. May be I do something wrong?\r\n\r\n```\r\n        $app['security.firewalls'] = [\r\n            'secured_area' => [\r\n                'pattern' => '^/admin',\r\n                'anonymous' => false,\r\n                'form' => ['login_path' => '/login', 'check_path' => '/admin/check_login',\r\n                    'always_use_default_target_path'=>true,\r\n                    'default_target_path' => 'post_add',\r\n                ],\r\n                'users' => [\r\n                    'admin' => ['ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='],\r\n                ],\r\n            ],\r\n        ];\r\n```\r\n\r\nlogs\r\n\r\n```\r\n[2015-09-22 08:31:33] application.DEBUG: > GET /login [] []\r\n[2015-09-22 08:31:34] application.DEBUG: < 200 [] []\r\n[2015-09-22 08:31:49] application.INFO: Matched route \"admin_check_login\". {\"route_parameters\":{\"_controller\":null,\"_route\":\"admin_check_login\"},\"request_uri\":\"http://symfony.dev/admin/check_login\"} []\r\n[2015-09-22 08:31:49] application.INFO: User has been authenticated successfully. {\"username\":\"admin\"} []\r\n[2015-09-22 08:31:49] application.DEBUG: < 302 http://symfony.dev/admin/post/add/ [] []\r\n[2015-09-22 08:31:49] application.DEBUG: Stored the security token in the session. {\"key\":\"_security_secured_area\"} []\r\n[2015-09-22 08:31:49] application.INFO: Matched route \"post_add\". {\"route_parameters\":{\"_controller\":\"home.controller:postEdit\",\"_route\":\"post_add\"},\"request_uri\":\"http://symfony.dev/admin/post/add/\"} []\r\n[2015-09-22 08:31:49] application.INFO: An AuthenticationException was thrown; redirecting to authentication entry point. {\"exception\":\"[object] (Symfony\\\\Component\\\\Security\\\\Core\\\\Exception\\\\AuthenticationCredentialsNotFoundException(code: 0): A Token was not found in the TokenStorage. at /var/www/silex/vendor/symfony/security/Http/Firewall/AccessListener.php:53)\"} []\r\n[2015-09-22 08:31:49] application.DEBUG: Calling Authentication entry point. [] []\r\n[2015-09-22 08:31:49] application.DEBUG: < 302 http://symfony.dev/login [] []\r\n[2015-09-22 08:31:49] application.INFO: Matched route \"GET_login\". {\"route_parameters\":{\"_controller\":\"[object] (Closure: {})\",\"_route\":\"GET_login\"},\"request_uri\":\"http://symfony.dev/login\"} []\r\n[2015-09-22 08:31:49] application.DEBUG: > GET /login [] []\r\n[2015-09-22 08:31:49] application.DEBUG: < 200 [] []\r\n```"},"comment":{"url":"https://api.github.com/repos/silexphp/Silex/issues/comments/142254402","html_url":"https://github.com/silexphp/Silex/issues/1259#issuecomment-142254402","issue_url":"https://api.github.com/repos/silexphp/Silex/issues/1259","id":142254402,"user":{"login":"arduanov","id":8693029,"avatar_url":"https://avatars.githubusercontent.com/u/8693029?v=3","gravatar_id":"","url":"https://api.github.com/users/arduanov","html_url":"https://github.com/arduanov","followers_url":"https://api.github.com/users/arduanov/followers","following_url":"https://api.github.com/users/arduanov/following{/other_user}","gists_url":"https://api.github.com/users/arduanov/gists{/gist_id}","starred_url":"https://api.github.com/users/arduanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arduanov/subscriptions","organizations_url":"https://api.github.com/users/arduanov/orgs","repos_url":"https://api.github.com/users/arduanov/repos","events_url":"https://api.github.com/users/arduanov/events{/privacy}","received_events_url":"https://api.github.com/users/arduanov/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T11:13:27Z","updated_at":"2015-09-22T11:13:27Z","body":"Thanks for help. I create test app and it works. I check my code again.\r\n"}}