Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Windows Active Directory lookup

SonyPanchakshari
Level 1
Level 1

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!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

5 Replies
SonyPanchakshari
Level 1
Level 1

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);

SonyPanchakshari
Level 1
Level 1

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());

 

exc.png