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

AbandonedArchivedMagento2-module[Authentication &amp; Authorization](/categories/authentication)

magenerds/ldap
==============

LDAP auth for Magento 2 backend login

2.0.2(7y ago)154.1k15[4 issues](https://github.com/Magenerds/Ldap/issues)[1 PRs](https://github.com/Magenerds/Ldap/pulls)OSL-3.0PHPPHP ~5.6.0|7.0.2|~7.0.6|~7.1.0

Since Jan 26Pushed 7y ago6 watchersCompare

[ Source](https://github.com/Magenerds/Ldap)[ Packagist](https://packagist.org/packages/magenerds/ldap)[ RSS](/packages/magenerds-ldap/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (8)Dependencies (2)Versions (8)Used By (0)

Magenerds\_Ldap
===============

[](#magenerds_ldap)

[![Latest Stable Version](https://camo.githubusercontent.com/e63a2433424250ac0c9a1ac5d385103573a1072099f09565a1a9885128ea1c4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6167656e657264732f6c6461702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/magenerds/ldap)[![License](https://camo.githubusercontent.com/f106bb27e5ea22f190015aa38b7b4c5e9c146ab67f35cec9f0b68455a348f369/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6167656e657264732f6c6461702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/magenerds/ldap)

Installation through Composer
-----------------------------

[](#installation-through-composer)

Add `"magenerds/ldap": "~2.0"` to the require block in your composer.json and then run `composer install`.

```
{
	"require": {
		"magenerds/ldap": "~2.0"
	}
}
```

Alternatively, you can simply run the following from the command line:

```
composer require magenerds/ldap "~2.0"
```

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

[](#configuration)

There are several ways to configure the ldap module for your instance and your environment. You can use Magento's `setup:config:set` command and/or set the options within the `setup:install` command. However, in each case Magento will persist the configuration data in `app/etc/env.php`. You can edit this file manually and deploy or mount it to your target environment.

### Command options

[](#command-options)

for `setup:config:set` and `setup:install`

```
     --ldap-host                  Ldap host
     --ldap-port                  Ldap Port (default: "389")
     --ldap-use-tls               For the sake of security, this should be `yes` if the server has the necessary certificate installed.
     --ldap-use-ssl               Possibly used as an alternative to useStartTls
     --ldap-bind-requires-dn      Required and must be `yes`, as OpenLDAP requires that usernames be in DN form when performing a bind.
     --ldap-base-dn               As with all servers, this option is required and indicates the DN under which all accounts being authenticated are located.
     --ldap-bind-dn               Required and must be a DN, as OpenLDAP requires that usernames be in DN form when performing a bind. Try to use an unprivileged account.
     --ldap-bind-password         The password corresponding to the username above, but this may be omitted if the LDAP server permits an anonymous binding to query user accounts.
     --ldap-allow-empty-password  Allow empty password
     --ldap-cache-password        To save the user password in the Magento database. Then, users will be able to log in even when the LDAP server is not reachable.
     --ldap-role                  Role that is assigned
     --ldap-user-filter           Ldap search filter. Placeholders are ":usernameAttribute" and ":username". (default: "(&(objectClass=*)(:usernameAttribute=:username))")
     --ldap-attribute-username    Attribute in LDAP defining the user’s username. (default: "uid")
     --ldap-attribute-first-name  Attribute in LDAP defining the user’s first name. (default: "givenname")
     --ldap-attribute-last-name   Attribute in LDAP defining the user’s last name. (default: "sn")
     --ldap-attribute-email       Attribute in LDAP defining the user’s email. (default: "mail")
```

Use `bin/magento setup:config:set --help` or `bin/magento setup:install --help`for further information.

Also see at [LDAP Authentication](https://framework.zend.com/manual/1.10/en/zend.auth.adapter.ldap.html) for a more details.

#### Ldap user filter

[](#ldap-user-filter)

Minimal search filter

```
(&(objectClass=*)(:usernameAttribute=:username))

```

Example for memberOf

```
(&(memberOf=cn=magento,ou=groups,dc=github,dc=com)(objectClass=person)(:usernameAttribute=:username))

```

### (optional) env.php

[](#optional-envphp)

```
'ldap' => array(
    'host' => 'ldap',
    'port' => '389',
    'base-dn' => 'ou=users,dc=github,dc=com',
    'bind-dn' => 'cn=admin,dc=github,dc=com',
    'bind-password' => 'password',
    'role' => 'Administrator',
    'user-filter' => '(&(objectClass=*)(:usernameAttribute=:username))',
    'attribute' => array(
        'username' => 'uid',
        'first-name' => 'givenname',
        'last-name' => 'sn',
        'email' => 'mail',
    ),
    'allow-empty-password' => false,
    'cache-password' => false,
    'use-tls' => false,
    'use-ssl' => false,
    'bind-requires-dn' => false,
)
```

Licence
-------

[](#licence)

magenerds/ldap is distributed under the terms of the [OSL-3.0](https://github.com/magenerds/ldap/blob/master/LICENSE.md)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 52.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.

###  Release Activity

Cadence

Every ~97 days

Recently: every ~139 days

Total

7

Last Release

2860d ago

Major Versions

1.0.4 → 2.0.02017-03-06

PHP version history (2 changes)1.0.1PHP ~5.6.0|7.0.2|~7.0.6

2.0.2PHP ~5.6.0|7.0.2|~7.0.6|~7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22537904?v=4)[Magenerds](/maintainers/magenerds)[@Magenerds](https://github.com/Magenerds)

---

Top Contributors

[![JSchlarb](https://avatars.githubusercontent.com/u/715666?v=4)](https://github.com/JSchlarb "JSchlarb (12 commits)")[![sydekumf](https://avatars.githubusercontent.com/u/3983052?v=4)](https://github.com/sydekumf "sydekumf (10 commits)")[![deiserh](https://avatars.githubusercontent.com/u/16748061?v=4)](https://github.com/deiserh "deiserh (1 commits)")

### Embed Badge

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

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

###  Alternatives

[markshust/magento2-module-disabletwofactorauth

The DisableTwoFactorAuth module provides the ability to disable two-factor authentication.

2292.8M9](/packages/markshust-magento2-module-disabletwofactorauth)[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.4M1](/packages/fastly-magento2)[hryvinskyi/magento2-invisible-captcha

Magento 2 Google Invisible Captcha (Recaptcha) module

279.5k](/packages/hryvinskyi-magento2-invisible-captcha)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1010.0k22](/packages/loki-magento2-components)

PHPackages © 2026

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