Skip to content

Commit

Permalink
bug #34536 [SecurityBundle] Don't require a user provider for the ano…
Browse files Browse the repository at this point in the history
…nymous listener (chalasr)

This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Don't require a user provider for the anonymous listener

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34504
| License       | MIT
| Doc PR        | -

Forgotten when adding the AnonymousFactory in #33503

Commits
-------

0950cfb [SecurityBundle] Don't require a user provider for the anonymous listener
  • Loading branch information
fabpot committed Nov 25, 2019
2 parents 9623414 + 0950cfb commit 218eb24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -464,8 +464,8 @@ private function createAuthenticationListeners(ContainerBuilder $container, stri
throw new InvalidConfigurationException(sprintf('Invalid firewall "%s": user provider "%s" not found.', $id, $firewall[$key]['provider']));
}
$userProvider = $providerIds[$normalizedName];
} elseif ('remember_me' === $key) {
// RememberMeFactory will use the firewall secret when created
} elseif ('remember_me' === $key || 'anonymous' === $key) {
// RememberMeFactory will use the firewall secret when created, AnonymousAuthenticationListener does not load users.
$userProvider = null;
} elseif ($defaultProvider) {
$userProvider = $defaultProvider;
Expand Down
Expand Up @@ -210,7 +210,7 @@ public function testMissingProviderForListener()
$container->compile();
}

public function testPerListenerProviderWithRememberMe()
public function testPerListenerProviderWithRememberMeAndAnonymous()
{
$container = $this->getRawContainer();
$container->loadFromExtension('security', [
Expand All @@ -223,6 +223,7 @@ public function testPerListenerProviderWithRememberMe()
'default' => [
'form_login' => ['provider' => 'second'],
'remember_me' => ['secret' => 'baz'],
'anonymous' => true,
],
],
]);
Expand Down

0 comments on commit 218eb24

Please sign in to comment.