How to create a logout option for the Spectrum OneClick webpage

Document ID : KB000125316
Last Modified Date : 25/01/2019
Show Technical Document Details
Introduction:
Out of the box Spectrum OneClick does not have a logout option.
We introduced this feature to the Webclient but not the OneClick page itself.

This KB will walk through using the code already built for the WebClient and using it for the OneClick webpage.
Instructions:
1. Navigate to $SPECROOT/tomcat/webapps/spectrum/console
2. Open the console-menubar.jsp in a text editor.
3. Add this code to the JSP:
 
              <th>
              <a href="webclient/logoutoc.jsp">Logout</a>
              </th>

This can be placed anywhere but for the sake of this KB, we placed it next to the "Start Console" link as it seemed to make sense there.

User-added image

4. Save the file and exit.
5. Next, navigate to the $SPECROOT/tomcat/webapps/spectrum/webclient
6. Copy the logout.jsp to the same location as logoutoc.jsp

User-added image
7. Confirm the permissions on logoutoc.jsp are NOT read-only.
8. Open the logoutoc.jsp in a text editor.
9. At the very bottom, the following code will be seen:
 
<h1>You are now logged out </h1>
Click <a href="/index.jsp">here</a> to Re-Login.

Change this to:
 
<h1>You are now logged out </h1>
Click <a href="../index.jsp">here</a> to Re-Login.

10. Save the file and exit.

The tomcat service does not need to be restarted but the webpage will need to be refreshed.  I.e. Hold shift and click the refresh button in your browser.
A logout option should now be seen:

User-added image

User-added image