Download the PHP package l3/ldap-user-bundle without Composer
On this page you can find all versions of the php package l3/ldap-user-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download l3/ldap-user-bundle
More information about l3/ldap-user-bundle
Files in l3/ldap-user-bundle
Package ldap-user-bundle
Short Description User Provider from LDAP (branch ou=people)
License LGPL-3.0-or-later
Homepage https://github.com/l3-team/LdapUserBundle
Informations about the package ldap-user-bundle
Symfony 2/3/4/5/6/7 User provider from LDAP
(author : Universite Lille)
Allow use LDAP like user provider and security in application written in Symfony2/3/4/5/6
Installation of the Bundle.
Install the Bundle with this command :
Launch the command composer update to install the package
For Symfony 2 and 3 : add the Bundle in AppKernel.php
For Symfony 4 and 5 and 6 and 7 : Verify if the lines are present in config/bundles.php file (if not present, just add the lines) :
Configuration of the bundle
For Symfony 2 and Symfony 3 : in the configuration file app/config/parameters.yml.dist and app/config/parameters.yml, add this under parameters:
and configure the values in parameters.yml file.
next in the configuration file app/config/config.yml, add this lines at the end of the file :
(optional) you can affect automatically a specific role to a user if the user got the ldap group in his memberOf ldap field. add this at the end of the file app/config/config.yml :
And configure the firewall in order to use the user provider of this Bundle :
For Symfony 4 and 5 and 6 and 7 : in the configuration file .env.local and .env, add this :
and configure the values in the file .env.local
next add this lines in the config/services.yaml file (under parameters) :
next in the configuration file config/services.yaml, add this lines at the end of the file :
(optional) you can affect automatically a specific role to a user if the user got the ldap group in his memberOf ldap field. add this at the end of the file config/services.yaml :
And configure the firewall in order to user the user provider of this Bundle :
For Symfony 6 :
and specify ldap_user_provider for the keys provider for your firewalls in security.yaml file
Twig page for control if the user is present in the ldap group of the ROLE_USER
you can show a page twig if the user is not present in the ldap group of the ROLE_USER, just create the file app/Resources/TwigBundle/views/Exception/error.html.twig and add this :
ORM LDAP functions
You can make custom ORM LDAP Entity through Doctrine ORM. Just create your Entity like this Entity People in your application Bundle :
- Dn : Use this annotation to build the dn with twig syntax
- Entity : Use this annotation to attribute to a php entity class an ldapObjectClass
- Column : Use this annotation to type the variable php
- Index : Use this annotation to set the index of the Entity
and in your Controller, you can read the LDAP with call your Entity like this :
For Symfony 7 :
for write the LDAP, call your Entity like this :
For symfony 7 :
Annotations
The Route annotations run if you install this package :
All versions of ldap-user-bundle with dependencies
symfony/http-foundation Version ~7.0
symfony/security-bundle Version ~7.0
symfony/routing Version ~7.0
symfony/framework-bundle Version ~7.0
openldapobject/ldapobjectbundle Version 1.1.5