Hi,
I am new to ovirt and LDAP. Looking at adding support for Tivoli
Directory Server. Here is a small java/jndi program (not using Spring
LDAP) that takes IBM intranet Id and searches the directory to return
IBM serial number.
*********
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial",
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.factory.url.pkgs",
"com.ibm.jndi");
env.put("java.naming.provider.url",
"ldap://<ldap-server>:389");
String dn = null;
try{
InitialDirContext dirContext = new
InitialDirContext(env);
SearchControls constraints = new
SearchControls();
String[] attr = new String[] {"uid"};
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
constraints.setReturningAttributes(attr);
NamingEnumeration ne =
dirContext.search("ou=<ldpap-server-name>,o=ibm.com",
"(mail=" + intranetID + ")",
constraints);
**************
But when I try to use
org.ovirt.engine.core.utils.ipa.SimpleAuthenticationCheck.java, I get a
"javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid
Credentials]"
I am issuing - ldapTemplate.search("", "", contextMapper);
Where contextMapper is RHDSUserContextMapper and
screenshots of ldapTemplate are attached.
There may be issues with the way I have setup filter and baseDN; but
that should not give AuthEx. At this time I am looking for ways to get
rid of authentication exception. Also, when using simple authentication,
why do I need to give password? I can run "ldapsearch -LLL
"(mail=<intranetID>)" -h <ldap-server>:389 -x" without password
to give
me expected results.
Thanks
Sharad Mishra
IBM