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 impersonator_user to "User was reloaded" log message #24026

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
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
avoid empty impersonator_username
  • Loading branch information
gharlan committed Aug 31, 2017
commit 7de58d4f26cbdd37d0d8b609175a1a7e116586d7
11 changes: 4 additions & 7 deletions 11 src/Symfony/Component/Security/Http/Firewall/ContextListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,16 @@ protected function refreshUser(TokenInterface $token)
$token->setUser($refreshedUser);

if (null !== $this->logger) {
$impersonatorUsername = null;
$context = array('provider' => get_class($provider), 'username' => $refreshedUser->getUsername());

foreach ($token->getRoles() as $role) {
if ($role instanceof SwitchUserRole) {
$impersonatorUsername = $role->getSource()->getUsername();
$context['impersonator_username'] = $role->getSource()->getUsername();
break;
}
}

$this->logger->debug('User was reloaded from a user provider.', array(
'provider' => get_class($provider),
'username' => $refreshedUser->getUsername(),
'impersonator_username' => $impersonatorUsername,
));
$this->logger->debug('User was reloaded from a user provider.', $context);
}

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