Announcement Announcement Module
Collapse
No announcement yet.
Using GUID as BaseDN Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using GUID as BaseDN

    Hi,

    I'm converting an old PHP web to Spring. We have an LDAP query in PHP like this:

    Code:
    $sr=ldap_search($ds,"guid=7a770a00-011d-1313-8567-0007d90007ec", "objectclass=User",$att);
    $info=ldap_get_entries($ds,$sr);
    This works fine in PHP and gives me all users in a group with the specified GUID but I can not figure out how to do this search in Spring-LDAP.

    Here is what I got, but I never get any results:

    Code:
            DistinguishedName dn = new DistinguishedName();
            dn.add("GUID", "7a770a00-011d-1313-8567-0007d90007ec");
            EqualsFilter filter = new EqualsFilter("objectclass", "User");
            return ldapTemplate.search(
                    dn,
                    filter.encode(),
                    getContextMapper());
    I have tried various versions of this but no luck Can someone please point me in the right direction?

    Best regards,

    Bjarni
    Last edited by komodo; Oct 8th, 2007, 11:08 AM. Reason: Minor formatting

  • #2
    So you would like to begin the search in the specified guid entry and search for all entries of objectclass User? Have you tried the same query using a command line tool like ldapsearch?

    Could you post the configuration and the complete code with mappers included?

    Comment


    • #3
      Thanks for your reply Ulrik,

      By digging into the LDAP I found out that the "Group" has "Members" and from the "Members" I could find the "Users". I have no idea how PHP could find the "Users" without finding the "Members" first!

      Anyway, Spring-LDAP is working like a charm, just differently than PHP.

      Thanks again,

      Bjarni

      Comment

      Working...
      X