@@ -184,27 +184,29 @@ Below is an example of configuration where the user will enter his/her
184
184
username and password via HTTP basic authentication. That information will
185
185
then be checked against our User entity records in the database:
186
186
187
- .. code -block :: yaml
187
+ .. configuration -block ::
188
188
189
- # app/config/security.yml
190
- security :
191
- encoders :
192
- Acme\UserBundle\Entity\User :
193
- algorithm : sha1
194
- encode_as_base64 : false
195
- iterations : 1
189
+ .. code-block :: yaml
196
190
197
- providers :
198
- administrators :
199
- entity : { class: AcmeUserBundle:User, property: username }
191
+ # app/config/security.yml
192
+ security :
193
+ encoders :
194
+ Acme\UserBundle\Entity\User :
195
+ algorithm : sha1
196
+ encode_as_base64 : false
197
+ iterations : 1
200
198
201
- firewalls :
202
- admin_area :
203
- pattern : ^/admin
204
- http_basic : ~
199
+ providers :
200
+ administrators :
201
+ entity : { class: AcmeUserBundle:User, property: username }
205
202
206
- access_control :
207
- - { path: ^/admin, roles: ROLE_ADMIN }
203
+ firewalls :
204
+ admin_area :
205
+ pattern : ^/admin
206
+ http_basic : ~
207
+
208
+ access_control :
209
+ - { path: ^/admin, roles: ROLE_ADMIN }
208
210
209
211
The ``encoders `` section associates the ``sha1 `` password encoder to the entity
210
212
class. This means that Symfony will expect the password that's encoded in
@@ -374,15 +376,17 @@ generic Doctrine entity provider. It's trival to achieve by removing the
374
376
``property `` field in the ``security.providers.administrators.entity `` section
375
377
of the ``security.yml `` file.
376
378
377
- .. code-block :: yaml
379
+ .. configuration-block ::
380
+
381
+ .. code-block :: yaml
378
382
379
- # app/config/security.yml
380
- security :
381
- # ...
382
- providers :
383
- administrators :
384
- entity : { class: AcmeUserBundle:User }
385
- # ...
383
+ # app/config/security.yml
384
+ security :
385
+ # ...
386
+ providers :
387
+ administrators :
388
+ entity : { class: AcmeUserBundle:User }
389
+ # ...
386
390
387
391
By doing this, the security layer will use an instance of ``UserRepository `` and
388
392
call its ``loadUserByUsername() `` method to fetch a user from the database
0 commit comments