Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to integrate my program with LDAP. I have an Active Directory server here, which apparently speaks LDAP. I want to see what's on the server before I go off trying to debug my own code. I found a program called jxplorer which claims to be able to talk to LDAP servers.

However, I can't seem to make it work. I'm using settings:

  • Host: (IP address of my AD server)
  • Port: 389
  • Protocol: LDAPv3
  • Base DN: OU=MyCompany,DC=domaincontroller,DC=local (a string I got from somebody else at my company who's written some LDAP code here before)
  • Level: User+Password
  • User DN, Password: (my user name and password on this Exchange server)

The error I'm getting is:

javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID=0C090334, comment: AcceptSecurityContext error, data 525, vece ]

The other LDAP dude here says 525 is "user not found", and hypothesizes that perhaps the user name needs to be specified in "LDAP nomenclature".

Does anyone know how to connect to AD with jxplorer?

share|improve this question
1  
If you get other error codes (525, 52e...), a list of correspondencies between code and "real error" is available here: www-01.ibm.com/support/docview.wss?uid=swg21290631 –  Frosty Z Sep 10 '12 at 9:56

2 Answers 2

Figured out the way: it's not your user log-in. It's an LDAP DN like:

CN=My Name,OU=My Company,DC=server,DC=local
share|improve this answer
1  
Be aware that your login name in AD is sAMAccountName usually. So ken. Whereas your CN depends on how the person creating you typed in the display name at create time. That might be Ken Smith or Smith, Ken or Ken J. Smith or actually anything they like. (Also recall that periods and commas need to be escaped with a backslash, so it might Smith\, Ken J\. as the value. –  geoffc Feb 28 '11 at 18:10

Pass the LDAP user id and password directly hard coded.

example:

     Hashtable env = new Hashtable();         
     env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.REFERRAL, "follow");
env.put(Context.SECURITY_PRINCIPAL,"adminuserid");
env.put(Context.SECURITY_CREDENTIALS,"adminPassword");
env.put(Context.PROVIDER_URL,"ldapUrllink");
DirContext ctx = new InitialDirContext(env);

This should work.

thanks Sajith

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.