ldapsearch() is not giving results

Certified Associate Developer

Hello,

I am trying to fetch the users or details of particular user from AD and I am using ldapsearch() to achieve this, but I am facing issues to fetch the results

 

I have created 'scsExternalSystemKey' ad.test with below details

username:<full DN>

password:<password>

 

ldapsearch(
  config: {
    scsExternalSystemKey: "ad.test",
    usePerUserCredentials: false,
    url: "ldap://<IP>:389/DC=PSIAPPIAN,DC=com"
    
  },
  searchFilter: "(&(ObjectClass=organizationalPerson)(uid=administrator)",
  attributes: {},
  pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
  )
)

 

Output:


LdapResponse
    success: true
    result: DataSubset
        startIndex: 1
        batchSize: -1
        sort: null (List of SortInfo)
        totalCount: 0
        data: null (List of Variant)
        identifiers: null (List of Variant)
    error: null (Text)

 

I have tried multiple filters to fetch the result but none are working. Highly appreciated if I get any pointers on this. Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Raghuvaran Nagarajan
    Third-Party Credentials
    -----------------------
    UserName: CN=admin,OU=Dev,DC=PSIAPPIAN,DC=com
    Password: <pwd>

    Request:
    =ldapsearch(
    config: {
    scsExternalSystemKey: "ldap.test",
    usePerUserCredentials: false,
    timeout: 10000,
    url: "ldap://<IP>:389/OU=Dev,DC=PSIAPPIAN,DC=com"
    /*baseDN: "DC=PSIAPPIAN,DC=com"*/
    },
    searchFilter: "(objectClass=person)",
    /*searchFilter:"(&(objectCategory=*)(cn=admin))"*/
    attributes: {"givenName", "sn", "sAMAccountName", "mail"},
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    )
    )

    Response:
    success: true
    result: DataSubset
    startIndex: 1
    batchSize: -1
    sort: null (List of SortInfo)
    totalCount: 0
    data: null (List of Variant)
    identifiers: null (List of Variant)
    error: null (Text)


    Request:
    =ldapsearch(
    config: {
    scsExternalSystemKey: "ldap.test",
    usePerUserCredentials: false,
    timeout: 10000,
    url: "ldap://<IP>:389"
    baseDN: "DC=PSIAPPIAN,DC=com"
    /*baseDN: "OU=dev,DC=PSIAPPIAN,DC=com"*/
    },
    searchFilter: "(objectClass=person)",
    /*searchFilter:"(&(objectCategory=*)(cn=admin))"*/
    attributes: {"givenName", "sn", "sAMAccountName", "mail"},
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    )
    )

    Response:
    success: false
    result: null (DataSubset)
    error: "Failed to request page: javax.naming.NameNotFoundException:
    [LDAP: error code 32 - 0000208D: NameErr: DSID-03100213, problem 2001 (NO_OBJECT), data 0, best match of:
    ''
    ]; remaining name ''"
  • 0
    Certified Associate Developer
    in reply to Raghuvaran Nagarajan
    Hey rahuvarann,

    I'm also getting the same issue where result shows success but its not returning any datasubset,
  • 0
    Certified Lead Developer
    in reply to viveku3486
    I have created custom function plugin and it works fine however ldapsearch() fails with same parameters. Appian wont allow further function for same functionality otherwise i can publish it in App Market.