0

I'm using Spring Security SAML 2.0 on Tomcat 7 on Windows platform for the SP. I authenticate against an IDP running on Unix.

The certificate part of the SAML request to the IDP is adding ^M characters at the end of each line. The Carriage Returns in our windows file shows as “^M” on Unix. I deleted the carriage returns character in the SP metadata xml, but we are still getting the ^M in Unix.

Thanks

Vladimír Schäfer
  • 15,375
  • 2
  • 51
  • 71
user3754289
  • 89
  • 1
  • 7
  • I'm looking at the code inside the spring-security-saml-core package and I don't find how to get rid of the carriage returns characters. I can see that the characters are not there when JKSKeyManager gets the certificate from the keystore. – user3754289 Jun 26 '14 at 00:55

1 Answers1

0

Use the dos2unix command to get rid of them.

E.g.

dos2unix file_with_control_m_chars > file_without_control_m_chars

You don't state what Unix you are using, but dos2unix is found on Solaris under /usr/bin, not sure about other Unixes. If you are using Solaris and you don't have dos2unix, you'll need to install the SUNWesu package - Extended System Utilities, which also gives you utilities like awk, bc, uniq etc.

Warwick
  • 255
  • 2
  • 11
  • My problem is not getting rid of the characters. The characters are not in the SP metadata xml file. I even ran the dos2unix command. The message SAML creates and sends to the IDP includes the carriage returns inside the X509Certificate. – user3754289 Jun 26 '14 at 00:49