0

after migrating from php5.6 to php7.0 on (dev and prod), i'm prevented to connect on my admin account although i can create a new one ! i get "Bad credentials" My security.yml :

security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext
        Application\Sonata\UserBundle\Entity\User: sha512 

any idea please.

Mirlo
  • 625
  • 9
  • 26
  • Try to only use : `FOS\UserBundle\Model\UserInterface: sha512` – Bobo Nov 02 '16 at 09:05
  • yes i did, but it seems that the problem persist unless i create another account ! but those who already connected cant get in ! – Mirlo Nov 02 '16 at 09:13
  • Have you the same problem when you create a new account ? – Bobo Nov 02 '16 at 09:22
  • If you can connect with the new account then problem come from php version. Whatever i think that you have to delete and create all account. You can do it with datafixtures – Bobo Nov 02 '16 at 09:42
  • yes i can create new ones, but how to use datafixtures in this case ? – Mirlo Nov 02 '16 at 10:10
  • **1**. Save your database **2.** Install [AliceBubndle] (https://github.com/hautelook/AliceBundle#installation) **3.** Config [user.yml] (https://github.com/adashbob/scolen/blob/master/src/Ecole/UserBundle/DataFixtures/ORM/Dev/users.yml) and [function to load fixture] (https://github.com/adashbob/scolen/blob/master/src/Ecole/UserBundle/DataFixtures/ORM/Dev/DataLoader.php). **4.** Execute command `php bin/console h:d:f:l` – Bobo Nov 02 '16 at 10:48
  • By default user's role is the default role in `security.yml` file. If you want to add role for exemple `ROLE_ADMIN` add `roles: [ROLE_ADMIN]` in your `user.yml` file – Bobo Nov 02 '16 at 10:59
  • thanks i'm going to do it – Mirlo Nov 02 '16 at 11:16

1 Answers1

0

I'm not sure why you have two encoders specified, try to comment the first one as you're loading user from database use

security:
    encoders:
        Application\Sonata\UserBundle\Entity\User: sha512 
tchartron
  • 669
  • 10
  • 18