Page 1 of 1
openkm custom logout
PostPosted:Mon Apr 11, 2011 6:54 am
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.
Re: openkm custom logout
PostPosted:Mon Apr 11, 2011 10:13 pm
by jllort
Why do you want to forward to other url ? It's hard coded in class LogoutPopup.java
Code: Select allpublic void onClick(ClickEvent event) {
super.hide();
Window.open("index.jsp", "_self", null);
}
Re: openkm custom logout
PostPosted:Tue Apr 12, 2011 2:17 am
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?
Re: openkm custom logout
PostPosted:Tue Apr 12, 2011 3:37 am
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?
Re: openkm custom logout
PostPosted:Tue Apr 12, 2011 4:15 am
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.
Re: openkm custom logout
PostPosted:Tue Apr 12, 2011 8:33 pm
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 ).
Re: openkm custom logout
PostPosted:Wed Apr 13, 2011 4:11 am
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
Re: openkm custom logout
PostPosted:Wed Apr 13, 2011 7:19 am
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.
Re: openkm custom logout
PostPosted:Wed Apr 13, 2011 7:33 am
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?
Re: openkm custom logout
PostPosted:Wed Apr 13, 2011 2:43 pm
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.
Re: openkm custom logout
PostPosted:Mon Apr 18, 2011 2:12 am
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 all2011-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?
Re: openkm custom logout
PostPosted:Mon Apr 18, 2011 5:42 pm
by jllort
Are you executing logout twice ?
Re: openkm custom logout
PostPosted:Wed Apr 20, 2011 6:59 am
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.
Re: openkm custom logout
PostPosted:Wed Apr 20, 2011 7:30 am
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.
Re: openkm custom logout
PostPosted:Wed Apr 20, 2011 8:33 pm
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.