Windows Active Directory lookup

Avatar

Avatar
Boost 1
Level 1
SonyPanchakshari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
SonyPanchakshari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
SonyPanchakshari
Level 1

06-07-2021

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!

Accepted Solutions (0)

Answers (4)

Answers (4)

Avatar

Avatar
Boost 1
Level 1
SonyPanchakshari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
SonyPanchakshari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
SonyPanchakshari
Level 1

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

 

exc.png

Avatar

Avatar
Boost 1
Level 1
SonyPanchakshari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
SonyPanchakshari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
SonyPanchakshari
Level 1

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

Avatar

Avatar
Boost 5
Level 7
Ritesh_M
Level 7

Likes

179 likes

Total Posts

142 posts

Correct reply

44 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Level 7
Ritesh_M
Level 7

Likes

179 likes

Total Posts

142 posts

Correct reply

44 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
Ritesh_M
Level 7

07-07-2021

Avatar

Avatar
Boost 100
Level 6
Dipti_Chauhan
Level 6

Likes

111 likes

Total Posts

133 posts

Correct reply

39 solutions
Top badges earned
Boost 100
Give Back 10
Affirm 25
Boost 50
Boost 25
View profile

Avatar
Boost 100
Level 6
Dipti_Chauhan
Level 6

Likes

111 likes

Total Posts

133 posts

Correct reply

39 solutions
Top badges earned
Boost 100
Give Back 10
Affirm 25
Boost 50
Boost 25
View profile
Dipti_Chauhan
Level 6

06-07-2021