dixonscarphoneplc / ldap
This package is abandoned and no longer maintained.
The author suggests using the bkno/ldap package instead.
LDAP authentication class
2.1
2019-03-09 08:40 UTC
Requires
- php: ^7.1
- laravel/framework: ~5.5
This package is not auto-updated.
Last update: 2019-07-23 09:41:22 UTC
README
A simple LDAP plugin built for Laravel. Use company-wide Active Directory sign-on for your application.
Installation
Install with composer:
composer require bkno/ldap
Generate config file:
php artisan vendor:publish
The above creates the config file config/ldap.php
this file contains settings that you will need about your LDAP instance before proceding.
If your company has multiple LDAP endpoints you can list multiple and all will be checked.
Basic usage
Register the Service Provider and Class Alias inside config/app.php
'providers' => [
Dixonscarphoneplc\Ldap\LdapServiceProvider::class,
]
'aliases' => [
'Ldap' => Dixonscarphoneplc\Ldap\LdapInterface::class,
]
Use the package into your AuthController
as below.
use Dixonscarphoneplc\Ldap;
Then call as needed:
class AuthController extends Controller
{
public function auth(Request $request) {
$credentials = $request->only('username', 'password');
$ldap = new Ldap();
$attempt = $ldap->attempt($credentials);
}
}