Skip to main content
cqlearner
Level 2
October 16, 2015
Solved

LDAP callback error

Hello,

I have set up the LDAP and in ldap_login.conf I set up syncCallbackClass="com.test.ldap.LDAPConnector". I then created the bundle that contains the class LDAPConnector that extends the Callback. 

However, after deploying the bundle I am seeing following error. Looks like it is not finding the class in the bundle.

27.02.2014 17:16:34.633 *ERROR* [127.0.0.1 [1393521394629] PUT /libs/sling/topology/connector.521e314c-30be-4efc-b9df-24f03f3d6af6.json HTTP/1.1] com.day.crx.security.ldap.LDAPUserSync Unable to initialize synchronization callback java.lang.ClassNotFoundException: com.test.ldap.LDAPConnector not found by com.day.crx.sling.server [65]

Any pointer would be greatly appreciated. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
JustinEd3Accepted solution
Adobe Employee
October 16, 2015

LDAP Callbacks are not DS components, so you can't use @Reference.

If you need access to the JCR Session from an LDAP Callback, you need to implement the interface com.day.crx.security.ldap.sync.ExtendedCallback. It unfortunately does not appear that this interface is listed in the public JavaDoc.

9 replies

cqlearner
cqlearnerAuthor
Level 2
October 16, 2015

Perfect! Thanks!

Translate
Adobe Employee
October 16, 2015

Try version 2.4.23

Translate
cqlearner
cqlearnerAuthor
Level 2
October 16, 2015

Justin - thank you for the prompt response.

I do not see ExtendedCallback class in "com.day.crx.security.ldap.sync" package. Is it available publicly?

Here is my dependency:    

            <dependency>
                <groupId>com.day.crx</groupId>
                <artifactId>crx-auth-ldap</artifactId>
                <version>2.3.5</version>
                <scope>provided</scope>
            </dependency>

Translate
JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

LDAP Callbacks are not DS components, so you can't use @Reference.

If you need access to the JCR Session from an LDAP Callback, you need to implement the interface com.day.crx.security.ldap.sync.ExtendedCallback. It unfortunately does not appear that this interface is listed in the public JavaDoc.

Translate
cqlearner
cqlearnerAuthor
Level 2
October 16, 2015

I get java.lang.NullPointerException

@Reference
private SlingRepository repository;
private Session session;

.....

try {
          LOGGER.debug("trying to get session..");
          repository.login();
        
  session = repository.loginAdministrative(null);
         
 LOGGER.debug("session " + session);

    
   } finally {   
                         session.logout(); 
                   }

 

Thanks

Translate
Sham_HC
Level 10
October 16, 2015

   @Reference
    private Repository repository;

Translate
cqlearner
cqlearnerAuthor
Level 2
October 16, 2015

I have a follow up question.

Looks like I do not have access to the session from the LDAP callback. How do I get the user stored in crx to update its property in callback method? Do I need to connect to Repo programmatically? 

Translate
cqlearner
cqlearnerAuthor
Level 2
October 16, 2015

Ah found the issue. I had to refresh "Day CRX LDAP Authenticationcom.day.crx.crx-auth-ldap" bundle.

Translate
Sham_HC
Level 10
October 16, 2015

In your bundle have you exported package?

Translate