No encoder has been configured for account with fosUserBundle symfony2.1

Try adding this to the security key in security.yml

encoders:
        FOS\UserBundle\Model\UserInterface: sha512

so it's

security:
    encoders:
        FOS\UserBundle\Model\UserInterface: sha512

    providers:
        ...

    firewalls:
        ...

You need juste add this code in the security.yml

    encoders:
        # use your user class name here
        App\Entity\User:
            # Use native password encoder
            # This value auto-selects the best possible hashing algorithm
            # (i.e. Sodium when available).
            algorithm: auto

Im use symfony 4.4

Working for me


I was getting this error on LexikJWTAuthenticationBundle.

It helps me (config/packages/security.yaml):

security:
    encoders:
      App\Entity\User:
        algorithm: bcrypt