tounaf/ldap-bundle

symfony应用的ldap连接提供程序

安装: 9

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 0

分支: 2

公开问题: 1

类型:symfony-bundle

v1.2.6 2023-11-29 10:37 UTC

This package is auto-updated.

Last update: 2024-09-29 12:16:40 UTC


README

此包的用途

此包的目标是尽可能轻松地集成symfony提供的登录功能。它将symfony ldap文档中提供的所有步骤替换为你的设置。你只需要设置你的ldap服务器参数。

安装

composer require tounaf/ldap-bundle

示例配置

tounaf_ldap:
    connection:
      host: "ldap.example.com"
      port: 389
      encryption: none # possible value tls/ssl/none, default is none
      options:
          protocol_version: 3
          referrals: false
    providers:
        pulse_ldap_provider:
            ldap:
                base_dn: "OU=Admin,DC=in,DC=com"
                search_dn: "CN=user-service,OU=Service accounts,OU=Admin,DC=in,DC=com"
                search_password: "password"
                extra_fields: ['mail']
    form_login_ldap:
        dn_string: 'DOMAIN\{username}' # or {username}
        login_path: app_login
        check_path: app_login
        default_target_path: app_kama

完整配置参考

tounaf_ldap:
    connection:
        # Ldap host
        host:                 ~ # Required
        # The port used by ldap
        port:                 '389' # Required
        # the encryption method: none/tls/ssl
        encryption:           none
        options:
            # Verstion of protocole
            protocol_version:     '3'
            # Verstion of protocole
            referrals:            false
    providers:
        # Prototype
        name:
            ldap:
                service:              Symfony\Component\Ldap\Ldap
                base_dn:              ~ # Required, Example: 'OU=Utilisateurs,DC=makeitpulse,DC=in,DC=axian-group,DC=com'
                search_dn:            ~ # Required, Example: 'CN=ogc-ass,OU=Service accounts,OU=Administrations,DC=ass,DC=in,DC=axian-group,DC=com'
                search_password:      null # Required, Example: your_favorit_password
                default_roles:        ROLE_USER # Required, Example: ROLE_USER
                uid_key:              sAMAccountName # Example: sAMAccountName
                extra_fields:         []
    form_login_ldap:
        # ds_string can be: DOMAIN\{username} or like just {username}
        dn_string:            '{username}' # Required, Example: 
        # route to login user
        login_path:           app_login
        # route to process login
        check_path:           app_login
        # route to redirect user when login success
        default_target_path:  ~