|Title|Unable to do custom authentication outside the jspwiki.jar file
|Date|23-Feb-2006 17:02:08 EET
|Version|2.3.72-alpha
|Submitter|84.188.175.31
|[Bug criticality]|BadBug
|Browser version|any
|[Bug status]|ClosedBug
|[PageProvider] used|Traditional Page Provider
|Servlet Container|Tomcat 5.5.12
|Operating System|Windows and Linux
|URL|
|Java version|1.5

This bug concerns the __new__ Authentication and Authorization System introduced in JSPWiki 2.3

The Problem appears, when a custom Authorization module is used, that is not stored in the jspwiki.jar file (but in the Classes folder) 
In this Case, the JVM actually finds the custom Authorization Module, but does not find any Classes from inside the jspwiki.jar file. 
(If, for example, you try to import ''com.ecyrd.jspwiki.WikiEngine'' you will retrieve an NoClassDefFoundError for the Class WikiEngine. (I am absolutely sure that my .class file was at the right location and everything ran properly!)

(I found this problem by trying to subclass the LoginModule to create an LDAP Authenticating Login Module) 

The big problem with this is, that you need some classes from the jspwiki.jar file in order to create you own login module (Especially Role and WikiPrincipal) Storing the custom classes inside the Jar file is not a great solution anyways, as this is not very update-friendly... 


----

It's hard to tell what's going on here. One thing that is certain -- if your custom authorizer class uses the package com.jspwiki or any of its sub-packages, the classloader will NOT load it because it isn't digitally signed. Our jspwiki.jar class *is* signed, and the way the Java classloader works is that if one class in a package is in a signed jar, it will expect ALL of the classes in that package to be signed also. Solution: name your classes using your own package name; e.g.: com.foobar.com.LDAPAuthorizer.

If you are using a different package name already, then I'd ask you to add a comment to this page, and include a stack trace that shows the error. The other thing you might try to do is attach a JPDA debugger to your running servlet container and see if you can pin down the issue. -- [Andrew Jaquith] 

--Andrew Jaquith, 24-Feb-2006

----

What's the status of this one?  Can we close it?

-- JanneJalkanen, 24-Sep-2006

----

No answer from bug reporter after 6 months, closing the bug.

--HarryMetske