Skip to content

Commit 04a76b7

Browse files
committed
Fix misleading error on missing provider with authenticator manager
1 parent b755ed5 commit 04a76b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ private function getUserProvider(ContainerBuilder $container, string $id, array
677677
return 'security.user_providers';
678678
}
679679

680-
throw new InvalidConfigurationException(sprintf('Not configuring explicitly the provider for the "%s" listener on "%s" firewall is ambiguous as there is more than one registered provider.', $factoryKey, $id));
680+
throw new InvalidConfigurationException(sprintf('Not configuring explicitly the provider for the "%s" %s on "%s" firewall is ambiguous as there is more than one registered provider.', $factoryKey, $this->authenticatorManagerEnabled ? 'authenticator' : 'listener', $id));
681681
}
682682

683683
private function createEncoders(array $encoders, ContainerBuilder $container)

Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function testPerListenerProvider()
220220
public function testMissingProviderForListener()
221221
{
222222
$this->expectException(InvalidConfigurationException::class);
223-
$this->expectExceptionMessage('Not configuring explicitly the provider for the "http_basic" listener on "ambiguous" firewall is ambiguous as there is more than one registered provider.');
223+
$this->expectExceptionMessage('Not configuring explicitly the provider for the "http_basic" authenticator on "ambiguous" firewall is ambiguous as there is more than one registered provider.');
224224
$container = $this->getRawContainer();
225225
$container->loadFromExtension('security', [
226226
'enable_authenticator_manager' => true,

0 commit comments

Comments
 (0)