Synchronizing information with LDAP and authenticating users by membership in the LDAP security group
Synchronizing information with LDAP and authenticating users by membership in the LDAP security group
kerberos
;Employee
and Department
;composer require anklimsk/cakephp-ldap-sync
Add the next line to the end of the file app/Config/bootstrap.php
:
CakePlugin::load('CakeLdap', ['bootstrap' => true, 'routes' => true]);
Open file app/Config/database.php
and add connection ldap
, e.g.:
public $ldap = [
'datasource' => 'CakeLdap.LdapExtSource',
'persistent' => false,
'host' => ['ldapsrv01', 'ldapsrv02'],
'port' => 389,
'login' => 'user@fabrikam.com',
'password' => 'pas$w0rd',
'database' => '',
'basedn' => 'dc=fabrikam,dc=com',
'type' => 'ActiveDirectory',
'tls' => false,
'version' => 3,
];
app/Plugin/CakeLdap/Config/cakeldap.php
to app/Config
.Example of configuration file
Console/cake schema create -p CakeLdap
app\Config\core.php
uncomment modify next line: Configure::write('Routing.prefixes', array('admin'));
app/Plugin/CakeLdap/Locale/rus/LC_MESSAGES/
to
app/Locale/rus/LC_MESSAGES
:
cake_ldap_field_name.*
;cake_ldap_validation_errors.*
.ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1
.crontab -u www-data -e
where
www-data
- user name for web server. #
# In this example, run the synchronizing script
# will be made every day on 7:10 AM
10 7 * * * cd /var/www/paht_to_app/app && Console/cake CakeLdap.cron sync -q