Windows Active Directory lookup | Community
Skip to main content
July 7, 2021

Windows Active Directory lookup

  • July 7, 2021
  • 4 replies
  • 1359 views

Hi,

 

I am trying to connect to a window's AD server that's not LDAP enabled. I have all details DNS, Domain Controller etc. When I am trying to use Intial Directory Context I get an error that "java.naming/javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(InitialDirContext.java:111)"

 

As  a standalone java program I am able to establish connection but not when using in combination with AEM. Is there any other way of connecting where LDAP protocol is not used?

 

 

Thank you in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Dipti_Chauhan
Community Advisor
Community Advisor
July 7, 2021
July 8, 2021
Hi,
Ritesh_Mittal
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 7, 2021
July 8, 2021

Thanks for the suggestions.

Installed all jars and resolve ddependencie, but I am getting a new errror now.

 

Ldapauth is failing and below message is from the error log - 

Tried api-all.jar and then with individual jars.

 

07.07.2021 18:12:33.589 ERROR [0:0:0:0:0:0:0:1 [1625661753586] GET /bin/ebook/service/ldapAuth HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable java.lang.NoSuchMethodError: org.apache.directory.ldap.client.api.LdapConnectionPool.<init>(Lorg/apache/commons/pool/PoolableObjectFactory;)

 

Getting error while establishing connection -

final LdapConnectionPool pool = new LdapConnectionPool(factory);

July 8, 2021

Somehow overcame the previous error after trying some old versions of the JAR, but getting this new error now

InvalidDN exception when authenticate method is ran.

final PasswordWarning warning = ldapConnectionTemplate.authenticate( "ou=test,dc=example,dc=com", "(sAMAccountName=" + username +")", SearchScope.SUBTREE, password.toCharArray());