PHP code example of t3chn0crat / laravel-ldap-connector
1. Go to this page and download the library: Download t3chn0crat/laravel-ldap-connector library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
t3chn0crat / laravel-ldap-connector example snippets
'driver' => 'ldap',
public function getAuthIdentifier()
{
if (isset($this->ldap)) {
return $this->ldap->samaccountname;
}
}
return [
'account_suffix'=> "@domain.local",
// Load balancing domain controllers, but only one is requried
'domain_controllers'=> [
"192.168.0.1",
"dc02.domain.local"
],
'base_dn' => 'DC=domain,DC=local',
// AD attributes to get http://msdn.microsoft.com/en-us/library/windows/desktop/ms675090%28v=vs.85%29.aspx
'fields' => [
'company',
'department',
'displayname',
'homephone',
'mail',
'memberof',
'mobile',
'primarygroupid',
'samaccountname',
'telephonenumber',
'title',
]
];