Why is the authorization not working in prod environment (Symfony2)?

Everything works fine in `dev` and `prod` judging by the logs, the authorization passes, then some of acceptn and redirects again to login.

logs:

[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") [] []


The error is probably here:

[2015-03-02 15:01:49] security.INFO: Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.) [] []

Googled, nothing helped.

security.I have a yml file looks like this:

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] }


the cache is cleaned, the user specified role ["ROLE_ADMIN"]
September 19th 19 at 00:11
1 answer
September 19th 19 at 00:13
Most likely you are somewhere in the configs have not changed on PROD (e.g. access database).
no, there is no such - Antonina41 commented on September 19th 19 at 00:16

Find more questions by tags User identification