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

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

kosoukhov/ldap
==============

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

1.0.0(8y ago)718.0k↓33.3%3[1 PRs](https://github.com/kosoukhov/yii2-ldap/pulls)MITPHP

Since Mar 7Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (3)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/a733d6fc1182bf31cec0fa615285c55d3337a53ae80d34e81ccfa5af944a76b1/68747470733a2f2f706f7365722e707567782e6f72672f6b6f736f756b686f762f6c6461702f762f737461626c65)](https://packagist.org/packages/kosoukhov/ldap)[![Total Downloads](https://camo.githubusercontent.com/b98a894cce9f7baf7b89131625a4cc13d015cccaa8b25af1334f56c036e60d98/68747470733a2f2f706f7365722e707567782e6f72672f6b6f736f756b686f762f6c6461702f646f776e6c6f616473)](https://packagist.org/packages/kosoukhov/ldap)[![Latest Unstable Version](https://camo.githubusercontent.com/e27cb87cd01b8a3108707871dca6adc8e6e791612bae29270ebc2e67516eab7a/68747470733a2f2f706f7365722e707567782e6f72672f6b6f736f756b686f762f6c6461702f762f756e737461626c65)](https://packagist.org/packages/kosoukhov/ldap)[![License](https://camo.githubusercontent.com/6c4604841e9e0bd941ec303c6680965849839d6aa840926cd4811ffe0c955f85/68747470733a2f2f706f7365722e707567782e6f72672f6b6f736f756b686f762f6c6461702f6c6963656e7365)](https://packagist.org/packages/kosoukhov/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 kosoukhov/ldap

```

or add

```
"kosoukhov/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' => 'kosoukhov\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 kosoukhov\ldap\widgets\UserImage::widget([
    'login' => Yii::$app->user->identity->username,
    'options' => [
        'class' => 'img-circle',
        'alt' => 'User Image',
    ]
]);
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2995d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17dd75a02e96212d6f31cff28baf28d94e1d4ff23de160237323c4161168bc93?d=identicon)[kosoukhov](/maintainers/kosoukhov)

---

Top Contributors

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

---

Tags

active-directoryauthenticationauthorizationldapldap-authenticationphpuser-managementyiiyii2yii2-extensionyii2extensionldap

### Embed Badge

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

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

###  Alternatives

[chrmorandi/yii2-ldap

Ldap

1453.1k](/packages/chrmorandi-yii2-ldap)[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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