"A Token was not found in the SecurityContext" on Silex / Symfony "A Token was not found in the SecurityContext" on Silex / Symfony symfony symfony

"A Token was not found in the SecurityContext" on Silex / Symfony


It seems it has nothing to do with HTTP Basic Auth, because you don't use it in any of your firewalls. What you use is a firewall with a form entry point, which then uses session to store the security token.

I would suggest you to look at how sessions (and cookies) are managed on prod server compared to your dev environment.


Most likely the reason why this works on your local machine but not in your productive environment is that .htaccess is supported by Apache, while nginx does not bother wasting I/O and CPU time parsing this files

If you post your .htaccess I will show you how to translate this to performant nginx-readable configuration.

EDIT

Silex even has a configuration example for nginx

http://silex.sensiolabs.org/doc/web_servers.html