[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#3630) [JLDAP] GetBindID extended operation gives ClassCastException when used on AD



Full_Name: Russell Howe
Version: CVS HEAD
OS: Linux/Java 1.[45]
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (217.207.158.98)


I get the following when trying to execute a GetBindDN extended operation
against Active Directory. I don't know whether AD supports the operation or not,
but JLDAP doesn't seem to like whatever AD tells it:

Exception in thread "Thread-7" java.lang.ClassCastException:
com.novell.ldap.asn1.ASN1Sequence
        at com.novell.ldap.rfc2251.RfcExtendedResponse.getResultCode(RfcExtendedResponse.java:144)
        at com.novell.ldap.Message.putReply(Message.java:305)
        at com.novell.ldap.Connection$ReaderThread.run(Connection.java:1201)
        at java.lang.Thread.run(Thread.java:595)

This was using a freshly built CVS HEAD of jldap, as of about 1200 GMT on 4th
April 2005.

The code I am using is as follows:

conn.connect(hostname, port);
conn.bind(ldapVersion, bindDN, ((String)webCredential).getBytes("UTF8"));

// ...

LDAPExtendedResponse response = conn.extendedOperation(new GetBindDNRequest());

LDAPEntry user = null;
if (((response.getResultCode()) == LDAPException.SUCCESS)
		&& (response instanceof GetBindDNResponse)) {
	String bindDNResponse = ((GetBindDNResponse)response).getIdentity();
	log.info("You were logged in as: " + bindDNResponse);
	
	user = conn.read(bindDNResponse);
} else {
	log.warn("GetBindDN extended operation failed. Perhaps your LDAP server doesn't
support it?");
}

I can make the complete source available upon request (it's not restricted in
any way..)