nucleos / NucleosUserBundle

👤 Lightweight user management for symfony.

Home Page:https://docs.nucleos.rocks/projects/user-bundle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

invalid password migrating from FOSUserBundle

tacman opened this issue · comments

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

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