nucleos / NucleosUserBundle

👤 Lightweight user management for symfony.
https://docs.nucleos.rocks/projects/user-bundle/
MIT License
59 stars 18 forks source link

invalid password migrating from FOSUserBundle #661

Open tacman opened 2 years ago

tacman commented 2 years ago

Question

I'm migrating from FOSUser, but when I go to login, I'm getting invalid password. It's a very old database, I imagine the issue is related to the security that's used hashing the passwords.

Since I'm using Symfony 6, I need a password hasher in security, I took a stab at this. How do I bypass this and use that Nucleos password hashing, which I assume will work with an old FOS User table.

Thanks

# security.yaml
    password_hashers:
        # FOS\UserBundle\Entity\User:
        App\Entity\User:
            algorithm: sha512
            encode_as_base64: false
            iterations: 1
    #    App\Entity\User: plaintext
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers

    providers:
        nucleos_userbundle:
            id: nucleos_user.user_provider.username
tacman commented 2 years ago

Or maybe I'm approaching this wrong. Is it possible to migrate from FOSUserBundle to this bundle with a legacy database?