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.
Solved! Go to Solution.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
In your bundle have you exported package?
Views
Replies
Total Likes
Ah found the issue. I had to refresh "Day CRX LDAP Authenticationcom.day.crx.crx-auth-ldap" bundle.
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
@Reference
private Repository repository;
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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>
Views
Replies
Total Likes
Try version 2.4.23
Views
Replies
Total Likes
Perfect! Thanks!
Views
Replies
Total Likes
Views
Likes
Replies