Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling authentication manager causes debug toolbar to fail with 404 #37277

Closed
Addvilz opened this issue Jun 14, 2020 · 7 comments
Closed

Enabling authentication manager causes debug toolbar to fail with 404 #37277

Addvilz opened this issue Jun 14, 2020 · 7 comments

Comments

@Addvilz
Copy link

Addvilz commented Jun 14, 2020

Symfony version(s) affected: 5.1.1

Description
Setting enable_authenticator_manager to true in security.yaml causes XMLHttpRequest against https://*/_wdt/* to fail with 404 response. Subsequently, debug toolbar displays An error occurred while loading the web debug toolbar. and is not usable.

For the particular code base just toggling enable_authenticator_manager on and off triggers the issue with no other changes. With key enable_authenticator_manager absent debug toolbar works just fine. With enable_authenticator_manager set true the _wdt endpoint returns 404.

Likely related to #34770 and #35365

How to reproduce
Set enable_authenticator_manager to true in security.yaml

Additional context
This particular project was created with and upgraded from 5.1 RC1. Something in the upgrade process maybe?

@Addvilz
Copy link
Author

Addvilz commented Jun 14, 2020

Looks like this is related to #37254 and potentially fixed with #37261. Setting csrf_protection: false in framework.yaml seems to make it all work again. If anyone can confirm this is indeed fixed already with pending release, that would be great.

⚠️ For whoever stumbles upon this ticket in search for a fix, setting csrf_protection to false in framework.yaml is a Very Bad Idea™. It's better to not have a debug toolbar than to not have CSRF protection enabled.

@wouterj
Copy link
Member

wouterj commented Jun 14, 2020

Yes, I'm sorry. Please note that this is not breaking only in the debug toolbar - it's breaking your application.

So:

  • If you're using the new system WITH csrf, consider staying at 5.1.0 and upgrading to 5.1.2 when it's available). If this is not possible, switch to the old system again for 5.1.1
  • If you're using the new system WITHOUT csrf, use 5.1.1 (it's broken in 5.1.0).

I'm sorry for having created a major bug in 5.1.1. We've now added a better functional testsuite for the new system, to avoid major bugs after 5.1.1.

@Addvilz
Copy link
Author

Addvilz commented Jun 14, 2020

@wouterj absolutely don't worry about it, it's fine really - things happen. If the work on this is tracked elsewhere / merged, we can probably close this issue? Up to you.

@fabpot
Copy link
Member

fabpot commented Jun 15, 2020

5.1.2 will be released later today to help people who have already (bravely) using the new security system.

@plencovich
Copy link

In my case, creating the .htaccess file in /public, it was fixed

   <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php [QSA,L]
   </IfModule>

@Mesleo
Copy link

Mesleo commented Jul 16, 2021

In my case, creating the .htaccess file in /public, it was fixed

   <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php [QSA,L]
   </IfModule>

This response is the best. Thanks, friend!

@fazliddin
Copy link

fazliddin commented Nov 14, 2021

Wow, .htaccess solves the problem. But it is strange that Symfony does not have it by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants