@@ -18,7 +18,7 @@ Configuring CSRF Protection
18
18
19
19
First, configure the Security component so it can use CSRF protection.
20
20
The 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:
22
22
23
23
.. configuration-block ::
24
24
@@ -31,7 +31,7 @@ provider available in the Form component:
31
31
# ...
32
32
form_login :
33
33
# ...
34
- csrf_provider : form.csrf_provider
34
+ csrf_provider : security.csrf.token_manager
35
35
36
36
.. code-block :: xml
37
37
@@ -46,7 +46,7 @@ provider available in the Form component:
46
46
<firewall name =" secured_area" >
47
47
<!-- ... -->
48
48
49
- <form-login csrf-provider =" form.csrf_provider " />
49
+ <form-login csrf-provider =" security.csrf.token_manager " />
50
50
</firewall >
51
51
</config >
52
52
</srv : container >
@@ -60,12 +60,17 @@ provider available in the Form component:
60
60
// ...
61
61
'form_login' => array(
62
62
// ...
63
- 'csrf_provider' => 'form.csrf_provider ',
63
+ 'csrf_provider' => 'security.csrf.token_manager ',
64
64
)
65
65
)
66
66
)
67
67
));
68
68
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
+
69
74
The Security component can be configured further, but this is all information
70
75
it needs to be able to use CSRF in the login form.
71
76
0 commit comments