Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Add a fake "provider" configuration node to satisfy SecurityExtension…
Browse files Browse the repository at this point in the history
…, issue #179
  • Loading branch information
scheb committed Nov 12, 2018
1 parent 8c1d371 commit af52901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DependencyInjection/Factory/Security/TwoFactorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
;
}

Expand Down
5 changes: 5 additions & 0 deletions Resources/doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit af52901

Please sign in to comment.