@@ -18,7 +18,7 @@ Configuring CSRF Protection
1818
1919First, configure the Security component so it can use CSRF protection.
2020The Security component needs a CSRF token provider. You can set this to use the default
21- provider available in the Form component:
21+ provider available in the Security component:
2222
2323.. configuration-block ::
2424
@@ -31,7 +31,7 @@ provider available in the Form component:
3131 # ...
3232 form_login :
3333 # ...
34- csrf_provider : form.csrf_provider
34+ csrf_provider : security.csrf.token_manager
3535
3636 .. code-block :: xml
3737
@@ -46,7 +46,7 @@ provider available in the Form component:
4646 <firewall name =" secured_area" >
4747 <!-- ... -->
4848
49- <form-login csrf-provider =" form.csrf_provider " />
49+ <form-login csrf-provider =" security.csrf.token_manager " />
5050 </firewall >
5151 </config >
5252 </srv : container >
@@ -60,12 +60,17 @@ provider available in the Form component:
6060 // ...
6161 'form_login' => array(
6262 // ...
63- 'csrf_provider' => 'form.csrf_provider ',
63+ 'csrf_provider' => 'security.csrf.token_manager ',
6464 )
6565 )
6666 )
6767 ));
6868
69+ .. versionadded :: 2.4
70+ The ``security.csrf.token_manager `` service was introduced in Symfony 2.4.
71+ Prior to Symfony 2.4, you can use the ``form.csrf_provider `` service
72+ available in the Form component.
73+
6974The Security component can be configured further, but this is all information
7075it needs to be able to use CSRF in the login form.
7176
0 commit comments