• openkm custom logout

  • 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.
 #10287  by tintin_chan
 
Hi All,

Is there any way I can manipulate the File -> Exit behaviour on the main page? I have tried modifying the logout.jsp in the admin folder to redirect to somewhere but it does not seem to be working.

Any advice is welcome. Thank you.
 #10335  by jllort
 
Why do you want to forward to other url ? It's hard coded in class LogoutPopup.java
Code: Select all
public void onClick(ClickEvent event) {
		super.hide();
		Window.open("index.jsp", "_self", null);
	}
 #10347  by tintin_chan
 
Hi,

My authentication is CAS. I need to perform a logout on the CAS server. Is this the only way to do it?
 #10352  by tintin_chan
 
I have replaced the original LogoutPopup class but when I click the exit submenu, it is not directing to the intended URL. Is there anything to do with the cache?
 #10355  by tintin_chan
 
What I do not understand is when i purposely remove the LogoutPopup.class in WEB-INF/classes, the app runs fine. However when i delete the XXX.cache.html in com.openkm.frontend.Main folder, the app is unable to run. Am i missing something here? Thanks.
 #10402  by jllort
 
NO NO NO that's a GWT class and must be compiled all project to generate javascript. Changing class file will not have any effect on javascript generated by GWT ( the ui is generated by GWT ).
 #10407  by tintin_chan
 
Hi jllort,

I have recompiled the source code for gwt using maven command "mvn gwt:compile -Dgwt.module=com.openkm.frontend.Main" and I am able to redirect to the URL I wanted. However when I click the back button of the browser, I am still logged into OpenKM main page. How do I completely clear the session data before the redirection to the URL takes place? Hope you can enlighten me. Thank you
 #10410  by jllort
 
You're not logged sure, because the RPC call is for kill session, but when you're pressing the back browser button you're seeing the browser cache nothing else ( if you try click on some resource will appearing a lot of errors ). You might investigate if there's some way to clean the browser historic with javascript.
 #10411  by tintin_chan
 
Hi jllort,

Thanks for your time in replying. What I mean is when I click the back button, I am still able to perform stuff on the main page e.g delete a document with no error. It seems to me I am not logged out at all.

I ever tried redirecting to a custom jsp page and call session.invalidate() before redirecting to the CAS server. However I am still able to perform stuff on the main page.

Do you have any more ideas for me on the above scenario?
 #10426  by jllort
 
Before redirecting ( GWT ) there's a RPC call to logout, that must be done, after it you can forward to other page, ensure this call is still done.
 #10532  by tintin_chan
 
Hi Jllort,

I have called logout() function in LogoutPopup.java before directing but I have encountered the following error "ERROR [com.openkm.frontend.server.OKMAuthServlet] CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250" below:
Code: Select all
2011-04-18 10:04:26,801 DEBUG [org.apache.jackrabbit.core.RepositoryImpl] No preauthenticated subject found -> return null.
2011-04-18 10:04:26,801 DEBUG [org.apache.jackrabbit.core.RepositoryImpl] Attempt to login without Credentials and Subject -> try login with null credentials.
2011-04-18 10:04:26,801 ERROR [com.openkm.frontend.server.OKMAuthServlet] CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250
com.openkm.core.RepositoryException: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250
	at com.openkm.module.direct.DirectAuthModule.logout(DirectAuthModule.java:121)
	at com.openkm.api.OKMAuth.logout(OKMAuth.java:70)
	at com.openkm.frontend.server.OKMAuthServlet.logout(OKMAuthServlet.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:420)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:662)
Caused by: javax.jcr.LoginException: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1407)
	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:41)
	at com.openkm.util.JCRUtils$1.run(JCRUtils.java:312)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:337)
	at com.openkm.util.JCRUtils.getSession(JCRUtils.java:307)
	at com.openkm.module.direct.DirectAuthModule.logout(DirectAuthModule.java:108)
	... 32 more
Caused by: javax.security.auth.login.LoginException: CallbackHandler does not support: javax.security.auth.callback.NameCallback@52250
	at org.jboss.security.auth.spi.UsernamePasswordLoginModule.getUsernameAndPassword(UsernamePasswordLoginModule.java:299)
	at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:181)
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
	at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
	at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
	at org.apache.jackrabbit.core.security.authentication.JAASAuthContext.login(JAASAuthContext.java:60)
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1392)
	... 38 more
Caused by: javax.security.auth.callback.UnsupportedCallbackException
	at org.apache.jackrabbit.core.security.authentication.CallbackHandlerImpl.handle(CallbackHandlerImpl.java:119)
	at javax.security.auth.login.LoginContext$SecureCallbackHandler$1.run(LoginContext.java:955)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.login.LoginContext$SecureCallbackHandler.handle(LoginContext.java:951)
	at org.jboss.security.auth.spi.UsernamePasswordLoginModule.getUsernameAndPassword(UsernamePasswordLoginModule.java:280)
	... 50 more
May I know if I am missing something on my side?
 #10548  by jllort
 
Are you executing logout twice ?
 #10600  by tintin_chan
 
Hi jllort,

I am unsure when the logout() in LogoutPopup.java is invoked but I have reused the logout() before redirecting. Hence I am unsure if I have performed logout twice by doing this.
 #10604  by pavila
 
If you want OpenKM to be integrated with CAS, you should send us the proper JBoss / OpenKM CAS configuration and we will include this in the next major release.
 #10621  by jllort
 
add some log in logout method ( AuthServlet ) and you'll see it. TAke a look at server.log I'm not sure, but all methods have log.debug might be there one time or more.

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.