From 34e69de95ed997846e9c755144105fcc2ff48519 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 3 Feb 2014 21:33:12 -0600 Subject: [PATCH] [#3533] Lots of nice changes thanks to @xabbuh --- cookbook/security/named_encoders.rst | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/cookbook/security/named_encoders.rst b/cookbook/security/named_encoders.rst index cf881563363..fe54738f670 100644 --- a/cookbook/security/named_encoders.rst +++ b/cookbook/security/named_encoders.rst @@ -5,7 +5,7 @@ How to Choose the Password Encoder Algorithm Dynamically ======================================================== .. versionadded:: 2.5 - Named encoders were introduced in Symfony 2.5 + Named encoders were introduced in Symfony 2.5. Usually, the same password encoder is used for all users by configuring it to apply to all instances of a specific class: @@ -19,12 +19,20 @@ to apply to all instances of a specific class: .. code-block:: xml - - - - + + + + + + + .. code-block:: php @@ -33,12 +41,12 @@ to apply to all instances of a specific class: // ... 'encoders' => array( 'Symfony\Component\Security\Core\User\User' => array( - 'algorithm' => 'sha512', + 'algorithm' => 'sha512', ), ), )); -Another option is to use a "named" encoder, and then select which encoder +Another option is to use a "named" encoder and then select which encoder you want to use dynamically. In the previous example, you've set the ``sha512`` algorithm for ``Acme\UserBundle\Entity\User``. @@ -63,7 +71,11 @@ named encoders: + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:srv="http://symfony.com/schema/dic/services" + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd" + >