Authentication class not found in custom extension

After having successfully installed a custom extension containing a class extending XWikiLDAPAuthServiceImpl, the custom class keeps being not found by the class loader (see error below). I gave a try to the tutorial extension as well, specifying xwiki.authentication.authclass=com.acme.internal.DefaultHelloWorld just to make a check on a model and the class is not found either while the extension is properly installed. I’m aware that XWikiLDAPAuthServiceImpl itself is an extension and is properly loaded. I can’t find the difference explaining this misbehaviour though.

java.lang.ClassNotFoundException: org.xwiki.contrib.ldap.LDAPAuthServiceLowercaseUIDImpl at org.xwiki.classloader.URIClassLoader$1.run(URIClassLoader.java:193) at org.xwiki.classloader.URIClassLoader$1.run(URIClassLoader.java:180) at java.security.AccessController.doPrivileged(Native Method) at org.xwiki.classloader.URIClassLoader.findClass(URIClassLoader.java:179) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:5077)

You probably installed your extension on main wiki but authenticators need to be installed on the root namespace (“On farm”) because the auth framework apply the same authenticator to the whole farm right now. You can force that in your extension descriptor, see how it’s done for the LDAP one on https://github.com/xwiki-contrib/ldap/blob/master/ldap-authenticator/pom.xml#L40.

Thank you, I was curious about that parameter, using it fixed the issue indeed and the custom authenticator is now used.