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

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

phantomnet/ldap
===============

06PHP

Since May 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/wislem/laravel-ldap-provider)[ Packagist](https://packagist.org/packages/phantomnet/ldap)[ RSS](/packages/phantomnet-ldap/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

LDAP Authentication Provider
============================

[](#ldap-authentication-provider)

The goal of this project is to connect with existing Authentication systems and provide connectivity and access via LDAP without implementing it's own session control system. Built natively into this package is support for cartalyst's [Sentry](http://cartalyst.com/manual/sentry) package to provide authentication services.

If you would like to connect your authentication system just send a pull request and your code will be revied for entry! :-)

Supported Authentication Systems
--------------------------------

[](#supported-authentication-systems)

The supported authentication systems are:

- [Cartalyst Sentry 2](http://cartalyst.com/manual/sentry)

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

[](#configuration)

Open your composer.json file and add the following to the require array:

```
"phantomnet/laravel-ldap-provider": "dev-master"

```

After modifying the composer.json file make sure to validate it:

```
composer validate

```

Install the dependencies and packages with the following:

```
composer install

```

Or

```
composer update

```

**Laravel 4**

The following configuration options go through the **app/config/app.php** file

In the **providers** array add the following:

```
/* LDAP Provider */
'Phantomnet\Ldap\LdapServiceProvider',

```

Within the aliases array add the following:

```
/* LDAP Auth Provider */
'LDAP'   => 'Phantomnet\Ldap\Facades\Laravel\Ldap',

```

**Migrations**

```
php artisan migrate --package=phantomnet/ldap

```

**Configuration**

```
php artisan config:publish phantomnet/ldap

```

This will publish **app/config/packages/phantomnet/ldap/config.php** where it can be modified.

Usage
-----

[](#usage)

The goal was to reuse as much existing code as possible without having to create separate authentication controls like session management, so integrating natively into existing auth solution is provided via a bridge.

The following example is the logic behind authenticating with LDAP and should be placed in a controller that handles logins. Please note this is **NOT** a complete example and should only be used as a model!

Using Laravel 4 syntaxing.

```
$credentials = array(
    /* this is the login attribute. See the
     * configuration file for properly changing it */
	'email'    => Input::get('username'),
	'password' => Input::get('password')
);

$remember = (bool)Input::has('remember-me');

try
{
	/* Attempt to authenticate the user with the given credentials */
	LDAP::getAuthProvider()->authenticate($credentials, $remember);

	/* Assuming login worked, we can route to the admin dashboard */
	return Redirect::intended('admin');
}
catch (Phantomnet\Ldap\users\WrongPasswordException $e)
{
	// If we get to this point, just return an error
    return Redirect::route('login') // named route "login"
        ->withInput()
        ->with('error', 'Incorrect username or password.');
}
catch (Phantomnet\Ldap\Users\UserNotFoundException $e)
{
	/* This will cover a wrong password as well */
	try
	{
		/* Assuming we have any targets with on-the-fly creation
		 * allowed we can try to login a new user here and then
		 * redirect them */
		LDAP::onTheFlyCreation($credentials, $remember);

		/* If we made it here .. we found a valid user and
		 * attempted to authenticate them */
		return Redirect::intended('admin');
	}
	catch (Phantomnet\Ldap\Users\UserNotFoundException $e)
	{
		// We do nothing in here
	}

	// If we get to this point, just return an error
    return Redirect::route('login') // named route "login"
        ->withInput()
        ->with('error', 'Incorrect username or password.');
}

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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://avatars.githubusercontent.com/u/1381586?v=4)[Peter Lazaridis](/maintainers/wislem)[@wislem](https://github.com/wislem)

---

Top Contributors

[![wislem](https://avatars.githubusercontent.com/u/1381586?v=4)](https://github.com/wislem "wislem (2 commits)")[![jocorki](https://avatars.githubusercontent.com/u/1518171?v=4)](https://github.com/jocorki "jocorki (1 commits)")

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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