• OpenKM and CAS

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #8879  by tintin_chan
 
Hi I have written a custom AuthenticatorBase class such that when CAS valid ticket is returned, the custom login module in login-config.xml will perform the authorization.
However even though I have my user name and correct role AdminRole set, I have encountered errors during loading of the OpenKM main page. There are errors such as "Error on getting extensions UUID". A capture of the screen is done below:

http://img405.imageshack.us/i/errorjz.jpg


Can anyone enlighten if I am missing something on my implementation? Thanks.
 #8880  by tintin_chan
 
Hi,

Upon browsing through the log file, i found the follow error in detail

Caused by: java.lang.NullPointerException
at com.openkm.frontend.server.OKMWorkspaceServlet.getUserWorkspace(OKMWorkspaceServlet.java:284)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

The error is caused by the following lines in the class OKMWorkspaceServlet

user = AuthDAO.findUserByPk(getThreadLocalRequest().getRemoteUser());
workspace.setEmail(user.getEmail());

My guess is getThreadLocalRequest().getRemoteUser() is null. How do i populate the remote user attribute?
 #8891  by pavila
 
getThreadLocalRequest().getRemoteUser() get the current authenticated user in the web app. If the resource is protected, the user must authenticate to access it and then you cat get the remoter user. OpenKM has its resources protected, as any typical web application and this is done in the web.xml and jboss-web.xml. If you are not familiar with CAS and / or J2EE I would recommend to start with a little web application and then try with OpenKM.
 #10283  by tintin_chan
 
The solution to the problem is that I have not set the email of the user in the database, resulting in a null exception in user.getEmail().

In order to use CAS with OpenKM, one has to write a custom Authenticator class and includes it in the /server/default/deploy/jboss-web.deployer/META-INF/jboss-service.xml

:mrgreen:
 #10415  by pavila
 
Would you like to share the source code with us? Please, attach the java or zip archive to this forum topic.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.