PHPackages                             yanglaw/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. yanglaw/yii2-auth

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

yanglaw/yii2-auth
=================

Yii 2 User Authentication

09PHP

Since Mar 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/yanglaw/yii2-auth)[ Packagist](https://packagist.org/packages/yanglaw/yii2-auth)[ RSS](/packages/yanglaw-yii2-auth/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)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 yanglaw/yii2-auth "*"

```

or add

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

```

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

Usage
-----

[](#usage)

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

```
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
	            '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' => [
	    ...
	    'user' => [
	        'class' => 'auth\components\User',
	    ],
	    ...
	]
];
```

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

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1acdd112ac86b257f80fb434973aa9416bd67ebc0f1a6e815d2f96cc1123b1d9?d=identicon)[yanglaw](/maintainers/yanglaw)

---

Top Contributors

[![yanglaw](https://avatars.githubusercontent.com/u/2204581?v=4)](https://github.com/yanglaw "yanglaw (1 commits)")

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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