riper/security-active_directory
Composer 安装命令:
composer require riper/security-active_directory
包简介
This is a bundle to allow authentication into symfony >= 2.6 by an Active directory
README 文档
README
This package is a bundle for Symfony. It uses the standard form_login security model to authenticate user from an Active Directory domain. It uses LDAP as communication layer, so you need the LDAP extension installed on your server to make it work.
Requirements
php 5.3.0
php_ldap
ssl configuration for LDAP. see http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
Compatible with Symfony starting from 2.6
Installation
You need to add a package to your dependency list :
// composer.json
"riper/security-active_directory": "2.*"
You need to enable the bundle into your kernel
// app/AppKernel.php
new Riper\Security\ActiveDirectoryBundle\RiperActiveDirectoryBundle(),
You need to configure your domain specific information
// app/config/config.yml or app/config/parameters.yml
parameters:
riper.security.active_directory.settings:
account_suffix : riper.fr # without the @ at the beginning
base_dn : DC=RIPER,DC=FR #The DN of the domain
domain_controllers : [ baudrive.kim.riper.fr ] #Servers to use for ldap connection (Random)
admin_username: #Null to use the userConnection
admin_password: #Null to use the userConnection
keep_password_in_token: false #Set to true if you want to re-use the adldap instance to make further queries (This is a security issue because the password is kept in session)
real_primarygroup : true #For Linux compatibility.
use_ssl : false #Set it true need configuration of the server to be useful
use_tls : false #Set it true need configuration of the server to be useful
recursive_grouproles: false #recursive group roles
username_validation_pattern: /^[a-z0-9-.]+$/i #Regex that check the final username value (extracted from patterns below). Must be compliant with your Active Directory username policy.
username_patterns: #username is extracted from the string the user put into the login form
- /([^@]*)@riper.fr/i # like toto@riper.fr
- /RIPER\\(.*)/i #like RIPER\toto
- /RIPER.FR\\(.*)/i #like RIEPER.FR\toto
- /(.*)/i #like toto
You need to add security parameters
// app/config/security.yml
encoders:
Riper\Security\ActiveDirectoryBundle\Security\User\AdUser : plaintext #Active directory does not support encrypted password yet
providers:
my_active_directory_provider :
id: riper.security.active.directory.user.provider
firewalls:
secured_area:
active_directory: #Replace the 'form_login' line with this
check_path: /demo/secured/login_check
login_path: /demo/secured/login
Useful information
Roles are got from Active directory. The name is transformed to match the ROLE system of Symfony2
Domain User => ROLE_DOMAIN_USER
Administrators => ROLE_ADMINISTRATORS
Nested Groups are not supported yet. Enabling the option wont affect the Role check.
SSL part of the lib isn't used yet and haven't been tested with Symfony
riper/security-active_directory 适用场景与选型建议
riper/security-active_directory 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.74k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2015 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「bundle」 「ldap」 「active directory」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 riper/security-active_directory 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 riper/security-active_directory 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 riper/security-active_directory 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
LDAP user provider bundle for Symfony 6.4
Provide a way to secure accesses to all routes of an symfony application.
DMS Meetup API Bundle, enables Meetup API clients in services
Bundle Symfony DaplosBundle
统计信息
- 总下载量: 3.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: CC-BY-4.0
- 更新时间: 2015-09-16