-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Add impersonation support for stateless authentication #24260
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
Conversation
should we actually have this extra configuration ? couldn't we just make the switch_user listener stateless when the firewall itself is stateless ? |
@stof ideally yes, like the exceptionlistener. But disabling the redirection for stateless firewalls now would be a BC Break right? |
should we plan any deprecation here? Like when the option doesn't match the statelessyness of the firewall, then plan to deprecate the option in 4.1 and make it automatic meanwhile? |
7152540
to
32fc7bb
Compare
Deprecation added |
32fc7bb
to
0f57086
Compare
0f57086
to
e7a5803
Compare
Rebased. ping @symfony/deciders |
Thank you @chalasr. |
…hentication (chalasr) This PR was merged into the 3.4 branch. Discussion ---------- [Security] Add impersonation support for stateless authentication | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | https://github.com/lafourchette/SwitchUserStatelessBundle/issues/10#issuecomment-330434589 | License | MIT | Doc PR | n/a The `switch_user` listener triggers a redirection in case of success and thus does not play well with stateless authentication which is common nowadays (as opposed to other listeners like the [exception one](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php#L187..#L189)). This adds a new `stateless` option to the `switch_user` listener, if set to true then no redirection is triggered during user switching. This will avoid the need for [lafourchette/SwitchUserStatelessBundle](https://github.com/lafourchette/SwitchUserStatelessBundle) which just duplicated the symfony SwitchUserListener (with config factory) at a given state to avoid the 2 LOC which are causing the redirection. The bundle is not actively maintained and the listener it provides is out of date due to the missing upstream additions and bug fixes (see https://github.com/lafourchette/SwitchUserStatelessBundle/issues/10). Commits ------- e7a5803 [Security] Add user impersonation support for stateless authentication
…halasr) This PR was merged into the 3.4 branch. Discussion ---------- [Security] Look at headers for switch_user username | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24260 | License | MIT | Doc PR | n/a Allowing `switch_user.parameter` config node to be a header name. It's supported by SwitchUserStatelessBundle and I think it makes sense. Forgotten in #24260 so targets 3.4 but not a blocker. Commits ------- 3c80195 [Security] Look at headers for switch user username parameter
Change to the documentation as [lafourchette/SwitchUserStatelessBundle](https://github.com/lafourchette/SwitchUserStatelessBundle) no longer appears to be maintained and is no longer necessary since this pull request symfony/symfony#24260
…eDoug) This PR was merged into the 2.x-dev branch. Discussion ---------- Update index.md - Remove reference to lafourchette. Change to the documentation as [lafourchette/SwitchUserStatelessBundle](https://github.com/lafourchette/SwitchUserStatelessBundle) no longer appears to be maintained and is no longer necessary since this pull request symfony/symfony#24260 Commits ------- beb93f9 Update index.md
The
switch_user
listener triggers a redirection in case of success and thus does not play well with stateless authentication which is common nowadays (as opposed to other listeners like the exception one).This adds a new
stateless
option to theswitch_user
listener, if set to true then no redirection is triggered during user switching.This will avoid the need for lafourchette/SwitchUserStatelessBundle which just duplicated the symfony SwitchUserListener (with config factory) at a given state to avoid the 2 LOC which are causing the redirection.
The bundle is not actively maintained and the listener it provides is out of date due to the missing upstream additions and bug fixes (see https://github.com/lafourchette/SwitchUserStatelessBundle/issues/10).