PHPackages                             knplabs/rad-user - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. knplabs/rad-user

AbandonedArchivedLibrary[Security](/categories/security)

knplabs/rad-user
================

Simply handle password encryption and salt generation

v3.1.1(7y ago)5111.7k3[2 issues](https://github.com/KnpLabs/rad-user/issues)[1 PRs](https://github.com/KnpLabs/rad-user/pulls)MITPHPPHP ~7.0

Since Dec 19Pushed 3y ago23 watchersCompare

[ Source](https://github.com/KnpLabs/rad-user)[ Packagist](https://packagist.org/packages/knplabs/rad-user)[ RSS](/packages/knplabs-rad-user/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (10)Used By (0)

DEPRECATED
==========

[](#deprecated)

Unfortunately we decided to not maintain this project anymore ([see why](https://knplabs.com/en/blog/news-for-our-foss-projects-maintenance)). If you want to mark another package as a replacement for this one please send an email to .

Rapid Application Development : User
====================================

[](#rapid-application-development--user)

A **Symfony bundle** to simply handle password encryption and salt generation

[![Build Status](https://camo.githubusercontent.com/b72a7e3cc4a4402c8a86e7331866bdadcdb83fc5379215f56ad87e50eadee464/68747470733a2f2f7472617669732d63692e6f72672f4b6e704c6162732f7261642d757365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/KnpLabs/rad-user)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/04731805ff737bfa6d943a5e46b674ca2cc93140bc881b05939c396b1d370c40/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6e704c6162732f7261642d757365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KnpLabs/rad-user/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/1c14c2c192e8e48f57a71913c63198b73a71394f69fb58a633bec11b9626a9eb/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d757365722f762f737461626c65)](https://packagist.org/packages/knplabs/rad-user) [![Total Downloads](https://camo.githubusercontent.com/80e92686b13a88167d5562e98a2fd38da9309bf5c91aed7d7d16019fc19af811/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d757365722f646f776e6c6f616473)](https://packagist.org/packages/knplabs/rad-user) [![Latest Unstable Version](https://camo.githubusercontent.com/1ae2a247ff05de3a1e9a744c5de95c93dce5b78ff7959bd76154abd2b836a344/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d757365722f762f756e737461626c65)](https://packagist.org/packages/knplabs/rad-user) [![License](https://camo.githubusercontent.com/2d03b637953aae86d3d4c9cbdce968a6b3f5290d4a8366f70b93599b1224873a/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d757365722f6c6963656e7365)](https://packagist.org/packages/knplabs/rad-user)

Official maintainers:
=====================

[](#official-maintainers)

- [@Einenlum](https://github.com/Einenlum)

Installation
============

[](#installation)

```
composer require knplabs/rad-user:~2.0
```

```
class AppKernel
{
    function registerBundles()
    {
        $bundles = array(
            //...
            new Knp\Rad\User\Bundle\UserBundle(),
            //...
        );

        //...

        return $bundles;
    }
}
```

Usages
======

[](#usages)

I want to auto-generate my user salt
------------------------------------

[](#i-want-to-auto-generate-my-user-salt)

> The salt feature is deprecated since PHP 5.5 and BCrypt usage. Please upgrade your version of PHP and use BCrypt.

Your User model should implement the `Knp\Rad\User\HasSalt` interface.

```
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Knp\Rad\User\HasSalt;

/**
 * @ORM\Entity
 */
class User implements HasSalt
{
    use HasSalt\HasSalt; //You can also use this trait

    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column
     */
    private $salt;
}
```

Now, before your user is inserted into your database, the salt will be auto-generated.

I want to auto-generate my user password
----------------------------------------

[](#i-want-to-auto-generate-my-user-password)

Your User model should implement the `Knp\Rad\User\HasInitialPassword` interface.

```
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Knp\Rad\User\HasInitialPassword;

/**
 * @ORM\Entity
 */
class User implements HasInitialPassword
{
    use HasInitialPassword\HasInitialPassword; // You can also use this trait

    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column
     */
    private $password;
}
```

Now, before your user is inserted or updated into your database, then the plain password will be automaticly generated.

I want to auto-encode my user password
--------------------------------------

[](#i-want-to-auto-encode-my-user-password)

Your User model should implement the `Knp\Rad\User\HasPassword` interface.

```
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Knp\Rad\User\HasPassword;

/**
 * @ORM\Entity
 */
class User implements HasPassword
{
    use HasPassword\HasPassword; // You can also use this trait

    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column
     */
    private $password;
}
```

Now, before your user is inserted or updated into your database, if you have set the attribute 'plainPassword', then the password will be automaticly generated.

WARNING
=======

[](#warning)

The `Knp\Rad\User\HasPassword\HasPassword` trait use the `Knp\Rad\User\HasInitialPassword\HasInitialPassword` trait. So don't use both into the same class or you will have a method conflict.

Some tips
=========

[](#some-tips)

Using with MongoDB or CouchDB Object Document Mapper
----------------------------------------------------

[](#using-with-mongodb-or-couchdb-object-document-mapper)

The knp/rad-user library is also compatible with MongoDB and CouchDB

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~192 days

Recently: every ~227 days

Total

8

Last Release

2811d ago

Major Versions

v1.1.0 → v2.0.02016-03-04

v2.1.0 → v3.0.02017-09-21

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v3.0.0PHP ~7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202732?v=4)[KNP Labs](/maintainers/KnpLabs)[@KnpLabs](https://github.com/KnpLabs)

---

Top Contributors

[![PedroTroller](https://avatars.githubusercontent.com/u/1766827?v=4)](https://github.com/PedroTroller "PedroTroller (14 commits)")[![jeremyb](https://avatars.githubusercontent.com/u/134588?v=4)](https://github.com/jeremyb "jeremyb (9 commits)")[![Djeg](https://avatars.githubusercontent.com/u/1638230?v=4)](https://github.com/Djeg "Djeg (6 commits)")[![polc](https://avatars.githubusercontent.com/u/3513348?v=4)](https://github.com/polc "polc (3 commits)")[![alexpozzi](https://avatars.githubusercontent.com/u/8307861?v=4)](https://github.com/alexpozzi "alexpozzi (1 commits)")[![stephanedelprat](https://avatars.githubusercontent.com/u/152964289?v=4)](https://github.com/stephanedelprat "stephanedelprat (1 commits)")

---

Tags

phpradsymfony-bundle

### Embed Badge

![Health badge](/badges/knplabs-rad-user/health.svg)

```
[![Health](https://phpackages.com/badges/knplabs-rad-user/health.svg)](https://phpackages.com/packages/knplabs-rad-user)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M648](/packages/sylius-sylius)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[shopware/storefront

Storefront for Shopware

684.2M148](/packages/shopware-storefront)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
