/PasswordStrengthBundle

Symfony 2 Password strengt and blacklisting constraint bundle

Primary LanguagePHPMIT LicenseMIT

RollerworksPasswordStrengthBundle

This bundle provides a validator for ensuring strong passwords in Symfony2 applications.

Passwords can be validated using either strength-levels (weak, medium, strong etc) or by configuring explicit requirements (needs letters, numbers etc)

This bundle provides the same level of functionality as the PasswordStrengthBundle created by John Bafford. And is considered a replacement of the original bundle.

Installation

Step 1: Using Composer (recommended)

To install RollerworksPasswordStrengthBundle with Composer just run:

$ php composer.phar require rollerworks/password-strength-bundle

Now, Composer will automatically download all required files, and install them for you.

Step2: Enable the bundle

Enable the bundle in the kernel:

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Rollerworks\Bundle\PasswordStrengthBundle\RollerworksPasswordStrengthBundle(),
    // ...
);

Congratulations! You're ready!

Basic Usage

Validates the passwords strength-level (weak, medium, strong etc).

Validates the passwords using explicitly configured requirements (letters, caseDiff, numbers, requireSpecialCharacter).

There are times you want forbid (blacklist) a password from usage.

Passwords are blacklisted using providers which can either an array or (flat-file) database (which you can update regularly).

With the default installation the following providers can be used.

  • Noop: Default provider, does nothing.
  • Array: Simple in memory blacklist provider (not recommended for big lists)
  • Sqlite: Provides the blacklist using a SQLite3 database file.

But building your own is also possible. Documentation on this is currently missing, see current providers for more information.