8000 [Security] [Firewall] Bug fixed in SimplePreAuthenticationListener when createToken() not return TokenInterface object by ad3n · Pull Request #11414 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] [Firewall] Bug fixed in SimplePreAuthenticationListener when createToken() not return TokenInterface object #11414

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Bug fixed in SimplePreAuthenticationListener when createToken() not r…
…eturn TokenInterface object
  • Loading branch information
adenkejawen committed Jul 18, 2014
commit b339d3349a3c838278edead2febdd43753ff3d81
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
composer.phar
autoload.php
/vendor/
/nbproject/private/
Copy link
Member

Choose a reason for hiding this comment

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

This must be ignored locally instead, because they are specific to your development environment, not to Symfony (and you should ignore all your netbeans files, not only the private ones. We don't want the other netbeans files in the repo either): https://help.github.com/articles/ignoring-files

Copy link
Author

Choose a reason for hiding this comment

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

@stof 👍 thanks for the response... i will push again

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

/**
* SimplePreAuthenticationListener implements simple proxying to an authenticator.
Expand Down Expand Up @@ -76,6 +77,11 @@ public function handle(GetResponseEvent $event)

try {
$token = $this->simpleAuthenticator->createToken($request, $this->providerKey);

if (! $token instanceof TokenInterface) {
return;
}

$token = $this->authenticationManager->authenticate($token);
$this->securityContext->setToken($token);
} catch (AuthenticationException $e) {
Expand Down
0