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:
Shutdown Confluence
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 commandAlternative to un-jar-ing, edit the xwork.xml/struts.xml directly in the jar file
Locate
xwork.xml
ℹ️ For Confluence 8.0.0+, locate the file
struts.xml
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>
Re-jar the files if you extracted them in Step 1
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.
Was this helpful?