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

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

futuretek/yii2-ldap
===================

Ldap

011PHP

Since Jun 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/futuretek-solutions-ltd/yii2-ldap)[ Packagist](https://packagist.org/packages/futuretek/yii2-ldap)[ RSS](/packages/futuretek-yii2-ldap/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Ldap database and ActiveRecord for Yii 2
========================================

[](#ldap-database-and-activerecord-for-yii-2)

This extension provides the LDAP integration for the Yii framework 2.0. It includes basic querying/search support and also implements the ActiveRecord pattern that allows you to store active records in Active Directory or OpenLDAP.

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bad30632fc248bfc496dcdecebdc4c4f167a5ea2a25e1c1eb6023a07fff50c66/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6368726d6f72616e64692f796969322d6c6461702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/chrmorandi/yii2-ldap/?branch=master)

Requirements
------------

[](#requirements)

To use yii2-ldap, your sever must support:

PHP LDAP Extension

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist chrmorandi/yii2-ldap

```

or add

```
"chrmorandi/yii2-ldap": "*"
```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

```
return [
    //....
    'components' => [
        'ldap' => [
            'class' => 'chrmorandi\ldap\Connection',
            // Mandatory Configuration Options
            'dc' => [
                '192.168.1.1',
                'ad.com'
            ],
            'baseDn'          => 'dc=ad,dc=com',
            'username'        => 'administrator@ad.com',
            'password'        => 'password',
            // Optional Configuration Options
            'port'            => 389,
            'followReferrals' => false,
            'useTLS'          => true,
            // Change pageSize (e.g. to 1000) if you are getting the following message
            // with large result sets:
            // ldap_search(): Partial search results returned: Sizelimit exceeded
            'pageSize'        => -1,
        ],
    ]
];
```

Authenticating Users
--------------------

[](#authenticating-users)

To authenticate users using your AD server, call the `Yii::$app->ldap->auth()`method on your provider:

```
try {
    if (Yii::$app->ldap->auth($this->username, $password)) {
        // Credentials were correct.
    } else {
        // Credentials were incorrect.
    }
    } catch (Exception $e) {
        // error
    }
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.2% 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/1ce67c863775f4dd7237db0547fe39aaf85c9841f34773d67e88f62dcf948ae4?d=identicon)[futuretek](/maintainers/futuretek)

---

Top Contributors

[![chrmmota](https://avatars.githubusercontent.com/u/242634898?v=4)](https://github.com/chrmmota "chrmmota (52 commits)")[![chrmorandi](https://avatars.githubusercontent.com/u/11622005?v=4)](https://github.com/chrmorandi "chrmorandi (5 commits)")[![lukascernydis](https://avatars.githubusercontent.com/u/3111717?v=4)](https://github.com/lukascernydis "lukascernydis (3 commits)")[![rimas-kudelis](https://avatars.githubusercontent.com/u/2812673?v=4)](https://github.com/rimas-kudelis "rimas-kudelis (1 commits)")

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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