Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions security/passwords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Further in this article, you can find a
.. configuration-block::

.. code-block:: yaml

# config/packages/test/security.yaml
security:
# ...
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -646,6 +648,12 @@ the name of the hasher to use::
}
}

.. caution::

When :ref:`migrating passwords <security-password-migration>`, 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:
Expand Down