You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2020-08-31 10:51:11

r0se
Member
Registered: 2020-08-31
Posts: 5

Import users from LDAP

Hello,
I have the problem with import users from LDAP.

My ldap configuration:

GLPI

Connection test to LDAP server is successful

I've tried many search filter configuration, but GLPI don't find any users to import.

•    (&(objectClass=person)(objectClass=user))
•    (&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
•    (&(objectClass=user)(objectClass=top)(objectClass=person))


Interestingly, GLPI can import groups from LDAP
201.png

---------------------------------------------------------------
GLPI:
GLPI 9.5.1
SQL Server version: 8.0.20
PHP Version : 7.4.3
Description:    Ubuntu 20.04 LTS

Last edited by r0se (2020-08-31 10:53:28)

Offline

#2 2020-08-31 11:07:58

Kaya84
Member
Registered: 2019-06-13
Posts: 217

Re: Import users from LDAP

Try the same query with an ldap tool (like ldapxplorer) and check if it returns some values.
My connection filter is
(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
and it work.

Offline

#3 2020-08-31 12:08:38

r0se
Member
Registered: 2020-08-31
Posts: 5

Re: Import users from LDAP

I used the query
(& (objectClass = user) (objectCategory = person) (! (userAccountControl: 1.2.840.113556.1.4.803: = 2)))
in Softerra LDAP and the program correctly displays the users list

501.png

Offline

#4 2020-08-31 13:32:48

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: Import users from LDAP

I read that "Connection test to LDAP server is successful" but I'm not sure connection is enough to import user.

instead "DN=GLPI, CN=use dc....  "  I Would just type "GLPI"  in RootDN (for non anonymous binds)


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

#5 2020-08-31 18:31:38

WebGreg
Member
Registered: 2020-02-27
Posts: 739

Re: Import users from LDAP

r0se wrote:

Hello,
I have the problem with import users from LDAP.

Did you try login as domain user?


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#6 2020-08-31 19:24:38

r0se
Member
Registered: 2020-08-31
Posts: 5

Re: Import users from LDAP

@WebGreg,

Yes, what is more some of users also could login as domain but others still can't.
They received a message: "You don't have right to connect".

The User which could login, after some time received a message:"Incorrect username or password".
After time  when I changed Connection Filter query, Users received a message: "You do not have access to this application because your account was deactivated or removed"

Offline

#7 2020-09-03 12:11:49

cirtaz
Member
Registered: 2018-02-13
Posts: 25

Re: Import users from LDAP

In rootDN instead "DN=GLPI, CN=use dc....  " write "domain\username". In baseDN write value of attribute "distinguishedName" for example "OU=!Users,OU=Company,DC=domain,DC=local" without spaces

Last edited by cirtaz (2020-09-03 12:11:58)

Offline

#8 2020-09-20 21:05:14

r0se
Member
Registered: 2020-08-31
Posts: 5

Re: Import users from LDAP

I changed settings according to Your proposition

LDAP
BaseDN: OU=Users,DC=w*****,DC=k*****,DC=pl
also DC=w*****,DC=k*****,DC=pl
also  OU=F****,DC=w*****,DC=k*****,DC=pl

RootDN: w*****\user
Connection filter: (&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
also (&(objectClass=user)(objectCategory=person))
also  (&(objectClass=top)(objectClass=person)(objectClass=organizationalPerson)(objectCategory=User))
Login field:  distinguishedname also samaccountname


In every case during searching Users in:
Administration > Users > LDAP directories > Import new users > Expert mode
I receive a message: No user to be imported

What is more interesting when I searching the Grups:
Administration > Groups > LDAP directories > Import of new groups
Filter to search in groups
(&(objectClass=user)(objectCategory=person))
Search filter for users
(&(objectClass=user)(objectCategory=person))
or empty

the result is Users and Grups objects.

glpi.png

Offline

#9 2020-09-21 06:53:55

Zakharov69
Member
Registered: 2017-11-17
Posts: 36

Re: Import users from LDAP

rootDN = CN=sa_glpi,CN=Users,DC=somename,DC=local

Offline

#10 2020-09-22 10:13:29

r0se
Member
Registered: 2020-08-31
Posts: 5

Re: Import users from LDAP

@Zakharov69
yes, that was my first setting

Offline

#11 2021-09-03 15:06:05

gianandrea
Member
Registered: 2017-01-25
Posts: 9

Re: Import users from LDAP

I have the very same behaviour. Can anyone send me in the right direction or a tutorial?

Thanks a lot!

Offline

#12 2021-09-07 09:38:51

gianandrea
Member
Registered: 2017-01-25
Posts: 9

Re: Import users from LDAP

I am stuck with the same problem (can't get the user list via LDAP). Is there a way to activate specific logging for this feature in order to debug?
The only message I get is "no user to import".
Authenticating on the Domain (ldap) works fine, thus I suppose the connection parameters are ok.

Thanks in advance,
G

Offline

#13 2021-09-07 12:01:04

WebGreg
Member
Registered: 2020-02-27
Posts: 739

Re: Import users from LDAP

1. Import group from AD (via LDAP)
2. Add profile.
3. Set rule when you bind group with profile.


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#14 2021-09-07 15:41:31

gianandrea
Member
Registered: 2017-01-25
Posts: 9

Re: Import users from LDAP

Thanks for the kind reply.
My issue seems to be a step before. I just can't get any user list:
Cattura.jpg

the groups list fine though:
Cattura2.jpg

I think that your suggestion is for the following step (assigning the users to groups)...

Offline

#15 2021-09-07 18:34:46

WebGreg
Member
Registered: 2020-02-27
Posts: 739

Re: Import users from LDAP

Go to expert mode and check base DN and filter.

I have something like this:

Base: DC=domain,DC=com
Filter: (& (samaccountname=*) (&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2))))

Or what did you set your rootDN on front/authldap.form.php?id=1  ?  But if you geting group list it seems like filter problem.

Last edited by WebGreg (2021-09-07 18:40:46)


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#16 2021-09-08 08:42:17

gianandrea
Member
Registered: 2017-01-25
Posts: 9

Re: Import users from LDAP

Apparently you are right, but the same filter used elsewhere (like in LDAP administrator by softerra) works fine.
It's really strange. I'll triple check again the filter.

Offline

#17 2021-09-08 14:36:25

WebGreg
Member
Registered: 2020-02-27
Posts: 739

Re: Import users from LDAP

Not always filter set in one program will work in other too. Did you try with one of above?

I'll go back to the rootDN. I have: CN=userName,OU=part1,DC=domain,DC=com. R0se wrote that he have: RootDN: w*****\user

Last edited by WebGreg (2021-09-08 14:40:28)


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#18 2021-09-09 11:55:30

gianandrea
Member
Registered: 2017-01-25
Posts: 9

Re: Import users from LDAP

The root DN, as far as I understand, works fine, since I get the groups and people are able to authenticate on LDAP.
The only thing that doesn't work is getting the user list to preemptively load all the users.


Frankly, I am about to give up. It looks like some kind of bug to me.

Offline

#19 2021-09-13 16:16:27

kumarabhinavv9
Member
Registered: 2021-09-13
Posts: 1

Re: Import users from LDAP

I have the same issue. Any tips for solution?

Offline

#20 2021-09-15 13:57:42

WebGreg
Member
Registered: 2020-02-27
Posts: 739

Re: Import users from LDAP

@gianandrea and @kumarabhinavv9 - are you using 9.5.5?


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#21 2021-09-16 09:28:41

Kaya84
Member
Registered: 2019-06-13
Posts: 217

Re: Import users from LDAP

gianandrea wrote:

The root DN, as far as I understand, works fine, since I get the groups and people are able to authenticate on LDAP.
The only thing that doesn't work is getting the user list to preemptively load all the users.


Frankly, I am about to give up. It looks like some kind of bug to me.

Try using Ldapexplorer to check if the sytanx is correct.

Ps: se vuoi possiamo sentirci direttamente via MP

Offline

#22 2024-08-05 11:04:03

Paulo Rodrigues
Member
Registered: 2024-08-05
Posts: 1

Re: Import users from LDAP

I'm using GLPI 10.0.16 on Ubunto 24.04 LTS and syncked my AD users with an Active Directory Windows Server 2022,

My GLPI LDAP configuration is like this:

Server: myserver.mydomain.local
Port: 389

Base DN: OU=myusers,OU=mycompany,DC=mydomain,DC=local
Root DN: mydomain\glpi

Connection filter: (objectclass=user)
login filed: samaccountname
Synchronization filed: objectguid


You can check if there are any ladp connection errors in the file /var/www/glpi/files/_/log/php-errors.log  (or whatever your glpi/apache instalation is on)

Connection filters syntax can be found in:  _https://wiki.mozilla.org/Mozilla_LDAP_SDK_Programmer%27s_Guide/Searching_the_Directory_With_LDAP_C_SDK

I hope this can help someone.

Last edited by Paulo Rodrigues (2024-08-05 11:50:28)

Offline

Board footer

Powered by FluxBB