Authentication: app_dev.php / _wdt / 511509b611682 instead of the main page

I am looking at security in Symfony 2.0 and I have a problem that I cannot explain.

My security package is very simple.

I try to put everything in order to work with real providers.

So, now, when I go to the site, it sends me to the login form, as expected. I put the user and password, and then instead of the home page I send "/.../app_dev.php/_wdt/511509b611682" (each time every time).

My user is not marked as authenticated on the debug toolbar.

If I remove the end of the URL, I come to the main page. My user seems to be identified and authenticated on the debug toolbar.

This only happens in the dev environment. In a prod environment, it works as expected.

thanks for the help

+7
source share
3 answers

In response to @artworkad, you should add the dev firewall in front of your main firewall, otherwise it will never match:

 security: firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: pattern: ^/ #... 
+15
source

When you log in using the development environment, you will be redirected to index_dev.php/_wdt/4e95412bc6871 .

WDT aka web debug toolbar can be removed from the firewall through

 dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false 

In fact, it is not associated with the SecurityBundle, somehow it is documented here https://github.com/FriendsOfSymfony/FOSUserBundle/issues/368

+4
source

You can also put these lines in access_control:

 { path: ^/_wdt, role: IS_AUTHENTICATED_ANONYMOUSLY } { path: ^/_profiler, role: IS_AUTHENTICATED_ANONYMOUSLY } 

but I prefer that my access_control be used only for my application routes.

+2
source

All Articles