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

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

erwin32/ldap
============

Simple lib to authenticate trough ldap with some extra features

1.3(8y ago)141GPL-2.0-onlyPHP

Since Nov 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Erwin32/simple-LDAP-auth)[ Packagist](https://packagist.org/packages/erwin32/ldap)[ RSS](/packages/erwin32-ldap/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)DependenciesVersions (5)Used By (0)

simple LDAP auth
================

[](#simple-ldap-auth)

class for very simple ldap auth cheks if user exists and if he/she is in given group.

Usage:
------

[](#usage)

```
$ composer require erwin32/ldap

```

Init sample

```
    // Active Directory server
    $ldap_host = "123.123.123.123";//IP adress or url

    // Active Directory DN
    $ldap_dn = 'DC=domain,DC=com';//domain in this example is used "domain.com"

    // Active Directory user group
    $ldap_user_group = "Group Name";

    // Active Directory manager group
    $ldap_manager_group = "Admins";

    // Domain, for purposes of constructing $user
    $ldap_usr_dom = "@domain.com";

    //class inicialization
    $ldap=new \LDAP\auth($ldap_host, $ldap_dn, $ldap_user_group, $ldap_manager_group, $ldap_usr_dom);
```

For auth use like this(expects inicialized class in $ldap)

first argument is username second is passoword

```
    try {
        $ldap->authenticate($user, $pass);
    } catch (Exception $exc) {
        $msg=$exc->getMessage();
        $code=$exc->getCode();

        //this is how we can determine if user dont have corect group but exist on LDAP
        if($ldap::ERROR_WRONG_USER_GROUP==$code){
            //custom handling
        }
    }
```

Thumbnail img retrival example

```
    try {
        $ldap->userInit($user, $pass);
        //we can display it like this
        echo '';

    } catch (Exception $exc) {
        $msg=$exc->getMessage();
        $code=$exc->getCode();

        //react to problems
    }
```

Exeptions Error codes

```
    $ldap::ERROR_WRONG_USER_GROUP

    $ldap::ERROR_CANT_AUTH

    $ldap::ERROR_CANT_SEARCH

    $ldap::ERROR_IMG_DECODE
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% 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 ~509 days

Total

4

Last Release

3031d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d503dce9a2e3d66e6826f98383cb498038f45c0929f3707e237fe32bb4ee198d?d=identicon)[Erwin32](/maintainers/Erwin32)

---

Top Contributors

[![Erwin32](https://avatars.githubusercontent.com/u/4253182?v=4)](https://github.com/Erwin32 "Erwin32 (23 commits)")[![foglcz](https://avatars.githubusercontent.com/u/767839?v=4)](https://github.com/foglcz "foglcz (3 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/erwin32-ldap/health.svg)](https://phpackages.com/packages/erwin32-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)
