Skip to content

Symfony 2 Password strengt and blacklisting constraint bundle

License

Notifications You must be signed in to change notification settings

Deserved/PasswordStrengthBundle

 
 

Repository files navigation

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

Caution:

The password validators do not enforce that the field must have a value! To make a field "required" use the NotBlank constraint in combination with the password validator(s).

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.
  • Pdo: Provides the blacklist using the PDO extension.

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

About

Symfony 2 Password strengt and blacklisting constraint bundle

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%