From d98d0a200e6cb4962ab4d6cadeed6d2a401fa35a Mon Sep 17 00:00:00 2001 From: Youssef El Montaser Date: Mon, 19 Oct 2015 18:01:25 +0200 Subject: [PATCH] Add authentication_listener option --- DependencyInjection/Security/Factory/JWTFactory.php | 4 +++- Resources/doc/1-configuration-reference.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 ```