Pages

Wednesday, October 15, 2008

How to change the logout URL for Lotus Connections

The other day, a customer asked me how to change the logout URL for Lotus Connections. They wanted to configure Lotus Connections so that when a user clicked on 'Log out' they would be redirected to the company's intranet home page.

I couldn't find any documentation out there, so I put on my hacker hat. After a couple of minutes (ok, maybe 30 minutes), I was able to figure it out. I decided to capture my changes and share it with you. You'll notice that while the process may look long, it's really only changing 1 line of code in 6 different files... so it's really easy!

Activities and Home page:

  1. Go to <WAS_PROFILE_ROOT>\installedApps\<CELL_NAME>\Activities.ear\oawebui.war\WEB-INF\jsps\html_prototype\fragments\mainpage
  2. Save a backup of banner.jsp
  3. Open banner.jsp with your favorite text editor
  4. Look for the following lines:

    <form method="post" action="ibm_security_logout" name="logout" id="logoutForm" style="display: none;" >
    <input type="hidden" name="logoutExitPage" value="/service/html/mainpage">
    <input type="submit" name="logout" value="Logout">
    </form>

  5. Change the logoutExitPage parameter as shown below:

    <form method="post" action="ibm_security_logout" name="logout" id="logoutForm" style="display: none;" >
    <input type="hidden" name="logoutExitPage" value="http://w3.acme.com/home">
    <input type="submit" name="logout" value="Logout">
    </form>

  6. Save the file
  7. Repeat steps 1-6 for the following file:
    • <WAS_PROFILE_ROOT>\installedApps\<CELL_NAME>\Homepage.ear\dboard.war\web\jsp\pageheader.jspf (touch main.jsp afterwards to force recompilations of the JSP fragment)

Blogs:

  1. Go to <WAS_PROFILE_ROOT>\installedApps\<CELL_NAME>\Blogs.ear\blogs.war\roller-ui
  2. Save a backup of logout-redirect.jsp
  3. Open logout-redirect.jsp with your favorite text editor
  4. Look for the following line:

    response.sendRedirect(request.getContextPath() + "/ibm_security_logout?logoutExitPage=" + "/");
    

  5. Change the logoutExitPage parameter as shown below:

    response.sendRedirect(request.getContextPath() 
    + "/ibm_security_logout?logoutExitPage=" + "http://w3.acme.com/home");

  6. Save the file

Communities:

  1. Go to <WAS_PROFILE_ROOT>\installedApps\<CELL_NAME>\Communities.ear\tango.web.ui.war\WEB-INF\jsps\html\scenes\dashboard
  2. Save a backup of banner.jsp
  3. Open banner.jsp with your favorite text editor
  4. Look for the following line:

    logoutSection.innerHTML ='<html:link page="/service/html/logout"><fmt:message key="link.logout" /></html:link>';
    

  5. Change the page parameter as shown below:

    logoutSection.innerHTML ='<html:link page="/ibm_security_logout?logoutExitPage=http://w3.acme.com/home"><fmt:message key="link.logout" /></html:link>';
    

  6. Save the file

Dogear:

  1. Go to <WAS_PROFILE_ROOT>\installedApps\<CELL_NAME>\Dogear.ear\dogear.webui.war\h3\jsp\main
  2. Save a backup of pageHeader.jspf
  3. Open pageHeader.jspf with your favorite text editor
  4. Look for the following line:

    logoutSection.innerHTML =<jscript:string><a title="<fmt:message key="jspf.menu.logout.title"/>" href="<c:url value="/logout" />"><fmt:message key = "jspf.menu.settings.logout"/></a></jscript:string>;
    

  5. Change the value parameter as shown below:

    logoutSection.innerHTML =<jscript:string><a title="<fmt:message key="jspf.menu.logout.title"/>" href="<c:url value="/ibm_security_logout?logoutExitPage=http://w3.acme.com/home />"><fmt:message key = "jspf.menu.settings.logout"/></a></jscript:string>;

  6. Save the file
  7. Touch h3.jsp (to force recompilation of the JSP fragment)

Profiles:

  1. Go to <WAS_PROFILE_ROOT>\installedApps\<CELL_NAME>\Profiles.ear\peoplepages.war\WEB-INF\jsps\ajax
  2. Save a backup of loginInfo.jspf
  3. Open loginInfo.jspf with your favorite text editor
  4. Look for the following line:

    <html:link page="/ibm_security_logout?logoutExitPage=/index.jsp" styleId="logoutLink">
    

  5. Change the logoutExitPage parameter as shown below:

    <html:link page="/ibm_security_logout?logoutExitPage=http://w3.acme.com/home" styleId="logoutLink">
    

  6. Save the file

Hope this is useful to you.

5 comments:

  1. Luis,

    Thanks for the great, detailed, how-to posts!

    Having spent last week customizing Quickr themes, it would be nice if Connections could pick up a similar system to update the theme, including links, layout, etc. without requiring your hacker hat or running wsadmin scripts.

    ReplyDelete
  2. In both LinkJam (Dogear for Domino) and IdeaJam the system admin would simply open the LinkJam/IdeaJam control panel form and go to the field called "Logout URL" and set it.

    We should schedule some time to talk about Connections and IdeaJam/LinkJam.

    ReplyDelete
  3. Luis,

    This approach seems only work with Lotus Connection 2.0.1, but not 2.5.

    If you could provide some advices on how to do this with 2.5, that would be highly appreciated.

    Thanks!

    ReplyDelete
  4. Actually, there's now an even easier way to change the logout URL thanks to some funky HTTP URL Redirection. See step (1) and step (16) of this procedure: http://publib.boulder.ibm.com/infocenter/ltscnnct/v2r0/topic/com.ibm.connections.25.help/t_secure_with_siteminder.html

    ReplyDelete
  5. Instead of applying the unrestricted JCE policy files, you can have a bit more control over this with the following WAS security properties.

    go to "Secure administration, applications, and infrastructure > Custom properties" and add one of the following:

    com.ibm.websphere.security.allowAnyLogoutExitPageHost=true/false
    When true, the redirection is unrestricted, and the following property is ignored. The default is false.

    com.ibm.websphere.security.logoutExitPageDomainList=
    This is a list of hosts that are valid targets for the redirection specified by logoutExitPage. The separator is the vertical bar. There is no default.

    If the specified logoutExitPage is not valid, a default page indicating successful logout is displayed.

    More details on these settings can be found here http://www-01.ibm.com/support/docview.wss?uid=swg24021527.

    Then as Luis said, simply update the http.conf file with where you want to redirect the users after logging out.

    in httpd.conf, uncomment: LoadModule rewrite_module modules/mod_rewrite.so

    and set

    RewriteEngine On
    RewriteCond %{REQUEST_URI} /(.*)/ibm_security_logout(.*)
    RewriteCond %{QUERY_STRING} !=logoutExitPage=http://w3.acme.com
    RewriteRule /(.*)/ibm_security_logout(.*) /homepage/web/ibm_security_logout?logoutExitPage=http://w3.acme.com [noescape,L,R]

    replacing http://w3.acme.com with the url you want users to be directed to.

    ReplyDelete

Anonymous comments are not encouraged. I reserve the right to delete anonymous comments.