PHPackages                             tecnical/l5-ldap-auth - 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. tecnical/l5-ldap-auth

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

tecnical/l5-ldap-auth
=====================

Laravel 5 Active Directory LDAP Authentication driver

012PHP

Since Sep 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/tecnical/ldap-auth)[ Packagist](https://packagist.org/packages/tecnical/l5-ldap-auth)[ RSS](/packages/tecnical-l5-ldap-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/1fc791a43da81ded6b61d3bdd0f35e0abf69dd68dc049d282770fc487a2d877e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73747265626c2f6c6461702d617574682e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/strebl/ldap-auth)[![Total Downloads](https://camo.githubusercontent.com/4e7487d02c4fbe56e5ad95ca239e449a39f38ac06e682d68521de45b15f69bcc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73747265626c2f6c352d6c6461702d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/strebl/l5-ldap-auth)[![Latest Stable Version](https://camo.githubusercontent.com/1e33b647813ebf3ec26203ca92019b6f83a3bdfebbd7f6d9899b7ec58dd5ee51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73747265626c2f6c352d6c6461702d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/strebl/l5-ldap-auth)[![License](https://camo.githubusercontent.com/aff668b8b1d91887f0b9feef8cb7d6dbd84ce86c451ee1acd1e07fd39d4f77b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73747265626c2f6c352d6c6461702d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/strebl/l5-ldap-auth)

Fork
====

[](#fork)

This is a fork of strebl/ldap-auth package. That package already has a minimum implementatios to work with Laravel 5.

This fork is to include some itens to be retrieved from AD, and also in the future, implements some more things about AD management.

Active Directory LDAP Authentication
====================================

[](#active-directory-ldap-authentication)

Laravel 5 Active Directory LDAP Authentication driver.

Contribution
------------

[](#contribution)

Just post an issue or create a pull request on this repository. I'll really appreciate it.

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

[](#installation)

Versions
--------

[](#versions)

This will follow releases similar to how Laravel itself manages releases. When Laravel moves to 5.2 this package will move to 2.2, with minor versions signifying bug fixes, etc.

Laravel VersionPackage VersionPackage Status5.1.x~2.1maintaned5.0.x~2.1maintaned5.0.x~2.0abandon4.x~1.0abandonVersion 2.1 requires PHP 5.5+. If you are using Laravel 5.0 which supports PHP 5.4 you can still use ~2.0. However, this version won't get updates.

Laravel 5.1 / 5.0
-----------------

[](#laravel-51--50)

To install this package pull it in through Composer.

```
composer require strebl/l5-ldap-auth:~2.1
```

After Composer is done, you need to tell your application to use the LDAP service provider.

Open `config/app.php` and find

`Illuminate\Auth\AuthServiceProvider::class`

and replace it with

`Ccovey\LdapAuth\LdapAuthServiceProvider::class`

This tells Laravel 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 `config/auth.php` and change driver to `ldap`:

```
    'driver' => 'ldap',

```

Laravel 4
---------

[](#laravel-4)

***The Laravel 4 version of this package is no longer maintained.***

To install this package pull it in through Composer.

```
composer require strebl/l5-ldap-auth:~1.0
```

After Composer is done, you need to tell your application to use the LDAP service provider.

Open `config/app.php` and find

`Illuminate\Auth\AuthServiceProvider`

and replace it with

`Ccovey\LdapAuth\LdapAuthServiceProvider`

This tells Laravel 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 `config/auth.php` and change driver to `ldap`

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

[](#configuration)

To specify the username field to be used in `app/config/auth.php` set a key / value pair `'username_field' => 'fieldname'` This will default to `username` if you don't provide one.

To set up your adLDAP for connections to your domain controller, create a file app/config/adldap.php This will provide all the configuration values for your connection. For all configuration options an array like the one below should be provided.

It is important to note that the only required options are `account_suffix`, `base_dn`, and `domain_controllers`The others provide either security or more information. If you don't want to use the others simply delete them.

```
return [
	'account_suffix' => "@domain.local",

	'domain_controllers' => array("dc1.domain.local", "dc2.domain.local"), // An array of domains may be provided for load balancing.

	'base_dn' => 'DC=domain,DC=local',

	'admin_username' => 'user',

	'admin_password' => 'password',

	'real_primary_group' => true, // Returns the primary group (an educated guess).

	'use_ssl' => true, // If TLS is true this MUST be false.

	'use_tls' => false, // If SSL is true this MUST be false.

	'recursive_groups' => true,
];
```

Usage
=====

[](#usage)

$guarded is now defaulted to all so to use a model you must change to `$guarded = []`. If you store Roles or similar sensitive information make sure that you add that to the guarded array.

Use of `Auth` is the same as with the default service provider.

By Default this will have the `username (samaccountname)`, `displayname`, `primary group`, as well as all groups user is a part of

To edit what is returned you can specify in `config/auth.php` under the `fields` key.

For more information on what fields from AD are available to you visit

You may also get a complete user list for a specific OU by defining the `userList` key and setting it to `true`. You must also set the `group` key that defined which OU to look at. Do not that on a large AD this may slow down the application.

Model Usage
===========

[](#model-usage)

You can still use a model with this implementation as well if you want. ldap-auth will take your fields from ldap and attach them to the model allowing you to access things such as roles / permissions from the model if the account is valid in Active Directory. It is also important to note that no authentication takes place off of the model. All authentication is done from Active Directory and if they are removed from AD but still in a users table they WILL NOT be able to log in.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

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/f9cbaa25dff145cff3892ad8cb3b55f2f665c322be8e68d27a4c01e3200216ca?d=identicon)[tecnical](/maintainers/tecnical)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tecnical-l5-ldap-auth/health.svg)

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

###  Alternatives

[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)[illuminate/auth

The Illuminate Auth package.

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

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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