2017 © Pedro Peláez
 

symfony-bundle fallback-password-encoder-bundle

Bundle providing a password encoder stack for support of legacy user data.

image

markup/fallback-password-encoder-bundle

Bundle providing a password encoder stack for support of legacy user data.

  • Monday, February 19, 2018
  • by shieldo
  • Repository
  • 2 Watchers
  • 7 Stars
  • 28,454 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

MarkupFallbackPasswordEncoderBundle

About

This Symfony2 bundle offers a strategy to use for password encoding for use with the friendsofsymfony/user-bundle package (FOSUserBundle). It requires version >=2.3.6 of the Symfony Security component., (*1)

The use case would be when there is legacy user data with passwords that are hashed using an algorithm that is easy to break, such as MD5. You'd like to use bcrypt, but this means getting all users to reset their passwords. This bundle allows you to declare a stack of encoders, so that you can run a primary algorithm and a set of fallback algorithms at the same time. A user with a password hashed using the legacy algorithm will have the stored hash transparently updated to the new, more secure hash the next time they sign in., (*2)

Current limitation: bundle does not currently work with Symfony framework encoders, as these are not declared as services., (*3)

Disclaimer

The existence of this software should by no means be construed as condoning the strategy itself. It is far preferable to have all passwords in your system using the same, secure algorithm. However, you may judge that this strategy is the most pragmatic for your situation - typically when you do not wish to enforce password resetting on your user base., (*4)

Installation

Add MarkupFallbackPasswordEncoderBundle to your composer.json:, (*5)

{
    "require": {
        "markup/fallback-password-encoder-bundle": "@dev"
    }
}

Add MarkupFallbackPasswordEncoderBundle to your AppKernel.php:, (*6)

    public function registerBundles()
    {
        $bundles = array(
            ...
            new Markup\FallbackPasswordEncoderBundle\MarkupFallbackPasswordEncoderBundle(),
        );
        ...
    }

Finally, install the bundle using Composer:, (*7)

$ php composer.phar update markup/fallback-password-encoder-bundle

Usage

Configuration example:, (*8)

A service ID is declared as the primary encoder - this is the canonical encoder that passwords should be hashed with. You then define a stack of fallback encoders that are used to check passwords using legacy algorithms. Manipulators also need to be registered if you are not making use of the fos_user.util.user_manipulator service provided by FOSUserBundle. (This service will still be used as a fallback for users of a class that does not appear in the keys of this manipulators list.), (*9)

markup_fallback_password_encoder:
    encoders:
        primary:
            id: security.encoder.blowfish
        fallbacks:
            - id: my_legacy_compat.encoder.md5.saltless
    manipulators:
        My\Bundle\CustomerBundle\Entity\Customer: my_customer.util.manipulator
        My\Bundle\AdminUserBundle\Entity\AdminUser: my_admin_user.util.manipulator

In your security.yml file, you would then specify the fallback encoder as markup_fallback_password_encoder:, (*10)

security:
    encoders:
        My\Bundle\CustomerBundle\Entity\Customer:
            id: markup_fallback_password_encoder
        My\Bundle\AdminUserBundle\Entity\AdminUser:
            id: markup_fallback_password_encoder

License

Released under the MIT License. See LICENSE., (*11)

Build Status, (*12)

The Versions

19/02 2018

dev-master

9999999-dev

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode

19/02 2018

dev-test_against_php_7_2

dev-test_against_php_7_2

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode

24/11 2017

1.0.3

1.0.3.0

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode

24/11 2017

dev-allow_symfony_3

dev-allow_symfony_3

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode

24/08 2015

1.0.2

1.0.2.0

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode

24/08 2015

1.0.1

1.0.1.0

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode

11/10 2013

1.0

1.0.0.0

Bundle providing a password encoder stack for support of legacy user data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

password barcode