2017 © Pedro Peláez
 

yii2-extension ldap

Authorize, search users, get user groups and other from LDAP

image

kosoukhov/ldap

Authorize, search users, get user groups and other from LDAP

  • Wednesday, March 7, 2018
  • by kosoukhov
  • Repository
  • 2 Watchers
  • 2 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 157 % Grown

The README.md

Yii2 extension for LDAP

Authorize, search users, get user groups and other from LDAP, (*1)

Yii2 Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist kosoukhov/ldap

or add, (*5)

"kosoukhov/ldap": "*"

to the require section of your composer.json file., (*6)

Application configuration example:

In config/main.php add:, (*7)

return [
    'components' => [
        'ldap' => [
            'class' => 'kosoukhov\ldap\Connector',
            'useCache' => YII_ENV_DEV ? false : true,
        ],
    ],
    // ...
];

In config/main-local.php add:, (*8)

return [
    'components' => [
        'ldap' => [
            'host' => 'ldap.example.com',
            'port' => '389',
            'baseDN' => 'OU=...,DC=...,DC=...,DC=net',
            'userDN' => '@....corp.net',
            'groupDN' => '',
            //Input your AD login/pass on dev or sys login/pass on test/prod servers
            'sysUserLogin' => '',
            'sysUserPassword' => '',
        ],
    ],
    // ...
];

Usage example:

if (!Yii::$app->ldap->validateUserCredentials('SAMAccountName', 'password')) {
    throw new ErrorException('Incorrect username or password.');
}
echo Yii::$app->ldap->getUserAttributesBySAMAccountName('SAMAccountName', ['mail', 'sn', 'givenname', 'middlename']);
echo kosoukhov\ldap\widgets\UserImage::widget([
    'login' => Yii::$app->user->identity->username,
    'options' => [
        'class' => 'img-circle',
        'alt' => 'User Image',
    ]
]);

The Versions

07/03 2018

dev-master

9999999-dev

Authorize, search users, get user groups and other from LDAP

  Sources   Download

MIT

The Requires

 

by Vadim Kosoukhov

authentication authorization extension yii2 ldap user-management yii2-extension active-directory ldap-authentication

07/03 2018

1.0.0

1.0.0.0

Authorize, search users, get user groups and other from LDAP

  Sources   Download

MIT

The Requires

 

by Vadim Kosoukhov

extension yii2 ldap