PHPackages                             johnparra/yii2-auth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. johnparra/yii2-auth

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

johnparra/yii2-auth
===================

Yii 2 User Authentication &amp; Role Based Access Control (RBAC) Module Fork of robregon

0.6.3(9y ago)012BSD-3-ClausePHPPHP &gt;=5.4.0

Since Oct 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/johnparra/yii2-auth)[ Packagist](https://packagist.org/packages/johnparra/yii2-auth)[ RSS](/packages/johnparra-yii2-auth/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (13)Used By (0)

Auth Module
===========

[](#auth-module)

Auth Module is a flexible user registration, authentication &amp; RBAC module for Yii2. It provides user authentication, registration and RBAC support to your Yii2 site.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require johnparra/yii2-auth "*"

```

or add

```
"johnparra/yii2-auth": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, modify your application configuration to include:

File config/web.php

```
return [
	'modules' => [
	    ...
	        'auth' => [
	            'class' => 'auth\Module',
	            'layout' => '//homepage', // Layout when not logged in yet
	            'layoutLogged' => '//main', // Layout for logged in users
	            'attemptsBeforeCaptcha' => 3, // Optional
	            'supportEmail' => 'support@mydomain.com', // Email for notifications
	            'passwordResetTokenExpire' => 3600, // Seconds for token expiration
	            'superAdmins' => ['admin'], // SuperAdmin users
	            'signupWithEmailOnly' => false, // false = signup with username + email, true = only email signup
	            'tableMap' => [ // Optional, but if defined, all must be declared
	                'User' => 'user',
	                'UserStatus' => 'user_status',
	                'ProfileFieldValue' => 'profile_field_value',
	                'ProfileField' => 'profile_field',
	                'ProfileFieldType' => 'profile_field_type',
	            ],
	        ],
	    ...
	],
	...
	'components' => [
	    ...
		'authManager' => [
			'class' => '\yii\rbac\DbManager',
			'ruleTable' => 'AuthRule', // Optional
			'itemTable' => 'AuthItem',  // Optional
			'itemChildTable' => 'AuthItemChild',  // Optional
			'assignmentTable' => 'AuthAssignment',  // Optional
		],
		'user' => [
			'class' => 'auth\components\User',
			'identityClass' => 'auth\models\User', // or replace to your custom identityClass
			'enableAutoLogin' => true,
		],
	    ...
	]
];
```

File config/console.php

```
    'components' => [
        'authManager' => [
            'class' => 'yii\rbac\DbManager'
        ],
        'user' => [
            'class' => 'auth\components\User',
        ],
        'db' => $db,
    ],

    'modules' => [
        'auth' => [
                'class' => 'auth\Module',
                'superAdmins' => ['admin'], // SuperAdmin users
        ],
    ],
```

And run migrations:

```
$ php yii migrate/up --migrationPath=@auth/migrations
```

License
-------

[](#license)

Auth module is released under the BSD-3 License. See the bundled `LICENSE.md` for details.

\#INSTALLATION

./yii migrate/up --migrationPath=@auth/migrations

URLs
----

[](#urls)

- Login: `yourhost/auth/default/login`
- Logout: `yourhost/auth/default/logout`
- Sign-up: `yourhost/auth/default/signup`
- Reset Password: `yourhost/auth/default/reset-password`
- User management: `yourhost/auth/user/index`
- User profile: `yourhost/auth/profile/view`

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.8% of commits — single point of failure

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 ~59 days

Recently: every ~107 days

Total

12

Last Release

3628d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ce0be6111735b8825d8314d1ddac95a4773c06d15a358f590fbe3bc504e64ee?d=identicon)[jedgarparra](/maintainers/jedgarparra)

---

Top Contributors

[![robregonm](https://avatars.githubusercontent.com/u/1051457?v=4)](https://github.com/robregonm "robregonm (79 commits)")[![fwerner13](https://avatars.githubusercontent.com/u/224561?v=4)](https://github.com/fwerner13 "fwerner13 (8 commits)")[![johnparra](https://avatars.githubusercontent.com/u/2760488?v=4)](https://github.com/johnparra "johnparra (7 commits)")[![mikebelozorov](https://avatars.githubusercontent.com/u/8688035?v=4)](https://github.com/mikebelozorov "mikebelozorov (1 commits)")[![cansozeri](https://avatars.githubusercontent.com/u/7555974?v=4)](https://github.com/cansozeri "cansozeri (1 commits)")[![youanden](https://avatars.githubusercontent.com/u/183880?v=4)](https://github.com/youanden "youanden (1 commits)")[![djfly](https://avatars.githubusercontent.com/u/4409731?v=4)](https://github.com/djfly "djfly (1 commits)")[![matyunya](https://avatars.githubusercontent.com/u/2044570?v=4)](https://github.com/matyunya "matyunya (1 commits)")

---

Tags

authAuthenticationuseraccessrbacyii2yii

### Embed Badge

![Health badge](/badges/johnparra-yii2-auth/health.svg)

```
[![Health](https://phpackages.com/badges/johnparra-yii2-auth/health.svg)](https://phpackages.com/packages/johnparra-yii2-auth)
```

###  Alternatives

[2amigos/yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension

294282.0k15](/packages/2amigos-yii2-usuario)[amnah/yii2-user

Yii 2 user authentication module

251231.0k3](/packages/amnah-yii2-user)[liujx/yii2-app-advanced

Yii2 ace-admin RBAC management background

1301.4k](/packages/liujx-yii2-app-advanced)[izyue/yii2-admin

RBAC Auth manager for Yii2

401.8k1](/packages/izyue-yii2-admin)

PHPackages © 2026

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