Skip to content

Commit 0a24749

Browse files
author
Mathieu
committed
[Security] Prevent unneeded implementation of PasswordHasherAwareInterface when migrating passwords
1 parent db74d6d commit 0a24749

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

security/passwords.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Further in this article, you can find a
134134
.. configuration-block::
135135

136136
.. code-block:: yaml
137-
137+
138138
# config/packages/test/security.yaml
139139
security:
140140
# ...
@@ -544,8 +544,8 @@ migration by returning ``true`` in the ``needsRehash()`` method::
544544
}
545545
}
546546

547-
Named Password Hashers
548-
----------------------
547+
Dynamic Password Hashers
548+
------------------------
549549

550550
Usually, the same password hasher is used for all users by configuring it
551551
to apply to all instances of a specific class. Another option is to use a
@@ -646,6 +646,12 @@ the name of the hasher to use::
646646
}
647647
}
648648

649+
.. note::
650+
651+
When migrating passwords, you don't need to implement ``PasswordHasherAwareInterface``
652+
to return the legacy hasher name:
653+
Symfony will detect it from your ``migrate_from`` configuration.
654+
649655
If you created your own password hasher implementing the
650656
:class:`Symfony\\Component\\PasswordHasher\\PasswordHasherInterface`,
651657
you must register a service for it in order to use it as a named hasher:

0 commit comments

Comments
 (0)