chrmorandi/yii2-ldap
最新稳定版本:v1.1.1
Composer 安装命令:
composer require chrmorandi/yii2-ldap
包简介
Ldap
README 文档
README
This extension provides the LDAP integration for the Yii framework 2.0. It includes basic querying/search support and also implements the ActiveRecord pattern that allows you to store active records in Active Directory or OpenLDAP.
Requirements
To use yii2-ldap, your sever must support:
PHP LDAP Extension
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist chrmorandi/yii2-ldap
or add
"chrmorandi/yii2-ldap": "*"
to the require section of your composer.json.
Configuration
return [ //.... 'components' => [ 'ldap' => [ 'class' => 'chrmorandi\ldap\Connection', // Mandatory Configuration Options 'dc' => [ '192.168.1.1', 'ad.com' ], 'baseDn' => 'dc=ad,dc=com', 'username' => 'administrator@ad.com', 'password' => 'password', // Optional Configuration Options 'port' => 389, 'followReferrals' => false, 'useTLS' => true, // Change pageSize (e.g. to 1000) if you are getting the following message // with large result sets: // ldap_search(): Partial search results returned: Sizelimit exceeded 'pageSize' => -1, ], ] ];
Authenticating Users
To authenticate users using your AD server, call the Yii::$app->ldap->auth()
method on your provider:
try { if (Yii::$app->ldap->auth($this->username, $password)) { // Credentials were correct. } else { // Credentials were incorrect. } } catch (Exception $e) { // error }
统计信息
- 总下载量: 52.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-21