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$ at org.xwiki.classloader.URIClassLoader$ at Method) at org.xwiki.classloader.URIClassLoader.findClass( at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at java.lang.Class.forName0(Native Method) at java.lang.Class.forName( at com.xpn.xwiki.XWiki.getAuthService(

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 ldap/ldap-authenticator/pom.xml at master · xwiki-contrib/ldap · GitHub.

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