This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Tomcat and the fly likes LDAP Authentication with Active Directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "LDAP Authentication with Active Directory" Watch "LDAP Authentication with Active Directory" New topic

LDAP Authentication with Active Directory

Princeton Ebanks

Joined: Mar 20, 2008
Posts: 5
I am using Netbeans and the Apache module that comes with it to build an intranet application that uses authentication with Active Directory. I have a few questions

1. Is the apache module that comes bundled with Netbeans configured to work with active directory for authentication?

2. How do I configure apache to use active directory for authentication

3. How do I configure the apache realm to use active directory for authentication through LDAP

I have tried with the code below, and the result is the java exception that follows. I have tried many options and several attributes for the realm configuration.

the code...

<Realm className="org.apache.catalina.realm.JNDIRealm"

the exception...

javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece

at com.sun.jndi.ldap.LdapCtx.mapErrorCode(
at com.sun.jndi.ldap.LdapCtx.processReturnCode(
at com.sun.jndi.ldap.LdapCtx.processReturnCode(
at com.sun.jndi.ldap.LdapCtx.c_getAttributes(
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(
at org.apache.catalina.realm.JNDIRealm.getUserByPattern(
at org.apache.catalina.realm.JNDIRealm.getUser(
at org.apache.catalina.realm.JNDIRealm.authenticate(
at org.apache.catalina.realm.JNDIRealm.authenticate(
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

I need some insights into possible sources of this error
Heather Rose
Ranch Hand

Joined: Aug 25, 2008
Posts: 54
Obviously, you will need a bind for your connection. I am having the same problem, but after I bind, I get an IllegalArgumentException stating I can't bind a null object with no attributes.

Let me know if you find a solution for this problem. I have posted my error for your reference. Thank you.

java.lang.IllegalArgumentException: cannot bind null object with no attributes
at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_bind(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
at javax.naming.InitialContext.bind(Unknown Source)
Oliver Baum

Joined: Jan 12, 2005
Posts: 16
I think you need a connectionName and a connectionPassword to connect to the LDAP server
Heather Rose
Ranch Hand

Joined: Aug 25, 2008
Posts: 54
Look at My other post, if you are still intersted in connecting to active directory.
[ September 26, 2008: Message edited by: Heather Rose ]
I agree. Here's the link:
subject: LDAP Authentication with Active Directory
It's not a secret anymore!