Giter Site home page Giter Site logo

pimcore-ldap-bundle's Introduction

CircleCI License Total Downloads Latest Stable Version Latest Unstable Version

LDAP bundle for Pimcore

Enables LDAP authentication to the Pimcore's admin UI.

If a user already exists in Pimcore (and is not in the list of the excluded users) it will be automatically updated with the informations coming from LDAP. If not a new user will be created automatically.

Requirements

Pimcore >= 5.1.0

Installation

  1. Install the bundle using composer composer require blackbit_digital_commerce/pimcore-ldap.
  2. Open Pimcore Admin UI, navigate to Tools > Extensions and activate the bundle.

Configuration

  1. Configure the Symfony LDAP client (see http://symfony.com/doc/current/security/ldap.html#configuring-the-ldap-client).
    # config/services.yaml
    services:
        Symfony\Component\Ldap\Ldap:
            arguments: ['@Symfony\Component\Ldap\Adapter\ExtLdap\Adapter']
        Symfony\Component\Ldap\Adapter\ExtLdap\Adapter:
            arguments:
                -   host: my-server
                    port: 389
                    encryption: tls
                    options:
                        protocol_version: 3
                        referrals: false
  1. Configure the LDAP bundle.
    # config/config.yaml
    alep_ldap:
      enabled: true
      base_dn: "dc=example,dc=com"

Supported options

  • enabled: Enables LDAP authentication (default: false).
  • service: LDAP client to use (required, default: Symfony\Component\Ldap\Ldap).
  • base_dn: Base DN for the directory (required, example: dc=example,dc=com).
  • search_dn: Read-only user's DN, which will be used to authenticate against the LDAP server in order to fetch the user's information (example: cn=your_search_dn_user,ou=users,dc=example,dc=com).
  • search_password: Read-only user's password, which will be used to authenticate against the LDAP server in order to fetch the user's information (example: your_search_dn_user_password).
  • uid_key: Entry's key to use as its UID. Depends on your LDAP server implementation (required, default: sAMAccountName).
  • filter: It lets you configure which LDAP query will be used. The {uid_key} string will be replaced by the value of the uid_key configuration value (by default, sAMAccountName), and the {username} string will be replaced by the username you are trying to load (required, default: ({uid_key}={username})).
  • exclude: [DEPRECATED] List of Pimcore's usernames to exclude from LDAP authentication (example: ['admin']). If already configured the values will be merged to exclude_rules.users configuration.
  • exclude_rules: List of rules which determine if a user has to be excluded from LDAP authentication (it supports regular expressions, see below).
    • users: List of usernames or regular expressions matching usernames (or user full paths if the user already exists) to exclude from LDAP authentication (example: ['admin', '/^noldap.*/i'] to exclude the user admin and all users with a username starting with noldap like noldap_alep).
    • roles: List of roles or regular expressions matching role names to exclude from LDAP authentication (example: ['ROLE_PIMCORE_ADMIN', '/^ROLE_NOLDAP.*/i'] to exclude the users with ROLE_PIMCORE_ADMIN assigned and all users with a role starting with ROLE_NOLDAP like ROLE_NOLDAP_USERS).
  • default_roles: List of Pimcore's roles you wish to give to a user fetched from the LDAP server (example: ['ROLE_LDAP_USERS']). All the configured default roles needs to be already present in Pimcore.
  • mapper: Data mapper service used to map ldap user data to Pimcore user (required, default: Alep\LdapBundle\DataMapper\DefaultLdapUserMapper). See Custom data mapper to build your own data mapper.
  • logger: Logger service used by the bundle (example: monolog.logger).

Custom data mapper

To build your own custom data mapper you just have to create a class which implements the LdapUserMapperInterface. You can use DefaultLdapUserMapper as an example. The DefaultLdapUserMapper is the default data mapper used by the bundle and it maps the following ldap attributes to the Pimcore user:

  • username -> Username
  • password -> Password (encoded using Pimcore's internal functions)
  • givenName -> Firstname
  • sn -> Lastname
  • mail -> Email

pimcore-ldap-bundle's People

Contributors

alexpozzi avatar blackbitdevs avatar ctippler avatar dpfahlbusch avatar palazzetti avatar se7en-it avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.