Git Product home page Git Product logo

Comments (7)

Kipjr avatar Kipjr commented on August 23, 2024

Can you use LDP.exe (installed on DC, or manually downloaded) to check the correct filter. I also need the log file, especially the line of the filter

from ldap_login.

janebi98 avatar janebi98 commented on August 23, 2024

I tested my base DN with LDP.exe and it works.

Which filter should I test exactly?

User Object Filter and Group Object Filter are currently not filled out. (Default AD values)

Here is my log (ldap_login.log)

[2023:11:23 10:40:313553] DEBUG: New LDAP Instance
[2023:11:23 10:40:313786] DEBUG: [function]> ldap_conn
[2023:11:23 10:40:313868] DEBUG: [function]> make_ldap_conn
[2023:11:23 10:40:313942] DEBUG: [make_ldap_conn]> ld_port is 389. Connecting using default protocol
[2023:11:23 10:40:314074] DEBUG: [make_ldap_conn]> connected (LDAP_OPT_PROTOCOL_VERSION 3)
[2023:11:23 10:40:314147] DEBUG: [ldap_conn]> true
[2023:11:23 10:40:314213] DEBUG: [function]> Ldap_Login Test
[2023:11:23 10:40:314282] DEBUG: [function]> ldap_search_dn 
[2023:11:23 10:40:314350] DEBUG: [function]> ldap_search_dn(lname)
[2023:11:23 10:40:314419] DEBUG: [ldap_search_dn]> Connecting to server
[2023:11:23 10:40:314486] DEBUG: [ldap_search_dn]> make_ldap_bind_as($this->cnx,CN=Piwigo,OU=Systembenutzer,OU=_Benutzer,DC=EXAMPLE,DC=local ,$this->config['ld_bindpw']
[2023:11:23 10:40:314593] DEBUG: [function]> make_ldap_bind_as
[2023:11:23 10:40:314659] DEBUG: [make_ldap_bind_as]> $conn,CN=Piwigo,OU=Systembenutzer,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:317650] DEBUG: [make_ldap_bind_as]> Bind was successfull
[2023:11:23 10:40:317771] DEBUG: [ldap_search_dn]> @ldap_search($this->cnx,DC=EXAMPLE,DC=local,(&(&(objectClass=person)(sAMAccountname=lname))(cn=*)),array('dn'),0,1)
[2023:11:23 10:40:318663] DEBUG: [ldap_search_dn]> ldap_search successfull
[2023:11:23 10:40:318780] DEBUG: [ldap_search_dn]> RESULT: CN=Lname\, Jan,OU=Testbenutzer,OU=Windows,OU=PC-Laptop User,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:318861] DEBUG: [function]> check_ldap
[2023:11:23 10:40:318927] DEBUG: [function]> ldap_conn
[2023:11:23 10:40:318991] DEBUG: [function]> make_ldap_conn
[2023:11:23 10:40:319060] DEBUG: [make_ldap_conn]> ld_port is 389. Connecting using default protocol
[2023:11:23 10:40:319195] DEBUG: [make_ldap_conn]> connected (LDAP_OPT_PROTOCOL_VERSION 3)
[2023:11:23 10:40:319478] DEBUG: [ldap_conn]> true
[2023:11:23 10:40:319623] DEBUG: [function]> ldap_bind_as
[2023:11:23 10:40:319698] DEBUG: [ldap_bind_as]> CN=Piwigo,OU=Systembenutzer,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:319772] DEBUG: [function]> make_ldap_bind_as
[2023:11:23 10:40:319842] DEBUG: [make_ldap_bind_as]> $conn,CN=Piwigo,OU=Systembenutzer,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:323031] DEBUG: [make_ldap_bind_as]> Bind was successfull
[2023:11:23 10:40:323211] DEBUG: [ldap_bind_as]> Bind was successfull
[2023:11:23 10:40:323289] DEBUG: [function]> ldap_bind_as
[2023:11:23 10:40:323357] DEBUG: [ldap_bind_as]> CN=Lname\, Jan,OU=Testbenutzer,OU=Windows,OU=PC-Laptop User,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:323427] DEBUG: [function]> make_ldap_bind_as
[2023:11:23 10:40:323493] DEBUG: [make_ldap_bind_as]> $conn,CN=Lname\, Jan,OU=Testbenutzer,OU=Windows,OU=PC-Laptop User,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:328436] DEBUG: [make_ldap_bind_as]> Bind was successfull
[2023:11:23 10:40:328680] DEBUG: [ldap_bind_as]> Bind was successfull
[2023:11:23 10:40:328757] DEBUG: [function]> check_ldap_group_membership
[2023:11:23 10:40:328871] DEBUG: [function]> make_ldap_bind_as
[2023:11:23 10:40:328941] DEBUG: [make_ldap_bind_as]> $conn,CN=Piwigo,OU=Systembenutzer,OU=_Benutzer,DC=EXAMPLE,DC=local
[2023:11:23 10:40:330551] DEBUG: [make_ldap_bind_as]> Bind was successfull
[2023:11:23 10:40:330695] DEBUG: [check_ldap_group_membership]> @ldap_search($this->cnx,'DC=EXAMPLE,DC=local', '(&(objectclass=group)(cn=Piwigo_User)(member=CN=Lname\, Jan,OU=Testbenutzer,OU=Windows,OU=PC-Laptop User,OU=_Benutzer,DC=EXAMPLE,DC=local)(cn=*))','member') for Piwigo_User
[2023:11:23 10:40:330848] DEBUG: [function]> getErrorString 
[2023:11:23 10:40:330929] DEBUG: [getErrorString]> Bad search filter
[2023:11:23 10:40:330998] DEBUG: [check_ldap_group_membership]> ldap_search NOT successful: Bad search filter

from ldap_login.

Kipjr avatar Kipjr commented on August 23, 2024
(&
(objectclass=group)
(cn=Piwigo_User)
(member=CN=Lname\, Jan,OU=Testbenutzer,OU=Windows,OU=PC-Laptop User,OU=_Benutzer,DC=EXAMPLE,DC=local)
(cn=*)
)

This seems OK. In LDP.exe can you do search and as filter add (&(objectclass=group)(cn=Piwigo_User)(member=CN=Lname\, Jan,OU=Testbenutzer,OU=Windows,OU=PC-Laptop User,OU=_Benutzer,DC=EXAMPLE,DC=local)(cn=*))

from ldap_login.

janebi98 avatar janebi98 commented on August 23, 2024

Okay, it works.
image

But is it right, that these fields are emty?
image

from ldap_login.

Kipjr avatar Kipjr commented on August 23, 2024

$search_filter = "(&(objectclass=$group_class)(cn=$group_cn)($member_attr=$user_dn)($group_filter))";

The cause might be related to your comma "," which is being escaped by ""

https://stackoverflow.com/questions/39794550/how-should-i-escape-ldap-special-characters

possible solution:

pingidentity/ldapsdk#10 (comment)

from ldap_login.

janebi98 avatar janebi98 commented on August 23, 2024

Okay, but is it right that user object and group object filter are emty? (see my screenshot)

from ldap_login.

Kipjr avatar Kipjr commented on August 23, 2024

Yes, as it is covered in this line:

https://github.com/Kipjr/Ldap_Login/blob/28043db6c471794b4fef3928ac625220549607a9/class.ldap.php#L340C3-L340C96

from ldap_login.

Related Issues (20)

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.