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

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

mauriliobmartins/yii2-ldap-php8
===============================

Authorize, search users, get user groups and more from LDAP in Yii2

1.0.0(1y ago)043MITPHP

Since Apr 10Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Yii2 extension for LDAP - PHP 8 Compatible Fork
===============================================

[](#yii2-extension-for-ldap---php-8-compatible-fork)

---

This is a **fork** of the original package created by [Vadim E. Kosoukhov](https://github.com/kosoukhov/yii2-ldap), updated to be compatible with **PHP 8**.

📦 About
-------

[](#-about)

The original package was no longer maintained and did not support PHP 8. This fork updates the codebase to ensure full compatibility with modern PHP versions, while preserving the functionality and spirit of the original implementation.

✅ Modifications
---------------

[](#-modifications)

The following updates were made in this fork:

- Updated syntax to support PHP 8
- Replaced deprecated functions and features
- Basic testing for PHP 8 compatibility

⚖ License
---------

[](#-license)

This project is licensed under the [MIT License](./LICENSE).

---

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/d6d955d721537c45c37b49ae60038a611c2d1db4745a20cbf12e644fa795957b/68747470733a2f2f706f7365722e707567782e6f72672f6d617572696c696f626d617274696e732f6c6461702f762f737461626c65)](https://packagist.org/packages/mauriliobmartins/ldap)[![Total Downloads](https://camo.githubusercontent.com/eafbbfe2c8c35f093c656e883a581fdd386508afc7b634076a770d680680a0ef/68747470733a2f2f706f7365722e707567782e6f72672f6d617572696c696f626d617274696e732f6c6461702f646f776e6c6f616473)](https://packagist.org/packages/mauriliobmartins/ldap)[![Latest Unstable Version](https://camo.githubusercontent.com/eae1d993142e7847c4cddc7e512d4745aaaacf2583f437b416bddf2ee0a5a12a/68747470733a2f2f706f7365722e707567782e6f72672f6d617572696c696f626d617274696e732f6c6461702f762f756e737461626c65)](https://packagist.org/packages/mauriliobmartins/ldap)[![License](https://camo.githubusercontent.com/fe20a9dadf1b68ffa4f5d8e202e28322a84f21d5424df6f6f28f04f70006fc12/68747470733a2f2f706f7365722e707567782e6f72672f6d617572696c696f626d617274696e732f6c6461702f6c6963656e7365)](https://packagist.org/packages/mauriliobmartins/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 mauriliobmartins/yii2-ldap-php8

```

or add

```
"mauriliobmartins/yii2-ldap-php8": "*"

```

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

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

[](#application-configuration-example)

In config/main.php add:

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance47

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

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

398d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12f0313b88b6aa128dbf96107adc4f830bea0b152a9bcbe5debbfbf7f399bc7d?d=identicon)[mauriliobmartins](/maintainers/mauriliobmartins)

---

Top Contributors

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

---

Tags

Authenticationauthorizationyii2extensionldapactive directoryUser managementyii2-extensionLDAP Authentication

### Embed Badge

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

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

###  Alternatives

[edvlerblog/yii2-adldap-module

yii2 Active Directory implementation (wrapper for Adldap2)

51227.3k](/packages/edvlerblog-yii2-adldap-module)[nodge/yii2-eauth

Yii2 EAuth Extension. EAuth allows to authenticate users with accounts on other websites (Google, Facebook, Twitter, etc).

19399.4k](/packages/nodge-yii2-eauth)[chrmorandi/yii2-ldap

Ldap

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

PHPackages © 2026

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