2017 © Pedro Peláez
 

library l5-ldap-auth

Laravel 5 Active Directory LDAP Authentication driver

image

fzhan/l5-ldap-auth

Laravel 5 Active Directory LDAP Authentication driver

  • Thursday, July 2, 2015
  • by fzhan
  • Repository
  • 2 Watchers
  • 1 Stars
  • 65 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 46 Forks
  • 0 Open issues
  • 15 Versions
  • 3 % Grown

The README.md

Active Directory LDAP Authentication

Laravel 5 Active Directory LDAP Authentication driver., (*1)

Fork

This is a fork of Cody Covey's ldap-auth package. Unfortunately he doesn't develeped the package recently and didn't update the package to Laravel 4.1+ or even Laravel 5. Therefore I decided to fork the package to provide a minimal Laravel 5 support., (*2)

The first release, 2.0, isn't well tested. Just be careful!, (*3)

Contribution

Just post an issue or create a pull request on this repository. I'll really appreciate it., (*4)

Installation

Laravel 5

This will follow releases similar to how Laravel itself manages releases. When Laravel moves to 5.1 this package will move to 2.1, with minor versions signifying bug fixes, etc. To install this package add the following to your composer.json, (*5)

require {
    "strebl/l5-ldap-auth": "~2.0",
}

Then run, (*6)

composer install or composer update as appropriate, (*7)

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

Open config/app.php and find, (*9)

Illuminate\Auth\AuthServiceProvider, (*10)

and replace it with, (*11)

Ccovey\LdapAuth\LdapAuthServiceProvider, (*12)

This tells Laravel 4 to use the service provider from the vendor folder., (*13)

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, (*14)

Laravel 4

The Laravel 4 version of this package is no longer developed., (*15)

To install this package add the following to your composer.json, (*16)

require {
    "strebl/l5-ldap-auth": "~1.0",
}

Then run, (*17)

composer install or composer update as appropriate, (*18)

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

Open config/app.php and find, (*20)

Illuminate\Auth\AuthServiceProvider, (*21)

and replace it with, (*22)

Ccovey\LdapAuth\LdapAuthServiceProvider, (*23)

This tells Laravel 4 to use the service provider from the vendor folder., (*24)

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, (*25)

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., (*26)

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., (*27)

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

return array(
    '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

$guarded is now defaulted to all so to use a model you must change to $guarded = array(). If you store Roles or similar sensitive information make sure that you add that to the guarded array., (*29)

Use of Auth is the same as with the default service provider., (*30)

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

To edit what is returned you can specify in config/auth.php under the fields key., (*32)

For more information on what fields from AD are available to you visit http://goo.gl/6jL4V, (*33)

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., (*34)

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., (*35)

The Versions

02/07 2015

dev-master

9999999-dev

Laravel 5 Active Directory LDAP Authentication driver

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey
by Zhan Chih-Yuan

laravel authentication ldap laravel 5 l5

25/05 2015

dev-develop

dev-develop

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

05/02 2015

v2.0

2.0.0.0

Laravel 5 Active Directory LDAP Authentication driver

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication ldap laravel 5 l5

26/06 2014

dev-patch-1

dev-patch-1

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4 laravel 4.2 laravel 4.1

19/04 2014

v1.1.5

1.1.5.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

02/02 2014

v1.1.4

1.1.4.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

02/02 2014

v1.1.3

1.1.3.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

02/02 2014

v1.1.2

1.1.2.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

17/12 2013

v1.1.1

1.1.1.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

17/12 2013

v1.1.0

1.1.0.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

20/10 2013

v1.0.3

1.0.3.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

20/10 2013

v1.0.4

1.0.4.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

17/09 2013

v1.0.2

1.0.2.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

17/09 2013

1.0.1

1.0.1.0

  Sources   Download

The Requires

 

The Development Requires

by Cody Covey

laravel authentication laravel 4 ldap l4

03/07 2013