Changing the Destination of the Logout Link

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The information in this page relates to customizations in Confluence. Consequently, Atlassian Support cannot guarantee to provide any support for the steps described on this page as customizations are not covered under Atlassian Support Offerings. Please be aware that this material is provided for your information only and that you use it at your own risk.

Also, please be aware that customizations done by directly modifying files are not included in the upgrade process. These modifications will need to be reapplied manually on the upgraded instance.

For more details on editing JAR files, refer to: How to edit files in Confluence JAR files

This page describes how to customise the destination of the logout page, for integration with a Single Sign On framework.

Solution

To configure a new logout, redirect by changing the way Confluence handles the logout action:

  1. Shutdown Confluence

  2. un-jar the confluence-x.y.z.jar (or com.atlassian.confluence_confluence-x.y.z.jar) file in $confluence-install/confluence/WEB-INF/lib, to another location. You can use a standard zip application or the java -jar command

    Alternative to un-jar-ing, edit the xwork.xml/struts.xml directly in the jar file

  3. Locate xwork.xml

    1. ℹ️ For Confluence 8.0.0+, locate the file struts.xml

  4. Change the behavior of logout.action by altering these lines:

    <!-- <result name="success" type="velocity">/logout.vm</result> --> <!-- CAS:START - CAS Logout Redirect --> <result name="success" type="redirect">https://cas.institution.edu/cas/logout</result> <!-- CAS:END -->

    Newer versions will need to be changed as such:

    From

    <action name="logout" class="com.atlassian.confluence.user.actions.LogoutAction"> <interceptor-ref name="defaultStack"/> <result name="error" type="velocity">/logout.vm</result> <result name="success" type="redirect">${logoutUrl}</result> </action>

    TO

    <action name="logout" class="com.atlassian.confluence.user.actions.LogoutAction"> <interceptor-ref name="defaultStack"/> <result name="error" type="velocity">/logout.vm</result> <result name="success" type="redirect">https://your.new.logout.url</result> </action>
  5. Re-jar the files if you extracted them in Step 1

  6. Start Confluence

This example is taken from a CAS customization. What was done here was to comment out the regular success action: /logout.vm, and instead replace it with a redirect to the your custom logout page.

Updated on May 22, 2025

Still need help?

The Atlassian Community is here for you.