mccwebdev / bat008.yii2-ldap-nwu
Yii 2 Ldap Extension for Northwestern University
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/mccwebdev/bat008.yii2-ldap-nwu
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-12-21 00:43:51 UTC
README
Yii 2 Ldap Extension for Northwestern University
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist mccwebdev/bat008.yii2-ldap-nwu "*"
or add
"mccwebdev/bat008.yii2-ldap-nwu": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, configure the component:
'ldap' => [
'class' => '\mccwebdev\ldap\Ldap',
'connectionHostname' => '========',
'connectionPort' => '========',
'serviceDistinguishedName' => '========',
'servicePassword' => '========',
'searchBaseDistinguishedName' => '========',
'searchParameters' => [
'uid' => 'username',
],
'requestedAttributes' => [
'name' => [
'id' => 'displayname',
'type' => 'single',
],
'emailAddress' => [
'id' => 'mail',
'type' => 'single',
],
'schoolAffiliations' => [
'id' => 'nuschoolaffiliations',
'type' => 'multiple',
],
],
],
Finally, use the component wherever you need to find or authenticate an account.
$isUser = Yii::$app->ldap->findUser( );
$isAuthenticated = Yii::$app->ldap->authenticateUser( );
You can get any additional attributes that were added to the configuration as an array using the following method after finding or authenticating an account.
$userAttributes = Yii::$app->ldap->getUserAttributes( );