Skip to content

Commit 46ca631

Browse files
committed
[reference] Removing some duplicate security reference and adding some links between sections
1 parent 2b17e1b commit 46ca631

File tree

2 files changed

+29
-95
lines changed

2 files changed

+29
-95
lines changed

cookbook/security/form_login.rst

+3-86
Original file line numberDiff line numberDiff line change
@@ -12,92 +12,9 @@ configuration is shown in the next section.
1212
Form Login Configuration Reference
1313
----------------------------------
1414

15-
.. configuration-block::
16-
17-
.. code-block:: yaml
18-
19-
# app/config/security.yml
20-
security:
21-
firewalls:
22-
main:
23-
form_login:
24-
# the user is redirected here when he/she needs to login
25-
login_path: /login
26-
27-
# if true, forward the user to the login form instead of redirecting
28-
use_forward: false
29-
30-
# submit the login form here
31-
check_path: /login_check
32-
33-
# by default, the login form *must* be a POST, not a GET
34-
post_only: true
35-
36-
# login success redirecting options (read further below)
37-
always_use_default_target_path: false
38-
default_target_path: /
39-
target_path_parameter: _target_path
40-
use_referer: false
41-
42-
# login failure redirecting options (read further below)
43-
failure_path: null
44-
failure_forward: false
45-
46-
# field names for the username and password fields
47-
username_parameter: _username
48-
password_parameter: _password
49-
50-
# csrf token options
51-
csrf_parameter: _csrf_token
52-
intention: authenticate
53-
54-
.. code-block:: xml
55-
56-
<!-- app/config/security.xml -->
57-
<config>
58-
<firewall>
59-
<form-login
60-
check_path="/login_check"
61-
login_path="/login"
62-
use_forward="false"
63-
always_use_default_target_path="false"
64-
default_target_path="/"
65-
target_path_parameter="_target_path"
66-
use_referer="false"
67-
failure_path="null"
68-
failure_forward="false"
69-
username_parameter="_username"
70-
password_parameter="_password"
71-
csrf_parameter="_csrf_token"
72-
intention="authenticate"
73-
post_only="true"
74-
/>
75-
</firewall>
76-
</config>
77-
78-
.. code-block:: php
79-
80-
// app/config/security.php
81-
$container->loadFromExtension('security', array(
82-
'firewalls' => array(
83-
'main' => array('form_login' => array(
84-
'check_path' => '/login_check',
85-
'login_path' => '/login',
86-
'user_forward' => false,
87-
'always_use_default_target_path' => false,
88-
'default_target_path' => '/',
89-
'target_path_parameter' => _target_path,
90-
'use_referer' => false,
91-
'failure_path' => null,
92-
'failure_forward' => false,
93-
'username_parameter' => '_username',
94-
'password_parameter' => '_password',
95-
'csrf_parameter' => '_csrf_token',
96-
'intention' => 'authenticate',
97-
'post_only' => true,
98-
)),
99-
),
100-
));
15+
To see the full form login configuration reference, see
16+
:doc:`/reference/configuration/security`. Some of the more interesting options
17+
are explained below.
10118

10219
Redirecting after Success
10320
-------------------------

reference/configuration/security.rst

+26-9
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,39 @@ Each part will be explained in the next section.
8686
http_digest:
8787
provider: name
8888
form_login:
89+
# submit the login form here
8990
check_path: /login_check
91+
92+
# the user is redirected here when he/she needs to login
9093
login_path: /login
94+
95+
# if true, forward the user to the login form instead of redirecting
9196
use_forward: false
97+
98+
# login success redirecting options (read further below)
9299
always_use_default_target_path: false
93-
default_target_path: /
94-
target_path_parameter: _target_path
95-
use_referer: false
96-
failure_path: /foo
100+
default_target_path: /
101+
target_path_parameter: _target_path
102+
use_referer: false
103+
104+
# login failure redirecting options (read further below)
105+
failure_path: /foo
97106
failure_forward: false
98107
failure_handler: some.service.id
99108
success_handler: some.service.id
109+
110+
# field names for the username and password fields
100111
username_parameter: _username
101112
password_parameter: _password
113+
114+
# csrf token options
102115
csrf_parameter: _csrf_token
103-
intention: authenticate
104-
csrf_provider: my.csrf_provider.id
105-
post_only: true
106-
remember_me: false
116+
intention: authenticate
117+
csrf_provider: my.csrf_provider.id
118+
119+
# by default, the login form *must* be a POST, not a GET
120+
post_only: true
121+
remember_me: false
107122
remember_me:
108123
token_provider: name
109124
key: someS3cretKey
@@ -147,7 +162,9 @@ Form Login Configuration
147162
------------------------
148163

149164
When using the ``form_login`` authentication listener beneath a firewall,
150-
there are several common options for configuring the "form login" experience:
165+
there are several common options for configuring the "form login" experience.
166+
167+
For even more details, see :doc:`/cookbook/security/form_login`.
151168

152169
The Login Form and Process
153170
~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)