8000 [Security] Remove hard dependency on $providerKey for default auth success handler by asm89 · Pull Request #4865 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Remove hard dependency on $providerKey for default auth success handler #4865

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

Merged

Conversation

asm89
Copy link
Contributor
@asm89 asm89 commented Jul 11, 2012

Bug fix: yes?
Feature addition: yes?
Backwards compatibility break: no
Symfony2 tests pass: Build Status
License of the code: MIT

In 8ffaafa a hard dependency was introduced between the default authentication success handling code and the active firewall. This makes sense. However, for people implementing their own success handler this makes it impossible to extend the default class as the $providerKey is set in the extension of the security bundle.

This PR makes the dependency a soft one so people can extend the class and use the default definition as a parent for their own service. However it is the responsibility of the developers to set the appropriate $providerKey if they want to use the target url saved in the session. Imo this is the right way as the developer should also set the appropriate options for the parent class in the overriding constructor.

@stof
Copy link
Member
stof commented Jul 11, 2012

@asm89 this PR need to be rebased according to github

@asm89
Copy link
Contributor Author
asm89 commented Jul 11, 2012

@stof Done :)

@@ -60,6 +58,23 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token)
return $this->httpUtils->createRedirectResponse($request, $this->determineTargetUrl($request));
}


/**
* @return string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the missing parts of the phpdoc? (same for the setter)

@asm89
Copy link
Contributor Author
asm89 commented Jul 12, 2012

@fabpot Done.

fabpot added a commit that referenced this pull request Jul 12, 2012
Commits
-------

5e6c06f [Security] Remove hard dependency on $providerKey for default auth success handler

Discussion
----------

[Security] Remove hard dependency on $providerKey for default auth success handler

Bug fix: yes?
Feature addition: yes?
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=fix-default-auth-successhandler-extension)](http://travis-ci.org/asm89/symfony)
License of the code: MIT

In 8ffaafa a hard dependency was introduced between the default authentication success handling code and the active firewall. This makes sense. However, for people implementing their own success handler this makes it impossible to extend the default class as the `$providerKey` is set in the extension of the security bundle.

This PR makes the dependency a soft one so people can extend the class and use the default definition as a parent for their own service. However it is the responsibility of the developers to set the appropriate `$providerKey` if they want to use the target url saved in the session. Imo this is the right way as the developer should also set the appropriate options for the parent class in the overriding constructor.

---------------------------------------------------------------------------

by stof at 2012-07-11T19:01:12Z

@asm89 this PR need to be rebased according to github

---------------------------------------------------------------------------

by asm89 at 2012-07-11T19:13:09Z

@stof Done :)

---------------------------------------------------------------------------

by asm89 at 2012-07-12T10:07:53Z

@fabpot Done.
@fabpot fabpot merged commit 5e6c06f into symfony:master Jul 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0