-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Beta3 to RC1 composer update fails with logout csrf Uncaught Error #48339
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
Comments
Good catch 👍 Seems there is a confusion between token managers and generators: https://symfony.com/doc/current/reference/configuration/security.html#csrf-token-generator I think @javiereguiluz maybe the blog post should also be updated? |
Hi. Thank you for trying out the pre-releases! If you manually remove the cache (e.g. If it does still occur, can you please create a minimal reproducer so someone can further investigate this issue? |
It does @wouterj the most easiest way to reproduce is the following commands
edit the security.yml and add the following to main you don’t need any other setup
run As it seems to throw that error no matter what if that csrf is true under the logout config. |
… value (MatTheCat) This PR was merged into the 6.2 branch. Discussion ---------- [SecurityBundle] Fix `logout.csrf_token_generator` default value | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #48339 | License | MIT | Doc PR | N/A The token **manager** service ID configuration node is called <code>csrf_token_**generator**</code>. As such it has been wrongly assumed in #46580 `security.csrf.token_generator` was a good default value, whereas `security.csrf.token_manager` should be used (this is reflected by [the documentation](https://symfony.com/doc/current/reference/configuration/security.html#csrf-token-generator)). `csrf_token_generator` should ideally be deprecated and renamed `csrf_token_manager`. Commits ------- df539e2 [SecurityBundle] Fix `logout.csrf_token_generator` default value
Thanks for the reproducing steps! @MatTheCat has fixed the error and when updating |
…enerator` to `firewalls.logout.csrf_token_manager` (MatTheCat) This PR was merged into the 6.3 branch. Discussion ---------- [SecurityBundle] Rename `firewalls.logout.csrf_token_generator` to `firewalls.logout.csrf_token_manager` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | N/A | License | MIT | Doc PR | symfony/symfony-docs#17482 A long time ago, #6554 replaced `CsrfProviderInterface` by `CsrfTokenGeneratorInterface`, and #9216 split the latter into `CsrfTokenManagerInterface` and `TokenGeneratorInterface`. #9587 later introduced `csrf_token_generator`, which was already wrong at the time. Given that token generators exist, it feels weird to have to set <code>csrf_token_**generator**</code> to <code>security.csrf.token_**manager**</code> as mentioned in [the documentation](https://symfony.com/doc/current/reference/configuration/security.html#csrf-token-generator). As this confusion recently led to #48339, I propose to rename `firewalls.logout.csrf_token_generator` to `firewalls.logout.csrf_token_manager`. Commits ------- 0a0a98a [SecurityBundle] Rename `firewalls.logout.csrf_token_generator` to `firewalls.logout.csrf_token_manager`
Symfony version(s) affected
6.2.0RC1
Description
When doing composer update from 6.2 beta3 to RC1 it throws an Uncaught Error
How to reproduce
security.yml
composer.json
This should work following
https://symfony.com/blog/new-in-symfony-6-2-security-improvements-part-2#simpler-logout-csrf-protection
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: