Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cff4453

Browse filesBrowse files
committed
Merge branch 'cookbook_doctrine_provider_fix' of https://github.com/hhamon/symfony-docs into hhamon-cookbook_doctrine_provider_fix
Conflicts: cookbook/security/entity_provider.rst
2 parents fa1e2a2 + 1cf47c4 commit cff4453
Copy full SHA for cff4453

File tree

Expand file treeCollapse file tree

2 files changed

+29
-26
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+29
-26
lines changed

‎cookbook/index.rst

Copy file name to clipboardExpand all lines: cookbook/index.rst
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ Cookbook
5555
testing/profiling
5656
testing/doctrine
5757

58-
security/entity_provider
5958
security/remember_me
6059
security/voters
6160
security/acl

‎cookbook/security/entity_provider.rst

Copy file name to clipboardExpand all lines: cookbook/security/entity_provider.rst
+29-25Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -184,27 +184,29 @@ Below is an example of configuration where the user will enter his/her
184184
username and password via HTTP basic authentication. That information will
185185
then be checked against our User entity records in the database:
186186

187-
.. code-block:: yaml
187+
.. configuration-block::
188188

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
196190
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
200198
201-
firewalls:
202-
admin_area:
203-
pattern: ^/admin
204-
http_basic: ~
199+
providers:
200+
administrators:
201+
entity: { class: AcmeUserBundle:User, property: username }
205202
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 }
208210
209211
The ``encoders`` section associates the ``sha1`` password encoder to the entity
210212
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
374376
``property`` field in the ``security.providers.administrators.entity`` section
375377
of the ``security.yml`` file.
376378

377-
.. code-block:: yaml
379+
.. configuration-block::
380+
381+
.. code-block:: yaml
378382
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+
# ...
386390
387391
By doing this, the security layer will use an instance of ``UserRepository`` and
388392
call its ``loadUserByUsername()`` method to fetch a user from the database

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.