diff --git a/DependencyInjection/Security/Factory/JWTFactory.php b/DependencyInjection/Security/Factory/JWTFactory.php index 8485f4aa..1d7fecb6 100644 --- a/DependencyInjection/Security/Factory/JWTFactory.php +++ b/DependencyInjection/Security/Factory/JWTFactory.php @@ -27,7 +27,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider, $listenerId = 'security.authentication.listener.jwt.' . $id; $container - ->setDefinition($listenerId, new DefinitionDecorator('lexik_jwt_authentication.security.authentication.listener')) + ->setDefinition($listenerId, new DefinitionDecorator($config['authentication_listener'])) ->replaceArgument(2, $config); $entryPointId = $defaultEntryPoint; @@ -142,6 +142,8 @@ public function addConfiguration(NodeDefinition $node) ->end() ->scalarNode('authentication_provider') ->defaultValue('lexik_jwt_authentication.security.authentication.provider') + ->scalarNode('authentication_listener') + ->defaultValue('lexik_jwt_authentication.security.authentication.listener') ->end() ->end(); } diff --git a/Resources/doc/1-configuration-reference.md b/Resources/doc/1-configuration-reference.md index 023915cf..5ddab3aa 100644 --- a/Resources/doc/1-configuration-reference.md +++ b/Resources/doc/1-configuration-reference.md @@ -52,4 +52,5 @@ firewalls: throw_exceptions: false # When an authentication failure occurs, return a 401 response immediately create_entry_point: true # When no authentication details are provided, create a default entry point that returns a 401 response authentication_provider: lexik_jwt_authentication.security.authentication.provider + authentication_listener: lexik_jwt_authentication.security.authentication.listener ```