承接 con4gis/ldap 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

con4gis/ldap

Composer 安装命令:

composer require con4gis/ldap

包简介

Authentication bundle with functionality needed for using external authentications for Contao Back-/Frontend

README 文档

README

Important

We are not actively developing this con4gis module. Further development orders are possible.

This bundle adds LDAP functionality for Contao backend and frontend users/groups.

Requirements

For everything to work you need to install and activate the PHP extension "php-ldap". Without it you can not install and use this Bundle Beside that you need at least the Contao Version 4.9.

Installation

Step 1: Install the bundle

You can install the bundle using composer or the contao manager. For composer use the following command:

$ composer require con4gis/ldap

In the contao manager, you can find the bundle under "con4gis/ldap".

Step 2: Configure the bundle

After the installationy you need to add the files "security.yml" and "services.yml" to your config folder in the root folder of your installation. If the file "config.yml" doesn't exist create it too. Then you need to add the following configurations to these files:

services.yml:

services:
    Symfony\Component\Ldap\Ldap:
        arguments: ['@Symfony\Component\Ldap\Adapter\ExtLdap\Adapter']
    Symfony\Component\Ldap\Adapter\ExtLdap\Adapter:
        arguments:
            -   host: ad.yourldapserver.com
                port: 389
                encryption: tls
                options:
                    protocol_version: 3
                    referrals: false

In the services.yml you need to change the host to where your LDAP server is available. If you don't use the standard port change it here to (SSL is normally port 636). For the encryption, you can choose between "none" (not recommended), "ssl" and "tls".

security.yml:

security:
    providers:
        con4gis_ldap:
            ldap:
                service: Symfony\Component\Ldap\Ldap
                base_dn: 'dc=ad,dc=yourldapserver,dc=com'
                search_dn: 'cn=Administrator,cn=Users,dc=ad,dc=yourldapserver,dc=com'
                search_password: '*Password*'
                default_roles: ROLE_USER
                uid_key: uid
                filter: '(objectClass=user)'

        chain_provider_backend:
            chain:
                provider: [contao.security.backend_user_provider, con4gis_ldap]

        chain_provider_frontend:
            chain:
                provider: [contao.security.frontend_user_provider, con4gis_ldap]        

    firewalls:  
        contao_backend:
            provider: chain_provider_backend
            form_login_ldap:
                service: Symfony\Component\Ldap\Ldap
                dn_string: 'uid={username},ou=Users,dc=ad,dc=yourldapserver,dc=com'

        contao_frontend:
            provider: chain_provider_frontend     
            form_login_ldap:
                service: Symfony\Component\Ldap\Ldap
                dn_string: 'uid={username},ou=Users,dc=ad,dc=yourldapserver,dc=com'

In this configuration file, you need to change a few things. These include the "base_dn", "search_dn", "search_password", "uid_key", "filter" and both "dn_string" at ""contao_backend" and "contao_frontend".

The uid_key needs to contain the attribute which contains the username. Normally it's "uid" or "sAMAccountName" (for Windows AD). You can filter which user can log in with the "filter". This is completely optional. If you don't want this delete the line.

The dn_string can contain two placeholders: "{username}" and "{uid_key}". These placeholders will be replaced with the username of the login request respectively the uid_key you set up earlier.

config.yml:

imports:
    - { resource: security.yml }
    - { resource: services.yml }

Here you need to import the newly created files.

After these changes, you need to clear the Symfony cache for everything to work.

Step 3: Configure the groups

Now you can login to the Backend and configure everything else from there. You can import user and member groups from your LDAP server and select an admin group.

con4gis/ldap 适用场景与选型建议

con4gis/ldap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 271 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 06 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Authentication」 「ldap」 「active directory」 「contao」 「con4gis」 「con4gis_auth」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 con4gis/ldap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 con4gis/ldap 我们能提供哪些服务?
定制开发 / 二次开发

基于 con4gis/ldap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 271
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 5
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2020-06-05