@@ -59,8 +59,8 @@ First, enable the JSON login under your firewall:
59
59
``/login/{foo} `` where ``foo `` has no default value).
60
60
61
61
Now, when a request is made to the ``/login `` URL, the security system initiates
62
- the authentication process. You just need to define anywhere in your application
63
- an empty controller associated with that URL :
62
+ the authentication process. You just need to configure a route matching this
63
+ path :
64
64
65
65
.. configuration-block ::
66
66
@@ -103,7 +103,7 @@ an empty controller associated with that URL:
103
103
</route >
104
104
</routes >
105
105
106
- .. code-block :: php
106
+ .. code-block :: php
107
107
108
108
// app/config/routing.php
109
109
use Symfony\Component\Routing\RouteCollection;
@@ -117,9 +117,10 @@ an empty controller associated with that URL:
117
117
return $collection;
118
118
119
119
Don't let this empty controller confuse you. When you submit a ``POST `` request
120
- to the ``/login `` URL with the following JSON document as body, the security
121
- system automatically handles it and takes care of checking the submitted
122
- username and password and authenticating the user or throwing an error:
120
+ to the ``/login `` URL with the following JSON document as the body, the security
121
+ system intercepts the requests. It takes care of authenticating the user with
122
+ the submitted username and password or triggers an error in case the authentication
123
+ process fails:
123
124
124
125
.. code-block :: json
125
126
@@ -129,10 +130,9 @@ username and password and authenticating the user or throwing an error:
129
130
}
130
131
131
132
If the JSON document has a different structure, you can specify the path to
132
- access to the user and password properties using the ``username_path `` and
133
- ``password_path `` keys (they default respectively to ``username `` and ``password ``).
134
-
135
- For example, if the JSON document has the following structure:
133
+ access the ``username `` and ``password `` properties using the ``username_path ``
134
+ and ``password_path `` keys (they default respectively to ``username `` and
135
+ ``password ``). For example, if the JSON document has the following structure:
136
136
137
137
.. code-block :: json
138
138
0 commit comments