SAML2 federation and WS-Federation fail due to presence of &#13 characters in signature and certificate blocks in AM 6.x

Last updated May 29, 2019

The purpose of this article is to provide assistance if federation (SAML2 and WS-Federation) fail because the Service Provider (SP) cannot parse the signature or certificate generated by the Identity Provider (IdP) due to the presence of &#13 characters at the end of the lines, when AM is the IdP.

2 readers recommend this article


Federation fails when using SP initiated SSO; the SP may see references such as "Invalid SAML signature" in their logs and will not be able to parse the signature or certificate blocks.

The Federation debug log will show the signature and certificate blocks with &#13 at the end of lines, for example:


Recent Changes

Upgraded to, or installed AM 6.x.


AM 6,,, or

The xmlsec library used in AM 6 to is 2.1.1, which has a known issue that causes line breaks to be replaced with these characters when the ignorelinebreak property is enabled. This property is enabled using either of the following JVM options:

If the XML parser used by the SP to process the assertion is not permissive, these characters will cause federation to fail. However, if the XML parser is permissive (as used by AM), federation will succeed; this explains why this issue will not affect you if AM is also acting as the SP. 

AM and later

The xmlsec library used in AM and later has been upgraded to 2.1.2, which resolves the known issue above; however, this issue can still occur if the property is not enabled (which it isn't by default). An RFE exists to change this:  OPENAM-14939 (Enable "" by default ).


This issue can be resolved by upgrading to AM or later and then setting the property; you can download this from BackStage.

Example using Apache Tomcat™ web container

You can set this property as follows:

  1. Add the following line to the file (typically located in the /tomcat/bin/ directory):
  2. Restart the web container.

If the file doesn't exist, you should create it in the same directory as the file (also typically located in the /tomcat/bin/ directory).

See Also

FAQ: SAML certificate management in AM/OpenAM

SAML Federation in AM/OpenAM

SAML v2.0 Guide

Related Training


Related Issue Tracker IDs

OPENAM-14939 (Enable "" by default )

OPENAM-13577 (xmlsec 2.1.1.jar used in AM6 have issues when linebreaks enabled)

Copyright and TrademarksCopyright © 2019 ForgeRock, all rights reserved.