1

A friend who has a Symfony tool asks me to change his password. I am a PHP developer but I don't know Symfony...

I found the security.yml file with the password encrypted in bcrypt (12 passes). When I replace the password by another bcrypt password (12 passes) directly in the code, it crashes when I try to connect (wrong credential). When I put back the old password, it works again...

Any idea ?

# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
    providers:
        in_memory:
            memory:
                users:
                    nextstep:
                        password: $2a$12$et/Xz8tDrdB3b5[etc...]
                        roles: 'ROLE_ADMIN'
    encoders:
        Symfony\Component\Security\Core\User\User:
            algorithm: bcrypt
            cost: 12```
exexalex
  • 11
  • 2
  • Don't have a S3 app handy. Does `bin/console security:hash-password` exist? Might be `app\console`. Might also be `security:encode-password` If I had to guess, it's the salt that is messing you up but perhaps not. – Cerad Mar 23 '22 at 13:38
  • cleared cache `bin/console c:c` after changing config? – Rufinus Mar 23 '22 at 18:30
  • @Cerad encode-password exists. I used this one – exexalex Mar 27 '22 at 09:44
  • 1
    @Rufinus thanx that was it. I had to add --env=prod in the command line. thanx a lot. Solved – exexalex Mar 27 '22 at 09:45

0 Answers0