You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I was playing with "impersonating users" inside the Symfony Demo app. In the current version of the app, everything works as expected. In the pending PR that uses 4.4-dev (symfony/demo#1039) impersonation doesn't work and I end up with an anonymous user.
How to reproduce
Use the Symfony Demo app and add switch_user: ~ to the main firewall and ROLE_ALLOWED_TO_SWITCH to the ROLE_ADMIN hierarchy.
Additional context
These are the logs when using Symfony 4.3:
[2019-10-31 12:37:19] security.DEBUG: Read existing security token from the session. {"key":"_security_main","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\SwitchUserToken"} []
[2019-10-31 12:37:19] doctrine.DEBUG: SELECT t0.id AS id_1, t0.full_name AS full_name_2, t0.username AS username_3, t0.email AS email_4, t0.password AS password_5, t0.roles AS roles_6 FROM symfony_demo_user t0 WHERE t0.id = ? [3] []
[2019-10-31 12:37:19] security.DEBUG: User was reloaded from a user provider. {"provider":"Symfony\\Bridge\\Doctrine\\Security\\User\\EntityUserProvider","username":"john_user","impersonator_username":"jane_admin"} []
[2019-10-31 12:37:19] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []
These are the logs when using Symfony 4.4-dev:
[2019-10-31 12:35:15] security.DEBUG: Read existing security token from the session. {"key":"_security_main","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\SwitchUserToken"} []
[2019-10-31 12:35:15] doctrine.DEBUG: SELECT t0.id AS id_1, t0.full_name AS full_name_2, t0.username AS username_3, t0.email AS email_4, t0.password AS password_5, t0.roles AS roles_6 FROM symfony_demo_user t0 WHERE t0.id = ? [3] []
[2019-10-31 12:35:15] security.DEBUG: Cannot refresh token because user has changed. {"username":"john_user","provider":"Symfony\\Bridge\\Doctrine\\Security\\User\\EntityUserProvider"} []
[2019-10-31 12:35:15] security.DEBUG: Token was deauthenticated after trying to refresh it. [] []
[2019-10-31 12:35:15] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected: 4.4
Description
I was playing with "impersonating users" inside the Symfony Demo app. In the current version of the app, everything works as expected. In the pending PR that uses 4.4-dev (symfony/demo#1039) impersonation doesn't work and I end up with an anonymous user.
How to reproduce
Use the Symfony Demo app and add
switch_user: ~
to themain
firewall andROLE_ALLOWED_TO_SWITCH
to theROLE_ADMIN
hierarchy.Additional context
These are the logs when using Symfony 4.3:
These are the logs when using Symfony 4.4-dev:
The text was updated successfully, but these errors were encountered: