Confluence encoding test goes wrong from submission stage due to a Kerberos or custom authenticator
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
The content on this page relates to platforms which are not supported for Confluence. Consequently, Atlassian can not guarantee providing any support for the steps described on this page. Please be aware that this material is provided for your information only and that you use it at your own risk.
Symptoms
The encoding test shows that the string passed for database round-trip is wrong and the string is modified after submission.
Cause
Confluence is configured to use Kerberos Authenticator in
<installation-directory>/Confluence/WEB-INF/classes/seraph-config.xml
Confluence is configured to use a Custom Authenticator in
<installation-directory>/Confluence/WEB-INF/classes/seraph-config.xml
. A filter mapping has been added to web.xml above the 'encoding' filters.
Resolution #1
Add the following mapping filter in
<installation dir>/confluence/WEB-INF/web.xml:
1 2 3 4
<filter-mapping> <filter-name>login</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
More details about this configuration explained here
ℹ️ After editing the web.xml
file, you will need to restart Confluence for your change to take effect.
Resolution #2
Ensure that no filters exist in
<installation dir>/confluence/WEB-INF/web.xml above the 'encoding' filters (as shown below):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<!-- THIS MUST REMAIN AS THE TOP FILTER SO THAT THE ENCODING CAN BE SET BEFORE ANYTHING ELSE TOUCHES IT (well, except the header sanitiser)--> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.vm</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/display/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/download/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/plugins/servlet/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/label/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/s/*</url-pattern> </filter-mapping> <<--New filters should be added here
ℹ️ After editing the web.xml
file, you will need to restart Confluence for your change to take effect.
Was this helpful?