Single post

FOSUserBundle – compatibility break

Well, four days ago Stof authored a braking-change in FOSUserBundle; after updating vendors, you may encounter errors like "an encoder is not configured for Your\User\Entity" exception. This is basically because "algorithm" field from User entity was wiped out, and moved to FOSAdvancedEncoderBundle.

If you've encountered this, you basically have two options:

1) stick to 1.1.0 branch of FOSUserBundle by modifying your deps:

[FOSUserBundle]
    git=git://github.com/FriendsOfSymfony/FOSUserBundle.git
    target=bundles/FOS/UserBundle
    version=1.1.0

of course, if you don't want to ever upgrade to symfony 2.1 )

2) upgrade to master FOSUserBundle:

do

bin/vendors update

update doctrine schema (this will delete "algorithm" column):

app/console doctrine:schema:update --force

modify "encoders" section in security.yml:

  1.  
  2. encoders:
  3. FOS\UserBundle\Model\UserInterface:
  4. algorithm: sha512
  5. encode_as_base64: false
  6. iterations: 1
  7.  

encode_as_base64: false and iterations: 1 will add compatibility with you current encoded passwords from 1.1.0 version of FOSUserBundle.

Have fun!

theme by teslathemes