From af52901a07cfdcf837fe4c8dc5e16a695550d4d6 Mon Sep 17 00:00:00 2001 From: Christian Scheb Date: Mon, 12 Nov 2018 22:24:15 +0100 Subject: [PATCH] Add a fake "provider" configuration node to satisfy SecurityExtension, issue #179 --- DependencyInjection/Factory/Security/TwoFactorFactory.php | 2 ++ Resources/doc/configuration.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/DependencyInjection/Factory/Security/TwoFactorFactory.php b/DependencyInjection/Factory/Security/TwoFactorFactory.php index 14ce9456..2dd217d3 100644 --- a/DependencyInjection/Factory/Security/TwoFactorFactory.php +++ b/DependencyInjection/Factory/Security/TwoFactorFactory.php @@ -57,6 +57,8 @@ public function addConfiguration(NodeDefinition $node) ->scalarNode('csrf_token_generator')->defaultNull()->end() ->scalarNode('csrf_parameter')->defaultValue(self::DEFAULT_CSRF_PARAMETER)->end() ->scalarNode('csrf_token_id')->defaultValue(self::DEFAULT_CSRF_TOKEN_ID)->end() + // Fake node for SecurityExtension, which requires a provider to be set when multiple user providers are registered + ->scalarNode('provider')->defaultNull()->end() ; } diff --git a/Resources/doc/configuration.md b/Resources/doc/configuration.md index 527a104c..bb1aa8d1 100644 --- a/Resources/doc/configuration.md +++ b/Resources/doc/configuration.md @@ -96,6 +96,11 @@ security: csrf_token_generator: security.csrf.token_manager # CSRF protection will be enabled if a service id of CsrfTokenManagerInterface is given. Default: null csrf_parameter: _csrf_token # The default CSRF parameter name csrf_token_id: two_factor # The default CSRF token id, used for generating the token value. It is advised to use a different id per form + + # If you have multiple user providers registered, Symfony's security extension requires you to configure + # a user provider. You're forced to configure this node, although it doesn't have any effect on the + # TwoFactorBundle. So set this to any of you user providers, it doesn't matter which one. + provider: any_user_provider ``` For detailed information on the authentication methods see the individual documentation: