Все отлично работает в `dev`, а в `prod` судя по логам, авторизация проходит, потом какой-то эксепшн и редиректит опять на логин.
логи:
[2015-03-02 15:01:48] request.INFO: Matched route "admin_auth" (parameters: "_controller": "DEV\AdminBundle\Controller\AuthController::loginAction", "_route": "admin_auth") [] []
[2015-03-02 15:01:49] request.INFO: Matched route "admin_login_check" (parameters: "_route": "admin_login_check") [] []
[2015-03-02 15:01:49] security.INFO: User "xxx@gmail.com" has been authenticated successfully [] []
[2015-03-02 15:01:49] security.DEBUG: Write SecurityContext in the session [] []
[2015-03-02 15:01:49] request.INFO: Matched route "admin_index" (parameters: "_controller": "DEV\AdminBundle\Controller\DefaultController::indexAction", "_route": "admin_index") [] []
[2015-03-02 15:01:49] security.INFO: Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.) [] []
[2015-03-02 15:01:49] security.DEBUG: Calling Authentication entry point [] []
[2015-03-02 15:01:49] security.DEBUG: Write SecurityContext in the session [] []
[2015-03-02 15:01:49] request.INFO: Matched route "admin_auth" (parameters: "_controller": "DEV\AdminBundle\Controller\AuthController::loginAction", "_route": "admin_auth") [] []
Ошибка видмо здесь:
[2015-03-02 15:01:49] security.INFO: Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.) [] []
Гуглил, ничего не помогло.
security.yml у меня выглядит так:
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
DEV\MainBundle\Model\User:
algorithm: sha1
iterations: 1
encode_as_base64: false
role_hierarchy:
ROLE_ADMIN: [ROLE_ADMIN, ROLE_USER]
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
user_db:
propel:
class: DEV\MainBundle\Model\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/admin/auth$
security: false
anonymous: true
admin:
pattern: ^/(admin|api)
form_login:
login_path: admin_auth
check_path: admin_login_check
default_target_path: admin_index
provider: user_db
logout:
path: admin_logout
target: admin_auth
switch_user: true
access_control:
- { path: ^/admin, roles: [ROLE_ADMIN] }
кэш чистил, у юзера задана роль ["ROLE_ADMIN"]