1

I want to chain two user providers (FosUserBundle and a custom DB user provider over propel) with two distinct encoding password methods

app/config/security.yml

security:  

    encoders:
        FOS\UserBundle\Model\UserInterface: sha512
        My\AuthBundle\Model\User: sha1

    providers:
        my_chain_providers:
            chain:
                providers: ["fos_userbundle", "db_user"]
        fos_userbundle:
            id: fos_user.user_provider.username_email
        db_user:
            propel:
                class: My\AuthBundle\Model\User
                property: username

    firewalls:
        main:
            pattern: ^/
            form_login:
                provider: my_chain_providers
            logout:       true
            anonymous:    true

my problem: password's hashs follow $password.'{'.$salt.'}' in fos_user table and $salt.$password in my custom DB user provider

this gist https://gist.github.com/1243080 show how to custom mergePasswordAndSalt method, but is it possible to have one mergePasswordAndSalt method per user provider?

1 Answer 1

1

You should use multiple encoders in combination with the FOSAdvancedEncoderBundle. I had the same problem, and answered it pretty thurougly over here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.