PHPackages                             kv4nt/yii2-ldap - 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. kv4nt/yii2-ldap

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

kv4nt/yii2-ldap
===============

Authorize, search users, get user groups and other from LDAP

1.0.5(3y ago)019MITPHP

Since Nov 14Pushed 3y agoCompare

[ Source](https://github.com/kv4nt/yii2-ldap)[ Packagist](https://packagist.org/packages/kv4nt/yii2-ldap)[ RSS](/packages/kv4nt-yii2-ldap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Yii2 extension for LDAP
=======================

[](#yii2-extension-for-ldap)

Authorize, search users, get user groups and other from LDAP

[![Yii2](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](http://www.yiiframework.com/)[![Latest Stable Version](https://camo.githubusercontent.com/9cfc517998f7e9639e0de90d8244aa27ee74a5d364c7bee02f5d0e25fa024e17/68747470733a2f2f706f7365722e707567782e6f72672f6b76346e742f6c6461702f762f737461626c65)](https://packagist.org/packages/kv4nt/ldap)[![Total Downloads](https://camo.githubusercontent.com/58fe447240efd26342e00d0cde6195608e7907d54926404e4714731a5bc1de31/68747470733a2f2f706f7365722e707567782e6f72672f6b76346e742f6c6461702f646f776e6c6f616473)](https://packagist.org/packages/kv4nt/ldap)[![Latest Unstable Version](https://camo.githubusercontent.com/e66674b0211ac4df8d8e437dd312fec7818b86d26cc710ca3be15a848295fccf/68747470733a2f2f706f7365722e707567782e6f72672f6b76346e742f6c6461702f762f756e737461626c65)](https://packagist.org/packages/kv4nt/ldap)[![License](https://camo.githubusercontent.com/5e397b9187feaa83ef6b37d58a30cc19a433f2b6cf4c580bf700f478f5838c3f/68747470733a2f2f706f7365722e707567782e6f72672f6b76346e742f6c6461702f6c6963656e7365)](https://packagist.org/packages/kv4nt/ldap)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist kv4nt/ldap

```

or add

```
"kv4nt/ldap": "*"

```

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

Application configuration example:
----------------------------------

[](#application-configuration-example)

In config/main.php add:

```
return [
    'components' => [
        'ldap' => [
            'class' => 'kv4nt\ldap\Connector',
            'useCache' => YII_ENV_DEV ? false : true,
        ],
    ],
    // ...
];
```

In config/main-local.php add:

```
return [
    'components' => [
        'ldap' => [
            'host' => 'ldap.example.com',
            'port' => '389',
            'baseDN' => 'OU=...,DC=...,DC=...,DC=net',
            'userDN' => '@....corp.net',
            'groupDN' => '',
            //Input your AD login/pass on dev or sys login/pass on test/prod servers
            'sysUserLogin' => '',
            'sysUserPassword' => '',
        ],
    ],
    // ...
];
```

Usage example:
--------------

[](#usage-example)

```
if (!Yii::$app->ldap->validateUserCredentials('SAMAccountName', 'password')) {
    throw new ErrorException('Incorrect username or password.');
}
```

```
echo Yii::$app->ldap->getUserAttributesBySAMAccountName('SAMAccountName', ['mail', 'sn', 'givenname', 'middlename']);
```

```
echo kv4nt\ldap\widgets\UserImage::widget([
    'login' => Yii::$app->user->identity->username,
    'options' => [
        'class' => 'img-circle',
        'alt' => 'User Image',
    ]
]);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~0 days

Total

4

Last Release

1274d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d15ae5e94c57df8fb20e66d0d860cc741c2a6f6b2c2fb9d5dd323bb7f9a529c?d=identicon)[kv4nt](/maintainers/kv4nt)

---

Top Contributors

[![kosoukhov](https://avatars.githubusercontent.com/u/2130233?v=4)](https://github.com/kosoukhov "kosoukhov (4 commits)")[![kv4nt](https://avatars.githubusercontent.com/u/8049164?v=4)](https://github.com/kv4nt "kv4nt (2 commits)")

---

Tags

Authenticationauthorizationyii2extensionldapactive directoryUser managementyii2-extensionLDAP Authentication

### Embed Badge

![Health badge](/badges/kv4nt-yii2-ldap/health.svg)

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

###  Alternatives

[edvlerblog/yii2-adldap-module

yii2 Active Directory implementation (wrapper for Adldap2)

51227.3k](/packages/edvlerblog-yii2-adldap-module)[chrmorandi/yii2-ldap

Ldap

1453.1k](/packages/chrmorandi-yii2-ldap)

PHPackages © 2026

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