Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Security] Add authentication success sensitive event to authentication provider manager (rebase #26050) #30955

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 3 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
Prev Previous commit
Comply with Fabbot
  • Loading branch information
curry684 committed Apr 7, 2019
commit d7ab6cd63abf65e56464beffdd835c6ad91c4b72
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

namespace Symfony\Component\Security\Core\Event;

use Symfony\Contracts\EventDispatcher\Event;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Contracts\EventDispatcher\Event;
Copy link
Member

Choose a reason for hiding this comment

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

should be reverted: BC break :)


/**
* This is a general purpose authentication event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

namespace Symfony\Component\Security\Core\Event;

use Symfony\Contracts\EventDispatcher\Event;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
* This is an authentication event that includes sensitive data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\WrappedEvent;
use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
Expand Down Expand Up @@ -192,22 +191,22 @@ public function testAuthenticateDispatchesAuthenticationSuccessEventsWithCredent

$dispatcher = new EventDispatcher();
$dispatcher->addListener(AuthenticationEvents::AUTHENTICATION_SUCCESS_SENSITIVE, function ($event) use ($providerCN) {
if (\get_class($event) === 'Symfony\Component\EventDispatcher\WrappedEvent') {
if ('Symfony\Component\EventDispatcher\WrappedEvent' === \get_class($event)) {
$event = $event->getWrappedEvent();
}

/** @var AuthenticationSensitiveEvent $event */
/* @var AuthenticationSensitiveEvent $event */
$this->assertSame($providerCN, $event->getAuthenticationProviderClassName());
$this->assertSame('bar', $event->getAuthenticationTokenPassword());
$this->assertEquals('bar', $event->getPreAuthenticationToken()->getCredentials());
$this->assertEquals('bar', $event->getAuthenticationToken()->getCredentials());
});
$dispatcher->addListener(AuthenticationEvents::AUTHENTICATION_SUCCESS, function ($event) {
if (\get_class($event) === 'Symfony\Component\EventDispatcher\WrappedEvent') {
if ('Symfony\Component\EventDispatcher\WrappedEvent' === \get_class($event)) {
$event = $event->getWrappedEvent();
}

/** @var AuthenticationSuccessEvent $event */
/* @var AuthenticationSuccessEvent $event */
$this->assertEquals('', $event->getAuthenticationToken()->getCredentials());
});

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.