Download the PHP package t3chn0crat/laravel-ldap-connector without Composer
On this page you can find all versions of the php package t3chn0crat/laravel-ldap-connector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download t3chn0crat/laravel-ldap-connector
More information about t3chn0crat/laravel-ldap-connector
Files in t3chn0crat/laravel-ldap-connector
Package laravel-ldap-connector
Short Description Authenticate with and fecth data from LDAP in Laravel
License MIT
Homepage https://github.com/t3chn0crat/laravel-ldap-connector
Informations about the package laravel-ldap-connector
Package
This package is a fork of dsdevbe's package (https://github.com/dsdevbe/ldap-connector).
This package will allow you to authenticate to and fetch data from LDAP using Laravel 5.0.x.
It uses adLDAP library to create a bridge between Laravel and LDAP. adLDAP requires PHP 5 and both the LDAP and SSL libraries
Installation
-
Install this package through Composer for Laravel v5.0:
-
Change the authentication driver in the Laravel config to use the ldap driver. You can find this in the following file
config/auth.php -
The
config/auth.phpmust also have a valid model set. That model must include -
Create a new configuration file
ldap.phpin the configuration folder of Laravelapp/config/ldap.phpand modify to your needs. For more detail of the configuration you can always check on adLDAP documentationAll of these are required
- Once this is done you arrived at the final step and you will need to add a service provider. Open
config/app.php, and add a new item to the providers array.
Usage
Authentication
The LDAP plugin is an extension of the AUTH class and will act the same as normal usage with Eloquent driver.
You can find more examples on Laravel Auth Documentation on using the Auth:: function.
Getting LDAP fields
All the LDAP fields are stored in the Auth::user()->ldap object as public properties.
LdapUserObject Methods
- isMemberOf($group)
Will test a user to see if they are a member of the passed in group. Returns a bool
Getting all users
You can use the LdapService object and getAllUsersWithFields to return a Laravel Collection of LdapUserObjects.
You can now apply all the collection function to it. The results will be a collection of LdapUserObjects