lookup RACF user data with JNDI

1k Views Asked by At

I am developing a java program and need to read user data from RACF using the LDAP interface of the RACF. I establish a connection using the Java Naming Directory Interface but if I send a search request by

    ctx = new InitialLdapContext(env, null);
    SearchControls searchControls = new SearchControls();
    searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    String searchFilter = "(&(objectClass=*)(racfid=test123))";
    NamingEnumeration results = ctx.search(SEARCH_BASE, searchFilter, searchControls);

The server receives the request but it just returns the following errorcode:

javax.naming.NamingException: [LDAP: error code 80 - ICH31005I NO ENTRIES MEET SEARCH CRITERIA]; Remaining name: 'CN=RACFSYSA,O=IBM,C=US'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3061)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2963)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2770)
    at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1824)
    at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1747)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:380)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:350)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:333)
    at javax.naming.directory.InitialDirContext.search(Unknown Source)

If I perform this search for a "real" LDAP Directory it works fine. The errorcode is the default code and due to that not helpful for me. Does anyone has an idea how to solve this problem? Is there another way to get the data of a user?

1

There are 1 best solutions below

1
On

Your search filter is not supported by LDAP SDBM cf http://pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.glpa200%2Fglpa2ab077.htm

String searchFilter = "(racfid=test123" would be correct