roshangautam/sentinel-ldap

此包的最新版本(dev-master)没有提供许可信息。

dev-master 2016-05-25 13:04 UTC

This package is auto-updated.

Last update: 2024-09-06 16:18:41 UTC


README

Build Status

Sentinel LDAP 是一个 Cartalyst Sentinel 插件,允许您使用 LDAP(Active Directory)对用户进行身份验证。

此包需要 PHP 5.4+,并附带 Laravel 4 Facade 和 Service Provider 以简化可选框架集成,并遵循 FIG 标准 PSR-4,以确保共享 PHP 代码之间的高度互操作性。该包还需要您在服务器上安装 php5-ldap 扩展。

安装

Sentinel LDAP 可以通过 Composer 安装。请按照以下说明操作

  1. 将以下行复制到您的 composer.json "require" 部分。

"roshangautam/sentinel-ldap": "dev-master",

  1. 运行 composer update
  2. 运行 php artisan config:publish roshangautam/sentinel-ldap
  3. 打开 app/config/packages/roshangautam/sentinel-ldap/config.php 并填写参数
  4. 打开 app/config/app.php 并在 providers 数组中包含 'Roshangautam\Sentinel\Addons\Ldap\Laravel\LdapServiceProvider',在 aliases 数组中包含 'LDAP' => 'Roshangautam\Sentinel\Addons\Ldap\Laravel\Facades\Ldap'
  5. 要启用 LDAP 登录,请使用 LDAP::authenticate 而不是 Sentinel::authenticate。

就是这些。祝您玩得开心。

配置参数

'ldap' => [

	'host' => 'ldaps://yourcompany.com:3269', // This is the ldap host  preferable a Global Catalog if you have multiple ldap servers. Also prepend :port if you are using a url instead of hostname (php5-ldap requirement as it will ignore the port parameter while using URL)

	'port' => 389, // port number while using hostname instead of url

	'search_user_dn' => 'CN=Some User,OU=SomeGroup,OU=SomeGroup,DC=yourcompany,DC=com', // search user - ask your ldap adminstrator for this 

	'search_base' => 'DC=yourcompany,DC=com', // usually root of your domain

	'login_attribute' => 'sAMAccountName',  // currently unused

	'search_password' => 'yourpassword', // password for the search user - ask your ldap administrator

],