diff --git a/security/passwords.rst b/security/passwords.rst index 2a2f7acc336..76ff9651c08 100644 --- a/security/passwords.rst +++ b/security/passwords.rst @@ -134,7 +134,7 @@ Further in this article, you can find a .. configuration-block:: .. code-block:: yaml - + # config/packages/test/security.yaml security: # ... @@ -544,8 +544,10 @@ migration by returning ``true`` in the ``needsRehash()`` method:: } } -Named Password Hashers ----------------------- +.. _named-password-hashers: + +Dynamic Password Hashers +------------------------ Usually, the same password hasher is used for all users by configuring it to apply to all instances of a specific class. Another option is to use a @@ -646,6 +648,12 @@ the name of the hasher to use:: } } +.. caution:: + + When :ref:`migrating passwords `, you don't need to implement ``PasswordHasherAwareInterface`` + to return the legacy hasher name: + Symfony will detect it from your ``migrate_from`` configuration. + If you created your own password hasher implementing the :class:`Symfony\\Component\\PasswordHasher\\PasswordHasherInterface`, you must register a service for it in order to use it as a named hasher: