Why Symfony docs suggest to implement UserInterface interface on my domain User entity?
https://symfony.com/doc/3.4/security/entity_provider.html
class User implements UserInterface, \Serializable {}
To me it looks like this is breaking a basic DDD approach because my domain entities should never rely on something that resides outside the domain (in this case UserInterface is a Symfony component).
The problem is that Symfony's UserPasswordEncoder
need UserInterface
object to retrieve salt/password from users.
At the moment I have a very sketchy solution that it is not bullet-proof/scalable at all, so I'm looking for solutions.
Do I need to implement my own UserPasswordEncoder that can work directly on my Domain User entity?