PHPackages                             wells/l4-ldap-ntlm - 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. wells/l4-ldap-ntlm

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

wells/l4-ldap-ntlm
==================

An LDAP/Active Directory/NTLM authentication driver for Laravel 4.

253.9k12[1 issues](https://github.com/wells/l4-ldap-ntlm/issues)PHP

Since Dec 16Pushed 9y ago3 watchersCompare

[ Source](https://github.com/wells/l4-ldap-ntlm)[ Packagist](https://packagist.org/packages/wells/l4-ldap-ntlm)[ RSS](/packages/wells-l4-ldap-ntlm/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

l4-ldap-ntlm
============

[](#l4-ldap-ntlm)

An LDAP/Active Directory/NTLM authentication driver for Laravel 4.

This package will enable you to have basic authentication with a config-based ACL for admin and viewers of any auth based portion of a Laravel 4 based site. In addition, the package is capable of tying into Apache based NTLM authentication. You will need to install and configure both `php5-ldap` and `libapache2-mod-auth-ntlm-winbind` for Apache2 (Visit  for a tutorial). If it is not installed, the package should still operate.

Installation
============

[](#installation)

To install this in your application add the following to your `composer.json` file

```
require {
	"wells/l4-ldap-ntlm": "dev-master"
}
```

Then run `composer install` or `composer update` as appropriate

Once you have finished downloading the package from Packagist.org you need to tell your Application to use the LDAP service provider.

Open `app/config/app.php` and add:

`Wells\L4LdapNtlm\L4LdapNtlmServiceProvider`

This tells Laravel 4 to use the service provider from the vendor folder.

You also need to direct Auth to use the ldap driver instead of Eloquent or Database.

Edit `app/config/auth.php` and change driver to `ldap`

Configuration
=============

[](#configuration)

Add the following config into your `app/config/auth.php` file

```
/**
 * LDAP Configuration for wells/l4-ldap-ntlm
 */
'ldap' => array(
	// Domain controller (host), Domain to search (domain),
	// OU containing users (basedn), OU containing groups (groupdn)
	'host' => 'ldap://dc', // You can also use ldaps://
	'domain' => 'domain.com',
	'timeout' => 3, // Timeout in seconds (It is optional, if you don´t select it is used the default value)
	'basedn' => 'OU=Users,DC=domain,DC=com',
	'groupdn' => 'OU=Groups,DC=domain,DC=com',

	// Domain credentials the app should use to access DC
	// This user doesn't need any privileges
	'dn_user' => '*',
	'dn_pass' => '*',

	//At minimum, you'll need these attributes
	'attributes' => array(
		'dn',
		'samaccountname',
		'memberof'
	),

	// Optionally require groups to gain auth view access
	'groups' => array('AuthViewers'),

	// Optionally require group admins
	'admin_groups' => array('IT'),

	// Optionally require owners/admins (username)
	'owners' => array('ceo'),
),
```

Usage
=====

[](#usage)

In addition to the default Auth functionality, You can enable NTLM authentication with the auto() method from provided Guard class. Edit `app/config/filters.php` and change to:

```
Route::filter('auth', function()
{
	// !Auth::user() checks to see if the user has access permission
	if (!Auth::auto() || Auth::guest()) return Redirect::guest('login');
});
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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/5f00f32eaa61517c4ec4ce484936b8a89e8a7dfbc925d6bf66d557dd7d7ad09a?d=identicon)[wells](/maintainers/wells)

---

Top Contributors

[![wells](https://avatars.githubusercontent.com/u/2041871?v=4)](https://github.com/wells "wells (4 commits)")

### Embed Badge

![Health badge](/badges/wells-l4-ldap-ntlm/health.svg)

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

###  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)
